{"id":19141507,"url":"https://github.com/erigontech/silkworm","last_synced_at":"2025-05-16T04:06:28.692Z","repository":{"id":37098215,"uuid":"271566371","full_name":"erigontech/silkworm","owner":"erigontech","description":"C++ implementation of the Ethereum protocol","archived":false,"fork":false,"pushed_at":"2025-04-30T15:07:03.000Z","size":135237,"stargazers_count":300,"open_issues_count":116,"forks_count":80,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-16T04:06:19.351Z","etag":null,"topics":["cpp","ethereum"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erigontech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-11T14:22:43.000Z","updated_at":"2025-05-10T11:32:01.000Z","dependencies_parsed_at":"2024-11-05T14:18:23.890Z","dependency_job_id":"08ea5b52-6232-42de-af4c-883de329f13a","html_url":"https://github.com/erigontech/silkworm","commit_stats":null,"previous_names":["erigontech/silkworm","torquem-ch/silkworm"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erigontech%2Fsilkworm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erigontech%2Fsilkworm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erigontech%2Fsilkworm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erigontech%2Fsilkworm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erigontech","download_url":"https://codeload.github.com/erigontech/silkworm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","ethereum"],"created_at":"2024-11-09T07:23:38.094Z","updated_at":"2025-05-16T04:06:23.643Z","avatar_url":"https://github.com/erigontech.png","language":"C++","readme":"# Silkworm - C++ Ethereum Execution Client\n\nC++ implementation of the [Ethereum] Execution Layer (EL) protocol based on the [Erigon architecture].\n\n[![Linux](https://img.shields.io/circleci/build/gh/erigontech/silkworm?label=Linux)](https://circleci.com/gh/erigontech/silkworm)\n[![macOS](https://github.com/erigontech/silkworm/actions/workflows/macOS.yml/badge.svg)](https://github.com/erigontech/silkworm/actions/workflows/macOS.yml)\n[![Windows](https://github.com/erigontech/silkworm/actions/workflows/windows.yml/badge.svg)](https://github.com/erigontech/silkworm/actions/workflows/windows.yml)\n[![codecov](https://codecov.io/gh/erigontech/silkworm/graph/badge.svg?token=89IPVJGR4Q)](https://codecov.io/gh/erigontech/silkworm)\n\n[![JSON RPC Integration Tests](https://github.com/erigontech/silkworm/actions/workflows/rpc-integration-tests.yml/badge.svg)](https://github.com/erigontech/silkworm/actions/workflows/rpc-integration-tests.yml)\n[![JSON RPC Performance Tests](https://github.com/erigontech/silkworm/actions/workflows/rpc-performance-tests.yml/badge.svg)](https://github.com/erigontech/silkworm/actions/workflows/rpc-performance-tests.yml)\n\n## Table of Contents\n\n- [About Silkworm](#about)\n- [About Silkworm for Erigon, aka Erigon++](#erigon++)\n- [Obtaining Source Code](#source-code)\n- [Building on Linux \u0026 macOS](#build-on-unix)\n- [Building on Windows](#build-on-windows)\n- [Testing Silkworm](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n\u003ca name=\"about\"\u003e\u003c/a\u003e\n## About Silkworm\n\nSilkworm is a greenfield C++ implementation of the Ethereum protocol based on the [Erigon architecture].\nIt aims to be the fastest Ethereum client while maintaining the high quality and readability of its source code.\nSilkworm uses [libmdbx] as the database engine.\n\nSilkworm was conceived as an evolution of the [Erigon] project, as outlined in its [release commentary](https://ledgerwatch.github.io/turbo_geth_release.html#Licence-and-language-migration-plan-out-of-scope-for-the-release).\n\nSilkworm is under active development and hasn't reached the alpha phase yet.\nHence, there have been no releases so far.\n\n\n\u003ca name=\"erigon++\"\u003e\u003c/a\u003e\n## About Silkworm for Erigon a.k.a. Erigon++\n\nAt the very beginning, one of the main goals of Silkworm was implementing high-performance C++ libraries to be used\ndirectly within Erigon itself. Recently we focused again on this initial target, making it our highest priority and\ndelivering the first release of [Erigon++] starting from Erigon 2.59.0.\n\nErigon++ is supported on platforms:\n\n* Linux x86_64 with glibc 34+, glibcpp 30+ (such as Debian 12+, Ubuntu 22+, etc.)\n* macOS 14+ arm64\n\nIt is not supported on any arm64 Linux, Alpine Linux.\nTest compatibility by running [silkworm_compat_check.sh](https://github.com/erigontech/erigon/blob/main/turbo/silkworm/silkworm_compat_check.sh)\n\nPlease note that Erigon++ is just a fancy name for identifying such usage of Silkworm libraries within Erigon, which can\nbe selectively enabled by specifying optional flags in Erigon command-line.\n\nThere are two possible usages of Erigon++:\n\n* as a user, you may want to test Erigon++ features out of the box: in this case, no Silkworm build is required, you\njust build Erigon as usual and then enable any of the command-line flags:\n```\n--silkworm.exec [enables historical block execution powered by Silkworm]\n--silkworm.rpc [enables Ethereum JSON-RPC API powered by Silkworm]\n--silkworm.sentry [enables Execution Layer p2p networking powered by Silkworm]\n```\n* as a developer, you may want to experiment how you can build Erigon with Silkworm bindings and how you can play with\nthem together through [Cgo]. If you are interested, we have some documentation about the development process of our\n[C API for Erigon](https://github.com/erigontech/silkworm/blob/master/docs/CONTRIBUTING.md#c-api-for-erigon).\n\n\n\u003ca name=\"source-code\"\u003e\u003c/a\u003e\n## Obtaining Source Code\n\nTo obtain Silkworm source code for the first time:\n```\ngit clone --recurse-submodules https://github.com/erigontech/silkworm.git\ncd silkworm\n```\n\nSilkworm uses a few git submodules (some of which have their own submodules).\nSo after you've updated to the latest code with\n```\ngit pull\n```\nupdate the submodules as well by running\n```\ngit submodule update --init --recursive\n```\n\n\n\u003ca name=\"build-on-unix\"\u003e\u003c/a\u003e\n## Building on Linux \u0026 macOS\n\nBuilding Silkworm requires:\n* C++20 compiler: [GCC](https://www.gnu.org/software/gcc/) \u003e= 11.2 or [Clang](https://clang.llvm.org/) \u003e= 16\nor AppleClang ([Xcode](https://developer.apple.com/xcode/) \u003e= 15)\n* [CMake](https://cmake.org)\n* [Conan](https://conan.io)\n\nConan requires Python, and can be installed using:\n\n    pip3 install --user conan==2.10.2 chardet\n\nOn Linux the conan binary gets installed into `$HOME/.local/bin` which is typically in PATH already.\nOn macOS need to add the binary to PATH manually:\n\n    export \"PATH=$HOME/Library/Python/3.9/bin:$PATH\"\n\nOnce the prerequisites are installed, bootstrap cmake by running\n```\nmkdir build\ncd build\ncmake ..\n```\n(In the future you don't have to run `cmake ..` again.)\n\n\nA custom Conan \"profile\" can be passed via a cmake argument, for example: \n\n    cmake .. -DCONAN_PROFILE=macos_arm64_clang_13_debug\n\nwill use \"debug\" configuration builds of dependencies.\n\nSee available profiles in [cmake/profiles](cmake/profiles).\n\nDuring the cmake configuration step `conan_provider.cmake` runs a [conan install](https://docs.conan.io/2/reference/commands/install.html) command that downloads packages and builds some of them from source if needed. The exact arguments to this command are printed in the build log.\n\n\nThen run the build itself\n```\nmake -j\n```\n_Note about parallel builds using `-j`: if not specified the exact number of parallel tasks, the compiler will spawn as many\nas the cores available. That may cause OOM errors if the build is executed on a host with a large number of cores but a relatively\nsmall amount of RAM. To work around this, either specify `-jn` where `n` is the number of parallel tasks you want to allow or\nremove `-j` completely. Typically, for Silkworm each compiler job requires 4GB of RAM. So, if your total RAM is 16GB, for example,\nthen `-j4` should be OK, while `-j8` is probably not. It also means that you need a machine with at least 4GB RAM to compile Silkworm._\n\nNow you can run the unit tests\n```\nmake test\n```\nor the [Ethereum EL Tests]\n```\ncmd/test/ethereum\n```\n\n\n\u003ca name=\"build-on-windows\"\u003e\u003c/a\u003e\n## Building on Windows\n\n**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.**\n* Install [Visual Studio] 2019. Community edition is fine.\n* Make sure your setup includes CMake support and Windows 10 SDK.\n* Install [Conan](https://conan.io) and add it to PATH.\n* Open Visual Studio and select File -\u003e CMake...\n* Browse the folder where you have cloned this repository and select the file CMakeLists.txt\n* Let CMake cache generation complete (it may take several minutes)\n* Solution explorer shows the project tree.\n* To build simply `CTRL+Shift+B`\n* Binaries are written to `%USERPROFILE%\\CMakeBuilds\\silkworm\\build` If you want to change this path simply edit `CMakeSettings.json` file.\n\n**Note ! Memory compression on Windows 10/11**\n\nWindows 10/11 provide a _memory compression_ feature which makes available more RAM than what physically mounted at cost of extra CPU cycles to compress/decompress while accessing data. As MDBX is a memory mapped file this feature may impact overall performances. Is advisable to have memory compression off.\n\nUse the following steps to detect/enable/disable memory compression:\n* Open a PowerShell prompt with Admin privileges\n* Run `Get-MMAgent` (check whether memory compression is enabled)\n* To disable memory compression : `Disable-MMAgent -mc` and reboot\n* To enable memory compression : `Enable-MMAgent -mc` and reboot\n\n\n\u003ca name=\"testing\"\u003e\u003c/a\u003e\n## Testing Silkworm\n\n**Note: at current state of development Silkworm can't actually sync the chain like Erigon does.**\n\nYou can try to run Silkworm to test just the sync on the *pre-Merge* Ethereum chain. In order to do that you need to:\n\n- run an instance of `Erigon Sentry` component from branch `release/2.60`\n- set the environment variable `STOP_AT_BLOCK` to a value \u003c 15'537'351 (e.g. STOP_AT_BLOCK=15000000)\n\n### Linux and macOS\n\n#### Erigon Sentry\n```\ngit clone --recurse-submodules https://github.com/erigontech/erigon.git\ncd erigon\ngit checkout release/2.60\nmake sentry\n./build/bin/sentry\n```\n\n#### Silkworm\n```\nexport STOP_AT_BLOCK=15000000\n./cmd/silkworm\n```\n\n### Windows\n\n#### Erigon Sentry\n```\ngit clone --recurse-submodules https://github.com/erigontech/erigon.git\ncd erigon\ngit checkout release/2.60\nmake sentry\n./build/bin/sentry.exe\n```\n\n#### Silkworm\n```\n$env:STOP_AT_BLOCK=15000000\n./cmd/silkworm.exe\n```\n\n\n\u003ca name=\"contributing\"\u003e\u003c/a\u003e\n## Contributing\n\nIf you want to contribute, you can read our [contribution guidelines](docs/CONTRIBUTING.md).\n\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n## License\n\nSilkworm is licensed under the terms of the Apache license.\nSee [LICENSE](LICENSE) for more information.\n\nSome files in [elias_fano](silkworm/db/datastore/snapshots/elias_fano) and [rec_split](silkworm/db/datastore/snapshots/rec_split) folders are licensed under the LGPL license.\n\n[Ethereum]: https://ethereum.org\n[Ethereum EL Tests]: https://github.com/ethereum/tests\n[Erigon]: https://github.com/erigontech/erigon\n[Erigon architecture]: https://github.com/erigontech/interfaces/blob/master/_docs/README.md\n[Erigon++]: https://erigon.tech/erigonpp\n[Cgo]: https://go.dev/blog/cgo\n[GMP]: http://gmplib.org\n[libmdbx]: https://github.com/erthink/libmdbx\n[staged sync]: https://github.com/erigontech/erigon/blob/main/eth/stagedsync/README.md\n[Visual Studio]: https://www.visualstudio.com/downloads\n[Yellow Paper]: https://ethereum.github.io/yellowpaper/paper.pdf\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferigontech%2Fsilkworm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferigontech%2Fsilkworm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferigontech%2Fsilkworm/lists"}