Skip to content

Prerequisites

Hardware

To run an Autonity Bakerloo testnet node, we recommend using a host machine (which can be a physical or a virtual machine) with the following minimum specification:

  • Linux (e.g. Ubuntu 20.04 LTS, or another recent system)
  • two CPU cores
  • 8GB of RAM
  • 250GB of persistent storage space (preferably SSD)

Configure your network

Your host machine will need a network connection with a public-facing, static, internet IP address.

Warning

The IP Address cannot be behind a Network Address Translation, a feature common in many enterprise (and domestic) settings

The following ports must allow incoming traffic on the network:

  • TCP 8545 to make http rpc connections to the node
  • TCP 8546 to make WebSocket connections to the node
  • TCP 30303 for node p2p (DEVp2p) communication
  • TCP 6060 to export Autonity metrics (optional but recommended)

Warning

The setup described here is easy for testing and experimentation. It is not a production-grade installation in terms of security, stability, or resilience

Software

Update Linux

Ensure that the Linux installation on your host machine is up to date.

Install Docker

Follow the official Docker documentation to install Docker onto both, the machine you intend to host your node, and your local machine. You will need it on the node to run the AGC Docker image, and for some operations on your local machine to run AGC in a container, e.g. manually create an Autonity account.

Once installed, follow the post-installation steps for Docker.

Info

If you do not follow the Docker post-installation steps, you will need to run all Docker commands as sudo

Optional but recommended:

To limit the size of the log files, edit or create daemon.json in /etc/docker

sudo nano /etc/docker/daemon.json

Copy the following content into the file (in nano, use <ctrl-o> to save the file, and <ctrl-x> to exit):

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "500m",
    "max-file": "20"
  }
}

Restart the Docker service to implement the change:

sudo systemctl restart docker

Info

To ensure the authenticity of any Clearmatics Docker images referenced here, you can verify their checksums

Install wallet application

You will need to install a wallet application on your local computer to connect with the node. There are many suitable wallet applications available. Quickstart explains how to use MetaMask for this purpose.

Install the Autonity Node.JS Console

The Autonity Node.JS Console can be used to connect to the WebSocket endpoint on an Autonity full node, and execute commands to interact with the Autonity node client and Autonity protocol smart contracts. Set up the Node.JS Console on your local machine as follows:

  • Create a directory, download the console, and uncompress the archive:

    mkdir nodejsconsole
    cd nodejsconsole
    wget https://github.com/clearmatics/autonity/releases/download/v0.7.1/nodejsconsole-linux-amd64-0.7.1.tar.gz
    tar -xvf nodejsconsole-linux-amd64-0.7.1.tar.gz
    
  • Run the Console, specifying the IP address of the node:

    ./console ws://<IP-ADDRESS>:8546
    

    If the node you are connecting to has an encrypted WebSocket endpoint, such as Clearmatics' public endpoint rpc4.bakerloo.autonity.network:8546, then you need to connect to it via wss ("web socket secure"):

    ./console wss://rpc4.bakerloo.autonity.network:8546
    
  • Before issuing commands, enter the following in the console; otherwise any Autonity protocol smart contract function calls (even read-only) will fail

    contract.options.gasPrice=0
    
  • Use await before function calls, since by default, functions return a promise object, and await then delivers the result of that promise. E.g. to get the node whitelist:

    await autonity.getWhitelist().call()
    

    Or, to check an account balance, use:

    await web3.eth.getBalance("<ACCOUNT_ADDRESS>")
    
  • For functions that read information by calling Autonity protocol smart contract methods such as above, add .call()

  • For functions that retrieve information from the node client itself, like many of the web3.eth functions, you do not need .call()

  • Web3 commands can be accessed by typing await web3. then pressing <TAB> twice to list available functions

  • The 'eth' command namespace can be found by typing await web3.eth. then pressing <TAB> twice

  • Autonity specific commands can be found by typing await autonity. then pressing <TAB> twice. (e.g., as above, await autonity.getWhitelist().call())

  • You can leave the console by typing .exit


Help

If you need help, you can: