Sections in this article

Starting a Root Node

Once you’ve defined your node’s configuration, you can start your root node by running:

$ plasma --config <your-config-file>.yml start

The node will connect to your Ethereum client and begin creating blocks. By default, the JSON-RPC port will listen on port 8643.

Starting a Validator Node

Similarly, you can start a validator node as follows:

$ plasma --config <your-config-file>.yml validator --root-port <port> --root-addr <addr>

The node will immediately begin polling the root node for new blocks and automatically perform exits on your behalf if malfeasance is detected.

Inspecting Your Node

From another terminal on the same machine, you can query the state of your plasma node via the following commands:

  • plasma blocks --height <height>: Shows the transactions in the block at the specified height.
  • plasma balance: Shows the balance of the account specified by the user-address config variable.
  • plasma utxos --addr <addr>: Prints the UTXOs for the specified addr.

These commands read directly from plasma’s underlying LevelDB store.

Rest API

Your node also exposes a REST API which by default listens on port 6545. Below, see the following example requests and responses:

Note: Binary data is currently being string-encoded as base 64. We’re working on making it properly encode to hex.

Second note on numeric values: These are the base64 encoding of a byte string - i.e., []byte("1000") in Golang. We’re working on fixing this as well.

GET /v1/blockheight

Returns the highest block.

{ "height": "9" }

GET /v1/block/{number}

Returns a block and the transactions therein.