Verification on Local Test Chain
When running locally i.e. NODE_ENV !== production
, Sourcify adds the chainIds for the Ganache (1337) and Hardhat Network (31337) by default.
If you are running a different local chain, you can add it to Sourcify manually.
First, find the chainId
of your local chain. For Hardhat network default is 31337
. For Ganache it is 1337
. If you don't know the chain id of your network, you can send the net_version
RPC call and look at the result
field:
$ curl localhost:8545 -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'
{"jsonrpc":"2.0","id":67,"result":"31337"}
Similar to adding EVM chains add the chain to sourcify-chains-default.json
, or to override all other chains you can simply create a new file sourcify-chains.json
in the same directory. For example, to add the Hardhat Network:
...
...
"31337": {
"sourcifyName": "Hardhat Network",
"supported": true,
"rpc": ["http://localhost:8545"],
},
...
Now you can deploy and verify contracts on the testnet. Don't forget to rebuild the repo for changes to take effect:
npx lerna run build
Start the server
npm run server:start
Start the UI
npm run ui:start