Skip to content

getting started_send coin

asteroid edited this page Nov 27, 2018 · 1 revision

To transfer some coins to another account, you should create a new transaction and sign with private key of the account.

Since coin transfer is often used, aergocli supports simple coin transfer function.

Unlock account

Before transferring coins, you must unlock your account first.

aergocli account unlock --address {{SENDER_ADDRESS}} --password {{YOUR_PASSWORD}}

example

aergocli account unlock --address AmPBwxbpGKF3dJJFaJHb69SnL1JJVqx4jSET3CNb36wmfTp5MGtu

Send Transaction

Send a transaction that transfers some coins using amount, addresses of sender and recipient.

aergocli sendtx --amount {{COIN_AMOUNT}} --from {{SENDER_ADDRESS}} --to {{RECIPIENT_ADDRESS}}

example

aergocli sendtx --amount 1000 \
  --from AmPBwxbpGKF3dJJFaJHb69SnL1JJVqx4jSET3CNb36wmfTp5MGtu \
  --to AmQAohfMHCE8BepQK1jNFDLcUb3LNobPAH7VcAMRE36AzWdNyVRL

Usage

aergocli sendtx --help

Send transaction

Usage:
  aergocli sendtx [flags]

Flags:
      --amount uint   How much in AER
      --from string   Sender account address
  -h, --help          help for sendtx
      --to string     Recipient account address

Global Flags:
      --config string   config file (default is cliconfig.toml)
      --home string     aergo cli home path
  -H, --host string     Host address to aergo server (default "localhost")
  -p, --port int32      Port number to aergo server (default 7845)