Smart contracts & UI of blockLAB - The first club to be managed on the blockchain.
- 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 ...
Build and run ethverein
- 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
Further angular commands
ng s -o to start and open dev-server
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
ng test to execute the unit tests via Karma.
Running end-to-end tests
ng e2e to execute the end-to-end tests via Protractor.