Configuration and Deployment
This guide outlines the technical steps required to deploy smart contracts on the Cypher testnet. It includes configuring your development environment, deploying contracts, verifying deployments, and obtaining testnet tokens for transactions.
Deployment Steps
Step 1: Configure Network Settings
Set up the Cypher network in your development framework (e.g., Hardhat or Truffle). Below is an example configuration for Hardhat:
Copy
module.exports = {
networks: {
cypherTestnet: {
url: "https://testnet-rpc.cypher.z1labs.ai",
chainId: 10111,
accounts: ["<YOUR_PRIVATE_KEY>"] // Replace with your wallet's private key or use a .env file for security
}
},
solidity: "0.8.17",
};For Truffle, modify your truffle-config.js:
Copy
// Example configuration for the Cypher network using Web3j in Java
module.exports = {
networks: {
cypherTestnet: {
provider: () => new HDWalletProvider("<YOUR_MNEMONIC>", "https://testnet-rpc.cypher.z1labs.ai"),
network_id: 10111, // Cypher testnet Chain ID
}
},
compilers: {
solc: {
version: "0.8.17"
}
}
};Step 2: Update Gateway Configuration
If your application interacts with encrypted data, ensure the Gateway URL is correctly configured. For example, in fhevmjs:
Copy
Step 3: Deploy Your Contracts
Use your preferred tool to deploy contracts. For Hardhat, an example deployment script is as follows:
Copy
Run the script with:
Copy
For Truffle:
Copy
Step 4: Verify Deployment
Cypherscan Interface Verification
Provide your contract address, compiler details, and source code.
Follow the guided form to complete the verification process.
Cypherscan API Verification
Automate verification by interacting with the Cypherscan API:
API Endpoint: https://testnet.cypherscan.ai/api/v2/
Example Request:
After deployment, verify your contract on Cypherscan to make the source code accessible for public inspection.
Copy
Follow the Blockscout API documentation for additional parameters.
Last updated