Files
docs/apps/docs/content/docs/sdk/python/rpc.mdx
T
zeekay 1982a62421 fix: replace L2/subnet language with sovereign L1 across all docs
All Zoo, Hanzo, SPC, Pars, and Liquidity chains are sovereign L1s with
their own validator sets, not L2s or rollups.

Changes across 45 files:
- "L2 EVM" -> "Sovereign L1 EVM" in chain docs, bridge, wallet, SDK,
  operator, cloud, CLI, faucet, explorer, and all reference docs
- chains/evm.mdx title: "L2 EVM" -> "EVM Chains"
- deploy-subnet.mdx title: "Deploy an L2" -> "Deploy a Chain"
- CLI chain types: remove L2 default, L1 is now default
- Post-quantum doc: update Dilithium -> ML-DSA-65 (FIPS 204),
  Kyber -> ML-KEM-768 (FIPS 203), SPHINCS+ -> SLH-DSA (FIPS 205),
  mark Phase 1+2 as Deployed, Phase 3 as In Governance Review,
  add Quasar triple hybrid consensus (BLS + Corona + ML-DSA),
  add Smart Account PQ signing via SafeMLDSASigner (ERC-1271)
- plugins: "L2 EVM" alias -> "subnet-evm", fix URLs to luxfi/evm

Left as-is: SafeL2 (Gnosis Safe contract name), NIST L2 (security
level), L2 norm (math), Optimism/Polygon/Base (they are L2s),
LP proposal titles, Go struct names, wire protocol field names.
2026-04-09 21:17:53 -07:00

83 lines
1.7 KiB
Plaintext

---
title: RPC Operations
description: JSON-RPC calls to Lux nodes using the Python SDK
---
The Python SDK wraps Web3.py to provide typed access to all Lux node RPC endpoints.
## C-Chain RPC
```python
from web3 import Web3
w3 = Web3(Web3.HTTPProvider(
"https://api.lux.network/mainnet/ext/bc/C/rpc"
))
# Get latest block
block = w3.eth.get_block("latest")
print(f"Block {block.number}: {block.hash.hex()}")
# Get balance
balance = w3.eth.get_balance(
"0x9011E888251AB053B7bD1cdB598Db4f9DEd94714"
)
print(f"Balance: {w3.from_wei(balance, 'ether')} LUX")
# Get gas price
gas_price = w3.eth.gas_price
print(f"Gas price: {gas_price} wei")
```
## Sovereign L1 EVM RPC
Connect to any sovereign L1 EVM chain by changing the endpoint:
```python
# Zoo chain
zoo = Web3(Web3.HTTPProvider(
"https://api.lux.network/mainnet/ext/bc/zoo/rpc"
))
# Hanzo chain
hanzo = Web3(Web3.HTTPProvider(
"https://api.lux.network/mainnet/ext/bc/hanzo/rpc"
))
```
## P-Chain Info (Read-Only)
```python
import requests
resp = requests.post(
"https://api.lux.network/mainnet/ext/bc/P",
json={
"jsonrpc": "2.0",
"method": "platform.getCurrentValidators",
"params": {},
"id": 1,
},
)
validators = resp.json()["result"]["validators"]
print(f"Active validators: {len(validators)}")
```
## Network Endpoints
| Network | C-Chain RPC URL |
|---------|-----------------|
| Mainnet | `https://api.lux.network/mainnet/ext/bc/C/rpc` |
| Testnet | `https://api.lux.network/testnet/ext/bc/C/rpc` |
| Local | `http://127.0.0.1:9630/ext/bc/C/rpc` |
## Chain IDs
| Chain | Mainnet | Testnet |
|-------|---------|---------|
| C-Chain | 96369 | 96368 |
| Zoo | 200200 | 200201 |
| Hanzo | 36963 | 36964 |
| SPC | 36911 | 36910 |
| Pars | 494949 | 494950 |