nft-handler

NFT handler | Chainlink node | ERC1155

View on GitHub

How to setup chainlink node

Setting up the .env file

    ROOT=/chainlink
    LOG_LEVEL=debug
    ETH_CHAIN_ID=42
    MIN_OUTGOING_CONFIRMATIONS=2
    LINK_CONTRACT_ADDRESS=0xa36085F69e2889c224210F603D836748e7dC0088
    CHAINLINK_TLS_PORT=0
    SECURE_COOKIES=false
    GAS_UPDATER_ENABLED=true
    ALLOW_ORIGINS=*
    ETH_URL=CHANGEME

Set the local postgres DATABASE_URL Config

    username: postgres
    password: postgres
    server: localhost
    port: 5432
    database: postgres
    DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
    DATABASE_TIMEOUT=0

Helpful resources

How to start chainlink node?

Stopping & deleting container:

Screenshots

How to deploy APIConsumer

How to run local express server

ENV variables for the project

A template of .env file is already given as .env.example, set them accordingly:

LINK_CONTRACT_ADDRESS="..."
RPC_URL="..."
MNEMONIC="..."
NODE_ADDRESS="..."
JOB_ID="..."
ETHERSCAN_API_KEY="..."

Directory structure

pam@g3:~/cl-node$ tree -I 'node_modules|build'
.
├── contracts
│   ├── Distributor
│   │   ├── APIConsumer.sol
│   │   └── TokenHandler.sol
│   ├── ERC1155
│   │   └── Token.sol
│   └── Migrations.sol
├── help
│   ├── node.info.js
│   ├── postgres.check.js
│   └── query.js
├── index.js
├── job_specs
│   └── eth=>bool.json
├── migrations
│   ├── 1_initial_migration.js
│   ├── 2_oracle.js
│   ├── 3_token.js
│   └── 4_testnet_consumer.js
├── package.json
├── README.md
├── scripts
│   ├── 1_fund_link.js
│   ├── 2_add_permission.js
│   ├── 3_request.js
│   └── 4_read_val.js
├── truffle-config.js
└── yarn.lock

7 directories, 21 files

Deployments