Bitcoin類錢包命令

FLy_鵬程萬里發表於2019-04-29

使用bitcoin-cli命令時,錢包不在預設路徑的情況下需要使用絕對路徑配置

./bitcoin-cli --datadir=/www/bitcoin/data/

檢視錢包支援的命令

./bitcoind help

A、一般性的命令

stop
getinfo
ping
getnettotals
getnetworkinfo
getpeerinfo
getconnectioncount
verifychain ( checklevel numblocks )
getaddednodeinfo dns ( "node" )
addnode "node" "add|remove|onetry"

B、錢包、賬戶、地址、轉帳、發訊息

getwalletinfo
walletpassphrase "passphrase" timeout
walletlock
walletpassphrasechange "oldpassphrase" "newpassphrase"
backupwallet "destination"
importwallet "filename"
dumpwallet "filename"
listaccounts ( minconf )
getaddressesbyaccount "account"
getaccountaddress "account"
getaccount "bitcoinaddress"
validateaddress "bitcoinaddress"
dumpprivkey "bitcoinaddress"
setaccount "bitcoinaddress" "account"
getnewaddress ( "account" )
keypoolrefill ( newsize )
importprivkey "bitcoinprivkey" ( "label" rescan )
createmultisig nrequired ["key",...]
addmultisigaddress nrequired ["key",...] ( "account" )

getbalance ( "account" minconf )
getunconfirmedbalance
getreceivedbyaccount "account" ( minconf )
listreceivedbyaccount ( minconf includeempty )
getreceivedbyaddress "bitcoinaddress" ( minconf )
listreceivedbyaddress ( minconf includeempty )
move "fromaccount" "toaccount" amount ( minconf "comment" )
listunspent ( minconf maxconf ["address",...] )
listlockunspent
lockunspent unlock [{"txid":"txid","vout":n},...]

getrawchangeaddress
listaddressgroupings
settxfee amount
sendtoaddress "bitcoinaddress" amount ( "comment" "comment-to" )
sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" )
signmessage "bitcoinaddress" "message"
verifymessage "bitcoinaddress" "signature" "message"

C、Tx、Block、Ming

createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,...}
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
sendrawtransaction "hexstring" ( allowhighfees )

gettransaction "txid"
listtransactions ( "account" count from )
listsinceblock ( "blockhash" target-confirmations )

getrawmempool ( verbose )
gettxoutsetinfo
gettxout "txid" n ( includemempool )
getrawtransaction "txid" ( verbose )
decoderawtransaction "hexstring"
decodescript "hex"

getblockchaininfo
getblockcount
getbestblockhash
getblockhash index
getblock "hash" ( verbose )
getmininginfo
getdifficulty
getnetworkhashps ( blocks height )
gethashespersec
getgenerate
setgenerate generate ( genproclimit )
getwork ( "data" )
getblocktemplate ( "jsonrequestobject" )
submitblock "hexdata" ( "jsonparametersobject" )

bulwark-cli

 Blockchain 

getbestblockhash
getblock “hash” ( verbose )
getblockchaininfo
getblockcount
getblockhash index
getblockheader “hash” ( verbose )
getchaintips
getdifficulty
getmempoolinfo
getrawmempool ( verbose )
gettxout “txid” n ( includemempool )
gettxoutsetinfo
verifychain ( checklevel numblocks )

Bulwark 

checkbudgets
createmasternodekey
getbudgetinfo ( “proposal” )
getbudgetprojection
getbudgetvotes “proposal-name”
getmasternodecount
getmasternodeoutputs
getmasternodescores ( blocks )
getmasternodestatus
getmasternodewinners ( blocks “filter” )
getnextsuperblock
getpoolinfo
listmasternodeconf ( “filter” )
listmasternodes ( “filter” )
masternode “command”…
masternodeconnect “address”
masternodecurrent
masternodedebug
mnbudget “command”… ( “passphrase” )
mnbudgetrawvote “masternode-tx-hash” masternode-tx-index “proposal-hash” yes|no time “vote-sig”
mnbudgetvote “local|many|alias” “votehash” “yes|no” ( “alias” )
mnfinalbudget “command”… ( “passphrase” )
mnsync “status|reset”
obfuscation 
preparebudget “proposal-name” “url” payment-count block-start “bulwark-address” monthy-payment
spork []
startmasternode “local|all|many|missing|disabled|alias” lockwallet ( “alias” )
submitbudget “proposal-name” “url” payment-count block-start “bulwark-address” monthy-payment “fee-tx”

Control

getinfo
help ( “command” )
stop

Generating 

getgenerate
gethashespersec
setgenerate generate ( genproclimit )

 Mining

getblocktemplate ( “jsonrequestobject” )
getmininginfo
getnetworkhashps ( blocks height )
prioritisetransaction 
reservebalance ( reserve amount )
submitblock “hexdata” ( “jsonparametersobject” )

 Network 

addnode “node” “add|remove|onetry”
clearbanned
getaddednodeinfo dns ( “node” )
getconnectioncount
getnettotals
getnetworkinfo
getpeerinfo
listbanned
ping
setban “ip(/netmask)” “add|remove” (bantime) (absolute)

Rawtransactions

createrawtransaction [{“txid”:”id”,”vout”:n},…] {“address”:amount,…}
decoderawtransaction “hexstring”
decodescript “hex”
getrawtransaction “txid” ( verbose )
sendrawtransaction “hexstring” ( allowhighfees )
signrawtransaction “hexstring” ( [{“txid”:”id”,”vout”:n,”scriptPubKey”:”hex”,”redeemScript”:”hex”},…] [“privatekey1”,…] sighashtype )

Util

createmultisig nrequired [“key”,…]
estimatefee nblocks
estimatepriority nblocks
validateaddress “bulwarkaddress”
verifymessage “bulwarkaddress” “signature” “message”

Wallet 

addmultisigaddress nrequired [“key”,…] ( “account” )
autocombinerewards true|false ( threshold )
backupwallet “destination”
bip38decrypt “bulwarkaddress”
bip38encrypt “bulwarkaddress”
dumpprivkey “bulwarkaddress”
dumpwallet “filename”
getaccount “bulwarkaddress”
getaccountaddress “account”
getaddressesbyaccount “account”
getbalance ( “account” minconf includeWatchonly )
getnewaddress ( “account” )
getrawchangeaddress
getreceivedbyaccount “account” ( minconf )
getreceivedbyaddress “bulwarkaddress” ( minconf )
getstakesplitthreshold
getstakingstatus
gettransaction “txid” ( includeWatchonly )
getunconfirmedbalance
getwalletinfo
importaddress “address” ( “label” rescan )
importprivkey “bulwarkprivkey” ( “label” rescan )
importwallet “filename”
keypoolrefill ( newsize )
listaccounts ( minconf includeWatchonly)
listaddressgroupings
listlockunspent
listreceivedbyaccount ( minconf includeempty includeWatchonly)
listreceivedbyaddress ( minconf includeempty includeWatchonly)
listsinceblock ( “blockhash” target-confirmations includeWatchonly)
listtransactions ( “account” count from includeWatchonly)
listunspent ( minconf maxconf [“address”,…] )
lockunspent unlock [{“txid”:”txid”,”vout”:n},…]
move “fromaccount” “toaccount” amount ( minconf “comment” )
multisend 
sendfrom “fromaccount” “tobulwarkaddress” amount ( minconf “comment” “comment-to” )
sendmany “fromaccount” {“address”:amount,…} ( minconf “comment” )
sendtoaddress “bulwarkaddress” amount ( “comment” “comment-to” )
sendtoaddressix “bulwarkaddress” amount ( “comment” “comment-to” )
setaccount “bulwarkaddress” “account”
setstakesplitthreshold value
settxfee amount
signmessage “bulwarkaddress” “message”
walletlock
walletpassphrase “passphrase” timeout ( anonymizeonly )

其中第一個引數yourpassword為之前設定的密碼;第二個可變引數為需要解鎖的時間,單位是秒。最後一個引數true表示只解鎖挖礦功能,用該命令解鎖後,錢包可以正常挖礦,但其他資金安全相關操作仍被禁止,只有完全解鎖後才能使用。

walletpassphrasechange “oldpassphrase” “newpassphrase”

相關文章