Skip to content

Step by step tutorial

shufenlim edited this page Apr 4, 2022 · 10 revisions

Prerequisites

1. Linux VM with nodeJS and npm

The commands below are tested for Ubuntu 20.04

  1. Node version 16 or above

    Task Command
    To check version of node node -v
    To install node sudo apt install nodejs
    To upgrade node to latest version 1. Remove current version
    sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
    sudo rm -rf /usr/local/lib/node*
    sudo rm -rf /usr/local/bin/node*
    sudo rm -rf /usr/local/include/node*
    sudo apt-get purge nodejs npm
    sudo apt autoremove

    2. Download NodeJS version 16 or above from https://nodejs.org/en/download/

    3. Install it
    Do note to change the command according to the nodeJS version you have downloaded
    tar -xf node-v16.14.2-linux-x64.tar.xz
    sudo mv node-v16.14.2-linux-x64/bin/* /usr/local/bin/
    sudo mv node-v16.14.2-linux-x64/lib/node_modules/ /usr/local/lib/
  2. Npm version 8.5.2 or above

    Task Command
    To check version of npm npm -v
    To install npm sudo apt install npm
    To upgrade npm to latest version sudo npm install npm -g

2. Metamask account

  1. Install Metamask for the browser (e.g. Firefox) from Metamask installation link

  2. Click on the MetaMask extension and follow Metamask account creation tutorial to setup Metamask account

  3. After setting up Metamask, ensure that it is connected to Rinkeby network

  4. Now you can request free Ethereum for Rinkeby network from Faucets

  5. Note down the Metamask private key. You will need it when editing the .env file.

    1. Click "Account details"
    2. Next, click "Export Private Key". You will be prompted to key in your Metamask password. After keying in the password, you will see the private key.

3. Alchemy account

  1. Browse to Alchemy and create an account for it.

  2. After logging into Alchemy, you will see the "+CREATE APP" button on your right, click it.
    Fill in the details as shown below.

    • Name: any value
    • Description: any value
    • Environment: Staging
    • Chain: Ethereum
    • Network: Rinkeby
  3. You will see the app is created successfully. In this example the app created is called "test1". Click the "VIEW DETAILS" button.

  4. Click the "VIEW KEY" button and you will see the HTTP URL for your app. Note down the HTTP URL as you will need it when editing the .env file.

4. Etherscan account

  1. Browse to Etherscan and create an account for it https://etherscan.io/myapikey
  2. After logging into Etherscan, browse to API Key and create your API key by clicking "+Add" for "My API keys". You can give any name to this key.
  3. You will see the key is created successfully. Note down the API key token as you will need it when editing the .env file.

5. Create account for NFT platforms

Create account for Rarible, NFTrade, Opensea, and Looksrare with your Metamask.

6. Pinata account

Browse to Pinata and create an account for it.


Before running the project

1. Clone the project into the Linux VM

2. Change the value in uploadContracts/.env file

API_URL="your HTTP URL for Alchemy app"
PRIVATE_KEY="your Metamask private key"
ETHERSCAN_API_KEY="your Etherscan API key token"

Leave the IPFS and MINT_NUM blank.

3. Install dependencies required for uploading contracts

  1. cd into uploadContract folder

  2. Install dependencies
    sudo apt-get install python3-bs4
    sudo apt-get install python3-colorama
    npm install dotenv --save
    npm install @openzeppelin/contracts

    npm install --save-dev hardhat

    Important note:

    Before running npm install --save-dev hardhat, please temporarily delete the hardhat.config.js file from uploadContract folder. It is because the npm will skip the installation if detected the preconfigured hardhat.config.js exists.

    After running the command successfully, please put back the hardhat.config.js file before continuing with the the rest of the steps.


    npm install @nomiclabs/hardhat-etherscan
    npm install @nomiclabs/hardhat-waffle


Run the program

python3 main.py


After running the program

After uploading NFT with smart contract and verify that smart contract is deployed successfully, you verify whether the NFT is auto-uploaded to

Platform Speed for auto-upload
Rarible Fast
NFTrade Fast
Opensea Very slow
Looksrare Depends on Opeansea because it retrieves from listing on Opensea

Clone this wiki locally