Awesome
aepp-cli-js
Command Line Interface for the æternity blockchain.
Installation
You can install aecli
using your preferred tool (yarn
or npm
). Here's an npm
example
$ npm install --global @aeternity/aepp-cli
Quick start
Let's ensure that CLI installed correctly by running $ aecli
. It will show the available commands as below.
$ aecli
Usage: aecli [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
account handle wallet operations
spend [options] <wallet> <receiver> <amount> send coins to another account or contract
name manage AENS names
contract contract interactions
oracle interact with oracles
chain make a request to the node
inspect [options] <identifier> get details of a node entity
tx generate transactions to sign and submit manually
config [options] print the current sdk configuration
select-node [nodeUrl] specify node to use in other commands
select-compiler [compilerUrl] specify compiler to use in other commands
help [command] display help for command
<!-- ROOT-HELP-END -->
To read documentation of other commands and sub-commands, you can append
--help
. For example, typeaecli account --help
to get a list of commands available inaccount
module.
The next step is to create a wallet to use in other commands:
<!-- WALLET-CREATE-BEGIN -->$ aecli account create ./wallet.json
Address _________________________________ ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
Path ____________________________________ /path/to/wallet.json
<!-- WALLET-CREATE-END -->
You need to send some coins to the created wallet.
On testnet you can do that using faucet. Switch to testnet using
$ aecli select-node
.
Run $ aecli inspect <wallet address>
to ensure that it got coins.
$ aecli inspect ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
Account ID ______________________________ ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
Account balance _________________________ 10000ae
Account nonce ___________________________ 0
No pending transactions
<!-- INSPECT-END -->
At the last step, we will send our coins to another account:
<!-- SPEND-BEGIN -->$ aecli spend ./wallet.json ak_AgV756Vfo99juwzNVgnjP1gXX1op1QN3NXTxvkPnHJPUDE8NT 42ae
Transaction mined
Transaction hash ________________________ th_2muLsbZeFaVJ3tePTnLqobPhxBzwFsm1zUv8sjgMX4LKuevX2T
Block hash ______________________________ mh_dnoULQWpiRtcrntd5yJPUxcu7YrTu18xZ1e9EC2b8prKdShME
Block height ____________________________ 2 (about now)
Signatures ______________________________ ["sg_SG5uW5KEGiy5iG1cCkKq4VEdpyvewcW4NjVf4vj2ZoCiap5iB7UQoknWpyWsD4FkziBuGPE88zwXemq3ZvPrdzNtXtKuD"]
Transaction type ________________________ SpendTx (ver. 1)
Sender address __________________________ ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
Recipient address _______________________ ak_AgV756Vfo99juwzNVgnjP1gXX1op1QN3NXTxvkPnHJPUDE8NT
Amount __________________________________ 42ae
Payload _________________________________ ba_Xfbg4g==
Fee _____________________________________ 0.00001684ae
Nonce ___________________________________ 1
TTL _____________________________________ 4 (about now)
<!-- SPEND-END -->
Find out more in the user guide.
Resources
Commands reference
<!-- REFERENCE-TOC-BEGIN -->account
sign
— sign a transaction using walletsign-message
— sign a personal message using walletverify-message
— check if message was signed by addressaddress
— get wallet address and optionally private keycreate
— create a wallet by a private key or generate a new one
spend
— send coins to another account or contractname
contract
compile
— compile a contract to get bytecodeencode-calldata
— encode calldata for contract calldecode-call-result
— decode contract call resultcall
— execute a function of the contractdeploy
— deploy a contract on the chain
oracle
create
— register current account as oracleextend
— extend oracle's time to leavecreate-query
— create an oracle queryrespond-query
— respond to an oracle query
chain
inspect
— get details of a node entitytx
spend
— build spend transactionname-preclaim
— build name preclaim transactionname-claim
— build name claim transactionname-update
— build name update transactionname-transfer
— build name transfer transactionname-revoke
— build name revoke transactioncontract-deploy
— build contract deploy transactioncontract-call
— build contract call transactionoracle-register
— build oracle register transactionoracle-extend
— build oracle extend transactionoracle-post-query
— build oracle post query transactionoracle-respond
— build oracle respond transactionverify
— verify transaction using node
config
— print the current sdk configurationselect-node
— specify node to use in other commandsselect-compiler
— specify compiler to use in other commands