Skip to Content
BXN Docs
JSON-RPC API

Overview

Talk to BXN with the standard Ethereum JSON-RPC API.

BXN nodes run Hyperledger Besu, which supports the standard Ethereum JSON-RPC API. Any Ethereum library (ethers.js, viem, web3.js, web3.py) works with BXN. Point it at a BXN RPC endpoint from the Networks page.

Methods are grouped into namespaces. A method name is the namespace, an underscore and the method, for example eth_call is in the eth namespace.

Namespaces on the public endpoints

NamespaceUse it for
ethBlocks, transactions, balances, contract calls
netNetwork ID and peer information
web3Client version and hashing
txpoolTransactions waiting to be included
qbftValidators and block production

debug, admin and trace are not enabled on the public endpoints. Run your own node if you need them.

Making a request

Send a POST request with a JSON body:

curl -s -X POST https://rpc.blackfort.network/mainnet/rpc \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
{"jsonrpc":"2.0","id":1,"result":"0x152ac69"}

Numbers are returned as hex strings.

Using a library

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

export const bxn = defineChain({
  id: 488,
  name: 'BXN',
  nativeCurrency: { name: 'BXN', symbol: 'BXN', decimals: 18 },
  rpcUrls: { default: { http: ['https://rpc.blackfort.network/mainnet/rpc'] } },
  blockExplorers: { default: { name: 'BlackFort Scan', url: 'https://blackfortscan.com' } },
});

const client = createPublicClient({ chain: bxn, transport: http() });
console.log(await client.getBlockNumber());
ethers v6
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://rpc.blackfort.network/mainnet/rpc', 488);
console.log(await provider.getBlockNumber());

Rate limits

The public endpoints are rate limited. If you need higher limits, email dev@blackfort.exchange.

On this page