Smart contracts & UI of blockLAB - The first club to be managed on the blockchain.
-
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)
- Clone Repository
$ git clone https://github.com/blocklab/ethverein.git
- Open a Terminal and cd to /ethverein and run :
docker-compose up -d --build
- (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
- deploy the contracts to the docker ganache service
docker exec -w /ethverein/src -ti ethverein truffle migrate --reset --network dockernache
- compose up again to see the logs
docker-compose up
- 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.
-
Set a custom RPC in Metamask with the URL http://localhost:6545
-
Import Metamask Accounts with the private keys of the docker ganache service (you can find those in your console output)
- Clone repository:
$ git clone https://github.com/blocklab/ethverein.git
- 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
- 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 ...
- Install git (should have been installed during bootstrapping)
$ sudo apt-get install git
- Compile, test, and run smart contracts using truffle:
$ cd ethverein
$ npm install --no-bin-links
$ cd src
$ truffle develop
$ test
$ migrate --reset
- Open a new terminal, ssh into vagrant, and run angular:
$ cd ethverein
$ npm rebuild node-sass
$ ng serve --host 0.0.0.0
- Use your browser and connect to http://localhost:4200.
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
Run ng s -o
to start and open dev-server
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.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.