Run web3 in Docker
On this page you will find steps to run blockchain and subgraph nodes in Docker locally
Running blockchain and subgraph nodes locally in Docker might be useful in order to test changes in smart contracts or/and SDKs.
In order to run necessary infra for local web3 - run next command from the project root:
This will run hardhat node with HUMAN Protocol smart contracts deployed on it and empty subgraph node w/ its dependencies.
Setting up Subgraph
First time setup
Running web3 docker containers for the first time provides you with empty subgraph node. In order to deploy our subgraphs to it you will need to follow next steps:
After that subgraph is ready for use.
Subsequent launches
Subgraph containers have Docker volumes attached to it, so every time you stop/start containers - data in subgraph persists, so you don't have to deploy graph again.
In case you make some changes to the subgraph - you might want to either re-deploy it and run re-indexing or have a clean setup. For the latter - remove all existing containers and their volumes:
After that run clean web3 services and deploy updated subgraph.
Playing around with local web3
Our TypeScript SDK has examples
folder, where you can find local-node.ts
script and use it to play around with your local web3 setup in order to verify that it works as expected:
Run it multiple times and see if values in KV store are updated.
Last updated
Was this helpful?