Comment on page

Deploy on Entangle Testnets

Entangle has created testnets through forks of mainnets to simulate real-life scenarios as close as possible. Developers may deploy on these in addition to official testnets when testing features of the Entangle Protocol. Please see relevant addresses and connectivity points in the next page.

For Official Testnets please see these (unofficial but helpful) guides:

Process for deployment on Entangle Testnets via hardhat environment:

  1. 1.
    Begin by installing Node.js and the npm package manager.
  2. 2.
    Proceed to install hardhat and create a project following the hardhat instructions (which appear in the console after installation): npm and hardhat.
  3. 3.
    Install the dotenv package: npm and dotenv.
  4. 4.
    Create a file named .env in the project's root directory.
  5. 5.
    Copy the following text entirely into this file:
ENT_ETH_URL = https://nodes.test.entangle.fi/rpc/eth
ENT_BSC_URL = https://nodes.test.entangle.fi/rpc/bsc
ENT_ARBITRUM_URL = https://nodes.test.entangle.fi/rpc/arbitrum
ENT_AVALANCHE_URL = https://nodes.test.entangle.fi/rpc/avalanche
ENT_FANTOM_URL = https://nodes.test.entangle.fi/rpc/fantom
ENT_OPTIMISM_URL = https://nodes.test.entangle.fi/rpc/optimism
ENT_POLYGON_URL = https://nodes.test.entangle.fi/rpc/polygon
MNEMONIC =
  1. 6.
    To deploy the account, insert the mnemonic phrase of your account. Alternatively, you can insert the private key, although this might affect subsequent sections' flow slightly.
  2. 7.
    Open the hardhat.config.(ts/js) file and navigate to the networks section. Insert the following text:
teth: {
url: process.env.ENT_ETH_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
},
tbsc: {
url: process.env.ENT_BSC_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
timeout: 100_000,
},
tavax: {
url: process.env.ENT_AVALANCHE_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
},
tftm: {
url: process.env.ENT_FANTOM_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
},
top: {
url: process.env.ENT_OPTIMISM_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
},
tarb: {
url: process.env.ENT_ARBITRUM_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
},
tent: {
url: process.env.ENT_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
},
tmat: {
url: process.env.ENT_POLYGON_URL || "",
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
timeout: 100_000,
After following the steps above, the mapping has been extended to Entangle testnets. In the .env file, you have been provided API URLs for all Entangle Testnets.
You have been forwarding these URLs while simultaneously linking them to your account. You can optionally also accomplish this using your account's private key.

Smart-contract deployment process:

To deploy a contract to any of the Entangle Testnets, follow these steps:

  1. 1.
    Write the smart-contract.
  2. 2.
    Create a contract deployment script. For instance, deploying the LpFaucet contract:
const FaucetFactory = await ethers.getContractFactory("LpFaucet");
const faucet = await FaucetFactory.deploy();
await faucet.deployed();
  1. 3.
    Once you've created the deployment script, execute it using the following command:
npx hardhat run --network [network] path/to/deploy_script.ts
  1. 4.
    Replace [network] with the desired (testnet) network choice:
  • teth (Ethereum)
  • tarb (Arbitrum)
  • tbsc (Binance Smart Chain)
  • tftm (Fantom)
  • top (Optimism)
  • tmat (Polygon)
  • tavax (Avalanche
For instance, to deploy a contract to the Binance Smart Chain network, use:
npx hardhat run --network tbsc path/to/deploy_script.ts
Keep in mind that these are Entangle testnets, forks of mainnets. Using etherscan or similar block explorers isn't feasible; it's code-only, hardcore development.
Be aware that the current state of all Entangle Testnets has advanced significantly:
ENT_ETH_BLOCK=16432377
ENT_BSC_BLOCK=24887866
ENT_OPTIMISM_BLOCK=68861185
ENT_AVALANCHE_BLOCK=30328909
ENT_FANTOM_BLOCK=53973773
ENT_POLYGON_BLOCK=38223722
ENT_ARBITRUM_BLOCK=53841787
Last modified 3d ago