Go implementation of Guru
Guru is a Universal Reputation Module for Distributed Consensus Protocols developed at the University of Luxembourg by Alex Biryukov, Daniel Feher, and Dmitry Khovratovich. The original Python simulation code is on Github.
Please make sure you have a development environment with
go installed and configured.
Quickstart: run web UI to see the system running live
cd web yarn vue build
Build and start the application - which will run on port
443and use development certificates for
cd .. go build ./cmd/gurud ./gurud
Browse to https://localhost
- Verify that the backend information says 'connected'
- Click on 'Start Simulation'
- Fiddle with adding and removing malicious bots
(Alternatively run "vue build" and deploy the content of the "dist" folder to a static web server)
Run unit tests
To run unit tests, run:
go run test ./...
The application uses the new Golang module system (
1.11 onwards) so it should
grab the required libraries automatically. Check out
go.mod for a snapshot
of the dependencies.
To create a cpu profile of the running application, run:
./gurud -cpuprofile=gurud.prof go tool pprof gurud.exe gurud.prof
Build all in Docker
Build websocket backend and ui in Docker:
Run application in containers:
Cleanup stale containers:
docker stop $(docker ps -q) docker rm $(docker ps -aq)
docker rmi $(docker images | grep none | col 3)
To setup a new environment from scratch:
- Setup a host with Docker
- Set environment variables $HOST (i.e. firstname.lastname@example.org) and $DEST (i.e. /some/path)
Generate HTTPS Certificates to deploy on custom domain
Generate Letsencrypt certificates in Windows 10 / Ubuntu System for Windows 10
sudo wget https://dl.eff.org/certbot-auto ./certbot-auto ./certbot-auto --manual certonly --preferred-challenges dns
Optionally check that the DNS challenge has propagated with this tool
Certificates will appear in: