-
Set connection to localhost
solana config set -u localhost -
Rename all
sample.envfiles to.env.
-
Install all packages with
npmin bothbackendandfrontend -
In root folder, start validator with Metaplex program pre-deployed
solana-test-validator --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s backend/src/mlp_token.so --reset -
In a new terminal, create a main and test wallet
solana-keygen new -o voltio-wallet.json solana airdrop 10 $(solana address -k voltio-wallet.json) solana-keygen new -o voltio-test-1.json solana airdrop 10 $(solana address -k voltio-test-1.json) -
Add the secret key in
voltio-wallet.jsontobackend/.envVOLTIO_WALLET=<SECRET_KEY_HERE> -
In
backend/, create tokennpm run getMint -
Head to the
Solana Explorer link, and updatebackend/.envto include token mint address, then set token metadataVOLTIO_MINT=<MINT_ADDRESS_HERE>npm run setTokenMetadata -
Create NFT collection, then add collection address to
backend/.envfrom the Solana Explorer linknpm run createCollection metadata/voltio-collection-metadata.jsonVOLTIO_COLLECTION_SOLAR=<COLLECTION_ADDRESS_HERE> -
Mint sample NFTs to main wallet
for i in {1..5}; do npm run mintNft metadata/solar-farm-$i-metadata.json; done -
In
backend/, start Express server for backendnpm run start -
In new terminal, navigate to
frontend/and start Vite for frontendnpm run dev
-
Make a POST HTTP request to
/transfer/tokenswith the following body:{ "senderSecretKey": <SECRET_KEY_IN_UINT8ARRAY>, "recipientAddress": <ADDRESS_TO_TRANSFER_TO>, "amount": <AMOUNT_OF_TOKENS> }
-
Make a POST HTTP request to
/transfer/nftwith the following body:{ "senderSecretKey": <SECRET_KEY_IN_UINT8ARRAY>, "recipientAddress": <ADDRESS_TO_TRANSFER_TO>, "mintAddress": <MINT_ADDRESS_OF_NFT> }
-
Make a POST HTTP request to
/airdropwith the following body:{ "recipientAddress": <ADDRESS_TO_AIRDROP_TO>, "amount": <AMOUNT_OF_TOKENS> }