mint-nft-collection
v1.0.0
Published
Source code to create and mint generative art via NFTPort API.
Downloads
2
Readme
根据您提供的第三个 README.md 文件,这里是重写的说明文档:
Peanut Gallery And Co 的代码库使用指南
本文档提供了使用由 Hashlips 和 codeSTACKr 创建的代码库的详细指南。感谢这些团队为开发这些资源所做的工作。
环境准备
- 安装 Node.js:请访问 Node.js 官网 下载并安装。
- 安装 MetaMask 钱包浏览器扩展:请访问 MetaMask 下载页面。
项目设置
克隆仓库
使用下面的命令将项目文件克隆到本地:
git clone https://github.com/ornelasguzman47/mint-nft-collection.git
安装依赖
克隆完成后,进入项目目录并执行:
npm install
配置环境变量
复制 .env.example
文件为 .env
,并根据需要填写环境变量,如 HARDHAT_CHAIN_ID
。
运行智能合约
本地编译
编译智能合约的 ABI:
npx hardhat compile
编译成功会显示提示,并在项目中创建 src/artifacts
文件夹。
部署到本地区块链
使用下面的命令部署智能合约到本地区块链进行测试:
npx hardhat node
npx hardhat run scripts/deploy.js --network localhost
部署成功后,你将看到命令行界面输出的账户详情示例。
MetaMask 配置
打开 MetaMask 扩展并切换到 Localhost 8545
网络,然后导入一个账户私钥。成功后,你应该在钱包中看到如 10000 ETH
的余额。
前端连接
在 .env
中设置 NEXT_PUBLIC_MINTER_ADDRESS
环境变量为你的智能合约地址。
在新的终端窗口启动前端应用:
npm run dev
功能演示
设置完毕后,访问 localhost:3000
查看 dApp。首先点击 Connect wallet
连接你的钱包,确认你已连接到 Localhost 8454
网络并选择了之前导入的钱包。
现在你可以测试 mint 功能,每次交易可以 mint 1 到 10 个 NFT。填写你想要的数量并点击 Mint
按钮。
如果成功,你将看到 minted 的数量增加。
提示
如果你觉得这个项目对你有帮助,并想对 Peanut Gallery And Co 做出贡献,可以向以下 MetaMask 钱包地址捐款:
0x5cE5D823f4bD8Ec610868fBa65832B479152C7E1
感谢您的支持与贡献!