Deploying Hive Node Service on Docker based on Ubuntu-18.04

1. Python3 and Docker are required

Before beginning the deployment, you need to be sure that Python3 and Docker have already been shipped on the target server. Generally, there is python3.6 already built-into the Ubuntu 18.04. About Docker, run the snippet of commands below to install Docker when no Docker found:

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo usermod -aG docker your-userid

2. Download source package

After the Docker environment having been settled, you will need to logout from the target server and login again to make Docker work effectively. Remember that you will be unable to carry out the installation unless Python3 and Docker are being shipped.

$ curl -fsL https://github.com/elastos/Elastos.NET.Hive.Node/archive/release-v2.0.1.tar.gz -o release.tar.gz
$ tar -xzvf release.tar.gz

3. Start the installation

Enter into the source code folder, directly run the command to install the Hive node service:

$ /bin/bash -c “$(curl -fsSL https://www.trinity-tech.io/hivenode/scripts/run.sh)" -s docker

4. Checking the installation

After that, get a coffee and wait for the installation to finish. It would not take you much time. As the whole process is completed, you can use the command to check the installation succeeded or not.

$ docker ps
$ curl -XPOST -H “Content-Type: application/json” -d ‘{“key”:”value”}’ http://YOUR-HIVE-NODE-IP:5000/api/v1/echo
{“key”:”value”}

5. Talking about ‘.env’

Under the directory of the Hive Node source code, you can see the whole content of config file .env displayed below:

DID_RESOLVER=http://api.elastos.io:20606
ELA_RESOLVER=http://api.elastos.io:20336

DID_MNEMONIC="street embark patrol frequent insect slot good model list armor absorb ripple"
DID_PASSPHRASE=
DID_STOREPASS=password

HIVE_DATA = ./data

HIVE_SENTRY_DSN =

HIVE_PAYMENT_CONFIG=./payment_config.json

MONGO_HOST=hive-mongo
MONGO_PORT=27017

DID_INFO_DB_NAME=hive_manage_info

RCLONE_CONFIG_FILE_DIR=./.rclone

# hive node release
HIVE_VERSION=1.0.0
HIVE_COMMIT_HASH=279b15650a86b16dcba289e74a09290ff225c69a

More advanced configuration available later

Now, the service entry-point of the Hive node would look like as:
http://YOUR-SERVER-IP:5000
You can set it up with a Nigix server as a gateway and enable the use of the https protocol to secure the communication between client and server. We will document a specific guiding article for this configuration later.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store