rahulkumaran / sf-unic-solidity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile

  • Run
    npx hardhat compile

Start a local node

  • Run
    npx hardhat node

Deploy

  • Deploy to a local node
    npx hardhat deploy --tags seed --network hardhat

  • Deploy to a testnet
    npx hardhat deploy --tags seed --network rinkeby

  • Deploy to a testnet
    npx hardhat deploy --tags main --network ethereum

Setup forge test

  • Install submodule
    git submodule add URL

  • Install submodules
    git submodule update --init

  • Install cargo
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh

  • Run test with specific network
    forge test -f https://rpc.api.moonbase.moonbeam.network -vvv --force

  • Run specific test
    forge test --match-contract IFOTest

  • Run gas costs
    forge test --gas-report

Setup seed data / subgraph

  • Run
    yarn install

  • Run
    yarn dev:seed
    (this will start a local hardhat node with seed data)

  • after start local hardhat node with seed data the logs printed out will give you an rpc address to your hardhat rpc (should look like this: http://127.0.0.1:8545/

  • go to subgraph directory and update the docker-compose.yml file "ethereum" environment variable to point to your local hardhat RPC. it should look like this: 'mainnet:http://host.docker.internal:8545'

  • subgraph should be connected to local hardhat node and should start reading event data

About


Languages

Language:Solidity 78.8%Language:TypeScript 21.2%