Change your Solana CLI to use the Devnet:
solana config set --url https://api.devnet.solana.com
Modify your Anchor.toml
file:
- In
[provider]
section, update to:
[provider]
cluster = "devnet"
- In
[programs.devnet]
section, add or update:
[programs.devnet]
nft_ticketing = "<your-program-id>"
Modify your ./app/frontend/.env
file (for the Next.js App):
- Update to:
NEXT_PUBLIC_REACT_APP_SOLANA_NETWORK="devnet"
Airdrop SOL to your Devnet wallet:
solana airdrop <amount>
cd /<your-path>/anchor-nft-ticketing
Build:
anchor build
Deploy on the Devnet:
anchor deploy --provider.cluster devnet
If the Program ID changed during deployment, you must update the references to the Program ID in your configuration files.
- Update Program ID:
npm run update-program-id
- Rebuild and Redeploy the Anchor Program:
anchor build && anchor deploy --provider.cluster devnet
In your Phantom wallet settings, switch to Solana Devnet.
Go to the Next.js App Directory:
cd /<your-path>/anchor-nft-ticketing/app/frontend
Start the development server:
npm run dev
Open your browser and go to:
http://localhost:3000