Master Node Setup

The Master Node includes several services:

  • operator dashboard: Provide Web UI for operators.
  • user dashboard: Provide Web UI for users.
  • engine: Provide RESTful APIs for chain consumers.
  • watchdog: Watch for health checking.

More details can be found at the Architecture Design.

System Requirement

  • Hardware: 8c16g100g
  • Linux Kernel >= 3.0.0
  • Docker engine: 1.10.0+ (Docker 18.0+ support is experimental)
  • docker-compose: 1.10.0+

The Master Node can be deployed by in 2 steps:

  • Clone code
  • Run setup script

Clone Code

You may check git and make are installed to clone the code.

$ sudo aptitude install git make -y
$ git clone http://gerrit.hyperledger.org/r/cello && cd cello

Run Setup

For the first time running, please setup the master node with the setup.sh.

Just run (safe to repeat it):

$ make setup-master

Make sure there is no error during the setup. Otherwise, please check the log msgs with make logs.

Usage

Start/Stop/Restart

To start the whole services, please run

$ SERVER_PUBLIC_IP=x.x.x.x make start

This may take 1+ min till all services are up. After all services containers are up, you can access the operator dashboard at x.x.x.x:8080, and user dashboard at x.x.x.x:8081.

Environment variables which you can use in the command:

  • SERVER_PUBLIC_IP(required): Master node's public IP address, do not use 127.0.0.1
  • THEME(optional): Theme name for operator dashboard basic/vue/react, default is basic
  • NPM_REGISTRY(optional):: npm registry for install node packages
  • DEV(optional):: Start service in dev/product mode, options is True/False, default is False
  • ENABLE_EMAIL_ACTIVE(optional):: Whether register user in user-dashboard need to active manually
  • SMTP_SERVER(optional):: smtp server address for send active email to user
  • SMTP_PORT(optional):: smtp server port
  • SMTP_AUTH_USERNAME(optional):: Username for authenticate of smtp server
  • SMTP_AUTH_PASSWORD(optional):: Password for authenticate of smtp server
  • FROM_EMAIL(optional):: Email address display to user
  • NEXT_VERSION(optional):: Whether use next version deployment files, True/False.
  • DEPLOY_METHOD(optional):: Deployment method, values docker-compose/k8s, default is docker-compose, only support NEXT_VERSION=True.

To stop or restart the whole services, please run

$ make stop

To restart the whole services, please run

$ make restart

Start/Stop/Restart in Development mode

As a developer, you can start/stop/restart services in development mode. In development mode, user dashboard will watch and restart service if files change. And operator dashboard will enalbe flask debug.

To start the whole services in developer mode, please run

$ SERVER_PUBLIC_IP=x.x.x.x MODE=dev make start

To stop or restart the whole services, please run

$ MODE=dev make stop

To restart the whole services, please run

$ SERVER_PUBLIC_IP=x.x.x.x MODE=dev make restart

Check Logs

To check the logs for all the services, please run

$ make logs

To check the logs for one specific service, please run

$ make log service=watchdog

Now you can access the x.x.x.x:8080 to open the Web-based operation dashboard.

Configuration

The application configuration can be imported from file named CELLO_CONFIG_FILE.

By default, it also loads the config.py file as the configurations.

Data Storage

The mongo container will use local /opt/cello/mongo path (Must exist locally) for persistent storage.

Please keep it safe by backups or using more high-available solutions.

Work with MacOS

Local Path Mount

In MacOS, Docker cannot mount local path from host by default. Hence for mongo container data volume, users need to:

  • Make sure the /opt/cello path exists locally, and it is writable for the current user account. Simply just run make setup-master.
  • Add the path to File Sharing list in the preference of Docker for MacOS, to make it mountable by container.

Install envsubst

macOS does not have envsubst command. In order to install it, need to use the Homebrew tool.

$ brew install gettext
$ brew link gettext
$ export PATH="/usr/local/opt/gettext/bin:$PATH"
$ echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

More Commands using make

To know more what the following make commands does please refer make_support page.

Cello Docker Images

Cello project also provide Docker images for quick adoptions, users can pull these images from dockerhub or build locally.

Docker Images

Pull from Dockerhub

The build process is generally expensive so you may wanna just pull those images from Dockerhub.

Run make dockerhub-pull will pull the following images:

By default, the latest version of images will be pulled, and you may optionally specify the version of images to pull down:

$ VERSION=0.8.0-beta make dockerhub-pull

Local Building

Run make docker will build the docker images locally and commit with architecture and version tag; e.g. "hyperledger/cello-baseimage:x86_64-0.8.0-snapshot-7b7fab6".

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.