The Observer DApp provides an interface to manage the observer set of nodes. To manage this set, it is possible to add and remove nodes. To identify nodes, the enode address is used.
MetaMask is having issues running on Firefox. This bug was reported back in August 2018 and we’re awaiting a fix. Until then please use Chrome.
Start the DApp¶
There are two options to get the DApp up and running:
Option 1: Docker image (fastest)¶
To get the DApp up and running quickly, you can directly tap into our Clearmatics image with
docker run -d -p 3000:3000 --name observer-dapp clearmatics/observer-dapp:latest
You can now find the DApp at http://localhost:3000/ in your browser.
If you would like to run several DApps in parallel, please change the first port number to avoid collisions, e.g. if you would like the Observer to show up on http://localhost:3001 you run same command as above but -p 3001:3000.
Option 2: From source¶
First, clone the Observer DApp repository with your terminal
git clone email@example.com:clearmatics/observer-dapp.git
Please write the following in your terminal before you proceed
To build it locally, you need to install the dependencies first with
As long as the terminal doesn’t display any error messages, you can now proceed with starting the app by writing
This should automatically open a tab in your Chrome browser which shows the user interface. If this is not the case, you can see it at http://localhost:3000/.
Does it work?¶
When the page has finished loading, you should see the user interface. In the user interface, you can see a list of current observers.
Perhaps you have noticed that pressing the buttons does not seem to have any effect. That is because MetaMask refuses connection from any invalid address. If your address is not part of the observer set, you will not be able to add or remove an address. Access is allowed if you can demonstrate that your account has a private key which belongs to any of the addresses in the list.
To add a new observer or remove an existing one, you need to have a private key that corresponds to an address in the observer set
Import a private key¶
To be an observer, you need to prove it to the network and this is where your private key comes into play. It is assumed that you know the private key to at least one of the observers. To import it please follow these three steps:
Firstly, you need to open MetaMask and press the account icon, in the upper right corner of the dropdown menu:
Now you need to press Import Account.
Finally, you need to paste your private key in the field and press Import.
If the account loads correctly you should be good to go. You can try that your account is authenticated by attempting to remove an observer. By pressing Remove, you should see a popup window from MetaMask asking you to confirm your transaction. If you see this window, that means that the connection was successfully authenticated.
When you do want to perform an actual change in the permissioning, you need to press Confirm to propagate your submission to the network.
Node management verification¶
Apart from the ability to display the current set of observers (or validators) through the user interface, we can verify it by network logs. In this example, we have filtered for any changes in the validator set. Before we make any changes to the permissioning, we have 7 validators and the full set can seen in the logs as follows:
DEBUG[05-02|15:26:49.308|consensus/istanbul/core/core.go:259] New round address=0xb494F71B4b792BB043cd4D5Fc51A5FD54a84abDF old_round=0 old_seq=4098161 old_proposer=0x33b99aa299AaE4dc67a0690Fc3F55474Ce49cD7f new_round=0 new_seq=4098162 new_proposer=0x69515E02c02D9D38C8d3421a395C0AD06F233d8c valSet="[0x33b99aa299AaE4dc67a0690Fc3F55474Ce49cD7f 0x49244BC7883522683b2355Cb3Eaed07234B546a4 0x5a1c5288A5AcfC471A1f6c44D24886f75Ea3D54a 0x69515E02c02D9D38C8d3421a395C0AD06F233d8c 0xa87408eBf1b5A4d65c8754d0BD43EcDdaFC7D1f1 0xb494F71B4b792BB043cd4D5Fc51A5FD54a84abDF 0xb92276AF73BD16c85Ea1d1d680d7786765baC9eb]" size=7 isProposer=false
After we have issued a request to remove the second validator through the DApp interface, we can see that the validator set has changed (and its size):
DEBUG[05-02|15:26:50.285|consensus/istanbul/core/core.go:259] New round address=0xb494F71B4b792BB043cd4D5Fc51A5FD54a84abDF old_round=0 old_seq=4098162 old_proposer=0x33b99aa299AaE4dc67a0690Fc3F55474Ce49cD7f new_round=0 new_seq=4098163 new_proposer=0xa87408eBf1b5A4d65c8754d0BD43EcDdaFC7D1f1 valSet="[0x33b99aa299AaE4dc67a0690Fc3F55474Ce49cD7f 0x5a1c5288A5AcfC471A1f6c44D24886f75Ea3D54a 0x69515E02c02D9D38C8d3421a395C0AD06F233d8c 0xa87408eBf1b5A4d65c8754d0BD43EcDdaFC7D1f1 0xb494F71B4b792BB043cd4D5Fc51A5FD54a84abDF 0xb92276AF73BD16c85Ea1d1d680d7786765baC9eb]" size=6 isProposer=false
Finally, we add the same validator back to return to our initial state:
DEBUG[05-02|15:27:07.121|consensus/istanbul/core/core.go:259] New round address=0xb494F71B4b792BB043cd4D5Fc51A5FD54a84abDF old_round=0 old_seq=4098179 old_proposer=0x33b99aa299AaE4dc67a0690Fc3F55474Ce49cD7f new_round=0 new_seq=4098180 new_proposer=0x69515E02c02D9D38C8d3421a395C0AD06F233d8c valSet="[0x33b99aa299AaE4dc67a0690Fc3F55474Ce49cD7f 0x49244BC7883522683b2355Cb3Eaed07234B546a4 0x5a1c5288A5AcfC471A1f6c44D24886f75Ea3D54a 0x69515E02c02D9D38C8d3421a395C0AD06F233d8c 0xa87408eBf1b5A4d65c8754d0BD43EcDdaFC7D1f1 0xb494F71B4b792BB043cd4D5Fc51A5FD54a84abDF 0xb92276AF73BD16c85Ea1d1d680d7786765baC9eb]" size=7 isProposer=false
That’s it. Since the contracts are pre-deployed as part of the Autonity client, you should now be able to adjust the network permissioning. If your MetaMask is properly set up and your account has sufficient funds, you should be able to fully interact with the observation mechanism.
For further information about managing the deployed observer contract please visit Glienicke.