hmyCLI is the ability to create and send signed transactions to the
JSON, most outputs of
hmydefaults to showing it nicely indented. Sometimes though you might want to turn that off, you can do that for any command with the flag
testnetchain-id; override that with the
hmyto send a transaction.
transfersubcommand gave us an error message about certain flags not being set. We'll need to provide legitimate values for these flags for our transaction to proceed successfully. Reading off the flags in the error message from left to right, the semantic meanings are as follows:
amount: The quantity of Harmony One token to transfer from the senders to the receiver
from: The sender's one address
from-shard: Shard from which sender's balance will be drawn from
to: Receiver's ONE address
to-shard: Shard in which receiver will receive the amount sent by the sender
passphrase:your wallet passphrase, which is prompted when you hit enter (or you can use a txt file with password and add it: --passphrase file.txt)
--dry-run, this flag tells
hmyto create, cryptographically sign the transaction but not actually send it off. Sender's balances are checked and the output is a JSON dump of the signed transaction.
RPC(Remote Procedure Call), you'll notice that we did not explicitly say where to send the transaction to. This is because the default destination of the
RPCcall goes to
http://localhost:9500, the default
RPCserver running when you start a local harmony blockchain. For real world usage though, you'll want a different location. You can control that with the
--nodeflag (see the top of this page for an example).
RPCmachine receives a transaction, it sends you back a transaction hash. This transaction hash is the key identifier used when querying the blockchain for transactions.
./hmy blockchain transaction-receiptas well:
hmyto wait until transaction confirmation by providing a positive integer value to flag
--wait-for-confirm. For example,
--wait-for-confirm=10will try checking the receipt of the transaction for 10 seconds.