Skip to content

nawei1010/NFT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

区块链与数字货币课程

姓名: 张宏伟

学号: 3190105029

主要代码在client/src文件夹下,合约代码为contracts/myNft.sol

编译环境

  • 操作系统: Windows 10
  • IDE: VS Code
  • 浏览器: Chrome
  • npm 8.1.0
  • node v14.17.0
  • yarn 1.22.10
  • Truffle v5.4.15
  • Solidity v0.5.16
  • web3.js v1.5.3
  • ipfs 0.10.0

如何运行

  1. 配置node,npm,yarn , 安装truffle、ganache,在Chrome浏览器,安装插件MetaMask

  2. 打开Ganache,选择quickstart,将server的端口号改成8545,配置完毕后,点击右上角save and start

  3. 进入demo文件夹下的client文件夹,依次输入命令 truffle compile truffle migrate

  4. truffle migrate后的结果中的‘myNft' 中的contract address 复制,

    image-20211031193919003

然后复制到client/src/getWeb3.js文件,将第6行的address变量的值设置为刚刚复制的地址

image-20211031193919003

  1. 在client目录下输入npm start启动项目,然后在google浏览器中访问http://localhost:3000
  2. 登陆MetaMask,连接localhost:8545的本地网络,并且从Ganache中导入几个账户,将账户同http://localhost:3000进行连接。 然后即可使用

界面截图

  1. 创建新的NFT

    image-20211031194232708

  2. 查看我的NFT

    image-20211031194331494

  3. 创建拍卖

    image-20211031194409075

  4. 查看所有正在拍卖的NFT

    image-20211031194450757

  5. 查看我的正在拍卖的NFT

    image-20211031194520927

  6. 查看我的投资

    image-20211031194610793

  7. 拍卖结束的NFT

    image-20211031194820355

  8. 竞拍成功的NFT

    image-20211031194920251

  9. 查看历史交易信息

    image-20211031195004944

  10. 出价最高者认领

    image-20211031195051991

  11. 拍卖失败后原主人认领

    image-20211031195152800

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published