This project is generated with the create-solana-dapp generator.
- Example cNFT code for creating trees, minting and transferring cNFTs can be found in this file
- Example site is deployed here
-
Node v18.18.0 or higher
-
Rust v1.70.0 or higher
-
Anchor CLI 0.29.0 or higher
-
Solana CLI 1.17.0 or higher
git clone <repo-url>
cd <repo-name>
npm install
npm run dev
This is a Solana program written in Rust using the Anchor framework.
You can use any normal anchor commands. Either move to the anchor
directory and run the anchor
command or prefix the command with npm run
, eg: npm run anchor
.
npm install
Running this command will create a new keypair in the anchor/target/deploy
directory and save the address to the Anchor config file and update the declare_id!
macro in the ./src/lib.rs
file of the program.
You will manually need to update the constant in anchor/lib/counter-exports.ts
to match the new program id.
npm run anchor keys sync
Some of the tests are using a devnet ReadAPI RPC to ensure the Read API client is working as expected. To run these tests locally, you'll need to set up the READ_API_RPC_DEVNET
environment variable. Simply add a .env
file in the anchor
directory and add the variable to it.
cp anchor/.env.example anchor/.env
# Edit the .env file and add the following line.
READ_API_RPC_DEVNET="INSERT_RPC_ENDPOINT_HERE"
npm run anchor-build
Note that the Anchor.toml configuration is setup to deploy and run the tests on devnet.
npm run anchor-test
This step is not needed with the default Anchor.toml configuration as the tests will automatically deploy to devnet.
npm run anchor deploy --provider.cluster devnet
If running on localnet, this script will dump the required programs.
./dump-programs.sh
This is a React app that uses the Anchor generated client to interact with the Solana program.
Start the web app
npm run dev
Build the web app
npm run build