-
Set connection to localhost
solana config set -u localhost
-
Rename all
sample.env
files to.env
.
-
Install all packages with
npm
in bothbackend
andfrontend
-
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.json
tobackend/.env
VOLTIO_WALLET=<SECRET_KEY_HERE>
-
In
backend/
, create tokennpm run getMint
-
Head to the
Solana Explorer link
, and updatebackend/.env
to include token mint address, then set token metadataVOLTIO_MINT=<MINT_ADDRESS_HERE>
npm run setTokenMetadata
-
Create NFT collection, then add collection address to
backend/.env
from the Solana Explorer linknpm run createCollection metadata/voltio-collection-metadata.json
VOLTIO_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/tokens
with the following body:{ "senderSecretKey": <SECRET_KEY_IN_UINT8ARRAY>, "recipientAddress": <ADDRESS_TO_TRANSFER_TO>, "amount": <AMOUNT_OF_TOKENS> }
-
Make a POST HTTP request to
/transfer/nft
with the following body:{ "senderSecretKey": <SECRET_KEY_IN_UINT8ARRAY>, "recipientAddress": <ADDRESS_TO_TRANSFER_TO>, "mintAddress": <MINT_ADDRESS_OF_NFT> }
-
Make a POST HTTP request to
/airdrop
with the following body:{ "recipientAddress": <ADDRESS_TO_AIRDROP_TO>, "amount": <AMOUNT_OF_TOKENS> }