Produce PoS Blocks

❗️

Block Signer Update

If you are running a block signer prior to Nov 13rd, make sure to follow this guide again to update your block signer for mainnet support.

Introduction

We have a very simple external staker tool available for stakers to sign PoS blocks on Unity. If the staker wins the lottery, the staker can use this tool to interact with a Unity-enabled node over RPC.

Once launched, the external staker repeatedly queries the node over RPC and submits signed staking blocks. Please note that it aggressively sends a signed block as soon as it produces it; the nodes must reject future blocks if they want to.

You can get the latest block signer here.

Prerequisites

Get the Block Signer

Open a terminal and run the following command:

 wget https://github.com/aionnetwork/block_signer/archive/1.0.tar.gz
 tar xvf 1.0.tar.gz 
 cd block_signer-1.0

Launch the Block Signer

We will be using block_signer.jar for interacting with a Unity-enabled node via RPC.

You can input the parameters with:

Config File

Usage:

-config <configFilePath>

Sample Config File

# The private key of the signing address of the registered staker(pool), input first 32-byte or the full 64-byte private key of the pool operator's signing key with `0x`.
signingAddressPrivateKey=

# The pool's identity address, which is also the public key of the pool operator's management key.
identityAddress=

# Network name: `amity` (testnet) or `mainnet`
network=

# The IP address of the node. Make sure that the RPC port is open.
ip=

# The port on which the node is accepting RPC requests.
port=

# True to get verbose logs (rpc request and responses) and set to false to disable this logging
verboseLoggingEnabled=

Example:

The config file, poolConfig, that is located in the same folder as the block signer:

java -jar block_signer.jar -config poolConfig 

CLI

Usage:

<signingAddressPrivateKey> <identityAddress> <networkName> <ip:127.0.0.1> <port:8545> <verboseLoggingEnabled:false> 

Inputs:

  • signingPrivateKey: First 32-byte or the full 64-byte private key of the pool operator's signing key with 0x.
  • identityAddress: The pool's identity address, which is also the public key of the pool operator's management key.
  • networkName: amity (testnet) or mainnet
  • IP (optional): the IP address of the node. Make sure that the RPC port is open. If this argument is not provided, 127.0.0.1 is used as default.
  • port (optional): the port on which the node is accepting RPC requests. If this argument is not provided, 8545 is used as default.
  • verboseLoggingEnabled:false (optional): true to get verbose logs(rpc request and responses) and set to false to disable this logging, false is set to false by default.

Example:

  • Local Mainnet node with verbose logging disabled
java -jar block_signer.jar 0x******************************************************************* 0xa0df2de13945675e009445e8bc6f3ec2f0a54262a6dc78c76c1a58e333322b64 mainnet
  • External node
java -jar block_signer.jar 0x******************************************************************* 0xa0df2de13945675e009445e8bc6f3ec2f0a54262a6dc78c76c1a58e333322b64 32.101.5.8 8545 

Then the external staker should be trying to produce PoS blocks now! A successful RPC call for submitsignature indicates that the staker has produced a PoS block, you will also be seeing Block submitted successfully. Sleeping for 500ms that indeciates it.

Note

Opening an RPC Port for Java Client

Navigate to your Aion kernel folder and run the following command in a terminal:

nano amity/config/config.xml 

and set RPC active to true:

<rpc active="true" ip="127.0.0.1" port="8545">

Opening an RPC Port for Rust Client

Navigate to your Aion kernel folder and run the following command in a terminal:

nano amity/amity.toml

and make sure http connection is set to:

[http]
disable = false
port = 8545