Giter VIP home page Giter VIP logo

nfttest's Introduction

Initialization

First, initialize the repo:

npm install

Then, You will need to create an API key to connect to your pinata.cloud storage. Follow this link for more information, create a new key here, then add the following .env file to the root of this project:

PINATA_JWT=<your JWT>
PINATA_API_KEY=<Your API Key>
PINATA_API_SECRET=<Your API Secret>

Furthermore, You will need to add to your .env file a mnemonic to be able to deploy to Polygon (visit this website to generate a mnemonic).

POLYGON_MNEMONIC=<your mnemonic>
additional setup:
# Run a local blockchain fork
npx hardhat node [--fork <JSON-RPC server url>]

# Run a local ipfs node
export IPFS_PATH=`pwd`/ipfs/.go-ipfs
cd ipfs/
npx go-ipfs init#if not already done
npx go-ipfs daemon

Full process: Deploy the contract and the metadata

npx hardhat run scripts/full_process.ts [--network <network name>]

# you can also test your contract using the same network
npx hardhat test --network <network name>

What can you find in this repo ?

contracts/

This folder contains all the contracts and solidity libraries. You can interact with them using hardhat:

# Compile contracts
npx hardat compile

# Deploy contracts (see hardhat.config.ts)
npx hardhat deploy --network <network name>

data/

this folder contains all the data that will be deployed on IPFS.

ipfs/

This folder contains scripts and explanations for the NFT's metadatas. See the following readme for more details.

scripts/

This folder contains various programs to ease the process of deployment.

# Run a script (check the related file to use the right command)
node <file.mjs path> [optional arguments]
#OR
npx ts-node <file.ts path> [optional arguments]
#OR
npx hardhat run [--network <network name>] <file path> [optional arguments]

test/

This folder contains unit tests for the contracts.

npx hardhat test [<files name>]

hardhat.config.ts

This file is the entry point for all hardhat-related commands. There should be nothing to add here, unless you want a new network for your test or deployment. here is the structure:

interface HttpNetworkUserConfig {
  chainId?: number;
  from?: string;
  gas?: "auto" | number;
  gasPrice?: "auto" | number;
  gasMultiplier?: number;
  url?: string;
  timeout?: number;
  httpHeaders?: { [name: string]: string };
  accounts?: HttpNetworkAccountsUserConfig;
}

nfttest's People

Contributors

bipbipbopbop avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.