Dự án NFT đơn giản với Metamask và Web3: Khởi tạo môi trường
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Trên thực tế thì việc sử dụng blockchain để làm một ứng dụng DApp với NFT cũng không mấy khó khăn. Chúng ta có thể tương tác với ethereum thông qua metamask và web3. Bắt đầu chúng ta hãy khởi tạo dự án đã nhé:
1. Tạo file genesis block có thông tin thế này:
2. Khởi dộng mạng private với câu lệnh:
geth --syncmode fast --allow-insecure-unlock --cache 512 --ipcpath ~/Library/Ethereum/geth.ipc --networkid 1337 --datadir . --http --http.api "personal,eth,net,web3,miner,admin" --http.corsdomain "*" --nodiscover
3. Thực hiện các bước để deploy 1 hợp đồng NFT lên mạng private vừa tạo theo hướng dẫn này
4. Tạo thư mục
apps/web
và chúng ta sẽ có cây thư muc thế này5. Cài đặt MetaMask extension trên chrome và import tài khoản từ thư mục
keystore
và chọn mạng privatelocalhost:8545
6. Xong phần khởi tạo môi trường.