This project extends Hardhat's viem sample project with Hardhat Ignition for Conflux eSpace and js-conflux-sdk for Conflux Core.
To install the package, use npm:
npm install
First, start the local network with the following command:
npm run chain
This will start the local Conflux node and fund the genesis accounts. The Hardhat config will use the first account (0) as the default deployer. Once the chain is running, you can open another terminal and use the following commands:
genesis_list
This command will list the available genesis addresses.
genesis_espace
This command will transfer 1000 CFX to the eSpace addresses to enable local code deployment. Since the chain saves the blocks, these commands are only needed once until all the funds are spent or the Docker image is rebuilt.
For more details, refer to the Conflux Devkit README.
Once the accounts are funded and the chain is running, you can invoke the deployment examples with the following commands:
npm run deploy_espace
This will use LockModule.ts with Ignition to deploy the contract on the local eSpace.
npm run deploy_core
This will use LockDeploy_Core.ts with js-conflux-sdk to deploy on the local Core.