Giter Site home page Giter Site logo

silkworm's Introduction

Silkworm

C++ implementation of the Ethereum protocol. It's conceived as an evolution of the Erigon project, as outlined in its release commentary.

CircleCI AppVeyor CodeCov

Building the source

Clone the repository

git clone --recurse-submodules https://github.com/torquem-ch/silkworm.git

To update the submodules later on run

git submodule update --init --recursive

Linux & macOS

Building silkworm requires:

Once the prerequisites are installed, bootstrap cmake by running

mkdir build
cd build
cmake ..

(In the future you don't have to run cmake .. again.)

Then run the build itself

make -j

Now you can run the unit tests

cmd/core_test

or Ethereum Consensus Tests

cmd/consensus

You can also execute Ethereum blocks with Silkworm. For that you need an LMDB instance populated with Ethereum blocks, which can be produced by running the first 4 stages of Erigon sync, which are before the Execute Blocks Stage. Then run

cmd/execute -d <path-to-chaindata>

Windows

Note ! Windows builds are maintained for compatibility/portability reasons. However, due to the lack of 128 bit integers support by MSVC, execution performance is inferior when compared to Linux builds.

  • Install Visual Studio 2019. Community edition is fine.
  • Make sure your setup includes CMake support and Windows 10 SDK.
  • Install vcpkg.
  • .\vcpkg\vcpkg install mpir:x64-windows
  • Add <VCPKG_ROOT>\installed\x64-windows\include to your INCLUDE environment variable.
  • Add <VCPKG_ROOT>\installed\x64-windows\bin to your PATH environment variable.
  • Open Visual Studio and select File -> CMake...
  • Browse the folder where you have cloned this repository and select the file CMakeLists.txt
  • Let CMake cache generation complete (it may take several minutes)
  • Solution explorer shows the project tree.
  • To build simply CTRL+Shift+B
  • Binaries are written to %USERPROFILE%\CMakeBuilds\silkworm\build If you want to change this path simply edit CMakeSettings.json file.

Code style

We use the standard C++17 programming language. We follow Google's C++ Style Guide with the following differences:

  • snake_case for function names.
  • .cpp & .hpp file extensions for C++; .c & .h are reserved for C.
  • using namespace foo is allowed inside .cpp files, but not inside headers.
  • Exceptions are allowed outside of Silkworm Core.
  • User-defined literals are allowed.
  • Maximum line length is 120, indentation is 4 spaces โ€“ see .clang-format.

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.