
概述
The Solana Token Minter app allows you to create fungible tokens on the Solana blockchain with built-in support for IPFS image uploads using Quicknode's IPFS API. Simply upload an image for your token metadata, fill out the token details, and connect your wallet. Click "Mint" to upload your metadata to IPFS and mint your token seamlessly.This app uses Next.js 14 该项目通过以下方式启动: create-next-app.
入门指南
安装依赖项
Open the project directory:
cd sample-dapps/solana-token-maker
Then, install the dependencies:
npm 安装
# 或
yarn
# 或
pnpm 安装
# 或
bun install
设置环境变量
请确保手头有一个 Quicknode 端点——您可以在这里免费获取一个。
- 重命名
.env.example到.env.localand update with your Quicknode Solana Node Endpoint and Quicknode IPFS key. - Make sure to update the cluster to ensure your transaction URLs point to the correct explorer (use only of the enum values provided in the
.env.examplefile). - You can use Quicknode's public IPFS Gateway URL or replace it with your own.
QN_IPFS_API=QN_abc123456789xyz_REPLACE_THIS
QN_ENDPOINT=https://example.solana-mainnet.quiknode.pro/123456
NEXT_PUBLIC_CLUSTER=mainnet-beta # mainnet-beta | devnet | testnet | local
NEXT_PUBLIC_GATEWAY_URL=https://quicknode.quicknode-ipfs.com/ipfs/
首先,运行开发服务器:
npm 运行 dev
# 或
yarn dev
# 或
pnpm dev
# 或
bun dev
请使用浏览器打开http://localhost:3000以查看结果。
使用 Dapp
- Upload an Image (this will be used for your token metadata)
- Fill out the form with the token details
- Connect your wallet
- Make sure you have ~0.04 SOL in your wallet to cover the new account fees
- If you are using Devnet, you can get free SOL from the Solana Faucet
- Click "Mint" to upload your image and metadata to IPFS and mint your token!
建筑
src/
├── app/
│ ├── page.tsx
│ └── layout.tsx
│ └── api/
│ └── solana/
│ └── createMintTx/route.ts # Create New Mint Transaction
│ └── sendAndConfirm/route.ts # Send and Confirm Transaction
│ └── upload/
│ └── image/route.ts # IPFS Image Upload
│ └── json/route.ts # IPFS JSON Upload
└── components/
├── SolanaProviders.tsx # Wallet Adapter Context providers
├── Minter.tsx # Main component
└── [supporting components]
部署到 Vercel
Next.js 文档
如需进一步了解 Next.js,请参考以下资源:
- Next.js 文档——了解 Next.js 的功能和 API。
- 学习 Next.js——一个交互式的 Next.js 教程。
您可以查看Next.js 的 GitHub 仓库——欢迎大家提出反馈和贡献!
投稿与反馈
我们非常希望听到您的反馈,并欢迎大家为这个示例应用做出任何贡献!
如需报告问题或提供反馈,请在 qn-guide-示例 存储库。
如需贡献,请按照以下步骤操作:
- 分叉该仓库
- 创建一个功能分支:git checkout -b feature/amazing-feature
- 提交您的更改:git commit -m "添加超棒的功能"
- 推送您的分支:git push origin feature/amazing-feature
- 提交一个拉取请求。
探索更多示例应用