Skip to content

Connect to the network

KriptoNyx speaks standard Ethereum JSON-RPC, so any Ethereum library or wallet connects to it unchanged.

Network details

FieldValue
Network nameKriptoNyx Testnet
RPC URLhttps://rpc.testnet.kriptonyx.com
Chain ID3009
Currency symbolKNYX
Block explorerhttps://explorer.testnet.kriptonyx.com

Add to MetaMask

Click the Add network button on any KriptoNyx application, or add it programmatically:

js
await window.ethereum.request({
  method: 'wallet_addEthereumChain',
  params: [{
    chainId: '0xbc1',
    chainName: 'KriptoNyx Testnet',
    nativeCurrency: { name: 'KriptoNyx', symbol: 'KNYX', decimals: 18 },
    rpcUrls: ['https://rpc.testnet.kriptonyx.com'],
    blockExplorerUrls: ['https://explorer.testnet.kriptonyx.com'],
  }],
});

0xbc1 is 3009 in hexadecimal. MetaMask requires the hex form.

Connect with ethers.js

js
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://rpc.testnet.kriptonyx.com');

console.log(await provider.getBlockNumber());
console.log((await provider.getNetwork()).chainId);   // 3009n

Connect with viem

js
import { createPublicClient, http, defineChain } from 'viem';

export const kriptonyx = defineChain({
  id: 3009,
  name: 'KriptoNyx Testnet',
  nativeCurrency: { name: 'KriptoNyx', symbol: 'KNYX', decimals: 18 },
  rpcUrls: { default: { http: ['https://rpc.testnet.kriptonyx.com'] } },
  blockExplorers: {
    default: { name: 'KriptoNyx Explorer', url: 'https://explorer.testnet.kriptonyx.com' },
  },
});

const client = createPublicClient({ chain: kriptonyx, transport: http() });
console.log(await client.getBlockNumber());

Deploy with Hardhat

js
// hardhat.config.js
module.exports = {
  solidity: '0.8.20',
  networks: {
    kriptonyx: {
      url: 'https://rpc.testnet.kriptonyx.com',
      chainId: 3009,
      accounts: [process.env.PRIVATE_KEY],
    },
  },
};

Verify the connection

bash
curl -s -X POST https://rpc.testnet.kriptonyx.com \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
json
{ "jsonrpc": "2.0", "id": 1, "result": "0xbc1" }

Next

Fund an account from the faucet, then send your first transaction.

KriptoNyx testnet — chain ID 3009 (kriptonyx_3009-1)