Run a PoS Node on AWS
This tutorial will help you set up a Conflux node on AWS.
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.
- Create an AWS account or log in your existing account.
- In AWS, go to Services > EC2 Management Console and launch a new EC2 instance.
- 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.
- Select the t2.large instance type and click Next: Configure Instance Details.
- Leave the default Configure Instance Details parameters and click Next: Add Storage.
- In Add Storage, set an image size of 1000 GiB and click Review and Launch. :::note
You can resize this later to 400 GiB, but this will greatly speed up the node setup process. ::: - 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.
Logging in to the EC2 Instance
- In this section, you’ll login to the EC2 instance for the first time.
- 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.
- In Key Pairs, click Create key pair.
- Create and download a key pair.
- 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.
- Download the newly-created key pair.
- In the EC2 Management Console, go to Instances > Instances.
- Go to your newly-created instance details by click its Instance ID.
- In the Instance summary, ensure that the instance state is “Running” and copy its Public IPv4 address.
- Go to your local machine’s terminal, and connect to your instance. You can do this by typing:
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>
- 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.
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 set up on your server, let’s move on and set up a Conflux node following the initial steps described on this guide.
Setting Up Your Conflux Node
In this section, you’ll download, install, configure, run, synchronize your Conflux node.
This will be, roughly, a two-step process:
- Installing and configuring the Conflux client.
- Running the Conflux client and syncing the node.
Installing & Configuring the Conflux Client
- Download the archive node snapshot. This will help us speed up the node synchronization process by downloading a recent snapshot of the chain.
The archivenode snapshot has a file size of around 200GB. Downloading it might take a few hours.
wget https://conflux-blockchain-data.oss-cn-beijing.aliyuncs.com/fullnode-db/M/download.sh
-
Follow the instructions on downloading the Conflux client pre-built binaries here
-
Extract the archive node snapshot to conflux-rust/run
tar -xvzf <archive-node-snapshot>.tar.gz conflux-rust/run
- Follow the instructions on configuring and running a Conflux node here
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.
- Run the Conflux client.
cd run
./conflux --config hydra.toml
- Set a secure PoS encryption password.
- Wait for the PoS node to sync.
This step might take a few hours.
You have successfully installed, configured, and ran a fully-synched Conflux PoS node!