- Open the port 52204-52207, 8080 in the server by specifying the inbound and outbound ports to 52204 and 8080.
8080 is for swagger
52204-52207 is for hashgraph nodes
- Unzip: Make sure unzip is installed on the target server, if it is not installed, install it with
sudo apt-get install unzip - Docker (version 17.12.1-ce, build 7390fc6) Make sure docker is installed on the target server, if not installed, install it with the instructions given in the below website
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
Make sure docker is installed properly with the command sudo docker version. Expected output:

- Docker compose (version docker-compose version 1.19.0, build 9e633ef): Make sure docker compose is installed on the target server, if not installed, install with
sudo curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
docker-compose --version: should returndocker-compose version 1.19.0, build 9e633ef
-
SSh to the target server.
ssh blockchain@xxx.xxx.xxx.xxx -
Download and unzip the repo with the commands:
wget https://github.com/GovTechSG/hashgraph_experiments/archive/master.zip
unzip master.zip -
Edit the config.txt if required to add the nodes.
Example:
address, A, Alice, 1, 127.0.0.1, 50204, 127.0.0.1, 50204
address, B, Bob, 1, 127.0.0.1, 50205, 127.0.0.1, 50205 -
Edit the swagger url in the docker file for the parameter: ENV API_URL
cd hashgraph_experiments-master/supporting-services/swagger-ui-master
vim Dockerfile
ENV API_URL "http://13.82.94.181:52204/swagger.json" -
Build and run the project
cd hashgraph_experiments-master/
sudo docker-compose up
Expected output of docker-compose up:

http://xxx.xxx.xxx.xxx:8080/ : This will bring up the swagger documentation for the hashgraph exposed rest endpoints.
Expected output:
- Java 1.8
- Maven
- Docker (Refer above for installation steps)
- Docker compose (Refer above for installation steps)
- Unzip (Refer above for installation steps)
-
Set up the servers in the same vnet inorder for them to communicate with each other
-
Open the port 8080 and 52204 in the target server. 8080 for swagger and 52204 is for the hashgraph node
-
Download and unzip the repo with the commands:
wget https://github.com/GovTechSG/hashgraph_experiments/archive/master.zip
unzip master.zip -
Edit the swagger url in the docker file for the parameter: ENV API_URL
Example:
cd hashgraph_experiments-master/supporting-services/swagger-ui-master
vim Dockerfile
ENV API_URL "http://13.82.94.181:52204/swagger.json" -
Change to hashgraph_experiments and bring up couchdb and swagger app with the command
cd hashgraph_experiments-mastersudo docker-compose up -
Edit config.txt with the private ip of the respective servers.
Example:
address, A, Alice, 1, 10.0.0.4, 50204, 10.0.0.4, 50204
address, B, Bob, 1, 10.0.0.5, 50204, 10.0.0.5, 50204 -
Bring up the hashgraph node
./build_and_run_hashgraph_node.sh -
Repeat the same steps: 1 to 4 on the other server.
http://xxx.xxx.xxx.xxx:8080/ : This will bring up the swagger documentation for the hashgraph exposed rest endpoints.
Expected output:
Notes: For the endpoints url if you see 2 entires then you can be sure that the nodes are in the cluster as expected
https://github.com/GovTechSG/hashgraph_experiments/blob/master/LICENSE.md

