Documentation

Querying the JSON RPC API

Mantis supports all standard web3 JSON-RPC APIs.

Enabling HTTP access

Use the following Dkey in order to enable the HTTP RPC API access:

-Dmantis.network.rpc.http.enabled=true

Once enabled, you can access the HTTP API through port 8545 over HTTP or WebSockets.

You can use an example below:

curl -X POST --header 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' http://localhost:8546

Geth console

You can also use the Geth Javascript console to access the API. For this, follow the steps below:

  1. Start Mantis with RPC enabled:
./mantis-launcher etc -Dmantis.network.rpc.http.enabled=true
  1. Run the Geth Javascript console and attach to the endpoint.

  2. Call an API method on the console:

> net.peerCount
1
>

More Endpoints

See here for more standard Ethereum RPC endpoints Mantis supports.