Send Transactions On Axon Via MetaMask
To proceed with this guide, you must have MetaMask installed. Visit Metamask and you will be automatically guided to the relevant store to download the extension or app based on the device and browser you’re using.
This guide provides instructions for sending transactions on Axon via MetaMask after setting up the Axon local node.
1 Set Up an Axon Node
1.1 Local Setup
Download Axon, find Compile in README, and run the following commands to start the node:
target/release/axon run --config devtools/chain/config.toml
Once the node has been successfully set up, you will notice that the block height is increasing, for instance:
Overlord: state goto new height 2171.
1.2 Add Axon to MetaMask's Local Network
Open Setting
Choose Networks
Add Network
Config Axon Network Manually
On the Networks page, make sure that the New RPC URL and Chain ID are configured according to the following information. Copy and paste the text from the boxes below:
Network name: axon-devnet
New RPC URL: http://localhost:8000
Chain ID: 0x41786f6e
This is the hexadecimal of ASCII string "Axon"
Currency symbol: axon
If you know Axon well enough, you can modify the RPC URL and Chain ID. They are in devtools/chain/config.toml
and devtools/chain/specs/single_node/chain-spec.toml
.
Save Axon Network
Once you have filled out all the items above, click Save and you will be notified that the Axon network has been added.
2 Send a Transaction
2.1 Add an Account
Add your Axon Genesis account to the local network. MetaMask supports importing accounts via both private keys and keystore files.
In Axon’s repository, the Genesis accounts and their associated funds are configured in devtools/chain/specs/single_node/chain-spec.toml
. Select an account and then use its corresponding private key.
For example, the private key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
, which corresponds to the address 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
, is derived from the mnemonic phrase test test test test test test test test test test test junk
for the first account. This mnemonic phrase is consistent with the one used for the initialization of the Hardhat Network.
The account and the balance will be displayed once the account is added. This Genesis account holds 100,000,000,000,000 AXON, as configured in devtools/chain/specs/single_node/chain-spec.toml
.
2.2 Send a Transaction
Click Send on the balance page and let’s transfer some tokens to another account. Here we are about to transfer 100 AXON to 0xdc796dfc1bb45f21d17be267877c3388d766937b
.
Click Next.
Click Confirm.
You'll see that the transaction is in Pending. It takes a few seconds for the status to change, then you'll know that the transaction has been successful and the balance is 100 AXON less.