Testnet Campaign Flow (Phase 3)
This section is under development. Any actions with this document are not recommended.
Introduction
This simple guide will help you participate in The Power testnet campaign.
Please, turn off the firewall before you start working with the node.
Prerequisites for a node
Hardware
CPU cores | Memory | Hard disk | Network |
---|---|---|---|
4 | 4 GB or more | Minimum: 40 GB, SSD preferred | 100 Mbit/s |
Software
OS | Erlang version | Docker version | Server |
---|---|---|---|
Ubuntu 22.04 | 24.3 | latest (20.10.18 as of September 2022) | Virtual machine or hardware |
You need to have a clear server to work with your node. If you have done any experiments before, please delete the previous builds.
If you use other versions of Ubuntu, you'll have to resolve the Erlang dependencies manually.
What do I need to participate in testnet campaign?
To participate in ThePower testnet campaign you need to:
Step 1: Prepare your directory structure
The following directory tree describes the directories and files in them:
/opt/storage/
├── data
│ ├── db
│ ├── html
│ └── tmp
├── log
│ ├── nginx
│ └── rhea
└── ssl
-
Create the directories using the following command:
mkdir -p /opt/storage/{ssl,data/{db,html,tmp},log/{nginx,rhea}}
-
Check that you are in the
storage
directory, or go to this directory using the following command:cd /opt/storage/
Step 2: Get IP addresses and DNS
You need to have a public IP address to take part in the testnet campaign. You can register a DNS for your server, if you want. The word "domain" will be used in the text below with the meaning of "domain", or of "IP address". The Power DCloud team is not responsible for assignment or registration of IP addresses or DNS.
Here you have the following options:
-
You may have your own domain name (recommended).
-
You may use the VPS-generated domain name. You can check your domain name at your VPS. Here are the examples for Hetzner and Scaleway:
-
You may use free services, like FreeDNS. You can also use the following hosting services from the list below:
-
If none of the options above didn't work, submit a request for a domain name in our Discord chat.
NoteThis option takes much more time, then the others, due to manual proccessing of submitted requests by the team.
Step 3: Download docker-compose.yml
See the link below!
Use the following command to download docker-compose.yml
:
wget https://raw.githubusercontent.com/thepower/power-docs/master/docs/Community/phase-3/resources/docker-compose.yml -O /opt/storage/docker-compose.yml
Step 4: Download the configuration files
Download storage.conf.template
, env, and rhea.config
using the following commands:
wget https://raw.githubusercontent.com/thepower/power-docs/master/docs/Community/phase-3/resources/storageconf.template -O /opt/storage/storage.conf.template
wget https://raw.githubusercontent.com/thepower/power-docs/master/docs/Community/phase-3/resources/rhea.config -O /opt/storage/rhea.config
Step 5: Set up the configs
The configs are under development. Some features may not work correctly.
You need to set up the configuration files you've downloaded on the previous step:
-
Fill your data into the following fields of
rhea.config
:{contract_address,"AA1000000016xxxxxx63"}.
{contract_gas, 1000000}.
{temp_dir,"/opt/storage/data/tmp"}.
{http_dir,"/opt/storage/data/html"}.
{db_dir,"/opt/storage/data/db"}.
{my_address,"AA1000000016xxxxxx41"}.
{my_privkey,"A5B277FCC00391D067A1C509EA96ExxxxxxxxxxxxxxxxxxxxxxxxxxxxxA79544"}. //Generate the key using tp_cli. -
Fill in your hostname into
HOSTNAME
field ofenv.env
file. Go back to Step 2 to get information about how to get your IP addresses and DNS names.
How to generate the private key
Before getting the keys you need to set up your environment by installing Erlang and getting tpcli
. Follow the steps below:
-
To install Erlang, run:
apt -y install erlang-base erlang-public-key erlang-ssl docker-compose jq
Note
You need to install
erlang-public key
anderlang-ssl
. Otherwise, Erlang will not operate properly! -
Get the power CLI:
-
Get the power cli by running the following command:
sudo wget https://tea.thepower.io/tp -O /usr/local/bin/tp
-
Change the
tp
file mode to executable by running the following command:sudo chmod a+x /usr/local/bin/tp
-
-
Go to
/opt/storage
by running the following command:cd /opt/storage
-
Generate private key by running the following command:
tp --genkey --ed25519
As a result of this action, you will get the
tpcli.key
file. This file contains your private and public keys. Here is an example of this file. DON'T use the keys specified in this example:cat tpcli.key
{privkey,"302E020100300506032B6570042204204B1F52826447066469E7DBCA4E95CB0A03A2998D268C27885364D4AD7B7B0A8E"}.
{pubkey,"302A300506032B6570032100667C84FB1195C73F97AE14430C2024490C0EA6490F6EC0C1DE3FAEB4B6B32251"}.cautionYou may share your public key when necessary, but never share your private key.
-
Copy
privkey
intomy_privkey
field ofrhea.config
file. You can also use the following command:grep privkey tpcli.key >> rhea.config
NoteDelete the second
{my_privkey,"..."}
string fromrhea.config
file after using the command.
Step 6: Start the node
Start your node using the following command:
docker-compose up -d
How to stop the node?
To stop the node run the following command:
docker-compose down
Step 7: Set up SSL
Follow the steps below to set up SSL:
-
Ensure that you use
root
account. It is necessary for further steps. -
Install
acme.sh
by running the following command. Please, specify your real e-mail address:apt-get install socat
curl https://get.acme.sh | sh -s email=my@example.comwhere
my@example.com
— your active e-mail. Make sure, you have replaced it with your e-mail address. -
Log out of the system.
-
Log in again.
-
Issue the certificate. To do this, run the following command:
acme.sh --issue -d your_storage_node.example.com -w /opt/storage/data/html/ --keylength ec-256
warningyour_storage_node.example.com
is an example. Replace it with your node link. -
Install the certificate by running the following command:
acme.sh --install-cert --ecc -d your_storage_node.example.com \
--key-file /opt/storage/ssl/ssl.key \
--fullchain-file /opt/storage/ssl/ssl.crt \
--reloadcmd "docker restart nginx"warningyour_storage_node.example.com
is an example. Replace it with your node link.After you've installed the certificate, you can get the certificate status by running the following command:
acme.sh --info -d your_storage_node.example.com
where
your_storage_node.example.com
— your node address link. Replace it with your node link.