Docs/Start building

Developer Quickstart

Start building

Developer Quickstart

Get started building on AnsemAgent testnet. Mainnet details will be available after launch.

ethers.js (Testnet)

import { JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider("https://t-rpc.ansemagent.network");
const chainId = await provider.getNetwork().then(n => Number(n.chainId));
console.log("Connected chainId:", chainId); // should be 307

web3.js (Testnet)

import Web3 from "web3";

const web3 = new Web3("https://t-rpc.ansemagent.network");
const chainId = await web3.eth.getChainId();
console.log("Connected chainId:", chainId); // should be 307

Hardhat Configuration

Add AnsemAgent Testnet to your hardhat.config.js:

module.exports = {
  networks: {
    ansemTestnet: {
      url: "https://t-rpc.ansemagent.network",
      chainId: 307,
      accounts: [process.env.PRIVATE_KEY]
    }
  }
};

Deploy to testnet:

npx hardhat run scripts/deploy.js --network ansemTestnet

Foundry Configuration

Add to foundry.toml:

[profile.default]

[rpc_endpoints]
ansem_testnet = "https://t-rpc.ansemagent.network"

Deploy to testnet:

forge create --rpc-url ansem_testnet --private-key $PRIVATE_KEY src/MyContract.sol:MyContract

Remix IDE

  • Open Remix IDE
  • Compile your contract
  • Go to Deploy & Run Transactions
  • Select Injected Provider — MetaMask
  • Ensure MetaMask is connected to AnsemAgent Testnet
  • Deploy your contract

Getting Testnet Tokens

Visit the faucet to claim free testnet ANSEM tokens for gas fees.