{% comment %} This file is licensed under the MIT License (MIT) available on http://opensource.org/licenses/MIT. {% endcomment %} #### ping ~~~ ping ~~~ {% autocrossref %} Requests that a ping be sent to all other nodes, to measure ping time. Results provided in `getpeerinfo` pingtime and pingwait fields as decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping. {% endautocrossref %} **Example** ~~~ bitcoin-cli -testnet ping ~~~ (Success: no result printed.) #### sendfrom ~~~ sendfrom
[confirmations] [comment] [label] ~~~ {% autocrossref %} Spend an amount from an account to a bitcoin address. {% endautocrossref %} **Argument #1: From Account** {% autocrossref %} *String, required:* the name of the account from which to spend the funds. Use "" for the default account. {% endautocrossref %} **Argument #2: To Address** {% autocrossref %} *String, required:* the address to which the funds should be spent. Use "" for the default account. {% endautocrossref %} **Argument #3: Amount To Spend** {% autocrossref %} *Number; required:* the amount to spend in decimal bitcoins. {% endautocrossref %} **Argument #4: Minimum Confirmations** {% autocrossref %} *Number; optional:* the minimum number of confirmations an incoming transaction must have before it will be spent. Previously spent UTXOs are not included regardless of the number of confirmations. Default is 1; use 0 to spend unconfirmed transactions. {% endautocrossref %} **Argument #5: A Comment** {% autocrossref %} *String; optional:* a comment to associate with this transaction. {% endautocrossref %} **Argument #6: A Label** {% autocrossref %} *String; optional:* the label (name) to give the recipient. {% endautocrossref %} **Result: TXID** {% autocrossref %} A txid for the transaction created. {% endautocrossref %} **Example** {% autocrossref %} Spend 0.1 bitcoins from the account "doc test" to the address indicated below using only UTXOs with at least six confirmations, giving the transaction the comment "Example spend" and labeling the spender "Example.com": {% endautocrossref %} ~~~ bitcoin-cli -testnet sendfrom "doc test" \ mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe \ 0.1 \ 6 \ "Example spend" \ "Example.com" ~~~ Result: ~~~ ca7cb6a5ffcc2f21036879493db4530c0ce9b5bff9648f9a3be46e2dfc8e0166 ~~~ #### sendmany ~~~ sendmany [confirmations] [memo] ~~~ {% autocrossref %} Create and broadcast a transaction which spends outputs to multiple addresses. {% endautocrossref %} **Argument #1: Account From Which The Satoshis Should Be Sent** {% autocrossref %} *String; required:* the wallet account from which the funds should be withdrawn. Can be "" for the default account. {% endautocrossref %} **Argument #2: The Output Address/Amount Pairs** {% autocrossref %} *String; required:* a JSON object with addresses as keys and amounts as values. {% endautocrossref %} ~~~ { "
": ,[...] } ~~~ **Argument #3: The Minimum Number Of Confirmations For Inputs** {% autocrossref %} *Number; optional:* the minimum number of confirmations an previously-received output must have before it will be spent. The default is 1 confirmation. {% endautocrossref %} **Argument #4: A Memo** {% autocrossref %} *String, optional:* a memo to be recorded with this transaction for record-keeping purposes. The memo is not included in the transaction. {% endautocrossref %} **Result: A Transaction Identifier** {% autocrossref %} *String:* a transaction identifier (txid) for the transaction created and broadcast to the peer-to-peer network. {% endautocrossref %} **Example** {% autocrossref %} From the account *test1*, send 0.1 bitcoins to the first address and 0.2 bitcoins to the second address, with a memo of "Example Transaction". {% endautocrossref %} ~~~ > bitcoin-cli -testnet sendmany \ "test1" \ ''' { "mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN": 0.1, "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe": 0.2 } ''' \ 6 \ "Example Transaction" ~~~ Result: ~~~ ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e ~~~ #### sendrawtransaction ~~~ sendrawtransaction [true|false] ~~~ {% autocrossref %} Broadcasts transaction in rawtransaction format to the peer-to-peer network. See also: `createrawtransaction` and `signrawtransaction` {% endautocrossref %} **Argument #1: Raw Transaction** {% autocrossref %} *String; required:* a fully-signed transaction in rawtransaction format (hex). {% endautocrossref %} **Argument #2: Whether To Allow High Fees** {% autocrossref %} *Boolean; optional:* whether or not to allow the transaction to have a high transaction fee. Transaction fees are the difference between the sum of the inputs and the sum of the outputs, so a raw transaction which accidentally leaves off a change output, for example, can have a transaction fee dozens or hundreds of times larger than the network norm. If *true* is specified, that will be allowed. If *false* (the default), the transaction will be rejected with an informative error message. {% endautocrossref %} **Result: A TXID Or Error Message** {% autocrossref %} If successful, the transaction's txid (hash) will be returned. If unsuccessful, an error message will be returned. {% endautocrossref %} **Examples** {% autocrossref %} Create and sign a transaction spending over 0.2 bitcoins as fees: {% endautocrossref %} ~~~ > bitcoin-cli -testnet signrawtransaction $( bitcoin-cli -testnet createrawtransaction ''' [ { "txid": "ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e", "vout": 0 } ]''' ''' { "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe": 0.1 }''' ) ~~~ Result: ~~~ { "hex" : "01000000011e48dee8b82c1cb03ba63998660b7bff269b70ba9\ b23ead268afa56bbf0c7cef000000006b4830450221009c711c\ e4df4cd8e22a10016ff6098e799f081e3a1706a9c0df14eeeb8\ 6c31bb302206323d29ab4f3138371df7b7bb794bb7c6a5e7e40\ 161e98b5c873f892d319d5230121027ce4f9db9f237fc75e420\ 742320c7df3b4ca95c44b6bc715400930f24870b2b1ffffffff\ 0180969800000000001976a9140dfc8bafc8419853b34d5e072\ ad37d1a5159f58488ac00000000", "complete" : true } ~~~ {% autocrossref %} Now attempt to broadcast it: {% endautocrossref %} ~~~ > bitcoin-cli -testnet sendrawtransaction 01000000011e48dee8b82c\ 1cb03ba63998660b7bff269b70ba9b23ead268afa56bbf0c7cef00000000\ 6b4830450221009c711ce4df4cd8e22a10016ff6098e799f081e3a1706a9\ c0df14eeeb86c31bb302206323d29ab4f3138371df7b7bb794bb7c6a5e7e\ 40161e98b5c873f892d319d5230121027ce4f9db9f237fc75e420742320c\ 7df3b4ca95c44b6bc715400930f24870b2b1ffffffff0180969800000000\ 001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000 ~~~ Result: ~~~ error: {"code":-22,"message":"TX rejected"} ~~~ {% autocrossref %} Allow high fees to force it to spend: {% endautocrossref %} ~~~ > bitcoin-cli -testnet sendrawtransaction 01000000[...]00000000 true ~~~ Result (success): ~~~ 6d62d3f74be5ca614e32a2fb662deabe87ff95c7d90228cd8615da39cc824e34 ~~~ #### sendtoaddress ~~~ sendtoaddress