- Structure of the repository
- Prerequisites
- How to install
- Starting a Semux-node-extender
- Updating a Semux-node-extender
All parts of the project are set to work with docker-compose. That is, running "Semux-node-extender" consists of the following services:
full-node
- "Semux Node" service based on the official Semux Core Project - https://github.com/semuxproject/semux-core/releases/tag/v2.1.1db
- database service based on PostgreSQL server - https://hub.docker.com/_/postgresnode-extender
- service "Node extender" developing by UnoLabs team - https://github.com/uno-labs/semux-node-extender
-
Installed docker
How to install docker on Ubuntu - https://docs.docker.com/install/linux/docker-ce/ubuntu/
How to install docker on Windows - https://docs.docker.com/docker-for-windows/install/ -
Installed docker-compose
How to install docker-compose - https://docs.docker.com/compose/install/#install-compose
First of all clone this repository and go into the project folder
git clone https://github.com/uno-labs/semux-node-extender-docker
cd semux-node-extender-docker
Main configuration file of the "full-node" service:
./full-node/config/semux.properties
Edit the configuration file and change the following pair of strings in the API
section:
api.username = username
api.password = password
That fields are needed for the "node-extender" service. Fill them whatever you like.
Now, there may be two situations - either you have got a wallet already or you have not.
Then you have to create it. For more information, please visit this website at https://www.semux.org.
Before you run all containers/services together in a general mode, you must perform the initial run of the "full-node" container, in order to set your password for wallet. For this, follow the steps below.
Set the following access rights of the wallet file in ./full-node
directory:
chmod 600 wallet.data
Start the "full-node" service and setup password (for random password generating you can use the command pwgen -Bs 25 3
):
sudo docker-compose run --rm fullnode
...
Please enter a new password:
Please repeat the new password:
Write down or save your password in any keystorage (ex., KeePass).
Your address of the wallet will be shown in the first line right after you repeat the password. Save it too:
INFO SemuxCli A new account has been created for you: address = e49a5bddf7235e34da48a608dc2ee24bd8e4a4af
If the following line appears in your terminal:
INFO SemuxSync Block [number = 200, view = 0, hash = 32da907fbec0da4c6c50c5b22690ebd81f0b494f6a88a0fd95626c0705391aef, # txs = 0, # votes = 4]
then it's all right.
Now you have to stop the "full-node" service . Use Ctrl-C
for it.
Copy your wallet file wallet.data
to ./full-node/
directory and set the following access rights: chmod 600 wallet.data
.
In both cases ( a) and b) ) return to the root folder of the project and insert your password of the wallet to a docker-compose.yml
file:
SEMUX_WALLET_PASSWORD: your_password
The first step has done successfully
You have to configure the database.
Set the following fields in the docker-compose.yml
file:
POSTGRES_PASSWORD: password user of database
POSTGRES_USER: name user of database
POSTGRES_DB: title of database
FULLNODE_API_USER_NAME: api.username from ./full-node/config/semux.properties
FULLNODE_API_USER_PASSWORD: api.password from ./full-node/config/semux.properties
PM_VALIDATOR_NAME: title of your validator
PM_VALIDATOR_COMISSION: commission of a transaction, percentage (0.00-100.00)
PM_POOLS_ADDR: addresses of validators (see below)
PM_PAYOUT_ADDR: address of payout wallet. Start it at 0x... and in double quotation marks
PM_START_BLOCK_ID: block number for beginning payouts (find it on https://semux.top)
PM_PAYMENT_PERIOD: number of blocks between payouts
PM_TX_FEE: tax of the transaction, nano SEM (min 0.005 SEM)
PM_MIN_PAYOUT: minimum payout in a period, nano SEM
PM_VOTES_MIN_AGE: minimum number of blocks a vote age
Setup of the PM_POOLS_ADDR field:
PM_POOLS_ADDR: "\"0x...\",\"0x...\""
Set access rights of the docker-compose.yml
file:
chmod 600 docker-compose.yml
Here you have to configure parameters of the Node extender.
Change parameters of the field connection_str
in the ./node-extender/config.json
file:
"connection_str":"dbname=db_name hostaddr=172.20.128.1 port=5432 connect_timeout=5 user=db_user password=db_user_pwd"
Where
dbname
- your title of databaseuser
- your user name of databasepassword
- your user password of database
Set access rights of the ./node-extender/config.json
file:
chmod 600 config.json
If you want to change parameters of the Node extender then get console of the database container:
sudo docker exec -it <container name or ID> psql -U <POSTGRES_USER> -d <POSTGRES_DB>
You will get a prompt:
<POSTGRES_DB>=#
The parameters of the Node extender are in the table pool_manager.config
.
For seeing it use the request: select * from pool_manager.config
.
For change it use the following request:
update pool_manager.config set data='{"id": 1, "name": "PM_VALIDATOR_NAME", "tx_fee": PM_TX_FEE, "comission": PM_VALIDATOR_COMISSION*100, "pools_addr": [PM_POOLS_ADDR], "payout_addr": "PM_PAYOUT_ADDR", "votes_min_age": PM_VOTES_MIN_AGE, "minimal_payout": PM_MIN_PAYOUT, "payment_period": PM_PAYMENT_PERIOD, "start_block_id": PM_START_BLOCK_ID}'::jsonb;
After you have configured all the parts you can start up them together:
sudo docker-compose up -d
cd /path/to/semux-node-extender-docker
git push origin master
sudo docker-compouse stop
sudo docker image rm semux-node-extender
sudo docker-compose up -d