Your first connection
1. Choose testnet
Section titled “1. Choose testnet”Use https://jsongw.testnet.tolar.io/jsonrpc. Testnet’s chain ID is 2 (0x2). Never identify Tolar by the chain ID alone; use the published endpoint.
2. Check the network
Section titled “2. Check the network”curl https://jsongw.testnet.tolar.io/jsonrpc \ -H 'Content-Type: application/json' \ --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'The result should be 0x2. Also request web3_clientVersion to inspect the node implementation. This is a read-only request; no wallet or funds are needed.
3. Read the latest block number
Section titled “3. Read the latest block number”const rpc = 'https://jsongw.testnet.tolar.io/jsonrpc';
async function request(method, params = []) { const response = await fetch(rpc, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }), }); if (!response.ok) throw new Error('RPC HTTP ' + response.status); const message = await response.json(); if (message.error) throw new Error(message.error.message); return message.result;}
if ((await request('eth_chainId')) !== '0x2') { throw new Error('Unexpected chain ID');}console.log('Client:', await request('web3_clientVersion'));console.log('Block:', BigInt(await request('eth_blockNumber')).toString());Run this with a current Node.js release that includes fetch. For browser applications, RPC access also depends on the endpoint’s CORS policy. Keep private keys out of browser examples and logs.
4. Prepare a test account
Section titled “4. Prepare a test account”Use a wallet or signing library with explicit Tolar network configuration. Obtain test TOL through the current project-supported process. The legacy faucet is linked from network settings; its availability is not guaranteed.
5. Build and submit
Section titled “5. Build and submit”Compile a contract for the EVM revision supported by the deployed network. Test read-only behavior, estimate gas, obtain a current fee quote, and sign locally. Submit with eth_sendRawTransaction or the corresponding Tolar interface.
A submitted hash is not proof of success. Retrieve the receipt and inspect the execution result. Continue with SDKs and examples and transaction handling.