1
1
# aepp-cli-js
2
+
2
3
Command Line Interface for the æternity blockchain.
3
4
4
5
## Installation
6
+
5
7
You can install ` aecli ` using your preferred tool (` yarn ` or ` npm ` ). Here's an ` npm ` example
8
+
6
9
```
7
10
$ npm install --global @aeternity/aepp-cli
8
11
```
9
12
10
13
## Quick start
14
+
11
15
Let's ensure that CLI installed correctly by running ` $ aecli ` . It will show the available commands as below.
12
16
13
17
<!-- ROOT-HELP-BEGIN -->
18
+
14
19
```
15
20
$ aecli
16
21
Usage: aecli [options] [command]
@@ -33,18 +38,21 @@ Commands:
33
38
select-compiler [compilerUrl] specify compiler to use in other commands
34
39
help [command] display help for command
35
40
```
41
+
36
42
<!-- ROOT-HELP-END -->
37
43
38
44
> To read documentation of other commands and sub-commands, you can append ` --help ` . For example, type ` aecli account --help ` to get a list of commands available in ` account ` module.
39
45
40
46
The next step is to create a wallet to use in other commands:
41
47
42
48
<!-- WALLET-CREATE-BEGIN -->
49
+
43
50
```
44
51
$ aecli account create ./wallet.json
45
- Address _________________________________ ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
46
- Path ____________________________________ /path/to/wallet.json
52
+ Address ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
53
+ Path /path/to/wallet.json
47
54
```
55
+
48
56
<!-- WALLET-CREATE-END -->
49
57
50
58
You need to send some coins to the created wallet.
@@ -54,34 +62,40 @@ You need to send some coins to the created wallet.
54
62
[ faucet ] : https://faucet.aepps.com/
55
63
56
64
Run ` $ aecli inspect <wallet address> ` to ensure that it got coins.
65
+
57
66
<!-- INSPECT-BEGIN -->
67
+
58
68
```
59
69
$ aecli inspect ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
60
- Account ID ______________________________ ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
61
- Account balance _________________________ 10000ae
62
- Account nonce ___________________________ 0
70
+ Account ID ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
71
+ Account balance 10000ae
72
+ Account nonce 0
63
73
No pending transactions
64
74
```
75
+
65
76
<!-- INSPECT-END -->
66
77
67
78
At the last step, we will send our coins to another account:
79
+
68
80
<!-- SPEND-BEGIN -->
81
+
69
82
```
70
83
$ aecli spend ./wallet.json ak_AgV756Vfo99juwzNVgnjP1gXX1op1QN3NXTxvkPnHJPUDE8NT 42ae
71
84
Transaction mined
72
- Transaction hash ________________________ th_2muLsbZeFaVJ3tePTnLqobPhxBzwFsm1zUv8sjgMX4LKuevX2T
73
- Block hash ______________________________ mh_dnoULQWpiRtcrntd5yJPUxcu7YrTu18xZ1e9EC2b8prKdShME
74
- Block height ____________________________ 2 (about now)
75
- Signatures ______________________________ ["sg_SG5uW5KEGiy5iG1cCkKq4VEdpyvewcW4NjVf4vj2ZoCiap5iB7UQoknWpyWsD4FkziBuGPE88zwXemq3ZvPrdzNtXtKuD"]
76
- Transaction type ________________________ SpendTx (ver. 1)
77
- Sender address __________________________ ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
78
- Recipient address _______________________ ak_AgV756Vfo99juwzNVgnjP1gXX1op1QN3NXTxvkPnHJPUDE8NT
79
- Amount __________________________________ 42ae
80
- Payload _________________________________ ba_Xfbg4g==
81
- Fee _____________________________________ 0.00001684ae
82
- Nonce ___________________________________ 1
83
- TTL _____________________________________ 4 (about now)
85
+ Transaction hash th_2muLsbZeFaVJ3tePTnLqobPhxBzwFsm1zUv8sjgMX4LKuevX2T
86
+ Block hash mh_dnoULQWpiRtcrntd5yJPUxcu7YrTu18xZ1e9EC2b8prKdShME
87
+ Block height 2 (about now)
88
+ Signatures ["sg_SG5uW5KEGiy5iG1cCkKq4VEdpyvewcW4NjVf4vj2ZoCiap5iB7UQoknWpyWsD4FkziBuGPE88zwXemq3ZvPrdzNtXtKuD"]
89
+ Transaction type SpendTx (ver. 1)
90
+ Sender address ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E
91
+ Recipient address ak_AgV756Vfo99juwzNVgnjP1gXX1op1QN3NXTxvkPnHJPUDE8NT
92
+ Amount 42ae
93
+ Payload ba_Xfbg4g==
94
+ Fee 0.00001684ae
95
+ Nonce 1
96
+ TTL 4 (about now)
84
97
```
98
+
85
99
<!-- SPEND-END -->
86
100
87
101
Find out more in the [ user guide] ( ./user-guide.md ) .
@@ -95,55 +109,57 @@ Find out more in the [user guide](./user-guide.md).
95
109
## Commands reference
96
110
97
111
<!-- REFERENCE-TOC-BEGIN -->
112
+
98
113
- ` account `
99
- - [ ` sign ` ] ( ./reference.md#sign ) — sign a transaction using wallet
100
- - [ ` sign-message ` ] ( ./reference.md#sign-message ) — sign a personal message using wallet
101
- - [ ` verify-message ` ] ( ./reference.md#verify-message ) — check if message was signed by address
102
- - [ ` address ` ] ( ./reference.md#address ) — get wallet address and optionally private key
103
- - [ ` create ` ] ( ./reference.md#create ) — create a wallet by a private key or generate a new one
114
+ - [ ` sign ` ] ( ./reference.md#sign ) — sign a transaction using wallet
115
+ - [ ` sign-message ` ] ( ./reference.md#sign-message ) — sign a personal message using wallet
116
+ - [ ` verify-message ` ] ( ./reference.md#verify-message ) — check if message was signed by address
117
+ - [ ` address ` ] ( ./reference.md#address ) — get wallet address and optionally secret key
118
+ - [ ` create ` ] ( ./reference.md#create ) — create a wallet by a secret key or generate a new one
104
119
- [ ` spend ` ] ( ./reference.md#spend ) — send coins to another account or contract
105
120
- ` name `
106
- - [ ` full-claim ` ] ( ./reference.md#full-claim ) — claim an AENS name in a single command
107
- - [ ` pre-claim ` ] ( ./reference.md#pre-claim ) — pre-claim an AENS name
108
- - [ ` claim ` ] ( ./reference.md#claim ) — claim an AENS name (requires pre-claim)
109
- - [ ` bid ` ] ( ./reference.md#bid ) — bid on name in auction
110
- - [ ` update ` ] ( ./reference.md#update ) — update a name pointer
111
- - [ ` extend ` ] ( ./reference.md#extend ) — extend name TTL
112
- - [ ` revoke ` ] ( ./reference.md#revoke ) — revoke an AENS name
113
- - [ ` transfer ` ] ( ./reference.md#transfer ) — transfer a name to another account
121
+ - [ ` full-claim ` ] ( ./reference.md#full-claim ) — claim an AENS name in a single command
122
+ - [ ` pre-claim ` ] ( ./reference.md#pre-claim ) — pre-claim an AENS name
123
+ - [ ` claim ` ] ( ./reference.md#claim ) — claim an AENS name (requires pre-claim)
124
+ - [ ` bid ` ] ( ./reference.md#bid ) — bid on name in auction
125
+ - [ ` update ` ] ( ./reference.md#update ) — update a name pointer
126
+ - [ ` extend ` ] ( ./reference.md#extend ) — extend name TTL
127
+ - [ ` revoke ` ] ( ./reference.md#revoke ) — revoke an AENS name
128
+ - [ ` transfer ` ] ( ./reference.md#transfer ) — transfer a name to another account
114
129
- ` contract `
115
- - [ ` compile ` ] ( ./reference.md#compile ) — compile a contract to get bytecode
116
- - [ ` encode-calldata ` ] ( ./reference.md#encode-calldata ) — encode calldata for contract call
117
- - [ ` decode-call-result ` ] ( ./reference.md#decode-call-result ) — decode contract call result
118
- - [ ` call ` ] ( ./reference.md#call ) — execute a function of the contract
119
- - [ ` deploy ` ] ( ./reference.md#deploy ) — deploy a contract on the chain
130
+ - [ ` compile ` ] ( ./reference.md#compile ) — compile a contract to get bytecode
131
+ - [ ` encode-calldata ` ] ( ./reference.md#encode-calldata ) — encode calldata for contract call
132
+ - [ ` decode-call-result ` ] ( ./reference.md#decode-call-result ) — decode contract call result
133
+ - [ ` call ` ] ( ./reference.md#call ) — execute a function of the contract
134
+ - [ ` deploy ` ] ( ./reference.md#deploy ) — deploy a contract on the chain
120
135
- ` oracle `
121
- - [ ` create ` ] ( ./reference.md#create-1 ) — register current account as oracle
122
- - [ ` extend ` ] ( ./reference.md#extend-1 ) — extend oracle's time to leave
123
- - [ ` create-query ` ] ( ./reference.md#create-query ) — create an oracle query
124
- - [ ` respond-query ` ] ( ./reference.md#respond-query ) — respond to an oracle query
136
+ - [ ` create ` ] ( ./reference.md#create-1 ) — register current account as oracle
137
+ - [ ` extend ` ] ( ./reference.md#extend-1 ) — extend oracle's time to leave
138
+ - [ ` create-query ` ] ( ./reference.md#create-query ) — create an oracle query
139
+ - [ ` respond-query ` ] ( ./reference.md#respond-query ) — respond to an oracle query
125
140
- ` chain `
126
- - [ ` top ` ] ( ./reference.md#top ) — query the top key/micro block of the chain
127
- - [ ` status ` ] ( ./reference.md#status ) — query node version, network id, and related details of the selected node
128
- - [ ` ttl ` ] ( ./reference.md#ttl ) — get relative TTL by absolute TTL
129
- - [ ` play ` ] ( ./reference.md#play ) — prints blocks from top until condition
130
- - [ ` broadcast ` ] ( ./reference.md#broadcast ) — send signed transaction to the chain
141
+ - [ ` top ` ] ( ./reference.md#top ) — query the top key/micro block of the chain
142
+ - [ ` status ` ] ( ./reference.md#status ) — query node version, network id, and related details of the selected node
143
+ - [ ` ttl ` ] ( ./reference.md#ttl ) — get relative TTL by absolute TTL
144
+ - [ ` play ` ] ( ./reference.md#play ) — prints blocks from top until condition
145
+ - [ ` broadcast ` ] ( ./reference.md#broadcast ) — send signed transaction to the chain
131
146
- [ ` inspect ` ] ( ./reference.md#inspect ) — get details of a node entity
132
147
- ` tx `
133
- - [ ` spend ` ] ( ./reference.md#spend-1 ) — build spend transaction
134
- - [ ` name-preclaim ` ] ( ./reference.md#name-preclaim ) — build name preclaim transaction
135
- - [ ` name-claim ` ] ( ./reference.md#name-claim ) — build name claim transaction
136
- - [ ` name-update ` ] ( ./reference.md#name-update ) — build name update transaction
137
- - [ ` name-transfer ` ] ( ./reference.md#name-transfer ) — build name transfer transaction
138
- - [ ` name-revoke ` ] ( ./reference.md#name-revoke ) — build name revoke transaction
139
- - [ ` contract-deploy ` ] ( ./reference.md#contract-deploy ) — build contract deploy transaction
140
- - [ ` contract-call ` ] ( ./reference.md#contract-call ) — build contract call transaction
141
- - [ ` oracle-register ` ] ( ./reference.md#oracle-register ) — build oracle register transaction
142
- - [ ` oracle-extend ` ] ( ./reference.md#oracle-extend ) — build oracle extend transaction
143
- - [ ` oracle-post-query ` ] ( ./reference.md#oracle-post-query ) — build oracle post query transaction
144
- - [ ` oracle-respond ` ] ( ./reference.md#oracle-respond ) — build oracle respond transaction
145
- - [ ` verify ` ] ( ./reference.md#verify ) — verify transaction using node
148
+ - [ ` spend ` ] ( ./reference.md#spend-1 ) — build spend transaction
149
+ - [ ` name-preclaim ` ] ( ./reference.md#name-preclaim ) — build name preclaim transaction
150
+ - [ ` name-claim ` ] ( ./reference.md#name-claim ) — build name claim transaction
151
+ - [ ` name-update ` ] ( ./reference.md#name-update ) — build name update transaction
152
+ - [ ` name-transfer ` ] ( ./reference.md#name-transfer ) — build name transfer transaction
153
+ - [ ` name-revoke ` ] ( ./reference.md#name-revoke ) — build name revoke transaction
154
+ - [ ` contract-deploy ` ] ( ./reference.md#contract-deploy ) — build contract deploy transaction
155
+ - [ ` contract-call ` ] ( ./reference.md#contract-call ) — build contract call transaction
156
+ - [ ` oracle-register ` ] ( ./reference.md#oracle-register ) — build oracle register transaction
157
+ - [ ` oracle-extend ` ] ( ./reference.md#oracle-extend ) — build oracle extend transaction
158
+ - [ ` oracle-post-query ` ] ( ./reference.md#oracle-post-query ) — build oracle post query transaction
159
+ - [ ` oracle-respond ` ] ( ./reference.md#oracle-respond ) — build oracle respond transaction
160
+ - [ ` verify ` ] ( ./reference.md#verify ) — verify transaction using node
146
161
- [ ` config ` ] ( ./reference.md#config ) — print the current sdk configuration
147
162
- [ ` select-node ` ] ( ./reference.md#select-node ) — specify node to use in other commands
148
163
- [ ` select-compiler ` ] ( ./reference.md#select-compiler ) — specify compiler to use in other commands
164
+
149
165
<!-- REFERENCE-TOC-END -->
0 commit comments