mirror of
https://github.com/luxfi/docs.git
synced 2026-09-24 00:25:32 +00:00
feat(docs): update all chain endpoints and standards to /v1/chain
This commit is contained in:
@@ -24,24 +24,23 @@ canonical statement of the rule; everything we publish conforms to it.
|
||||
returns `404`. Each network is a different host serving the identical
|
||||
path tree.
|
||||
- **Each sovereign L1 answers on its own host.** `api.lux.network` serves the
|
||||
Lux primary network only (`/v1/bc/{C,P,X}`). Zoo, Hanzo and Pars are not
|
||||
Lux primary network only (`/v1/chain/{C,P,X}`). Zoo, Hanzo and Pars are not
|
||||
reachable as an alias or a blockchain ID underneath it; use their own hosts.
|
||||
- **Chain paths keep the `bc/` segment**: `/v1/bc/<chain>/rpc`. `/v1/C/rpc` and
|
||||
`/v1/bc/C` are malformed paths, not short aliases, and return `404`.
|
||||
- **`<chain>` is the chain letter** (`C`, `P`, `X`), not an L1 nickname.
|
||||
- **Chain paths use the `chain/` segment**: `/v1/chain/<chain>` (e.g. `/v1/chain/c`, `/v1/chain/p`, `/v1/chain/x`), with `/rpc` optional (`/v1/chain/c/rpc`).
|
||||
- **Chain identifiers**: Primary network chains use standard abbreviations (`c`, `p`, `x`), while subnets use their brand or chain ID (`zoo`, `hanzo`, `pars`). Both lowercase and uppercase are supported.
|
||||
|
||||
### Canonical endpoints
|
||||
|
||||
| Network | Chain ID | C-Chain JSON-RPC |
|
||||
|---------|----------|------------------|
|
||||
| Lux mainnet | 96369 | `https://api.lux.network/v1/bc/C/rpc` |
|
||||
| Lux testnet | 96368 | `https://api.lux-test.network/v1/bc/C/rpc` |
|
||||
| Lux devnet | 96367 | `https://api.lux-dev.network/v1/bc/C/rpc` |
|
||||
| Zoo mainnet | 200200 | `https://api.zoo.network/v1/bc/C/rpc` |
|
||||
| Zoo testnet | 200201 | `https://api.zoo-test.network/v1/bc/C/rpc` |
|
||||
| Hanzo mainnet | 36963 | `https://api.hanzo.network/v1/bc/C/rpc` |
|
||||
| Hanzo testnet | 36964 | `https://api.hanzo-test.network/v1/bc/C/rpc` |
|
||||
| Pars mainnet | 494949 | `https://api.pars.network/v1/bc/C/rpc` |
|
||||
| Lux mainnet | 96369 | `https://api.lux.network/v1/chain/c` |
|
||||
| Lux testnet | 96368 | `https://api.lux-test.network/v1/chain/c` |
|
||||
| Lux devnet | 96367 | `https://api.lux-dev.network/v1/chain/c` |
|
||||
| Zoo mainnet | 200200 | `https://api.zoo.network/v1/chain/zoo` |
|
||||
| Zoo testnet | 200201 | `https://api.zoo-test.network/v1/chain/zoo` |
|
||||
| Hanzo mainnet | 36963 | `https://api.hanzo.network/v1/chain/hanzo` |
|
||||
| Hanzo testnet | 36964 | `https://api.hanzo-test.network/v1/chain/hanzo` |
|
||||
| Pars mainnet | 494949 | `https://api.pars.network/v1/chain/pars` |
|
||||
|
||||
WebSocket is the same path with `/ws` instead of `/rpc`, over `wss://`.
|
||||
Node-wide routes are `/v1/info` (POST) and `/v1/health` (GET).
|
||||
@@ -107,24 +106,24 @@ never on the status code alone.
|
||||
### Mainnet
|
||||
|
||||
```
|
||||
RPC: https://api.lux.network/v1/bc/C/rpc
|
||||
WebSocket: wss://api.lux.network/v1/bc/C/ws
|
||||
RPC: https://api.lux.network/v1/chain/c
|
||||
WebSocket: wss://api.lux.network/v1/chain/c/ws
|
||||
Chain ID: 96369
|
||||
```
|
||||
|
||||
### Testnet
|
||||
|
||||
```
|
||||
RPC: https://api.lux-test.network/v1/bc/C/rpc
|
||||
WebSocket: wss://api.lux-test.network/v1/bc/C/ws
|
||||
RPC: https://api.lux-test.network/v1/chain/c
|
||||
WebSocket: wss://api.lux-test.network/v1/chain/c/ws
|
||||
Chain ID: 96368
|
||||
```
|
||||
|
||||
### Devnet
|
||||
|
||||
```
|
||||
RPC: https://api.lux-dev.network/v1/bc/C/rpc
|
||||
WebSocket: wss://api.lux-dev.network/v1/bc/C/ws
|
||||
RPC: https://api.lux-dev.network/v1/chain/c
|
||||
WebSocket: wss://api.lux-dev.network/v1/chain/c/ws
|
||||
```
|
||||
|
||||
## SDK Reference
|
||||
|
||||
@@ -11,9 +11,9 @@ Lux C-Chain exposes an Ethereum-compatible JSON-RPC API. Any tool that works wit
|
||||
|
||||
| Network | HTTP | WebSocket |
|
||||
|---------|------|-----------|
|
||||
| Mainnet | `https://api.lux.network/v1/bc/C/rpc` | `wss://api.lux.network/v1/bc/C/ws` |
|
||||
| Testnet | `https://api.lux-test.network/v1/bc/C/rpc` | `wss://api.lux-test.network/v1/bc/C/ws` |
|
||||
| Local | `http://localhost:9650/v1/bc/C/rpc` | `ws://localhost:9650/v1/bc/C/ws` |
|
||||
| Mainnet | `https://api.lux.network/v1/chain/c` | `wss://api.lux.network/v1/chain/c/ws` |
|
||||
| Testnet | `https://api.lux-test.network/v1/chain/c` | `wss://api.lux-test.network/v1/chain/c/ws` |
|
||||
| Local | `http://localhost:9650/v1/chain/c` | `ws://localhost:9650/v1/chain/c/ws` |
|
||||
|
||||
### Chain IDs
|
||||
|
||||
@@ -30,7 +30,7 @@ All requests use HTTP POST with `Content-Type: application/json`.
|
||||
curl -s -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
--data '{"jsonrpc":"2.0","id":1,"method":"METHOD","params":PARAMS}' \
|
||||
https://api.lux.network/v1/bc/C/rpc
|
||||
https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
## Core Methods
|
||||
@@ -45,7 +45,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_blockNumber",
|
||||
"params": []
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
Response:
|
||||
@@ -73,7 +73,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_getBalance",
|
||||
"params": ["0xYourAddress", "latest"]
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
Response:
|
||||
@@ -102,7 +102,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_sendRawTransaction",
|
||||
"params": ["0xf86c...signed_tx_hex"]
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
Response:
|
||||
@@ -133,7 +133,7 @@ curl -s -X POST --data '{
|
||||
"to": "0xContractAddress",
|
||||
"data": "0x70a08231000000000000000000000000YourAddress"
|
||||
}, "latest"]
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
The `data` field is the ABI-encoded function selector and parameters. The example above calls `balanceOf(address)`.
|
||||
@@ -162,7 +162,7 @@ curl -s -X POST --data '{
|
||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
|
||||
]
|
||||
}]
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
The topic `0xddf252ad...` is the `Transfer(address,address,uint256)` event signature.
|
||||
@@ -177,7 +177,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_getTransactionReceipt",
|
||||
"params": ["0xTransactionHash"]
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
### eth_estimateGas
|
||||
@@ -194,7 +194,7 @@ curl -s -X POST --data '{
|
||||
"to": "0xRecipientAddress",
|
||||
"value": "0xDE0B6B3A7640000"
|
||||
}]
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
### eth_gasPrice
|
||||
@@ -207,7 +207,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_gasPrice",
|
||||
"params": []
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
## WebSocket Subscriptions
|
||||
@@ -217,7 +217,7 @@ Subscribe to real-time events over WebSocket.
|
||||
### New Blocks
|
||||
|
||||
```javascript
|
||||
const ws = new WebSocket("wss://api.lux.network/v1/bc/C/ws");
|
||||
const ws = new WebSocket("wss://api.lux.network/v1/chain/c/ws");
|
||||
|
||||
ws.onopen = () => {
|
||||
ws.send(JSON.stringify({
|
||||
|
||||
@@ -5,7 +5,7 @@ description: P-Chain Platform API reference for staking, validators, and chains
|
||||
|
||||
# Platform API
|
||||
|
||||
The Platform API provides access to the P-Chain, which manages validators, staking, and chains. All Platform API methods are accessed at the `/v1/P` endpoint (or equivalently `/v1/bc/P`).
|
||||
The Platform API provides access to the P-Chain, which manages validators, staking, and chains. All Platform API methods are accessed at the `/v1/P` endpoint (or equivalently `/v1/chain/p`).
|
||||
|
||||
## Endpoint
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/bc/C/rpc")
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/chain/c")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -246,7 +246,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/bc/C/rpc")
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/chain/c")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -308,7 +308,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/bc/C/rpc")
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/chain/c")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ For C-Chain interactions, use ethers.js with the Lux RPC endpoint.
|
||||
import { ethers } from "ethers";
|
||||
|
||||
const provider = new ethers.JsonRpcProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
);
|
||||
|
||||
const blockNumber = await provider.getBlockNumber();
|
||||
@@ -282,7 +282,7 @@ console.log("Deployed to:", await contract.getAddress());
|
||||
|
||||
```typescript
|
||||
const wsProvider = new ethers.WebSocketProvider(
|
||||
"wss://api.lux.network/v1/bc/C/ws"
|
||||
"wss://api.lux.network/v1/chain/c/ws"
|
||||
);
|
||||
|
||||
// Subscribe to new blocks
|
||||
|
||||
@@ -47,7 +47,7 @@ MPC_URL=http://localhost:8081
|
||||
|
||||
# Chain RPCs
|
||||
ETH_RPC_URL=https://eth.llamarpc.com
|
||||
LUX_RPC_URL=http://localhost:9630/v1/bc/C/rpc
|
||||
LUX_RPC_URL=http://localhost:9630/v1/chain/c
|
||||
```
|
||||
|
||||
## Docker Compose
|
||||
|
||||
@@ -83,7 +83,7 @@ curl -s http://127.0.0.1:9630/v1/health
|
||||
|
||||
curl -s -X POST -H 'content-type: application/json' \
|
||||
--data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' \
|
||||
http://127.0.0.1:9630/v1/bc/C/rpc
|
||||
http://127.0.0.1:9630/v1/chain/c
|
||||
```
|
||||
|
||||
`info.getNodeVersion` returns the version **and the git commit** the binary was
|
||||
|
||||
@@ -55,7 +55,7 @@ Go-live target for the Lux primary network (D + A + Z + B).
|
||||
The A-Chain uses a REST API (not JSON-RPC). Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}
|
||||
https://api.lux.network/v1/chain/{blockchain-id}
|
||||
```
|
||||
|
||||
### Provider Endpoints
|
||||
@@ -92,7 +92,7 @@ https://api.lux.network/v1/bc/{blockchain-id}
|
||||
|
||||
```bash
|
||||
curl -X POST \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/providers/register \
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/providers/register \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"id": "provider-1",
|
||||
|
||||
@@ -55,7 +55,7 @@ Go-live target for the Lux primary network (D + A + Z + B).
|
||||
The B-Chain API uses the `bridge` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Signer Management (LP-333)
|
||||
@@ -88,7 +88,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
## Example: Get Signer Set Info
|
||||
@@ -100,7 +100,7 @@ curl -X POST --data '{
|
||||
"params": {},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -10,9 +10,9 @@ The C-Chain (Contract Chain) is the primary smart contract platform on Lux Netwo
|
||||
|
||||
| Network | Chain ID | Currency | RPC Endpoint |
|
||||
|---------|----------|----------|-------------|
|
||||
| Mainnet | 96369 | LUX | `https://api.lux.network/v1/bc/C/rpc` |
|
||||
| Testnet | 96368 | LUX | `https://api.lux-test.network/v1/bc/C/rpc` |
|
||||
| Devnet | 96370 | LUX | `https://api.lux-dev.network/v1/bc/C/rpc` |
|
||||
| Mainnet | 96369 | LUX | `https://api.lux.network/v1/chain/c` |
|
||||
| Testnet | 96368 | LUX | `https://api.lux-test.network/v1/chain/c` |
|
||||
| Devnet | 96370 | LUX | `https://api.lux-dev.network/v1/chain/c` |
|
||||
|
||||
## Token Denomination
|
||||
|
||||
@@ -60,7 +60,7 @@ gate bytecode behavior; the C-Chain supports the Cancun blob schedule:
|
||||
|
||||
## RPC API
|
||||
|
||||
The C-Chain exposes the standard Ethereum JSON-RPC API. All methods are available at the `/v1/bc/C/rpc` endpoint.
|
||||
The C-Chain exposes the standard Ethereum JSON-RPC API. All methods are available at the `/v1/chain/c` endpoint.
|
||||
|
||||
### Common Methods
|
||||
|
||||
@@ -68,29 +68,29 @@ The C-Chain exposes the standard Ethereum JSON-RPC API. All methods are availabl
|
||||
# Get chain ID
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \
|
||||
https://api.lux.network/v1/bc/C/rpc
|
||||
https://api.lux.network/v1/chain/c
|
||||
|
||||
# Get latest block number
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
|
||||
https://api.lux.network/v1/bc/C/rpc
|
||||
https://api.lux.network/v1/chain/c
|
||||
|
||||
# Get balance
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x...","latest"],"id":1}' \
|
||||
https://api.lux.network/v1/bc/C/rpc
|
||||
https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
### WebSocket
|
||||
|
||||
WebSocket connections are available at `/v1/bc/C/ws` for real-time event subscriptions.
|
||||
WebSocket connections are available at `/v1/chain/c/ws` for real-time event subscriptions.
|
||||
|
||||
## Connecting with MetaMask
|
||||
|
||||
Add Lux Mainnet to MetaMask with these settings:
|
||||
|
||||
- **Network Name**: Lux Mainnet
|
||||
- **RPC URL**: `https://api.lux.network/v1/bc/C/rpc`
|
||||
- **RPC URL**: `https://api.lux.network/v1/chain/c`
|
||||
- **Chain ID**: 96369
|
||||
- **Currency Symbol**: LUX
|
||||
- **Explorer**: `https://explore.lux.network`
|
||||
@@ -100,7 +100,7 @@ Add Lux Mainnet to MetaMask with these settings:
|
||||
Use any standard EVM tooling. Example with Foundry:
|
||||
|
||||
```bash
|
||||
forge create --rpc-url https://api.lux.network/v1/bc/C/rpc \
|
||||
forge create --rpc-url https://api.lux.network/v1/chain/c \
|
||||
--private-key $PRIVATE_KEY \
|
||||
src/MyContract.sol:MyContract
|
||||
```
|
||||
|
||||
@@ -59,7 +59,7 @@ Go-live target for the Lux primary network (D + A + Z + B).
|
||||
The D-Chain API uses the `dex` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Health and Status
|
||||
|
||||
@@ -20,16 +20,16 @@ Each sovereign L1 EVM chain has its own validator set, gas configuration, fee st
|
||||
Chain RPCs are accessible via the gateway using their blockchain ID:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
Named shortcuts are available for deployed chains:
|
||||
|
||||
```
|
||||
https://api.zoo.network/v1/bc/C/rpc
|
||||
https://api.hanzo.network/v1/bc/C/rpc
|
||||
https://api.spc.network/v1/bc/C/rpc
|
||||
https://api.pars.network/v1/bc/C/rpc
|
||||
https://api.zoo.network/v1/chain/zoo
|
||||
https://api.hanzo.network/v1/chain/hanzo
|
||||
https://api.spc.network/v1/chain/spc
|
||||
https://api.pars.network/v1/chain/pars
|
||||
```
|
||||
|
||||
## Genesis Configuration
|
||||
|
||||
@@ -48,14 +48,14 @@ The Graph VM (G-Chain) provides a GraphQL-based data layer for the Lux network.
|
||||
The G-Chain exposes a GraphQL endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/graphql
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/graphql
|
||||
```
|
||||
|
||||
### Query Format
|
||||
|
||||
```bash
|
||||
curl -X POST \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/graphql \
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/graphql \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"query": "{ blocks(limit: 10) { height timestamp txCount } }",
|
||||
|
||||
@@ -40,7 +40,7 @@ The Identity VM (I-Chain) implements W3C-compatible Decentralized Identifiers (D
|
||||
The I-Chain API uses the `identity` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Identity Operations
|
||||
@@ -93,7 +93,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -51,7 +51,7 @@ These VMs run as chains and provide domain-specific functionality beyond general
|
||||
All chain RPCs are accessible through the Lux gateway:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{chain}/rpc
|
||||
https://api.lux.network/v1/chain/{chain}/rpc
|
||||
```
|
||||
|
||||
Where `network` is `mainnet`, `testnet`, or `devnet`, and `chain` is the chain alias (e.g., `C`, `P`, `X`) or the blockchain ID.
|
||||
|
||||
@@ -44,7 +44,7 @@ The K-Chain is configured via the `config` package. Key parameters:
|
||||
The K-Chain API uses the `kvm` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Key Management
|
||||
@@ -81,7 +81,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -48,7 +48,7 @@ The Oracle VM (O-Chain) provides decentralized oracle services for external data
|
||||
The O-Chain API uses the `oracle` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Feed Operations
|
||||
@@ -77,7 +77,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -28,7 +28,7 @@ Lux uses one consistent model end-to-end:
|
||||
## RPC Endpoint
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/P
|
||||
https://api.lux.network/v1/chain/p
|
||||
```
|
||||
|
||||
The P-Chain API uses the `platform` namespace with Lux-style JSON-RPC (not Ethereum JSON-RPC).
|
||||
@@ -123,7 +123,7 @@ curl -X POST --data '{
|
||||
"params": {},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/P
|
||||
https://api.lux.network/v1/chain/p
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -50,7 +50,7 @@ The Quantum VM (Q-Chain) is a post-quantum resistant blockchain virtual machine.
|
||||
The Q-Chain API uses the `qvm` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Block Operations
|
||||
@@ -81,7 +81,7 @@ curl -X POST --data '{
|
||||
"params": {},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
@@ -42,7 +42,7 @@ The Relay VM (R-Chain) provides cross-chain message passing between Lux chains.
|
||||
The R-Chain API uses the `relay` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Channel Operations
|
||||
@@ -86,7 +86,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
## Example: Send a Message
|
||||
@@ -102,7 +102,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -90,7 +90,7 @@ Each authorized chain has configurable permissions:
|
||||
The T-Chain uses JSON-RPC with the `threshold` namespace. Endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc
|
||||
```
|
||||
|
||||
### Key Generation
|
||||
|
||||
@@ -16,7 +16,7 @@ The X-Chain (UTXO Chain) is the asset creation and transfer platform on Lux Netw
|
||||
## RPC Endpoint
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/X
|
||||
https://api.lux.network/v1/chain/x
|
||||
```
|
||||
|
||||
The X-Chain API uses the `xvm` namespace with Lux-style JSON-RPC.
|
||||
@@ -93,7 +93,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/X
|
||||
https://api.lux.network/v1/chain/x
|
||||
```
|
||||
|
||||
## Example: Create a Fixed-Cap Asset
|
||||
@@ -118,7 +118,7 @@ curl -X POST --data '{
|
||||
},
|
||||
"id": 1
|
||||
}' -H "Content-Type: application/json" \
|
||||
https://api.lux.network/v1/bc/X
|
||||
https://api.lux.network/v1/chain/x
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -59,7 +59,7 @@ Go-live target for the Lux primary network (D + A + Z + B).
|
||||
The Z-Chain exposes three handler groups. Base endpoint:
|
||||
|
||||
```
|
||||
https://api.lux.network/v1/bc/{blockchain-id}
|
||||
https://api.lux.network/v1/chain/{blockchain-id}
|
||||
```
|
||||
|
||||
### Transaction Endpoints (`/rpc`)
|
||||
@@ -100,7 +100,7 @@ https://api.lux.network/v1/bc/{blockchain-id}
|
||||
|
||||
```bash
|
||||
curl -X POST \
|
||||
https://api.lux.network/v1/bc/{blockchain-id}/rpc/sendTransaction \
|
||||
https://api.lux.network/v1/chain/{blockchain-id}/rpc/sendTransaction \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"nullifiers": ["0x..."],
|
||||
@@ -113,7 +113,7 @@ curl -X POST \
|
||||
## Example: Check Nullifier
|
||||
|
||||
```bash
|
||||
curl "https://api.lux.network/v1/bc/{blockchain-id}/privacy/isNullifierSpent?nullifier=0x..."
|
||||
curl "https://api.lux.network/v1/chain/{blockchain-id}/privacy/isNullifierSpent?nullifier=0x..."
|
||||
```
|
||||
|
||||
## Related LPs
|
||||
|
||||
@@ -432,7 +432,7 @@ EXAMPLES:
|
||||
lux chain import zoo ~/work/lux/state/rlp/zoo-mainnet-200200.rlp --devnet
|
||||
|
||||
# Import with custom RPC endpoint
|
||||
lux chain import c blocks.rlp --rpc http://localhost:9630/v1/bc/C/rpc
|
||||
lux chain import c blocks.rlp --rpc http://localhost:9630/v1/chain/c
|
||||
|
||||
# Import to blockchain by ID
|
||||
lux chain import 2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt blocks.rlp --mainnet
|
||||
|
||||
@@ -536,7 +536,7 @@ TYPICAL WORKFLOW:
|
||||
|
||||
1. Start network: lux network start --devnet
|
||||
2. Deploy chain: lux chain deploy mychain
|
||||
3. Test your dapp: (connect to http://localhost:9650/v1/bc/C/rpc)
|
||||
3. Test your dapp: (connect to http://localhost:9650/v1/chain/c)
|
||||
4. Stop network: lux network stop
|
||||
|
||||
**Usage:**
|
||||
|
||||
@@ -11,15 +11,15 @@ Make JSON-RPC calls to a Lux node.
|
||||
|
||||
Examples:
|
||||
# Get P-Chain height
|
||||
lux rpc call --method platform.getHeight --endpoint http://localhost:9630/v1/bc/P
|
||||
lux rpc call --method platform.getHeight --endpoint http://localhost:9630/v1/chain/p
|
||||
|
||||
# Get blockchains with params
|
||||
lux rpc call --method platform.getBlockchains --params '{}' --endpoint http://localhost:9630/v1/bc/P
|
||||
lux rpc call --method platform.getBlockchains --params '{}' --endpoint http://localhost:9630/v1/chain/p
|
||||
|
||||
# Create blockchain
|
||||
lux rpc call --method platform.createBlockchain \
|
||||
--params '{"vmID":"...", "name":"mychain", "genesis":"..."}' \
|
||||
--endpoint http://localhost:9630/v1/bc/P
|
||||
--endpoint http://localhost:9630/v1/chain/p
|
||||
|
||||
|
||||
### lux rpc call
|
||||
@@ -35,7 +35,7 @@ lux rpc call [flags]
|
||||
**Flags:**
|
||||
|
||||
```
|
||||
--endpoint string RPC endpoint URL (default "http://localhost:9630/v1/bc/P")
|
||||
--endpoint string RPC endpoint URL (default "http://localhost:9630/v1/chain/p")
|
||||
--method string RPC method to call (required)
|
||||
--params string JSON params object (optional)
|
||||
--timeout int Request timeout in seconds (default 30)
|
||||
@@ -46,7 +46,7 @@ lux rpc call [flags]
|
||||
Transfer LUX between the P and X chains by atomic export/import.
|
||||
|
||||
The C-Chain is an EVM: move value on it with an ordinary EVM transaction
|
||||
against /v1/bc/C/rpc, not with this command.
|
||||
against /v1/chain/c, not with this command.
|
||||
|
||||
Example:
|
||||
lux rpc transfer --from-chain P --to-chain X --to X-lux1... --amount 10
|
||||
|
||||
@@ -213,7 +213,7 @@ lux zk srs download [flags]
|
||||
|
||||
```
|
||||
--output string Output file path (default: ~/.lux/zk/srs.bin)
|
||||
--url string SRS download URL (default "https://api.lux.network/mainnet/v1/bc/Z/srs")
|
||||
--url string SRS download URL (default "https://api.lux.network/mainnet/v1/chain/z/srs")
|
||||
```
|
||||
|
||||
#### lux zk srs info
|
||||
@@ -275,7 +275,7 @@ lux zk verify groth16 [flags]
|
||||
```
|
||||
--inputs string Public inputs file path (required)
|
||||
--proof string Proof file path (required)
|
||||
--rpc string Z-Chain RPC endpoint (default "http://localhost:9630/v1/bc/Z/rpc")
|
||||
--rpc string Z-Chain RPC endpoint (default "http://localhost:9630/v1/chain/zoo")
|
||||
--vk string Verification key file path (required)
|
||||
```
|
||||
|
||||
@@ -297,7 +297,7 @@ lux zk verify plonk [flags]
|
||||
```
|
||||
--inputs string Public inputs file path (required)
|
||||
--proof string Proof file path (required)
|
||||
--rpc string Z-Chain RPC endpoint (default "http://localhost:9630/v1/bc/Z/rpc")
|
||||
--rpc string Z-Chain RPC endpoint (default "http://localhost:9630/v1/chain/zoo")
|
||||
--vk string Verification key file path (required)
|
||||
```
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Add Lux to your development environment:
|
||||
<Tab value="Mainnet">
|
||||
```
|
||||
Network Name: Lux Mainnet C-Chain
|
||||
RPC URL: https://api.lux.network/v1/bc/C/rpc
|
||||
RPC URL: https://api.lux.network/v1/chain/c
|
||||
Chain ID: 96369
|
||||
Symbol: LUX
|
||||
Explorer: https://explorer.lux.network
|
||||
@@ -24,7 +24,7 @@ Add Lux to your development environment:
|
||||
<Tab value="Testnet">
|
||||
```
|
||||
Network Name: Lux Testnet C-Chain
|
||||
RPC URL: https://api.lux-test.network/v1/bc/C/rpc
|
||||
RPC URL: https://api.lux-test.network/v1/chain/c
|
||||
Chain ID: 96368
|
||||
Symbol: LUX
|
||||
Explorer: https://explorer.testnet.lux.network
|
||||
@@ -56,12 +56,12 @@ Add Lux to your development environment:
|
||||
solidity: "0.8.24",
|
||||
networks: {
|
||||
lux: {
|
||||
url: "https://api.lux.network/v1/bc/C/rpc",
|
||||
url: "https://api.lux.network/v1/chain/c",
|
||||
chainId: 96369,
|
||||
accounts: [process.env.PRIVATE_KEY],
|
||||
},
|
||||
luxTestnet: {
|
||||
url: "https://api.lux-test.network/v1/bc/C/rpc",
|
||||
url: "https://api.lux-test.network/v1/chain/c",
|
||||
chainId: 96368,
|
||||
accounts: [process.env.PRIVATE_KEY],
|
||||
},
|
||||
@@ -174,7 +174,7 @@ Foundry provides faster compilation and testing with Forge.
|
||||
<Step>
|
||||
### Deploy with Forge
|
||||
```bash
|
||||
forge create --rpc-url https://api.lux-test.network/v1/bc/C/rpc \
|
||||
forge create --rpc-url https://api.lux-test.network/v1/chain/c \
|
||||
--private-key $PRIVATE_KEY \
|
||||
src/Counter.sol:Counter
|
||||
```
|
||||
|
||||
@@ -46,7 +46,7 @@ console.log("Address:", keypair.getAddressString());
|
||||
import { ethers } from "ethers";
|
||||
|
||||
const provider = new ethers.JsonRpcProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
);
|
||||
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
|
||||
|
||||
@@ -153,7 +153,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/bc/C/rpc")
|
||||
client, err := ethclient.Dial("https://api.lux.network/v1/chain/c")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -224,7 +224,7 @@ print(f"Node version: {info}")
|
||||
# Query C-Chain balance
|
||||
from web3 import Web3
|
||||
|
||||
w3 = Web3(Web3.HTTPProvider("https://api.lux.network/v1/bc/C/rpc"))
|
||||
w3 = Web3(Web3.HTTPProvider("https://api.lux.network/v1/chain/c"))
|
||||
balance = w3.eth.get_balance("0xYourAddress")
|
||||
print(f"Balance: {Web3.from_wei(balance, 'ether')} LUX")
|
||||
```
|
||||
|
||||
@@ -59,7 +59,7 @@ Deploy a simple storage contract to Lux C-Chain testnet using Hardhat.
|
||||
solidity: "0.8.24",
|
||||
networks: {
|
||||
luxTestnet: {
|
||||
url: "https://api.lux-test.network/v1/bc/C/rpc",
|
||||
url: "https://api.lux-test.network/v1/chain/c",
|
||||
chainId: 96368,
|
||||
accounts: [process.env.PRIVATE_KEY],
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@ Chain configuration lives in `packages/config/`:
|
||||
export const luxChain = {
|
||||
id: 96369,
|
||||
name: 'Lux C-Chain',
|
||||
rpcUrls: { default: { http: ['https://api.lux.network/v1/bc/C/rpc'] } },
|
||||
rpcUrls: { default: { http: ['https://api.lux.network/v1/chain/c'] } },
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ cp .env.example .env
|
||||
Edit `.env` with your RPC endpoints:
|
||||
|
||||
```bash
|
||||
LUX_RPC_URL=http://127.0.0.1:9630/v1/bc/C/rpc
|
||||
LUX_RPC_URL=http://127.0.0.1:9630/v1/chain/c
|
||||
DATABASE_URL=postgres://exchange:pass@localhost:5432/exchange
|
||||
```
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ go build -o explorer ./cmd/explorer
|
||||
## Run
|
||||
|
||||
```bash
|
||||
./explorer --rpc=http://localhost:9650/v1/bc/C/rpc
|
||||
./explorer --rpc=http://localhost:9650/v1/chain/c
|
||||
```
|
||||
|
||||
Production image: `ghcr.io/luxfi/explorer`
|
||||
|
||||
@@ -21,7 +21,7 @@ explore-pars.lux.network → CHAIN_ID=494949 (Pars)
|
||||
The luxd configmap maps chain names to blockchain IDs. Each chain explorer uses the actual blockchain ID in its RPC URL:
|
||||
|
||||
```
|
||||
luxd-1.luxd-headless.lux-mainnet.svc:9630/v1/bc/{blockchain_id}/rpc
|
||||
luxd-1.luxd-headless.lux-mainnet.svc:9630/v1/chain/{blockchain_id}/rpc
|
||||
```
|
||||
|
||||
> Do NOT alias chain names to C-chain. This was a bug that caused chain explorers to index C-chain data instead of the actual chain.
|
||||
|
||||
@@ -9,8 +9,8 @@ description: Complete reference for backend and frontend configuration
|
||||
|----------|---------|-------------|
|
||||
| `DATABASE_URL` | `postgresql://user:pass@host:5432/db` | PostgreSQL connection |
|
||||
| `REDIS_URL` | `redis://redis:6379` | Redis cache |
|
||||
| `ETHEREUM_JSONRPC_HTTP_URL` | `http://luxd:9630/v1/bc/C/rpc` | RPC endpoint |
|
||||
| `ETHEREUM_JSONRPC_WS_URL` | `ws://luxd:9630/v1/bc/C/ws` | WebSocket RPC |
|
||||
| `ETHEREUM_JSONRPC_HTTP_URL` | `http://luxd:9630/v1/chain/c` | RPC endpoint |
|
||||
| `ETHEREUM_JSONRPC_WS_URL` | `ws://luxd:9630/v1/chain/c/ws` | WebSocket RPC |
|
||||
| `CHAIN_ID` | `96369` | EVM chain ID |
|
||||
| `COIN` | `LUX` | Native currency symbol |
|
||||
| `NETWORK` | `LUX Network` | Network display name |
|
||||
|
||||
@@ -22,11 +22,11 @@ Traefik Ingress
|
||||
|
||||
| Instance | Domain | Chain | Backend RPC |
|
||||
|----------|--------|-------|-------------|
|
||||
| C-Chain | `explore.lux.network` | Mainnet C-Chain | `luxd-1:9630/v1/bc/C/rpc` |
|
||||
| Zoo | `explore-zoo.lux.network` | Zoo chain | `luxd-1:9630/v1/bc/{id}/rpc` |
|
||||
| Hanzo | `explore-hanzo.lux.network` | Hanzo chain | `luxd-1:9630/v1/bc/{id}/rpc` |
|
||||
| SPC | `explore-spc.lux.network` | SPC chain | `luxd-1:9630/v1/bc/{id}/rpc` |
|
||||
| Pars | `explore-pars.lux.network` | Pars chain | `luxd-1:9630/v1/bc/{id}/rpc` |
|
||||
| C-Chain | `explore.lux.network` | Mainnet C-Chain | `luxd-1:9630/v1/chain/c` |
|
||||
| Zoo | `explore-zoo.lux.network` | Zoo chain | `luxd-1:9630/v1/chain/{id}/rpc` |
|
||||
| Hanzo | `explore-hanzo.lux.network` | Hanzo chain | `luxd-1:9630/v1/chain/{id}/rpc` |
|
||||
| SPC | `explore-spc.lux.network` | SPC chain | `luxd-1:9630/v1/chain/{id}/rpc` |
|
||||
| Pars | `explore-pars.lux.network` | Pars chain | `luxd-1:9630/v1/chain/{id}/rpc` |
|
||||
|
||||
## Docker Images
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Each chain gets its own backend + frontend pair:
|
||||
|
||||
```yaml
|
||||
# RPC endpoint format (internal)
|
||||
ETHEREUM_JSONRPC_HTTP_URL: "http://luxd-1.luxd-headless.lux-mainnet.svc:9630/v1/bc/{blockchain_id}/rpc"
|
||||
ETHEREUM_JSONRPC_HTTP_URL: "http://luxd-1.luxd-headless.lux-mainnet.svc:9630/v1/chain/{blockchain_id}/rpc"
|
||||
```
|
||||
|
||||
## TLS & Ingress
|
||||
|
||||
@@ -15,7 +15,7 @@ icon: Zap
|
||||
```bash
|
||||
git clone https://github.com/luxfi/explorer.git
|
||||
cd explorer
|
||||
go run ./cmd/explorer --rpc=http://localhost:9650/v1/bc/C/rpc
|
||||
go run ./cmd/explorer --rpc=http://localhost:9650/v1/chain/c
|
||||
```
|
||||
|
||||
Open http://localhost:4000. The embedded frontend and SQLite storage start automatically.
|
||||
@@ -42,7 +42,7 @@ Open http://localhost:3000.
|
||||
|
||||
```bash
|
||||
docker run -it \
|
||||
-e RPC_ENDPOINT=http://host.docker.internal:9650/v1/bc/C/rpc \
|
||||
-e RPC_ENDPOINT=http://host.docker.internal:9650/v1/chain/c \
|
||||
-p 4000:4000 \
|
||||
ghcr.io/luxfi/explorer:latest
|
||||
```
|
||||
|
||||
@@ -15,7 +15,7 @@ npm install @luxfi/fhe-sdk
|
||||
```typescript
|
||||
import { createInstance } from '@luxfi/fhe-sdk';
|
||||
|
||||
const fhe = await createInstance({ networkUrl: 'https://api.lux.network/v1/bc/C/rpc' });
|
||||
const fhe = await createInstance({ networkUrl: 'https://api.lux.network/v1/chain/c' });
|
||||
|
||||
// Encrypt a value
|
||||
const encrypted = fhe.encrypt32(42);
|
||||
|
||||
@@ -26,8 +26,8 @@ DAG chains use vertex/edge consensus instead of linear blocks:
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
./indexer -chain xchain -rpc http://luxd:9630/v1/bc/X -port 4200
|
||||
./indexer -chain achain -rpc http://luxd:9630/v1/bc/A -port 4500
|
||||
./indexer -chain xchain -rpc http://luxd:9630/v1/chain/x -port 4200
|
||||
./indexer -chain achain -rpc http://luxd:9630/v1/chain/a -port 4500
|
||||
```
|
||||
|
||||
## DAG Traversal
|
||||
|
||||
@@ -29,7 +29,7 @@ description: Full-featured EVM indexer
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
./indexer -chain cchain -rpc http://luxd:9630/v1/bc/C/rpc -port 4000
|
||||
./indexer -chain cchain -rpc http://luxd:9630/v1/chain/c -port 4000
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
@@ -17,7 +17,7 @@ The P-Chain (Platform Chain) manages the Lux Network's validators, staking, and
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
./indexer -chain pchain -rpc http://luxd:9630/v1/bc/P -port 4100
|
||||
./indexer -chain pchain -rpc http://luxd:9630/v1/chain/p -port 4100
|
||||
```
|
||||
|
||||
## Default Port
|
||||
|
||||
@@ -54,11 +54,11 @@ chains:
|
||||
database: postgresql://indexer:pass@localhost:5432/indexer
|
||||
chains:
|
||||
- name: cchain
|
||||
rpc: http://luxd:9630/v1/bc/C/rpc
|
||||
rpc: http://luxd:9630/v1/chain/c
|
||||
chain_id: 96369
|
||||
port: 4000
|
||||
- name: zoo
|
||||
rpc: http://luxd:9630/v1/bc/BLOCKCHAIN_ID/rpc
|
||||
rpc: http://luxd:9630/v1/chain/BLOCKCHAIN_ID/rpc
|
||||
chain_id: 200200
|
||||
port: 4001
|
||||
```
|
||||
|
||||
@@ -15,7 +15,7 @@ docker build -t ghcr.io/luxfi/indexer:v0.2.2 .
|
||||
|
||||
```bash
|
||||
docker run -it \
|
||||
-e RPC_ENDPOINT=http://host.docker.internal:9630/v1/bc/C/rpc \
|
||||
-e RPC_ENDPOINT=http://host.docker.internal:9630/v1/chain/c \
|
||||
-e DATABASE_URL=postgresql://indexer:indexer@postgres:5432/indexer \
|
||||
-p 4000:4000 \
|
||||
ghcr.io/luxfi/indexer:v0.2.2 indexer -chain cchain
|
||||
|
||||
@@ -13,17 +13,17 @@ Ensure a Lux node is running with JSON-RPC accessible.
|
||||
```bash
|
||||
# Index C-Chain
|
||||
./indexer -chain cchain \
|
||||
-rpc http://localhost:9650/v1/bc/C/rpc \
|
||||
-rpc http://localhost:9650/v1/chain/c \
|
||||
-port 4000
|
||||
|
||||
# Index X-Chain
|
||||
./indexer -chain xchain \
|
||||
-rpc http://localhost:9650/v1/bc/X \
|
||||
-rpc http://localhost:9650/v1/chain/x \
|
||||
-port 4200
|
||||
|
||||
# Index P-Chain
|
||||
./indexer -chain pchain \
|
||||
-rpc http://localhost:9650/v1/bc/P \
|
||||
-rpc http://localhost:9650/v1/chain/p \
|
||||
-port 4100
|
||||
```
|
||||
|
||||
@@ -70,7 +70,7 @@ Available chains:
|
||||
|
||||
```bash
|
||||
docker run -it \
|
||||
-e RPC_ENDPOINT=http://host.docker.internal:9650/v1/bc/C/rpc \
|
||||
-e RPC_ENDPOINT=http://host.docker.internal:9650/v1/chain/c \
|
||||
-e DATABASE_URL=postgresql://indexer:indexer@postgres:5432/indexer \
|
||||
-p 4000:4000 \
|
||||
ghcr.io/luxfi/indexer:v0.2.2 indexer -chain cchain
|
||||
|
||||
@@ -130,7 +130,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_blockNumber",
|
||||
"params": []
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/chain/c
|
||||
```
|
||||
|
||||
## Querying Historical State
|
||||
@@ -146,7 +146,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_getBalance",
|
||||
"params": ["0xYourAddress", "0x7A120"]
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/chain/c
|
||||
```
|
||||
|
||||
The second parameter is the block number in hex. A full node would return an error for old blocks; an archive node returns the actual historical balance.
|
||||
@@ -160,7 +160,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "debug_traceTransaction",
|
||||
"params": ["0xTransactionHash", {"tracer": "callTracer"}]
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/chain/c
|
||||
```
|
||||
|
||||
### Historical Contract Storage
|
||||
@@ -172,7 +172,7 @@ curl -s -X POST --data '{
|
||||
"id": 1,
|
||||
"method": "eth_getStorageAt",
|
||||
"params": ["0xContractAddress", "0x0", "0x7A120"]
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/bc/C/rpc
|
||||
}' -H 'content-type:application/json' http://localhost:9650/v1/chain/c
|
||||
```
|
||||
|
||||
## Storage Management
|
||||
|
||||
@@ -199,17 +199,17 @@ All contracts target Solidity 0.8.20 with OpenZeppelin 5.
|
||||
|
||||
| Chain | ID | RPC |
|
||||
|-------|----|-----|
|
||||
| Lux Mainnet | 96369 | `api.lux.network/v1/bc/C/rpc` |
|
||||
| Lux Testnet | 96368 | `api.lux-test.network/v1/bc/C/rpc` |
|
||||
| Zoo Mainnet | 200200 | `api.zoo.network/v1/bc/Z/rpc` or `api.zoo.network/v1/bc/C/rpc` |
|
||||
| Zoo Testnet | 200201 | `api.zoo-test.network/v1/bc/Z/rpc` |
|
||||
| Lux Mainnet | 96369 | `api.lux.network/v1/chain/c` |
|
||||
| Lux Testnet | 96368 | `api.lux-test.network/v1/chain/c` |
|
||||
| Zoo Mainnet | 200200 | `api.zoo.network/v1/chain/zoo` or `api.zoo.network/v1/chain/zoo` |
|
||||
| Zoo Testnet | 200201 | `api.zoo-test.network/v1/chain/zoo` |
|
||||
| Ethereum | 1 | `eth.llamarpc.com` |
|
||||
| Base | 8453 | `mainnet.base.org` |
|
||||
| BSC | 56 | `bsc-dataseed.binance.org` |
|
||||
| Polygon | 137 | `polygon-rpc.com` |
|
||||
| Arbitrum | 42161 | `arb1.arbitrum.io/rpc` |
|
||||
| Optimism | 10 | `mainnet.optimism.io` |
|
||||
| Lux | 43114 | `api.lux.network/v1/bc/C/rpc` |
|
||||
| Lux | 43114 | `api.lux.network/v1/chain/c` |
|
||||
| Linea | 59144 | `lineascan.build` |
|
||||
| Sepolia | 11155111 | `rpc.sepolia.org` |
|
||||
| Holesky | 17000 | `ethereum-holesky-rpc.publicnode.com` |
|
||||
|
||||
@@ -47,8 +47,8 @@ The EVM runs as a **plugin binary** loaded by `luxd` (the Lux node). The binary
|
||||
|------|-------|
|
||||
| Module | `github.com/luxfi/evm` |
|
||||
| Go version | 1.26.1 |
|
||||
| C-Chain RPC | `http://<node>:9630/v1/bc/C/rpc` |
|
||||
| C-Chain WebSocket | `ws://<node>:9630/v1/bc/C/ws` |
|
||||
| C-Chain RPC | `http://<node>:9630/v1/chain/c` |
|
||||
| C-Chain WebSocket | `ws://<node>:9630/v1/chain/c/ws` |
|
||||
| C-Chain ID (mainnet) | 96369 |
|
||||
| C-Chain ID (testnet) | 96368 |
|
||||
| C-Chain ID (devnet) | 96370 |
|
||||
@@ -101,24 +101,24 @@ When deployed as a sovereign L1 chain:
|
||||
|
||||
```bash
|
||||
# Get latest block number
|
||||
curl -X POST http://localhost:9630/v1/bc/C/rpc \
|
||||
curl -X POST http://localhost:9630/v1/chain/c \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
|
||||
|
||||
# Get account balance
|
||||
curl -X POST http://localhost:9630/v1/bc/C/rpc \
|
||||
curl -X POST http://localhost:9630/v1/chain/c \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0x...","latest"]}'
|
||||
|
||||
# Send raw transaction
|
||||
curl -X POST http://localhost:9630/v1/bc/C/rpc \
|
||||
curl -X POST http://localhost:9630/v1/chain/c \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"eth_sendRawTransaction","params":["0x..."]}'
|
||||
|
||||
# Get chain ID
|
||||
curl -X POST http://localhost:9630/v1/bc/C/rpc \
|
||||
curl -X POST http://localhost:9630/v1/chain/c \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
|
||||
|
||||
# Get fee config (Lux-specific)
|
||||
curl -X POST http://localhost:9630/v1/bc/C/rpc \
|
||||
curl -X POST http://localhost:9630/v1/chain/c \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"eth_feeConfig","params":[]}'
|
||||
```
|
||||
|
||||
@@ -126,7 +126,7 @@ curl -X POST http://localhost:9630/v1/bc/C/rpc \
|
||||
|
||||
```go
|
||||
|
||||
client, err := ethclient.Dial("http://localhost:9630/v1/bc/C/rpc")
|
||||
client, err := ethclient.Dial("http://localhost:9630/v1/chain/c")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -450,10 +450,10 @@ Cross-chain communication via LP-118 Warp protocol (`warp/`):
|
||||
### Lux-Specific API Endpoints
|
||||
|
||||
```
|
||||
POST /v1/bc/C/rpc -- Standard EVM JSON-RPC
|
||||
WS /v1/bc/C/ws -- WebSocket subscriptions
|
||||
POST /v1/bc/C/lux -- Lux-specific APIs (validators)
|
||||
POST /v1/bc/C/admin -- Admin APIs (import/export, profiling)
|
||||
POST /v1/chain/c -- Standard EVM JSON-RPC
|
||||
WS /v1/chain/c/ws -- WebSocket subscriptions
|
||||
POST /v1/chain/c/lux -- Lux-specific APIs (validators)
|
||||
POST /v1/chain/c/admin -- Admin APIs (import/export, profiling)
|
||||
```
|
||||
|
||||
## Key Dependencies (go.mod verified)
|
||||
|
||||
@@ -139,14 +139,14 @@ Cache strategy: tokens/chains 5min, pools/positions 30s, quotes/prices 5s, Graph
|
||||
|
||||
| Chain | Chain ID | Native Token | RPC | Explorer |
|
||||
|-------|----------|-------------|-----|----------|
|
||||
| Lux Mainnet | 96369 | LUX | `https://api.lux.network/v1/bc/C/rpc` | `explore.lux.network` |
|
||||
| Lux Testnet | 96368 | LUX | `https://api.lux-test.network/v1/bc/C/rpc` | `explore.lux-test.network` |
|
||||
| Lux Mainnet | 96369 | LUX | `https://api.lux.network/v1/chain/c` | `explore.lux.network` |
|
||||
| Lux Testnet | 96368 | LUX | `https://api.lux-test.network/v1/chain/c` | `explore.lux-test.network` |
|
||||
| Zoo Mainnet | 200200 | ZOO | `https://api.zoo.network/rpc` | `explore.zoo.network` |
|
||||
| Zoo Testnet | 200201 | ZOO | `https://api.zoo-test.network/rpc` | `explore.zoo-test.network` |
|
||||
| Hanzo Network | 36963 | HANZO | Lux chain RPC | `explore-hanzo.lux.network` |
|
||||
| SPC Network | 36911 | SPC | Lux chain RPC | `explore-spc.lux.network` |
|
||||
| Pars Network | 494949 | PARS | Lux chain RPC | `explore-pars.lux.network` |
|
||||
| Lux Dev | 1337 | LUX | `http://localhost:8545/v1/bc/C/rpc` | local |
|
||||
| Lux Dev | 1337 | LUX | `http://localhost:8545/v1/chain/c` | local |
|
||||
|
||||
All chain definitions are in `packages/config/src/chains.ts` using viem's `defineChain()`.
|
||||
|
||||
@@ -491,7 +491,7 @@ candles.get -- Request historical candles
|
||||
| V2 Subgraph | `subgraph.lux.network/subgraphs/name/luxfi/uniswap-v2` | Pairs, reserves, swaps, token prices |
|
||||
| V3 Subgraph | `subgraph.lux.network/subgraphs/name/luxfi/uniswap-v3` | Pools, ticks, positions, concentrated liquidity |
|
||||
| Blockscout | `api-explore.lux.network/api/v2/tokens` | ERC-20 token metadata, holder counts |
|
||||
| G-Chain GraphQL | `localhost:9630/v1/bc/G/graphql` | Native blockchain data (blocks, accounts, balances) |
|
||||
| G-Chain GraphQL | `localhost:9630/v1/chain/g/graphql` | Native blockchain data (blocks, accounts, balances) |
|
||||
| DEX Gateway | `dex.lux.network` | Unified quote/swap API |
|
||||
|
||||
### 13. Smart Contracts
|
||||
|
||||
@@ -88,7 +88,7 @@ pnpm build:docker # Build Docker image
|
||||
```bash
|
||||
NEXT_PUBLIC_NETWORK_NAME=Lux Network
|
||||
NEXT_PUBLIC_NETWORK_ID=96369
|
||||
NEXT_PUBLIC_NETWORK_RPC_URL=https://api.lux.network/v1/bc/C/rpc
|
||||
NEXT_PUBLIC_NETWORK_RPC_URL=https://api.lux.network/v1/chain/c
|
||||
NEXT_PUBLIC_API_HOST=https://explore.lux.network
|
||||
NEXT_PUBLIC_APP_HOST=https://explore.lux.network
|
||||
NEXT_PUBLIC_ACCOUNT_AUTH_PROVIDER=oidc
|
||||
|
||||
@@ -84,7 +84,7 @@ go build -o explorer ./cmd/explorer
|
||||
|
||||
```bash
|
||||
# Single chain
|
||||
./explorer --rpc=http://localhost:9650/v1/bc/C/rpc
|
||||
./explorer --rpc=http://localhost:9650/v1/chain/c
|
||||
|
||||
# Multi-chain
|
||||
./explorer --config=chains.yaml
|
||||
@@ -111,7 +111,7 @@ chains:
|
||||
- slug: cchain
|
||||
name: "C-Chain"
|
||||
chain_id: 96369
|
||||
rpc: "http://luxd:9630/v1/bc/C/rpc"
|
||||
rpc: "http://luxd:9630/v1/chain/c"
|
||||
logo: "/logos/lux.svg"
|
||||
color: "#1a1a2e"
|
||||
```
|
||||
|
||||
@@ -94,7 +94,7 @@ EOF
|
||||
# Run graph-node pointing at Lux C-Chain
|
||||
cargo run -p graph-node --release -- \
|
||||
--postgres-url postgresql://user:pass@localhost:5432/graph-node \
|
||||
--ethereum-rpc lux:https://api.lux.network/v1/bc/C/rpc \
|
||||
--ethereum-rpc lux:https://api.lux.network/v1/chain/c \
|
||||
--ipfs 127.0.0.1:5001
|
||||
```
|
||||
|
||||
@@ -148,7 +148,7 @@ graph-node [FLAGS] [OPTIONS]
|
||||
--ethereum-rpc NETWORK_NAME:[CAPABILITIES]:URL
|
||||
|
||||
# Examples:
|
||||
--ethereum-rpc lux:full,archive:https://api.lux.network/v1/bc/C/rpc
|
||||
--ethereum-rpc lux:full,archive:https://api.lux.network/v1/chain/c
|
||||
--ethereum-rpc mainnet:https://eth-mainnet.g.alchemy.com/v2/KEY
|
||||
```
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ make dev-zchain # Z-Chain DAG indexer on port 4400
|
||||
|
||||
```bash
|
||||
# Single native chain
|
||||
./bin/indexer -chain xchain -rpc http://localhost:9630/v1/bc/X -port 4200
|
||||
./bin/indexer -chain xchain -rpc http://localhost:9630/v1/chain/x -port 4200
|
||||
|
||||
# All Lux EVM chains (single process)
|
||||
./bin/evmchains -config configs/evmchains.yaml
|
||||
|
||||
@@ -99,10 +99,10 @@ forge test
|
||||
|
||||
| Network | RPC |
|
||||
|---------|-----|
|
||||
| Lux Mainnet | `https://api.lux.network/v1/bc/C/rpc` |
|
||||
| Lux Testnet | `https://api.lux-test.network/v1/bc/C/rpc` |
|
||||
| Zoo Mainnet | `https://api.Zoo.network/v1/bc/C/rpc` |
|
||||
| Hanzo Mainnet | `https://api.Hanzo.network/v1/bc/C/rpc` |
|
||||
| Lux Mainnet | `https://api.lux.network/v1/chain/c` |
|
||||
| Lux Testnet | `https://api.lux-test.network/v1/chain/c` |
|
||||
| Zoo Mainnet | `https://api.Zoo.network/v1/chain/c` |
|
||||
| Hanzo Mainnet | `https://api.Hanzo.network/v1/chain/c` |
|
||||
| Ethereum Mainnet | via `MAINNET_API_KEY` env |
|
||||
| Ethereum Sepolia | via `SEPOLIA_API_KEY` env |
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ All chains defined via `viem.defineChain()` in `src/lib/chains.ts`:
|
||||
|
||||
| Chain | ID | Symbol | RPC | Explorer |
|
||||
|-------|-----|--------|-----|----------|
|
||||
| Lux (C-Chain) | 96369 | LUX | `api.lux.network/v1/bc/C/rpc` | `explore.lux.network` |
|
||||
| Zoo | 200200 | ZOO | `api.zoo.network/v1/bc/C/rpc` | `explore-zoo.lux.network` |
|
||||
| Hanzo | 36963 | HNZ | `api.hanzo.network/v1/bc/C/rpc` | `explore-hanzo.lux.network` |
|
||||
| SPC | 36911 | SPC | `api.spc.network/v1/bc/C/rpc` | `explore-spc.lux.network` |
|
||||
| Pars | 494949 | PARS | `api.pars.network/v1/bc/C/rpc` | `explore-pars.lux.network` |
|
||||
| Lux (C-Chain) | 96369 | LUX | `api.lux.network/v1/chain/c` | `explore.lux.network` |
|
||||
| Zoo | 200200 | ZOO | `api.zoo.network/v1/chain/zoo` | `explore-zoo.lux.network` |
|
||||
| Hanzo | 36963 | HNZ | `api.hanzo.network/v1/chain/hanzo` | `explore-hanzo.lux.network` |
|
||||
| SPC | 36911 | SPC | `api.spc.network/v1/chain/spc` | `explore-spc.lux.network` |
|
||||
| Pars | 494949 | PARS | `api.pars.network/v1/chain/pars` | `explore-pars.lux.network` |
|
||||
|
||||
Explorer API base URLs follow `https://explore[-chain].lux.network/api/v2` for on-chain data queries.
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ go build -o bin/import-rpc ./cmd/import-rpc/
|
||||
# Import to C-Chain via RPC
|
||||
./bin/import-rpc \
|
||||
-jsonl blocks.jsonl \
|
||||
-rpc http://127.0.0.1:9630/v1/bc/C/rpc \
|
||||
-rpc http://127.0.0.1:9630/v1/chain/c \
|
||||
-batch 100 -start 1 -reload 10000
|
||||
```
|
||||
|
||||
|
||||
@@ -119,10 +119,10 @@ Global scrape interval: **15s**. Evaluation interval: **15s**.
|
||||
| `prometheus` | `/metrics` | `localhost:9090` | -- |
|
||||
| `node` | `/metrics` | `node-exporter:9100` | -- |
|
||||
| `luxd` | `/v1/metrics` | `luxd:9630`, `host.docker.internal:9630` | `lux-mainnet` |
|
||||
| `c-chain` | `/v1/bc/C/metrics` | `luxd:9630` | `c-chain-mainnet` |
|
||||
| `c-chain-rpc` | `/v1/bc/C/rpc` | `luxd:9630` | `c-chain-rpc` |
|
||||
| `x-chain` | `/v1/bc/X/metrics` | `luxd:9630` | `x-chain-mainnet` |
|
||||
| `p-chain` | `/v1/bc/P/metrics` | `luxd:9630` | `p-chain-mainnet` |
|
||||
| `c-chain` | `/v1/chain/c/metrics` | `luxd:9630` | `c-chain-mainnet` |
|
||||
| `c-chain-rpc` | `/v1/chain/c` | `luxd:9630` | `c-chain-rpc` |
|
||||
| `x-chain` | `/v1/chain/x/metrics` | `luxd:9630` | `x-chain-mainnet` |
|
||||
| `p-chain` | `/v1/chain/p/metrics` | `luxd:9630` | `p-chain-mainnet` |
|
||||
| `lux-health` | `/v1/health` | `luxd:9630` | `lux-health` |
|
||||
| `blockscout-lux` | `/metrics` | `host.docker.internal:4000` | `blockscout-lux-mainnet` |
|
||||
| `postgres` | `/metrics` | `postgres-exporter:9187` | -- |
|
||||
|
||||
@@ -163,15 +163,15 @@ curl -X POST http://localhost:9630/v1/info \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"info.isBootstrapped","params":{}}'
|
||||
|
||||
# P-Chain: current validators
|
||||
curl -X POST http://localhost:9630/v1/bc/P \
|
||||
curl -X POST http://localhost:9630/v1/chain/p \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"platform.getCurrentValidators","params":{}}'
|
||||
|
||||
# C-Chain: EVM JSON-RPC
|
||||
curl -X POST http://localhost:9630/v1/bc/C/rpc \
|
||||
curl -X POST http://localhost:9630/v1/chain/c \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
|
||||
|
||||
# X-Chain: asset balance
|
||||
curl -X POST http://localhost:9630/v1/bc/X \
|
||||
curl -X POST http://localhost:9630/v1/chain/x \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"xvm.getBalance","params":{"address":"X-lux1...","assetID":"LUX"}}'
|
||||
```
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ spaces-cli info myspace
|
||||
|
||||
## JSON-RPC API
|
||||
|
||||
All endpoints at `/v1/bc/<chainID>/public`:
|
||||
All endpoints at `/v1/chain/<chainID>/public`:
|
||||
|
||||
```bash
|
||||
# Ping
|
||||
|
||||
@@ -79,7 +79,7 @@ CHAIN_ID=99999 # EVM chain ID (unique)
|
||||
NETWORK_ID=12345 # Lux network ID
|
||||
|
||||
# Lux mainnet connection (bridge + PQ safety)
|
||||
LUX_MAINNET_RPC=https://api.lux.network/v1/bc/C/rpc
|
||||
LUX_MAINNET_RPC=https://api.lux.network/v1/chain/c
|
||||
|
||||
# Node
|
||||
LOG_LEVEL=info
|
||||
@@ -122,9 +122,9 @@ Health checks are configured on all critical services (node, redis, all database
|
||||
The explorer connects to the C-Chain:
|
||||
|
||||
```
|
||||
RPC: http://node:9650/v1/bc/C/rpc
|
||||
Trace: http://node:9650/v1/bc/C/rpc
|
||||
WebSocket: ws://node:9650/v1/bc/C/ws
|
||||
RPC: http://node:9650/v1/chain/c
|
||||
Trace: http://node:9650/v1/chain/c
|
||||
WebSocket: ws://node:9650/v1/chain/c/ws
|
||||
```
|
||||
|
||||
Environment variables control chain display: `COIN`, `COIN_NAME`, `NETWORK`, `CHAIN_ID`.
|
||||
|
||||
@@ -259,9 +259,9 @@ make lint # Run go vet
|
||||
|
||||
| Endpoint | URL |
|
||||
|----------|-----|
|
||||
| Mainnet C-Chain RPC | `http://127.0.0.1:9630/v1/bc/C/rpc` |
|
||||
| Testnet C-Chain RPC | `http://127.0.0.1:9640/v1/bc/C/rpc` |
|
||||
| Devnet C-Chain RPC | `http://127.0.0.1:9650/v1/bc/C/rpc` |
|
||||
| Mainnet C-Chain RPC | `http://127.0.0.1:9630/v1/chain/c` |
|
||||
| Testnet C-Chain RPC | `http://127.0.0.1:9640/v1/chain/c` |
|
||||
| Devnet C-Chain RPC | `http://127.0.0.1:9650/v1/chain/c` |
|
||||
| LUX Explorer | `http://127.0.0.1:4010` |
|
||||
| Zoo Explorer | `http://127.0.0.1:4011` |
|
||||
| Graph Node | `http://127.0.0.1:8000` |
|
||||
|
||||
@@ -211,7 +211,7 @@ github.com/spf13/[email protected] — CLI framework
|
||||
|
||||
```yaml
|
||||
rpc:
|
||||
url: http://localhost:9650/v1/bc/C/rpc
|
||||
url: http://localhost:9650/v1/chain/c
|
||||
timeout: 30s
|
||||
signing:
|
||||
key_path: ~/.lux/staking/signer.key
|
||||
|
||||
@@ -39,11 +39,11 @@ To use Lux Safe on a specific chain, ensure your wallet is configured with the c
|
||||
|
||||
| Chain | RPC URL |
|
||||
|-------|---------|
|
||||
| C-Chain | `https://api.lux.network/v1/bc/C/rpc` |
|
||||
| Zoo | `https://api.zoo.network/v1/bc/C/rpc` |
|
||||
| Hanzo | `https://api.hanzo.network/v1/bc/C/rpc` |
|
||||
| SPC | `https://api.spc.network/v1/bc/C/rpc` |
|
||||
| Pars | `https://api.pars.network/v1/bc/C/rpc` |
|
||||
| C-Chain | `https://api.lux.network/v1/chain/c` |
|
||||
| Zoo | `https://api.zoo.network/v1/chain/zoo` |
|
||||
| Hanzo | `https://api.hanzo.network/v1/chain/hanzo` |
|
||||
| SPC | `https://api.spc.network/v1/chain/spc` |
|
||||
| Pars | `https://api.pars.network/v1/chain/pars` |
|
||||
|
||||
## Static Deployment
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ All Lux chains expose JSON-RPC APIs. The SDK wraps these APIs with typed clients
|
||||
|
||||
| API | Endpoint | Description |
|
||||
|-----|----------|-------------|
|
||||
| P-Chain | `/v1/bc/P` | Validators, chains, staking, delegations |
|
||||
| X-Chain | `/v1/bc/X` | UTXO operations, asset creation and transfer |
|
||||
| C-Chain | `/v1/bc/C/rpc` | EVM JSON-RPC (eth, net, web3 namespaces) |
|
||||
| Sovereign L1 EVM | `/v1/bc/{name}/rpc` | Same as C-Chain, per-chain endpoint |
|
||||
| P-Chain | `/v1/chain/p` | Validators, chains, staking, delegations |
|
||||
| X-Chain | `/v1/chain/x` | UTXO operations, asset creation and transfer |
|
||||
| C-Chain | `/v1/chain/c` | EVM JSON-RPC (eth, net, web3 namespaces) |
|
||||
| Sovereign L1 EVM | `/v1/chain/{name}/rpc` | Same as C-Chain, per-chain endpoint |
|
||||
| Info | `/v1/info` | Node info, network ID, node ID |
|
||||
| Health | `/v1/health` | Node and chain health status |
|
||||
| Admin | `/v1/admin` | Node administration (whitelisted) |
|
||||
|
||||
@@ -20,7 +20,7 @@ therefore compiles and tests with NO luxfi/evm dependency, so default
|
||||
`GOWORK=off go test ./...` stays green. Build/import this file only inside the
|
||||
lux workspace (where evm resolves) or with `-tags livedial`:
|
||||
|
||||
c, err := aichain.Dial("https://api.lux.network/v1/bc/C/rpc", privKeyHex)
|
||||
c, err := aichain.Dial("https://api.lux.network/v1/chain/c", privKeyHex)
|
||||
|
||||
Everywhere else, construct the Client directly from any EVMBackend
|
||||
(aichain.NewClient) — luxfi/evm/ethclient.Client satisfies that interface, so
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
func main() {
|
||||
client, err := ethclient.Dial(
|
||||
"https://api.lux.network/v1/bc/C/rpc",
|
||||
"https://api.lux.network/v1/chain/c",
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -53,7 +53,7 @@ Platform chain operations use the `platformvm` client for validator and staking
|
||||
import "github.com/luxfi/sdk/platformvm"
|
||||
|
||||
client := platformvm.NewClient(
|
||||
"https://api.lux.network/v1/bc/P",
|
||||
"https://api.lux.network/v1/chain/p",
|
||||
)
|
||||
|
||||
// Get current validators
|
||||
@@ -70,7 +70,7 @@ Exchange chain operations for UTXO-based asset management:
|
||||
import "github.com/luxfi/sdk/xvm"
|
||||
|
||||
client := xvm.NewClient(
|
||||
"https://api.lux.network/v1/bc/X",
|
||||
"https://api.lux.network/v1/chain/x",
|
||||
)
|
||||
|
||||
// Get asset description
|
||||
@@ -86,12 +86,12 @@ Sovereign L1 EVM chains use the same `ethclient` interface with a different endp
|
||||
```go
|
||||
// Zoo chain RPC
|
||||
zooClient, _ := ethclient.Dial(
|
||||
"https://api.zoo.network/v1/bc/C/rpc",
|
||||
"https://api.zoo.network/v1/chain/zoo",
|
||||
)
|
||||
|
||||
// Hanzo chain RPC
|
||||
hanzoClient, _ := ethclient.Dial(
|
||||
"https://api.hanzo.network/v1/bc/C/rpc",
|
||||
"https://api.hanzo.network/v1/chain/hanzo",
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
func sendEVM() error {
|
||||
client, _ := ethclient.Dial(
|
||||
"http://127.0.0.1:9630/v1/bc/C/rpc",
|
||||
"http://127.0.0.1:9630/v1/chain/c",
|
||||
)
|
||||
|
||||
// Build EIP-1559 transaction
|
||||
|
||||
@@ -45,7 +45,7 @@ import { createPublicClient, http } from "viem";
|
||||
|
||||
const client = createPublicClient({
|
||||
transport: http(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
),
|
||||
});
|
||||
const block = await client.getBlockNumber();
|
||||
@@ -57,7 +57,7 @@ const block = await client.getBlockNumber();
|
||||
from web3 import Web3
|
||||
|
||||
w3 = Web3(Web3.HTTPProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
))
|
||||
block = w3.eth.block_number
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@ The Python SDK wraps Web3.py to provide typed access to all Lux node RPC endpoin
|
||||
from web3 import Web3
|
||||
|
||||
w3 = Web3(Web3.HTTPProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
))
|
||||
|
||||
# Get latest block
|
||||
@@ -36,12 +36,12 @@ Connect to any sovereign L1 EVM chain by changing the endpoint:
|
||||
```python
|
||||
# Zoo chain
|
||||
zoo = Web3(Web3.HTTPProvider(
|
||||
"https://api.zoo.network/v1/bc/C/rpc"
|
||||
"https://api.zoo.network/v1/chain/zoo"
|
||||
))
|
||||
|
||||
# Hanzo chain
|
||||
hanzo = Web3(Web3.HTTPProvider(
|
||||
"https://api.hanzo.network/v1/bc/C/rpc"
|
||||
"https://api.hanzo.network/v1/chain/hanzo"
|
||||
))
|
||||
```
|
||||
|
||||
@@ -51,7 +51,7 @@ hanzo = Web3(Web3.HTTPProvider(
|
||||
import requests
|
||||
|
||||
resp = requests.post(
|
||||
"https://api.lux.network/v1/bc/P",
|
||||
"https://api.lux.network/v1/chain/p",
|
||||
json={
|
||||
"jsonrpc": "2.0",
|
||||
"method": "platform.getCurrentValidators",
|
||||
@@ -67,9 +67,9 @@ print(f"Active validators: {len(validators)}")
|
||||
|
||||
| Network | C-Chain RPC URL |
|
||||
|---------|-----------------|
|
||||
| Mainnet | `https://api.lux.network/v1/bc/C/rpc` |
|
||||
| Testnet | `https://api.lux-test.network/v1/bc/C/rpc` |
|
||||
| Local | `http://127.0.0.1:9630/v1/bc/C/rpc` |
|
||||
| Mainnet | `https://api.lux.network/v1/chain/c` |
|
||||
| Testnet | `https://api.lux-test.network/v1/chain/c` |
|
||||
| Local | `http://127.0.0.1:9630/v1/chain/c` |
|
||||
|
||||
## Chain IDs
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from web3 import Web3
|
||||
from eth_account import Account
|
||||
|
||||
w3 = Web3(Web3.HTTPProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
))
|
||||
|
||||
account = Account.from_key("0x...")
|
||||
@@ -91,7 +91,7 @@ Same patterns work on any sovereign L1 EVM chain -- just change the provider URL
|
||||
```python
|
||||
# Zoo chain (chain ID 200200)
|
||||
w3 = Web3(Web3.HTTPProvider(
|
||||
"https://api.zoo.network/v1/bc/C/rpc"
|
||||
"https://api.zoo.network/v1/chain/zoo"
|
||||
))
|
||||
tx["chainId"] = 200200
|
||||
```
|
||||
|
||||
@@ -51,7 +51,7 @@ for i in range(5):
|
||||
from web3 import Web3
|
||||
|
||||
w3 = Web3(Web3.HTTPProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
))
|
||||
|
||||
# Build transaction
|
||||
|
||||
@@ -69,7 +69,7 @@ const client = createPublicClient({
|
||||
nativeCurrency: { name: "LUX", symbol: "LUX", decimals: 18 },
|
||||
rpcUrls: {
|
||||
default: {
|
||||
http: ["https://api.lux.network/v1/bc/C/rpc"],
|
||||
http: ["https://api.lux.network/v1/chain/c"],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@ import { createPublicClient, http, formatEther } from "viem";
|
||||
|
||||
const client = createPublicClient({
|
||||
transport: http(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
),
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ console.log("Gas price:", gasPrice);
|
||||
import { ethers } from "ethers";
|
||||
|
||||
const provider = new ethers.JsonRpcProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
);
|
||||
|
||||
const block = await provider.getBlockNumber();
|
||||
@@ -51,7 +51,7 @@ console.log("Block:", block, "Balance:", ethers.formatEther(balance));
|
||||
|
||||
```typescript
|
||||
const response = await fetch(
|
||||
"https://api.lux.network/v1/bc/P",
|
||||
"https://api.lux.network/v1/chain/p",
|
||||
{
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
@@ -76,14 +76,14 @@ All sovereign L1 EVM chains use the same interface -- change the endpoint URL:
|
||||
// Zoo chain
|
||||
const zoo = createPublicClient({
|
||||
transport: http(
|
||||
"https://api.zoo.network/v1/bc/C/rpc"
|
||||
"https://api.zoo.network/v1/chain/zoo"
|
||||
),
|
||||
});
|
||||
|
||||
// Hanzo chain
|
||||
const hanzo = createPublicClient({
|
||||
transport: http(
|
||||
"https://api.hanzo.network/v1/bc/C/rpc"
|
||||
"https://api.hanzo.network/v1/chain/hanzo"
|
||||
),
|
||||
});
|
||||
```
|
||||
@@ -92,9 +92,9 @@ const hanzo = createPublicClient({
|
||||
|
||||
| Network | C-Chain RPC URL |
|
||||
|---------|-----------------|
|
||||
| Mainnet | `https://api.lux.network/v1/bc/C/rpc` |
|
||||
| Testnet | `https://api.lux-test.network/v1/bc/C/rpc` |
|
||||
| Local | `http://127.0.0.1:9630/v1/bc/C/rpc` |
|
||||
| Mainnet | `https://api.lux.network/v1/chain/c` |
|
||||
| Testnet | `https://api.lux-test.network/v1/chain/c` |
|
||||
| Local | `http://127.0.0.1:9630/v1/chain/c` |
|
||||
|
||||
## Chain IDs
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ const account = privateKeyToAccount("0x...");
|
||||
|
||||
const publicClient = createPublicClient({
|
||||
transport: http(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
),
|
||||
});
|
||||
|
||||
const walletClient = createWalletClient({
|
||||
account,
|
||||
transport: http(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
),
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ Same API, different chain configuration:
|
||||
const zooWallet = createWalletClient({
|
||||
account,
|
||||
transport: http(
|
||||
"https://api.zoo.network/v1/bc/C/rpc"
|
||||
"https://api.zoo.network/v1/chain/zoo"
|
||||
),
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ console.log("Address:", account.address);
|
||||
const wallet = createWalletClient({
|
||||
account,
|
||||
transport: http(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
),
|
||||
});
|
||||
```
|
||||
@@ -62,7 +62,7 @@ const hash = await wallet.sendTransaction({
|
||||
rpcUrls: {
|
||||
default: {
|
||||
http: [
|
||||
"https://api.lux.network/v1/bc/C/rpc",
|
||||
"https://api.lux.network/v1/chain/c",
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -78,7 +78,7 @@ console.log("TX hash:", hash);
|
||||
import { ethers } from "ethers";
|
||||
|
||||
const provider = new ethers.JsonRpcProvider(
|
||||
"https://api.lux.network/v1/bc/C/rpc"
|
||||
"https://api.lux.network/v1/chain/c"
|
||||
);
|
||||
const signer = new ethers.Wallet("0xPrivateKey...", provider);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ description: P-Chain staking API endpoints for validators and delegators
|
||||
icon: FileCode
|
||||
---
|
||||
|
||||
All staking operations go through the P-Chain API at `/v1/bc/P`.
|
||||
All staking operations go through the P-Chain API at `/v1/chain/p`.
|
||||
|
||||
## Add Validator
|
||||
|
||||
@@ -91,5 +91,5 @@ Returns `minValidatorStake` and `minDelegatorStake` in nLUX.
|
||||
|
||||
| Network | URL |
|
||||
|---------|-----|
|
||||
| Mainnet | `https://api.lux.network/v1/bc/P` |
|
||||
| Testnet | `https://api.lux-test.network/v1/bc/P` |
|
||||
| Mainnet | `https://api.lux.network/v1/chain/p` |
|
||||
| Testnet | `https://api.lux-test.network/v1/chain/p` |
|
||||
|
||||
@@ -54,7 +54,7 @@ curl -s -X POST --data '{
|
||||
"method":"platform.getCurrentValidators",
|
||||
"params":{},
|
||||
"id":1
|
||||
}' -H 'content-type:application/json' http://127.0.0.1:9630/v1/bc/P | jq '.result.validators[] | {nodeID, uptime, delegationFee}'
|
||||
}' -H 'content-type:application/json' http://127.0.0.1:9630/v1/chain/p | jq '.result.validators[] | {nodeID, uptime, delegationFee}'
|
||||
```
|
||||
|
||||
Look for validators with uptime above 95% and delegation fees at or near the 2% minimum.
|
||||
|
||||
@@ -44,7 +44,7 @@ forge script script/DeployFullStack.s.sol --rpc-url lux_testnet --broadcast --ve
|
||||
| **WLUX** | `0x52c84043cd9c865236f11d9fc9f56aa003c1f922` |
|
||||
| **AI** | `0xa4cd3b0eb6e5ab5d8ce4065bccd70040adab1f00` |
|
||||
|
||||
RPC: `https://api.lux.network/v1/bc/C/rpc`
|
||||
RPC: `https://api.lux.network/v1/chain/c`
|
||||
|
||||
## C-Chain Testnet (96368)
|
||||
|
||||
@@ -56,7 +56,7 @@ RPC: `https://api.lux.network/v1/bc/C/rpc`
|
||||
| **LBTC** | `0x7fc4f8a926e47fa3587c0d7658c00e7489e67916` |
|
||||
| **LiquidLUX** | `0x00947bbdc619974b0eddaf103b981f3273a3e8da` |
|
||||
|
||||
RPC: `https://api.lux-test.network/v1/bc/C/rpc`
|
||||
RPC: `https://api.lux-test.network/v1/chain/c`
|
||||
|
||||
## C-Chain Devnet (96370)
|
||||
|
||||
@@ -77,7 +77,7 @@ RPC: `https://api.lux-test.network/v1/bc/C/rpc`
|
||||
| **Streams** | `0xd9e69a0A38BF48898456170CB3B4451cBaF5F597` |
|
||||
| **Cover** | `0x92d057F8B4132Ca8Aa237fbd4C41F9c57079582E` |
|
||||
|
||||
RPC: `https://api.lux-dev.network/v1/bc/C/rpc`
|
||||
RPC: `https://api.lux-dev.network/v1/chain/c`
|
||||
|
||||
## AMM Production Addresses (Shared via CREATE2)
|
||||
|
||||
@@ -96,6 +96,6 @@ These addresses are identical across LUX mainnet, testnet, and Zoo:
|
||||
|
||||
| Network | Network ID | C-Chain ID | RPC |
|
||||
|---------|------------|-----------|-----|
|
||||
| Mainnet | 1 | 96369 | `https://api.lux.network/v1/bc/C/rpc` |
|
||||
| Testnet | 2 | 96368 | `https://api.lux-test.network/v1/bc/C/rpc` |
|
||||
| Devnet | 3 | 96370 | `https://api.lux-dev.network/v1/bc/C/rpc` |
|
||||
| Mainnet | 1 | 96369 | `https://api.lux.network/v1/chain/c` |
|
||||
| Testnet | 2 | 96368 | `https://api.lux-test.network/v1/chain/c` |
|
||||
| Devnet | 3 | 96370 | `https://api.lux-dev.network/v1/chain/c` |
|
||||
|
||||
@@ -47,7 +47,7 @@ Your delegate votes with the weight of your vLUX. You can change your delegate a
|
||||
|
||||
```bash
|
||||
# Check who an address delegates to
|
||||
curl -X POST https://api.lux.network/v1/bc/C/rpc \
|
||||
curl -X POST https://api.lux.network/v1/chain/c \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "eth_call",
|
||||
|
||||
@@ -42,7 +42,7 @@ import (
|
||||
)
|
||||
|
||||
client, _ := ethclient.Dial(
|
||||
"http://127.0.0.1:9630/v1/bc/C/rpc",
|
||||
"http://127.0.0.1:9630/v1/chain/c",
|
||||
)
|
||||
|
||||
tx := types.NewTx(&types.DynamicFeeTx{
|
||||
|
||||
Reference in New Issue
Block a user