solana config get
solana config set --url devnet
solana config set --url localnet
solana balance
solana address
solana airdrop 1
To run the test, it must be first build; the first deploy should print the new program_id, which must be places in 'lib.rs', 'contants.ts' and 'anchor.toml'.
yarn
anchor build
anchor deploy --provider.cluster <DEVNET> --provider.wallet <KEYPAIR.JSON>
anchor test
You can also
anchor run test
to only run the typescript tests and not upgrade the program trough deploy
To deploy both Candy and State Machine, must first create their account through context. Notice that there is commenting instructions for deploy and instructions order in the test file.
anchor test
After you finished adding the pubKey as response for the account creation and changed the varriables in 'constants.ts', run the test again with the mint uncommented.
Metadata Program in constants, do not exist in localnet. You can comment the invoke 'create_metadata_accounts' in 'lib.rs' to run the tests smoothly in localnet.
Start the local validator and logs
solana-test-validator
solana logs
anchor deploy
Run both Machine initializers, copy their pubKeys to constants and run the mint using:
anchor test --skip-local-validator
You can close programs to fetch you lamports rent back!
solana program close <PROGRAM_ID>
spl-token accounts