How to use the Ledger with the Accumulate CLI
This guide will show you how to set up Accumulate Ledger CLI for a few operations like sending tokens, adding Accumulate credits, generate a faucet. Etc.
Clone the accumulate cli repo
git clone https://gitlab.com/accumulatenetwork/core/wallet.git
Enter Accumulate folder
cd wallet
Run Accumulate CLI
go run ./cmd/accumulate
Build Accumulate CLI
go build ./cmd/accumulate
Make the project
make
Run make Accumulate command
make accumulate
Install go in accumulate folder
go install ./cmd/accumulate
Ledger device
On your ledger Device,
Open the Accumulate app.
If the Accumulate ledger app was sideloaded the app will show
app is not genuine.
Press the right button till you see,Open application.
However, the app store version will not show this.Then press both buttons to open the application.
You will see Accumulate is ready.
Scan for a Ledger device using the CLI
Note: The Accumulate ledger app must be open and your device unlocked.
accumulate ledger info
The above command will scan the USB port(s) for ledger devices and return an output similar to the following:
Wallets:
1 Manufacturer: Ledger
Product: Nano S Plus
Vendor ID: 11415
Product ID: 20497
App Version: 1.0.2
Status: ok
Wallet ID: acc://c6a629f9a65bf21159c5dfbffbc868ec3ae61ce4651108ec
The Wallet ID will reference the device, representing the first Accumulate lite address.
Send token to a lite account.
In this section, you will learn how to send a token to a lite account using the Accumulate Ledger CLI.
To send a token, you need to follow the steps below.
Generate a Ledger key.
Generate a faucet.
Add credit to your Accumulate Ledger wallet ID.
Send token.
1. Generate the Ledger key
This will store the public key along with the derivation path & wallet id in the wallet database.
Syntax
accumulate ledger key generate [key label]
Command
./accumulate ledger key generate wise
After running the command above, your Ledger device will prompt you to Review Key Information.
Press the right button till you see,
Approve.
Then press both buttons to approve the request.
Now, you will see Accumulate is ready.
The above command will return an output similar to the following on your Accumulate Ledger CLI:
name : wise
wallet ID : acc://1336bbe9ab0de46cbf2cbe539697ed0f654a0fddfefe8455
public key : 6eb9dfa41b3400d4ea226a52a0c93484ae61e3cd02ccee27c5373a8d2049d732
key type : ed25519
Congratulations 🥳🥳👏👏🥳👏🥳👏🥳, Accumulate CLI is ready for use. Your key is now registered with the CLI and from this point forward, you can perform transactions using the ledger simply by referencing the registered key name or public key.
When using the registered ledger key, your Accumulate ledger app must be open, and your device unlocked.
4. Add credit
This command will add credit to your lite account.
Syntax
accumulate credits [origin token account] [key page or lite identity url] [number of credits wanted] [max acme to spend]
Command
./accumulate credits acc://1336bbe9ab0de46cbf2cbe539697ed0f654a0fddfefe8455/ACME acc://1336bbe9ab0de46cbf2cbe539697ed0f654a0fddfefe8455/ACME 50
After running the above command, your Ledger device will prompt you to Review Add Credits.
Press the left button till you see,
Approve.
Then press both buttons to approve the request.
The above command will return an output similar to the following:
Transaction Hash : eee36ce9bdde941b3e6a8f5ab1be226053cffefacb629ee985598fcddf7ed6da
Signature 0 Hash : b54eccd2b600a7b0be112a17e2574bbfb62d04458861435d777a4f2ad0210449
Simple Hash : 27a61ccf3656b685f4fadfeb6ca293338bc3ade4ac3dd7042bade30515c840ce
Error code : ok
Result : Oracle $5000.00 / ACME
Credits 5000.00
Amount 0.01000000 ACME
5. Send tokens
This command will send a token from one lite account to another.
Syntax
accumulate tx create [lite token account url] [to] [amount] Create new token tx
Command
./accumulate tx create acc://4fde6a90d5a19af0ff2a745dd8d608c2ceeafdbd098f172a/ACME acc://4fde6a90d5a19af0ff2a745dd8d608c2ceeafdbd098f172a/ACME 10
After running the above command, your Ledger device will prompt you to Review Send Tokens.
Press the left button till you see,
Approve.
Then press both buttons to approve the request.
The above command will return an output similar to the following:
Transaction Hash : 0a00f374aa2c04a9b6040c87eb43b22716437420a17c0cc40193fca2ce65afa9
Signature 0 Hash : 6161371cc457a3f699f1bfff7fb6cc19de0595baacb42e34783ec4ab2a396834
Simple Hash : 4b3158ad75c65a71176e318e95fe0d641a16d111300cf4cf53fe53b0eb016e36
Error code : ok
Result :
Get token balance
The get token command will query the balance to check the token balance of a Lite Token Account. The Token URL in the output specifies the type of Token.
Syntax
accumulate get [url] Get data by Accumulate URL
Command
./accumulate get acc://4fde6a90d5a19af0ff2a745dd8d608c2ceeafdbd098f172a/ACME
The above command will return an output similar to the following:
Account Url : acc://4fde6a90d5a19af0ff2a745dd8d608c2ceeafdbd098f172a/ACME
Token Url : acc://ACME
Balance : 2000000.00000000 ACME
Last updated
Was this helpful?