Installing Full STEEM API and AH Nodes in a Same server and and configuring with JUSSI , NGINX and SSL Certificate

Few days back i published a document as a tutorial for installing API node for developent purposes where i might have missed few important things .

Today i am going to post this tutorial as installing API Node + AH node on a same server and using jussi as multiplexer . This came to my mind when the steems only AH node might have crashed two days back and wallet and block explorers were not working

My Full node is reachable at https://api.steemdb.online with the below plugins enabled

webserver
p2p
json_rpc
account_by_key
market_history
database_api
account_by_key_api
network_broadcast_api
reputation_api
market_history_api
condenser_api
block_api
rc_api
condenser_api
account_history_rocksdb
account_history_api

My previous post can be found in the below link https://steemit.com/witness-category/@steem-supporter/installing-a-full-api-server-with-hf-version-0-23-1-with-mira

I will as well copy most of the things from my previous blog as to save effor of rewriting it again .

How to install API NODE and AH NODE in a same server

First you need to update your server

apt get update -y && upgrade

Once the update is completed we need to install docker,git,lz4

apt install wget git lz4 docker.io

Downloading the Steem docker package (this time we shall do it two times as we will be building API and AH Nodes)

git clone https://github.com/ssdc-chain/steem-docker-ex.git steem-api
git clone https://github.com/ssdc-chain/steem-docker-ex.git steem-ah

This will create two folders with names steem-api and steem-ah

Lets start with steem api , goto steem-api directory and do the as follows (the utility of those commands can be easily understood and are in my previous post as well )

cd steem-api

docker pull ety001/steem-full-mira:0.23.1

docker tag ety001/steem-full-mira:0.23.1 steem

As we will be running two nodes so we should resolve port conflicts before the docker can be started later , copy the example environment file

mv example.env .env
nano .env

here you need to make few changes as in exposed ports , or simply delete all content there and copy the configuration here for easy access. I have made changes on line 31,35 and 39 respectively to rename the default docker name from seed to steemapi , ws and http port exposed to 8090 and 8091 so that they dont conflict woth other docker .

do the same on another folder names steem-ah as well with

docker pull ety001/steem-full-mira:0.23.1

docker tag ety001/steem-full-mira:0.23.1 steem

mv example.env .env

do the same changes in those said line but use different name as steemah in line 31 , use ports 8092 and 8093 in line 35 and 2002 in line 39 . By doing so we dont conflict any ports while starting the docker .

Once the folders are ready we need to download the blockchain files those are prebuilt by @etyoo1 and this helps a lot while saving time to having the entire blockchain replayed .

use screen to not disconnect ssh session while downloading

apt install screen -y
screen -R steemapi
axel https://files.steem.fans/data/steem_api-20210506.tar.lz4

hit CTRL + A + D to detach from this session and create a new session for ah node file downloads

screen -R ah
axel https://files.steem.fans/data/steem_ah-20210513.tar.lz4

Detach from this session as well by hitting CTRL + A + D

to get back to screen session we can simpy use screen

for api

screen -r steemapi

for ah

screen -r ah

once the download has been finished we need to copy files to the witness folder

For API Node

lz4 lz4 steem_api-20210506.tar.lz4

rm -rf lz4 steem_api-20210506.tar.lz4

tar -xvf lz4 steem_api-20210506.tar

rm -rf lz4 steem_api-20210506.tar

rm -rf /root/steem-api/data/witness_node_data_dir/blockchain

mv blockchain /root/steem-api/data/witness_node_data_dir/

At this point our most part of the step is finished lets edit the config file

nano /root/steem-api/data/witness_node_data_dir/ config.ini

paste the content avilable here https://hackmd.io/dp-ZAySaQVe1KlxOxXekkA

now we can start the docker

cd steem-api
./run.sh start

this will start the api node with docker name steemapi

get out in root directory

cd /root/

now lets work on the AH Node , as we have already changed docker environment config and file is downloaded

For AH NODE

lz4 steem_ah-20210513.tar.lz4

rm -rf steem_ah-20210513.tar.lz4

tar -xvf steem_ah-20210513.tar

rm -rf steem_ah-20210513.tar

rm -rf /root/steem-ah/data/witness_node_data_dir/blockchain

mv blockchain /root/steem-ah/data/witness_node_data_dir/

lets edit the config file

nano /root/steem-ah/data/witness_node_data_dir/config.ini

paste the content from here https://hackmd.io/dp-ZAySaQVe1KlxOxXekkA
and change
line 2 port number 2001 to 2002
line 51 port number 8091 to 8092
line 52 port number 8090 to 8093

comment lines 70 and 71 and paste the below

plugin = webserver p2p json_rpc condenser_api account_history_rocksdb account_history_api

save and exit

to start the ah node

cd steem-ah
./run.sh start

this will start AH Node with docker name steemah.

Now to configure jussi multiplexer please follow the below configuration

Jussi Configuration

Since we are running multiple nodes in the backend jussin need to be configured to communicate to nodes as per upstream url configuration

To install Jussi

git clone https://github.com/steemit/jussi.git
cd jussi

I will suggest running jussi in screen

screen -R jussi

nano nano DEV_config.json

remove enitre configuration files there and paste the content of this document https://hackmd.io/5sxitHGWQ3SPHe7aU1KkTg

Note : My docker and your docker netwrok settings might differ. as per my docker network setting steemapi is running with ip 172.17.0.4 and steemah is running with ip 172.17.0.2 . To check you docker ip please execute the below command .

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' steemapi

this above will give your API Node IP

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' steemah

This will give your AH NODE IP

replace respective ip's in jussi configuration in lines 19,31,32,33,34,48,49,50,51 and 52. (Please node port 8091 is for API nodes and port 8092 is for AH nodes)

Now once this part is finished we will head over and install nginx and ssl certificate , as this part has no changes than my previous post you can follow the link on top of this post .

Cheers

Group 11.png


Group 14.png

Supporting Steem Power Up Day

5% of this post reward is going to support STEEM COFFEE SHOP Initiative taken by @steemcoffeeshop and @arie.steem

Sort:  

Congratulations !
logo-seven.png
We are the hope of the helpless posts.
Your post has been manually rewarded by The Seven Team. Follow our Curation Trail or delegate us | 50SP | 100SP | 200SP | 300SP | 400SP | 500SP | and reach us in our discord channel.
Become in a Seven now.

@shreyap has received votes without our authorization. Please explain.

hello , bstrail i dont think such mis votes has ever happened in steemdb and steemdb as well don't have your private keys , are you sure you haven't followed some trail accounts that might have executed the voting round .
If that's the case then i will have to check manually and that is hell of a job to be done . why don't you hop in our discord server and explain a bit more about it

I will see if there is a bug in steemdb

https://discord.gg/psHEdsK

P.S our team manages https://steemdb.online and we haven't seen such activity ever

Useful information 👍🏻✨

Coin Marketplace

STEEM 0.26
TRX 0.20
JST 0.038
BTC 97288.28
ETH 3596.14
USDT 1.00
SBD 3.87