Skip to main content

Node administration

Endpoint
http://127.0.0.1:3413/v2/owner
Credential
HTTP Basic, username epic, password from ~/.epic/<network>/.api_secret
Methods here
8
Documented against
node 4.0.3, wallet 4.0.0

get_status

Read only

Sync state, connected peer count, the chain tip, and the supply figures the node reports.

Surface
/v2/owner on port 3413
Parameters
none
Declared in
api/src/owner_rpc.rs:73
  • supply and max_supply are whole EPIC, not freemen, and blocks_to_next_halving counts reward steps that are not all halvings.
  • total_difficulty is an object keyed by algorithm. A client expecting an integer fails to parse.

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_status",
  "params": []
}
Response20 lines
{
  "blocks_to_next_halving": 479521,
  "connections": 0,
  "max_supply": 21000000,
  "protocol_version": 2,
  "supply": 23024,
  "sync_status": "no_sync",
  "tip": {
    "height": 1439,
    "last_block_pushed": "9abbd80483f9b082a9362ebac0aba5619bdba7cf647cb15f5ed33102faf3cd1b",
    "prev_block_to_last": "6ceed7ff0ff7da1d44b01dc03189edeb1323bfa6d3625768520dd1a0498a0735",
    "total_difficulty": {
      "cuckaroo": 1440,
      "cuckatoo": 1440,
      "progpow": 1440,
      "randomx": 1440
    }
  },
  "user_agent": "MW/Epic 4.0.3"
}

The peers this node currently has a live connection to.

Surface
/v2/owner on port 3413
Parameters
none
Declared in
api/src/owner_rpc.rs:294
  • Returns an empty array on a private chain with no peers, which is expected.

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_connected_peers",
  "params": []
}
Response1 lines
[]

get_peers

Read only

Every peer the node knows about, healthy, banned or defunct.

Surface
/v2/owner on port 3413
Parameters
1 positional
Declared in
api/src/owner_rpc.rs:175
Parameters

Restrict to one peer address. Null returns all known peers.

8 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_peers",
  "params": [
    null
  ]
}
Response
N/A

ban_peer

Changes state

Ban a peer address.

Changes how your node connects. Reversed by unban_peer.

Surface
/v2/owner on port 3413
Parameters
1 positional
Declared in
api/src/owner_rpc.rs:324
Parameters

Peer address and port.

8 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "ban_peer",
  "params": [
    "1.2.3.4:3414"
  ]
}
Response
N/A

unban_peer

Changes state

Lift a ban.

Changes how your node connects.

Surface
/v2/owner on port 3413
Parameters
1 positional
Declared in
api/src/owner_rpc.rs:354
Parameters

Peer address and port.

8 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "unban_peer",
  "params": [
    "1.2.3.4:3414"
  ]
}
Response
N/A

Re-validate the chain the node holds.

Reads only, but it is expensive and can take a long time on mainnet.

Surface
/v2/owner on port 3413
Parameters
none
Declared in
api/src/owner_rpc.rs:103

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "validate_chain",
  "params": []
}
Response
N/A

compact_chain

Destructive

Compact the chain data, discarding what pruning allows.

Removes prunable history from local storage. The chain stays valid; a node in archive_mode should not do this.

Surface
/v2/owner on port 3413
Parameters
none
Declared in
api/src/owner_rpc.rs:133

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "compact_chain",
  "params": []
}
Response
N/A

The node's own onion addresses, if it has any.

Surface
/v2/owner on port 3413
Parameters
none
Declared in
api/src/owner_rpc.rs:387

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_onion_addresses",
  "params": []
}
Response
N/A

Next