Connecting Hardhat to Caduceus
We recommend you create a clone a repository like https://github.com/OpenZeppelin/openzeppelin-contracts which already has Hardhat set up and working. It also comes with an extensive amount of expertly written smart contracts which can be used to bootstrap your development. So fork the repository and go through the readme to get you up and running
alternatively you can also do this hardhat tutorial to initialise a new project: https://hardhat.org/hardhat-runner/docs/getting-started#quick-start
Inside your hardhat.config.js there will be a networks object. this object is where you can define other networks for hardhat to deploy and test the smart contracts on. This means you can point hardhat to the Testnet.
note that the hardhat network is the default network used.
To add the caduceus network you have to add the RPC endpoint along with a test wallet that ideally has Test CMP tokens. As deploying and interacting with contracts will take up CMP for gas.
As you can see the url is set to our testnet RPC endpoint. Also there is an accounts object which includes the wallets Secret Recovery Phrase along with other path details. These path details are the default path details for HD wallets thus they might work for your wallet as well.
If you use MetaMask you can copy your mnemonic phrase from the app and paste it in here with this config and it should work.
Go to here to see how to get your mnemonic phrase from MetaMask - Create a Wallet
Now your hardhat configuration is set up you can execute tests by doing
where the --network flag is the key of the of the network object in the config file. In our case we named it caduceusTestnet.
When you decide to run tests that deploy and interact with contracts then make sure that each account has enough CMP tokens to do so. Getting Testnet Tokens can help you get test CMP.