Skip to content

Instantly share code, notes, and snippets.

@luzhuomi
Last active April 30, 2019 10:16
Show Gist options
  • Save luzhuomi/2c2c9faec384d2e7e2bf13126b56cb56 to your computer and use it in GitHub Desktop.
Save luzhuomi/2c2c9faec384d2e7e2bf13126b56cb56 to your computer and use it in GitHub Desktop.
setup cello in Ubuntu 18.04

Setup Cello

For VirtualBox

Master:

  • eth0: nat
  • eht1: internal 192.168.0.2

Worker:

  • eth0: nat
  • eth1: internal 192.168.0.3

Setup for both

  1. (Both) Setup Docker CE. [https://docs.docker.com/install/linux/docker-ce/ubuntu/]
 $ sudo apt-get remove docker docker-engine docker.io containerd runc
 $ sudo apt-get update
 $ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
 $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo  apt-key add -
 $ sudo apt-key fingerprint 0EBFCD88
 $ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
 $ sudo apt-get update
 $ sudo apt-get install docker-ce docker-ce-cli containerd.io
  1. (Both) Add the user to docker group. add the current user, to the docker group at the last line in the file /etc/group
 docker:x:999:<the_user_name>
  1. (Both) Test
$ docker run hello-world

Setup Master

  1. (Master) Setup Cello Master. [https://cello.readthedocs.io/en/latest/setup/setup_master/]
$ sudo apt install git make -y
$ git clone http://gerrit.hyperledger.org/r/cello && cd cello
$ make setup-master
$ SERVER_PUBLIC_IP=192.168.0.2 make start
  1. (Master) Now go to [http://192.168.0.2:8080] to see the admin dashboard and [http://192.168.0.2:8080] to set the user dashboard. Default username: admin, password: pass
  2. (Master) In case of login problem with ("uri_redirect") error, remove /opt/cello/keycloak-mysql and run the make start command above again.

Setup Worker

  1. (Worker) Setup Cello worker [https://cello.readthedocs.io/en/latest/setup/setup_worker_docker/]
  2. (Worker) Edit systemd service config file /lib/systemd/system/docker.service, update the ExecStart line under section [Service], as the following:
[Service]
ExecStart=/usr/bin/dockerd -H fd:// -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384
  1. (Worker) Restart the docker
$ sudo systemctl daemon-reload; sudo systemctl restart docker.service
  1. (Master) To test the connection to the worker's docker
$ docker -H 192.168.0.3:2375 info
  1. (Worker)
$ sudo apt install git make nfs-common -y
$ git clone http://gerrit.hyperledger.org/r/cello && cd cello
  1. (Worker) edit the file scripts/worker_node/setup_worker_node_docker.sh
# Empty string means no need to setup NFS
MASTER_NODE="192.168.0.2"
  1. (Worker)
$ make setup-worker

Create a chain and test it out

  1. (Master) On the dashboard with port 8080, you should be able to add the host 192.168.0.3:2375. And create a chain allocated to the worker node

  2. (Master) Create a new user

  3. (Master) Logout of the dashboard with port 8080. Login to the user dashboard with port 8081 with the new user created. You now can create a chain and deploy the template smart contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment