> For the complete documentation index, see [llms.txt](https://docs.onyx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onyx.org/developer-guide/getting-started.md).

# Getting Started

Onyx Mainnet accepts signed EVM transactions through JSON-RPC on Chain ID `327`.

```javascript
import { JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider("https://rpc.onyx.org", 327);
const network = await provider.getNetwork();

if (network.chainId !== 327n) throw new Error("Wrong network");
console.log(await provider.getBlockNumber());
```

## Mainnet endpoints

| Service             | URL                         |
| ------------------- | --------------------------- |
| JSON-RPC            | `https://rpc.onyx.org`      |
| Explorer            | <https://explorer.onyx.org> |
| Markets and OpenAPI | `https://markets.onyx.org`  |

End users can also add Onyx with one click from the [Onyx Explorer](https://explorer.onyx.org) (bottom-left **Add Onyx Network** button). See [Quick Start](/readme/quick-start.md).

## Add Onyx programmatically

For wallet dApps and browser providers, request the chain with EIP-3085:

```javascript
await window.ethereum.request({
  method: "wallet_addEthereumChain",
  params: [{
    chainId: "0x147",
    chainName: "Onyx Mainnet",
    nativeCurrency: { name: "XCN", symbol: "XCN", decimals: 18 },
    rpcUrls: ["https://rpc.onyx.org"],
    blockExplorerUrls: ["https://explorer.onyx.org"]
  }]
});
```

Verify the network before signing:

```bash
curl -sS https://rpc.onyx.org \
  -H 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
```

The result must be `0x147` (decimal `327`).

## Before sending value

1. Verify `eth_chainId` returns `0x147`.
2. Use `eth_estimateGas` for every transaction, especially transfers to unused addresses.
3. Use the gas price returned by the RPC. See [Network Fees](/developer-guide/network-fees.md) for the current snapshot, calculation, and USD denomination.
4. Keep native XCN values aligned to the ledger's 8-decimal precision.
5. Wait for a successful transaction receipt and reconcile balances through an independent read path.

Onyx supports the commonly used EVM read, transaction, contract-call, log, and subscription methods documented in [EVM JSON-RPC](/apis/evm-json-rpc.md). It does not claim complete parity with every Ethereum client extension.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.onyx.org/developer-guide/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
