Setting Up a Validator Node
All the instructions needed to get your node from zero to ready to create blocks.
Hardware Requirements
We recommend using a VPS with these minimum requirements:
4 vCPUs
8 GB RAM
160 - 256 GB of Disk
(a full Pchain install is currently ~35 GB)
We recommend you use a Ubuntu 18.04 or Debian 10 OS, but Pchain can be run on other OS as outlined in the Alternate Installation Instructions.
Installing Pchain
To install from the latest release, run the following command. This automatically looks up the latest release and downloads that tar archive.
If you would like to build from source or install via PPA, see the alternate installation instructions
Once this is done downloading, let's unpack it into its own directory:
After that, copy over the contents into your pchain
directory:
Downloading the Snapshot to Speed up the Sync
At this point, Pchain is ready to run. If you would like to begin syncing from block 0, you can start the node by executing:
This can take a few days to sync though as there are now several million blocks. To quicken this up, we provide a snapshot of all the block data. To download this, make sure you are in the pchain
directory:
and then download the snapshot. If you are planning on running both the main chain and the subchain, download block data with this command:
Once this is complete, unpack it:
If you are planning to run just the main chain, download the block data with this command:
Once this is complete, unpack it:
You now can start Pchain and begin syncing from where the snapshot left off:
Start Auto-update Scripts
We recommend you install Pchain's auto-update service, so you don't need to update the software manually after we release a new version.
If it returns
You have started the service correctly.
Opening the Javascript Console
The Javascript console is one way to interact with your Validator Node and the Pchain network. To see a list of commands and examples, see Pchain Javascript Console.
Main Chain
To open the console for the main chain, execute:
Subchain
Creating an Executable Console
Main Chain
If you don't want to have to remember the command to open the console, you can create a simple bash script to open it. First, open a document called openconsole.sh
That will open a text editor. In the text editor, copy and paste the below:
Then type ctrl-x
then y
to save and exit. To make it executable:
The console can now be opened by executing the command ./openconsole.sh
Subchain
The same can be done for creating an executable to attach to the subchain. To do that, open a document called openconsolecc.sh
That will open a text editor. In the text editor, copy and paste the below:
Then type ctrl-x
then y
to save and exit. To make it executable:
The console can now be opened by executing the command ./openconsolecc.sh
Importing or Generating a New Address
If you have a PI address that you would like to use on your validator node, you can import it within the console, using your private key and executing:
Where keydata
is the private key and passphrase
is the password to lock the key.
If you want to generate a new key, execute:
and follow the prompts for entering your password.
Generating a BLS Validator Key
One of the most innovative and important features of the Plian blockchain is the use of BLS signatures which allows nodes to quickly aggregate signatures from other nodes in the network. This enables Pchain to not only create 2-second blocks but also in a network that supports hundreds of nodes.
To create a BLS key associated with your node key, execute:
where your_address
is the address you imported or generated above.
This will output something like this:
This is the key that will be used for consensus. It is saved in a file called priv_validator.json and needs to be copied into the chain directories to enable the node software to use it to sign blocks. To copy it to the main chain directory:
and if you are also operating the subchain, copy it here:
Now let's restart Pchain so it recognizes the keys:
Now the console will show your address when it is opened.
Your Validator Node is now ready to create and sign blocks for the network! Now you have to either stake enough PI to become a validator or register as a candidate for users to stake their PI to you.
Last updated