Now live on Devnet!
Frontend - https://voltio.vercel.app/
Backend - https://voltio-backend.onrender.com
- Set connection to localhost
solana config set -u localhost
- Rename all
sample.env
files to.env
.
- Install all packages in both
backend
andfrontend
npm install
- In
voltio/
, 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 token
cd backend && npm run getMint
- Head to the Solana Explorer link, and update
backend/.env
to include token mint address, then set token metadata
VOLTIO_MINT=<MINT_ADDRESS_HERE>
npm run setTokenMetadata
- Create NFT collection, then add collection address to
backend/.env
from the Solana Explorer link
npm 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
npm run start
- Open a new terminal in
frontend
and start development server
npm 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>
}