Skip to content

C++ implementation of the Ethereum protocol

License

Notifications You must be signed in to change notification settings

root-servers/silkworm

 
 

Repository files navigation

Silkworm

C++ implementation of the Ethereum protocol. It's conceived as an evolution of the Turbo-Geth 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:

  • C++17 compiler (GCC or Clang)
  • CMake
  • GMP (sudo apt-get install libgmp3-dev or brew install gmp)

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 check database changes (produced by Turbo-Geth) with silkworm

./check_changes

and also run either the unit tests

./unit_test

or Ethereum Consensus Tests

./consensus

Windows

  • 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.
  • Exceptions are allowed.
  • User-defined literals are allowed.
  • Maximum line length is 120, indentation is 4 spaces – see .clang-format.

About

C++ implementation of the Ethereum protocol

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.1%
  • CMake 1.8%
  • C 1.1%