nexus query height
Get the current block height.
Output
→ Querying chain height...
Current block height: 1234
nexus query block
Get block information by height.
nexus query block <HEIGHT>
Example
Output
→ Block #100
Current Chain Tip: 1234
nexus query events
Query contract events with filters.
nexus query events [OPTIONS]
Options
| Option | Description |
|---|
-c, --contract <ID> | Filter by contract ID |
-n, --event-name <NAME> | Filter by event name |
-f, --from <HEIGHT> | From block height |
-t, --to <HEIGHT> | To block height |
Examples
# All events for a contract
nexus query events --contract a1b2c3d4...
# Specific event type
nexus query events --contract a1b2c3d4... --event-name Transfer
# Events in block range
nexus query events --from 100 --to 200
# Combined filters
nexus query events \
--contract a1b2c3d4... \
--event-name Transfer \
--from 100 \
--to 200
Output
→ Querying events...
Found 3 events:
Block 105: [Transfer] 0x1234...
Block 110: [Transfer] 0x5678...
Block 115: [Approval] 0x9abc...
nexus query node-info
Get node information including protocol key.
Output
{
"version": "0.1.0",
"network": "regtest",
"mode": "primary",
"block_height": 1234,
"protocol_public_key": "1234567890abcdef...",
"peer_count": 5
}
The protocol_public_key is needed for deriving vault addresses.
Common Queries
Check Sync Status
Get Gas Price
List Contracts
nexus query contracts --limit 10
Get Transaction
RPC Endpoint Selection
Query commands use the configured RPC endpoint:
# Use default (localhost:8545)
nexus query height
# Use custom endpoint
nexus --rpc http://node.example.com:8545 query height
# Use with fallbacks
nexus --rpc http://primary:8545 \
--rpc-fallback http://backup1:8545,http://backup2:8545 \
query height