Deploy the Validator Set contract - Wiki OpenEthereum Documentation

Now that every node is configured, and either creates or imports blocks, we can create and deploy a Validator Set contract. The following steps assume that Node0, Node1 and Alice nodes are running. In this tutorial, Alice will deploy and be the owner of the contract. In a real world setting, Alice could be replaced by a multi-signature contract or any other governing logic, so as to prevent one single entity from controlling the Validator Set.

1. Setup Remix and remixd

The Validator Set contract used for Kovan Network is in fact a set of contracts. We will first download them locally before using remixd and Remix to deploy this set of contracts. remixd is a convenient way to load local files to Remix and avoid tedious manual work. Explaining how to install remixd is outside of the scope of this tutorial. Please install it with npm, and we’ll continue from there.

remixd kovan contract

We will now connect remix to Alice’s node. We’ve set it up earlier to accept connections from Remix domain over the standard JSON RPC HTTP port 8545.

remix kovan contract

2. Deploy RelaySet and RelayedOwnedSet

The contract used in this tutorial is not trivial to understand as it consists of a set of contracts using a proxy as well as libraries. You can read more about the internals in the dedicated repository. The important concept to understand is that RelaySet is a proxy contract that will point to the main contract that itself allows to add and remove validators. Proxy contracts allow to be flexible and update the “proxied” contract in the future if needed. In our case, RelayedOwnedSet will be the “proxied” contract.

We will need to deploy RelaySet, then deploy RelayedOwnedSet, and finally, link the former with the later.

The Validator Set contract is now deployed. You can make sure Node0 is the only allowed validator by calling getValidators.

← Part 1 - Configuring each node Part 3 - Hardfork to use the Validator Set contract →