This project enhances Hardhat's viem sample project with Hardhat Ignition for Conflux eSpace and js-conflux-sdk for Conflux Core. It is based on the Conflux DevKit devcontainer. For more details, refer to the Conflux Devkit README. You can use this repository in GitHub Codespaces or with VS Code devcontainer support.
To install the package, use npm:
npm installAdditionally, to enable Hardhat CLI completion, use the following command:
hardhat-completion installFollow the instructions and select bash and y. To reload the shell, type bash in the terminal.
The system will auto-generate 5 private keys. If you want to add your development private keys to the system, use the following command before starting the node:
hh vars set DEPLOYER_PRIVATE_KEYTo start the development node, use:
hh nodeThis will start the local Conflux node and fund the genesis accounts on Core.
Other available commands:
To stop the node:
hh node --stopTo get the status:
hh node --statusTo get the balance of the configured keys:
hh balanceTo add funds to a specific address on the local node:
hh faucet 100 0x1231231231123To list all available genesis accounts:
hh accountsOnce the accounts are funded and the chain is running, you can deploy contracts using the following commands:
To deploy a contract on the local eSpace using Ignition, use:
hh ignition deploy ./ignition/modules/LockModule.ts --network confluxESpaceLocalTo deploy a contract on the local Core using js-conflux-sdk, use:
hh run scripts/LockDeploy_Core.ts --network confluxCoreLocalThis will use LockModule.ts and LockDeploy_Core.ts to deploy the contracts on eSpace and Core, respectively.