Code Monkey home page Code Monkey logo

go-lachesis's Introduction

Lachesis

aBFT Consensus platform for distributed applications.

Build Details

version
Build Status
appveyor
license
libraries.io dependencies

Code Quality

Go Report Card
GolangCI
Code Climate Maintainability Grade
Code Climate Maintainability
Code Climate Technical Dept
Codacy code quality
cii best practices
cii percentage

GoDoc

Documentation.

Sonarcloud

GitHub

Commit Activity
Last Commit
Contributors
Issues
LoC

Social


twitter

Building the source

Building lachesis requires both a Go (version 1.13 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run

go build -o ./build/lachesis ./cmd/lachesis

The build output is build/lachesis executable.

Do not clone the project into $GOPATH, due to the Go Modules. Instead, use any other location.

Running lachesis

Going through all the possible command line flags is out of scope here, but we've enumerated a few common parameter combos to get you up to speed quickly on how you can run your own lachesis instance.

Configuration

As an alternative to passing the numerous flags to the lachesis binary, you can also pass a configuration file via:

$ lachesis --config /path/to/your_config.toml

To get an idea how the file should look like you can use the dumpconfig subcommand to export your existing configuration:

$ lachesis --your-favourite-flags dumpconfig

Docker quick start

One of the quickest ways to get Lachesis up and running on your machine is by using Docker:

cd docker/
make
docker run -d --name lachesis-node -v /home/alice/lachesis:/root \
           -p 5050:5050 \
          "lachesis" \
          --port 5050 \
          --nat=extip:YOUR_IP

This will start lachesis with --port 5050 --nat=extip:YOUR_IP arguments, with DB files inside /home/alice/lachesis/.lachesis

Do not forget --rpcaddr 0.0.0.0, if you want to access RPC from other containers and/or hosts. By default, lachesis binds to the local interface and RPC endpoints is not accessible from the outside.

To find out your enode ID, use:

docker exec -i lachesis-node /lachesis --exec "admin.nodeInfo.enode" attach

To get the logs:

docker logs lachesis-node

Dev

Testing

Lachesis has extensive unit-testing. Use the Go tool to run tests:

go test ./...

If everything goes well, it should output something along these lines:

?       github.com/Fantom-foundation/go-lachesis/event_check/basic_check    [no test files]
?       github.com/Fantom-foundation/go-lachesis/event_check/epoch_check    [no test files]
?       github.com/Fantom-foundation/go-lachesis/event_check/heavy_check    [no test files]
?       github.com/Fantom-foundation/go-lachesis/event_check/parents_check  [no test files]
ok      github.com/Fantom-foundation/go-lachesis/evm_core   (cached)
ok      github.com/Fantom-foundation/go-lachesis/gossip (cached)
?       github.com/Fantom-foundation/go-lachesis/gossip/fetcher [no test files]
?       github.com/Fantom-foundation/go-lachesis/gossip/occuredtxs [no test files]
ok      github.com/Fantom-foundation/go-lachesis/gossip/ordering    (cached)
ok      github.com/Fantom-foundation/go-lachesis/gossip/packsdownloader    (cached)

Operating a private network

Maintaining your own private network is more involved as a lot of configurations taken for granted in the official networks need to be manually set up.

To run the fakenet with just one validator, use:

$ lachesis --fakenet 1/1

To run the fakenet with 5 validators, run the command for each validator:

$ lachesis --fakenet 1/5 # first node, use 2/5 for second node

After that, you have to connect your nodes. Either connect them statically, or specify a bootnode:

$ lachesis --fakenet 1/5 --bootnodes "enode://ade7067fe5495db3d9f44dfda710a2873f339f9288c02941c80b1a7ede16f1d1ceef97736c6680d163f04be7f706dabca01e697e1e7290dfc7c07d1eacb47c54@172.20.0.3:38051"

Running the demo

For the testing purposes, the full demo may be launched using:

cd docker/
make # build docker image
./start.sh # start the containers
./stop.sh # stop the demo

The full demo doesn't spin up very fast. To avoid the full docker image building, you may run the integration test instead:

go test -v ./integration/...

Adjust test duration, number of nodes and logs verbosity in the test source code.

go-lachesis's People

Contributors

devintegral2 avatar arrivets avatar sfxdxdev avatar samuelmarks avatar maxime2 avatar okislitsin avatar andrecronje avatar dev10 avatar dzeckelev avatar champii avatar calvinchengx avatar devintegral avatar roanbrand avatar mpitid avatar josephg avatar rishflab avatar s4kibs4mi avatar stanislavstoyanov avatar devintegral7 avatar mkong avatar mauleyzaola avatar quan8 avatar fhaynes avatar joneskm avatar shalokshalom avatar devvcat avatar orangetest1 avatar shdown avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar  avatar  avatar

go-lachesis's Issues

Review maidsafe/parsec

Investigate https://github.com/maidsafe/parsec, see if it's useful for our purposes.

Lachesis will be rewritten in Rust.

From a bird's eye:

Advantages to using parsec

  • Active codebase
  • Lots already done for us, out-of-the-box

Disadvantages to using parsec

  • Too active a codebase, will be hard to keep in-sync
  • Issues with not having our own codebase
  • Lots of technical debt

@AgustinCB : Can you do a deep dive into parsec, and expand on my enumerated strengths and weaknesses?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.