Running a PoS node on AWS - Server Setup & Node Configuration

This is the first tutorial in a multi-part series on running a Conflux PoS staking pool. This tutorial will help you set up a PoS node on AWS. Once you complete this tutorial, you’ll be able to continue with this guide to install a PoS pool.

1. Setting up an AWS Instance

In this section, you’ll configure and launch an AWS EC2 instance where your Conflux PoS staking pool will be hosted.

  1. Create an AWS account or log in your existing account.
  2. In AWS, go to Services > EC2 Management Console and launch a new EC2 instance.
  3. Click select on the Ubuntu Server 20.04 64-bit (x86) image. You can optionally use other Linux or Windows-based images, but we’ll stick to this one in this tutorial.
  4. Select the t2.large instance type and click Next: Configure Instance Details.
  5. Leave the default Configure Instance Details parameters and click Next: Add Storage.
  6. In Add Storage, set an image size of 700 GiB and click Review and Launch.
  7. Note: You can resize this later to 400 GiB, but this will greatly speed up the node setup process.
  8. Review the instance details and click Launch.

You have successfully created and launched an EC2 instance. Now let’s log in to it from our local machine.

2. Logging in to the EC2 Instance

  1. In this section, you’ll login to the EC2 instance for the first time.
  2. Once your instance is created, in the EC2 Management Console go to Network & Security > Key Pairs. If you already have an AWS key pair, you can skip to Step 6.
  3. In Key Pairs, click Create key pair.
  4. Create and download a key pair.
  5. In Create key pair, enter a name for your key pair (in this case, we’ll enter the name conflux), then click create Create key pair.
  6. Download the newly-created key pair.
  7. In the EC2 Management Console, go to Instances > Instances.
  8. Go to your newly-created instance details by click its Instance ID.
  9. In the Instance summary, ensure that the instance state is “Running” and copy its Public IPv4 address.
  10. Go to your local machine’s terminal, and connect to your instance. You can do this by typing:
    Note: You’ll need to change your key pair file’s permissions.
ssh -i <path to your key pair> ubuntu@<your machine's IP address or IPv4 DNS> 
  1. Enter the password that you defined in your key pair.

You have successfully logged in to your EC2 instance! Now let’s log in to our instance and prepare the server.

3. First Steps on the Server

Some of the recommended first steps are the following:

  • Upgrade currently installed applications.
sudo apt-get update
sudo apt-get upgrade
  • Adding a new dedicated user for your PoS node.
  • Add your user to sudoers.
  • Changing your server’s hostname.

None of these are essential steps, so you can skip them or save them for later.

Now that you have done this initial grooming on your server, let’s move on and set up a Conflux node.

4. Setting Up Your Conflux Node

In this section, you’ll download, install, configure, run, synchronize your Conflux node.

This will be, roughly, a three-step process:

  1. Installing and configuring the Conflux client.
  2. Running the Conflux client and syncing the node.

2.1 Installing & Configuring the Conflux Client

  1. Download the archive node snapshot. This will help us speed up the node synchronization process by downloading a recent snapshot of the chain.
    Note: The archivenode snapshot has a file size of around 160GB. Downloading it might take a few hours.
wget https://github.com/conflux-fans/archive-tool 
  1. Follow the instructions on downloading the Conflux client pre-built binaries:
    https://developer.confluxnetwork.org/run-a-node/en/how_to_get
  2. Follow the instructions on compiling the Conflux client from source:
    https://developer.confluxnetwork.org/conflux-doc/docs/installation
  3. Extract the archive node snapshot to conflux-rust/run
tar xvzf <archive-node-snapshot>.tar.gz conflux-rust/run 
  1. Download the PoS configuration file:
wget https://github.com/Conflux-Chain/conflux-rust/releases/download/v2.0.0-fix/pos_config-hydra.tgz 
  1. Extract the files to conflux-rust/run
tar xvzf pos_config-hydra.tar.gz conflux-rust/run 
  1. Follow the instructions on configuring and running a Conflux node:
    https://developer.confluxnetwork.org/conflux-doc/docs/get_started

2.2 Running the Conflux Client and Syncing the Node

In this process, we’ll run a Conflux node. Once the node is running, it will first sync to the latest PoW block. Once this process is done it will then sync to the latest PoS block.

  1. Run the Conflux client.
cd run 
../target/release/conflux --config hydra.toml 
  1. Set a secure PoS encryption password.
  2. Wait for the PoS node to sync.
    Note: This step might take a few hours.

You have successfully installed, configured, and ran a fully-synched Conflux PoS node!

In future tutorials we’ll cover other aspects, such as security, monitoring, and other tips & tricks.

3 Likes