Solana: Minting an NFT Using Sugar, Candy Machine, and Filebase

Learn how to mint an NFT on Solana with Sugar, Candy Machine, and Filebase.

What is Solana?

Solana is a high-performance, open-source blockchain that is designed to scale and support decentralized applications with fast transaction processing speeds and low fees. It was built to be scalable, secure, and developer-friendly, making it a popular choice for building decentralized finance applications, NFT marketplaces, and gaming platforms.

Read below to learn how to mint an NFT on Solana with Sugar, Candy Machine, and Filebase.

Prerequisites:

1. Begin by downloading the latest Solana package:

sh -c "$(curl -sSfL https://release.solana.com/v1.15.1/install)"

2. Next, generate a new Solana wallet and key pair with the command:

solana-keygen new --outfile ~/.config/solana/devnet.json

3. Next, set your newly generated Solana key pair as the default to be used with the Solana Devnet, which is the test network:

solana config set --keypair ~/.config/solana/devnet.json

4. Then, configure the following devnet RPC URL to use the following RPC URL:

solana config set --url https://metaplex.devnet.rpcpool.com/

5. To confirm your Solana configuration, use the following command:

solana config get

6. Next, you’ll need some Solana to be used on the devnet. Use the following command to get 2 SOL to use:

solana airdrop 2

7. Then, download the Sugar CLI with the command:

bash (curl -sSf https://sugar.metaplex.com/install.sh)

8. Then use the following command to create a sugar configuration:

sugar create-config

When prompted, the answers to the configuration questions will vary based on your NFT collection’s configuration parameters. The important questions to pay attention to are the ones used to configure Filebase as your NFT upload location:

  • What upload method do you want to use?: AWS

  • What is the AWS S3 Bucket Name?: Your Filebase IPFS Bucket Name

  • What is the AWS profile Name?: Default

  • What is the Directory Name?: Leave blank by pressing enter.

  • Do you have a custom domain?: https://s3.filebase.com

Since Filebase is S3-compatible, it can be used in place of AWS in this configuration.

9. Then, configure a local file called ~/.aws/credentials to reflect the following:

[default]
aws_access_key_id = FILEBASE_ACCESS_KEY
aws_secret_access_key = FILEBASE_SECRET_KEY
region = us-east-1

Replace FILEBASE_ACCESS_KEY and FILEBASE_SECRET_KEY with your Filebase Access and Secret keys.

10. Next, you will need a folder called ~./assets that contains your NFT collection image files with correlating JSON files, each named sequentially such as ‘0.png, 1.png, 2.png,’ etc.

An example download of this folder can be found here.

11. Then, upload your images and json files to Filebase with the command:

sugar upload

12. Deploy your collection onto the Solana devnet network with the command:

sugar deploy

13. You can verify the deployment with the command:

sugar verify

14. Then, to mint your collection, use the command:

sugar mint

Last updated