mirror of
				https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
				synced 2025-10-31 02:17:24 +00:00 
			
		
		
		
	Update 4_3_Creating_a_Raw_Transaction_with_Named_Arguments.md
This commit is contained in:
		
							parent
							
								
									a5ae98e205
								
							
						
					
					
						commit
						92f84c42d2
					
				| @ -41,7 +41,7 @@ $ utxo_txid=$(bitcoin-cli listunspent | jq -r '.[0] | .txid') | |||||||
| $ utxo_vout=$(bitcoin-cli listunspent | jq -r '.[0] | .vout') | $ utxo_vout=$(bitcoin-cli listunspent | jq -r '.[0] | .vout') | ||||||
| $ recipient="n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi" | $ recipient="n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi" | ||||||
| 
 | 
 | ||||||
| $  rawtxhex=$(bitcoin-cli -named createrawtransaction inputs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout' } ]''' outputs='''{ "'$recipient'": 0.7595 }''') | $  rawtxhex=$(bitcoin-cli -named createrawtransaction transactions='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout' } ]''' outputs='''{ "'$recipient'": 0.7595 }''') | ||||||
| $ bitcoin-cli -named decoderawtransaction hexstring=$rawtxhex  | $ bitcoin-cli -named decoderawtransaction hexstring=$rawtxhex  | ||||||
| { | { | ||||||
|   "txid": "f445f121085d98635f7302e641f815d1ca4ce70f0e1b03f144ad1661dc5e10e7", |   "txid": "f445f121085d98635f7302e641f815d1ca4ce70f0e1b03f144ad1661dc5e10e7", | ||||||
| @ -84,9 +84,7 @@ $ bitcoin-cli -named sendrawtransaction hexstring=$signedtx | |||||||
| ``` | ``` | ||||||
| Voila! You've sent out another raw transaction, but this time using named arguments for clarity and to reduce errors. | Voila! You've sent out another raw transaction, but this time using named arguments for clarity and to reduce errors. | ||||||
| 
 | 
 | ||||||
| > **WARNING:** This doesn't actually seem to work at the moment. The `createrawtransaction` command gives the error "Unknown named parameter inputs", though it's definitely listed as the appropriate argument name in the help page. | > **WARNING:** At the time of this writing, there was a bug in the `createrawtransactions` named arguments. The help files said to use `inputs`, but the code used `transactions`. We believe that `transactions` will stay in usage and the help files will be updated accordingly. | ||||||
| 
 |  | ||||||
| With this lesson out of the way, we're now going to put named arguments back on the shelf. If you want to use it your own, you should; just consult the `help` info for each command to see what the arguments are called. However, this tutorial will now return to the shorter (but not necessarily more intuitive) use of ordered arguments. |  | ||||||
| 
 | 
 | ||||||
| ## Summary: Creating a Raw Transaction with Named Arguments | ## Summary: Creating a Raw Transaction with Named Arguments | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user