Walk through this article using amman to label, inspect, etc.
npm install -g @metaplex-foundation/amman
solana-keygen new --silent --no-bip39-passphrase --outfile solpair1.json
solana-keygen new --silent --no-bip39-passphrase --outfile solpair2.json
amman airdrop ./solpair1.json -l soladdr1
amman airdrop ./solpair2.json -l soladdr2
Optionally label the "From Address" faucet
amman label faucet:AsK6qsN4HCi3e8GxZiCmPgvASyJU56kNSgNzNLXXXcvq
solana config set --keypair `pwd`/solpair1.json
solana config get
amman account soladdr1
amman run -- solana balance +soladdr1
Simple example of amman run
and how it resolves labels marked with +
spl-token create-token --mint-authority ./solpair1.json
- amman explorer now shows that transaction
- let's label the created token and the transaction (note that we can copy the addresses from the command line or from the explorer)
amman label token1:B4Bexr8YcAfypaRjope8kZyWjnpp48WAA7bEakXsSdoD \
amman label tx-create-token1:3ka9HdVKF8MJLcirUa5szaYE1abnQjRtcPBFtxTc1pKs6g2qAdeVNkDHniYmqZG1VCsbPiPWR9Apqs6r8oqzKdRZ
- in explorer select it first inspect Token Mint and then Resolved Info
- they overlap a bit, but Resolved Info will track states as they change
- note that addresses have labels added when they exist
- do the same from the command line
amman account token1
- similar to
solana account
, but supports passing labels + resolves account info like the explorer does - token is owned (internal Solana relation) by the Token Program
- mintAuthority is our soladdr1 (user-space relation)
amman run -l ata-tok1-addr1 -l tx-create-ata-tok1-addr1 -- \
spl-token create-account +token1 --owner +soladdr1
- prefixing the command with
amman run
allows us to pass labels indicated by+
(think expand to address) - labeling ata-tok1-addr1 and the transaction as part of the command
- labels help a lot to see how sol were transfered, then the token account allocated and assigned to the Token Program
- finally the account was initialized byt the Token Program
- we can inspect the created account via the amman CLI as well as in the explorer
amman account ata-tok1-addr1
- token1 is the Mint (user-space)
- Token Program is Owner (internal Solana relation)
- soladdr1 i owner (user-space relation)
amman run -- spl-token balance +token1 --owner +soladdr1
- shows
0
currently
amman run -l tx-mint-token1-to-ata-tok1-addr1 -t -- \
spl-token mint +token1 10 +ata-tok1-addr1 --mint-authority ./solpair1.json
- labeling transaction as part of command
- inspect Token Balances and the only one instruction
- ata-tok1-addr1 now shows 2 Resolved Info (mainly the amount changed)
- confirm on CLI
amman account ata-tok1-addr1
- same for
token
shows that supply now is10.0000000
(9 decimals) - not sure why
Current Supply
above is0
amman account token1
amman run -- spl-token accounts --owner +soladdr1
Token Balance
---------------------------------------------------------------
7L2BuYfwZUqHQ2MjRRH2X9vqc8kHoiNjBZfaCp2kiMF6 10
amman run -- spl-token mint +token1 10 +ata-tok1-addr1 --mint-authority ./solpair2.json
- fails
amman run -- spl-token transfer +token1 1 +soladdr2 --owner ./solpair1.json
- fails since
soladdr2
does not have the needed ATA yet - could create ATA or use
--fund-recipient
amman run -l ata-tok1-addr2 -l tx-create-ata-tok1-addr2 -- \
spl-token create-account +token1 --owner +soladdr2
- inspect
ata-tok1-addr2
(has no tokens yet)
amman run -l tx-transfer-token1-addr2 -t -- \
spl-token transfer +token1 1 +soladdr2 --owner ./solpair1.json
- labeling transaction only as part of command
- looking at accounts for that transaction we see that
soladdr2
was not sent along, but instead the derived ATA - inspect
ata-tok1-addr2
(which now has token) - find
soladdr2
in explorer and inspect Tokens which now shows1
token1
soladdr1
has9
nowtoken1
Distribution confirms this and also shows Owners (internal Solana relation)- (not sure why
token1
Transfers shows nothing) amman account
shows a summary of all accounts createdamman run -- spl-token accounts --owner +soladdr2
shows token balance