Skip to content

How to start las2peer with ethereum (v0.8)

Michi03 edited this page Aug 12, 2020 · 8 revisions

Overview

v0.8 of las2peer introduces an Ethereum block-chain based decentralized service registry and discovery system. This mechanism enables the discovery of services in a network and secure verification of their integrity and origin. This latest infrastructure works on the concept of block-chain. It consists of a decentralized service registry that is governed by the whole community so that the service releases can be authorized and service instances can be validated. The main components of the decentralized service registry are Smart contracts, the Register Gateway and Service Browser. This article is going to guide you on how to start your own las2peer network with ethereum.

Tools needed

For running your own las2peer network with ethereum you need to have Docker and Docker-compose installed on your system.

Starting the las2peer network with ethereum

After installing the docker and docker-compose, please check if its properly installed or not by using the following commands: docker --version docker-compose --version After verifying the installation, make sure that you have allocated at least 4GB of RAM to the docker containers. This can be done via Docker Preferences under the Advanced tab. Now, your system is all ready to set up las2peer network. We start by pulling the following Docker images:

  1. docker pull rwthacis/las2peer:latest
  2. docker pull rwthacis/monitored-geth-client:latest

rwthacis/las2peer is the compiled, ready-to-run version of las2peer from the main las2peer branch. rwthacis/monitored-geth-client is an Ethereum client, modified to use a lower than usual mining difficulty.

After successfully pulling the images, create a new directory by using mkdir directory_name and then navigate to the newly created directory. Now, to retrieve the ready-to-run docker-compose file we will use the following command: wget https://raw.githubusercontent.com/rwth-acis/las2peer-ethereum-cluster/master/docker-compose-files/2-node-docker-compose.yml

But first make sure that you have wget software package installed on your system.

You can see that docker-compose file is now present in your newly created directory. This file is the startup script that will run your own las2peer network. To start the network please use the following command: docker-compose -f 2-node.docker-compose.yml up You just have to wait for few minutes and the network will then be started and can las2peer network can then be viewed through localhost. Now you can enjoy the perks of this network by publishing/using the services.

This network consists of two las2peer nodes and 2 ethereum nodes, since every las2peer node has an associated ethereum node. Therefore, altogether there are 4 containers for ethereum nodes and las2peer nodes. To stop the network you can just enter: docker-compose -f 2-node.docker-compose.yml down

Some helpful tips

On first start-up it sometimes happens that the peer las2peer node fails to bootstrap because the network has not properly started, yet. In this case, simply open a second terminal in the directory containing the docker-compose file and run: docker-compose restart las2peer-peer-1 which should restart the failed container.

If due to some technical reasons the network gets interrupted while starting then you can do the following:

  1. Check the containers that have been started by using, docker ps -a. This command displays all the containers (killed and active).
  2. You can now kill the started containers by using, docker kill [container_name]
  3. Or, if the containers were just created and not running then you can use the following command, docker container prune but please be careful before using this command as this may remove all the stopped containers. Please have a look at the official docker documentation for further information.

Lastly, if you want to see the logs of the container, you can use docker logs [container_name] command.

Clone this wiki locally