Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

blocklab/ethverein

Repository files navigation

blockLAB

Smart contracts & UI of blockLAB - The first club to be managed on the blockchain.

Build and run ethverein with docker

Prerequisites

  • Docker Please remind for Windows you will need Hyper-V. If you have already installed docker on your machine, please make sure to upgrade it to a recent version.

  • Docker-Compose (make sure you use a recent version)

  • MetaMask browser plugin

  1. Clone Repository
$ git clone https://github.com/blocklab/ethverein.git
  1. Open a Terminal and cd to /ethverein and run :
docker-compose up -d --build
  1. (Optional) Open a second Terminal and cd to /ethverein and run :
docker exec -ti ethverein /bin/bash
cd src/
truffle test

If the tests compile without errors run :

exit
  1. deploy the contracts to the docker ganache service
docker exec -w /ethverein/src -ti ethverein truffle migrate --reset --network dockernache
  1. compose up again to see the logs
docker-compose up
  1. Use your browser and connect to http://localhost:4201.

If you have trouble to connect to the application, you might run

docker-compose run --service-ports

to use the specified ports and just to be sure run

docker inspect ethverein

to get the container id and use this instead of localhost.

  1. Set a custom RPC in Metamask with the URL http://localhost:6545

  2. Import Metamask Accounts with the private keys of the docker ganache service (you can find those in your console output)

Build and run ethverein with Vagrant

Prerequisites

Vagrant setup

  1. Clone repository:
$ git clone https://github.com/blocklab/ethverein.git
  1. Set up VM with vagrant. This will run bootstrap.sh and install the required build environment (e.g., node, npm, truffle, angular-cli):
$ cd ethverein
$ vagrant up
  1. Connect to VM:
$ vagrant ssh

At the end of your session, logout or exit terminates the ssh session, and vagrand suspend suspends the VM to free up memory as well as forwarded ports. Ultimately, vagrant destroy destroys the whole thing ...

Build and run ethverein

  1. Install git (should have been installed during bootstrapping)
$ sudo apt-get install git
  1. Compile, test, and run smart contracts using truffle:
$ cd ethverein
$ npm install --no-bin-links 
$ cd src
$ truffle develop
$ test
$ migrate --reset
  1. Open a new terminal, ssh into vagrant, and run angular:
$ cd ethverein
$ npm rebuild node-sass
$ ng serve --host 0.0.0.0
  1. Use your browser and connect to http://localhost:4200.

Installation (Ropsten)

There are two ways to deploy the contracts to Ropsten testnet:

  • Using geth/truffle.
  • Using http://remix.ethereum.org/. Initially, we deployed the contracts through Remix. Since leaving our build environment and copying/pasting contract code is quite painfull, we will add support for geth and truffle as well.

As soon as the contract is deployed on the test net, insert the contract URL into environment.test.ts and run angular as follows:

$ ng serve --configuration=test --host 0.0.0.0

Further angular commands

Development server

Run ng s -o to start and open dev-server

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

About

Codebase of the very first "club" to be managed on the blockchain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published