91 lines
2.0 KiB
Markdown
91 lines
2.0 KiB
Markdown
# Blockchain Devnet
|
|
|
|
This stack runs a local Ethereum-compatible devnet for learning smart contracts,
|
|
wallets, JSON-RPC, block production, and defensive RPC operations.
|
|
|
|
It is intentionally local/dev-only. Do not use real wallets, seed phrases, or
|
|
mainnet private keys here.
|
|
|
|
## Commands
|
|
|
|
```bash
|
|
./jeannie blockchain-devnet status
|
|
./jeannie blockchain-devnet up
|
|
./jeannie blockchain-devnet logs
|
|
./jeannie blockchain-devnet down
|
|
```
|
|
|
|
The default RPC endpoint is:
|
|
|
|
```text
|
|
http://127.0.0.1:8545
|
|
```
|
|
|
|
The lightweight local explorer is available at:
|
|
|
|
```text
|
|
http://127.0.0.1:8089
|
|
```
|
|
|
|
The local RPC gateway is available at:
|
|
|
|
```text
|
|
http://127.0.0.1:18545
|
|
```
|
|
|
|
Use the gateway when you want to practice RPC protection patterns such as method
|
|
restriction, rate limiting, CORS headers, and request logging. Keep the raw
|
|
Anvil RPC for direct local development.
|
|
|
|
The Prometheus metrics endpoint is available at:
|
|
|
|
```text
|
|
http://127.0.0.1:9109/metrics
|
|
```
|
|
|
|
Metrics include:
|
|
|
|
- `homelab_blockchain_rpc_up`
|
|
- `homelab_blockchain_chain_id`
|
|
- `homelab_blockchain_latest_block`
|
|
- `homelab_blockchain_peer_count`
|
|
- `homelab_blockchain_gas_price_wei`
|
|
- `homelab_blockchain_rpc_latency_seconds`
|
|
|
|
Use `prometheus-scrape.example.yml` as the scrape target shape. The repo also
|
|
includes the `Homelab Blockchain Devnet` Grafana dashboard under
|
|
`bootstrap/platform/grafana-dashboards`; rebuild dashboard ConfigMaps with:
|
|
|
|
```bash
|
|
./jeannie grafana-dashboards apply
|
|
```
|
|
|
|
From another LAN host, use the Debian host IP:
|
|
|
|
```text
|
|
http://192.168.100.73:8545
|
|
```
|
|
|
|
## Useful RPC Checks
|
|
|
|
```bash
|
|
curl -sS -X POST http://127.0.0.1:8545 \
|
|
-H 'content-type: application/json' \
|
|
--data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
|
|
|
|
curl -sS -X POST http://127.0.0.1:8545 \
|
|
-H 'content-type: application/json' \
|
|
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
|
```
|
|
|
|
## Environment
|
|
|
|
```bash
|
|
BLOCKCHAIN_RPC_PORT=8545
|
|
BLOCKCHAIN_RPC_GATEWAY_PORT=18545
|
|
BLOCKCHAIN_EXPLORER_PORT=8089
|
|
BLOCKCHAIN_METRICS_PORT=9109
|
|
BLOCKCHAIN_CHAIN_ID=31337
|
|
BLOCKCHAIN_BLOCK_TIME=2
|
|
```
|