{"id":18542747,"url":"https://github.com/coinbase/mesh-ethereum","last_synced_at":"2025-04-13T03:14:39.431Z","repository":{"id":37848752,"uuid":"306699318","full_name":"coinbase/mesh-ethereum","owner":"coinbase","description":"Ethereum Mesh API Implementation","archived":false,"fork":false,"pushed_at":"2024-07-09T21:57:32.000Z","size":854,"stargazers_count":104,"open_issues_count":21,"forks_count":71,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-13T03:14:29.899Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/coinbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-23T17:08:49.000Z","updated_at":"2025-03-28T20:45:06.000Z","dependencies_parsed_at":"2024-04-14T16:48:53.589Z","dependency_job_id":"9e3672c5-322e-4fad-a1f5-758cb6406ed6","html_url":"https://github.com/coinbase/mesh-ethereum","commit_stats":null,"previous_names":["coinbase/mesh-ethereum","coinbase/rosetta-ethereum"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-ethereum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-ethereum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-ethereum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-ethereum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coinbase","download_url":"https://codeload.github.com/coinbase/mesh-ethereum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657920,"owners_count":21140846,"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":[],"created_at":"2024-11-06T20:10:22.396Z","updated_at":"2025-04-13T03:14:39.399Z","avatar_url":"https://github.com/coinbase.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003c!-- HTML Graphic image –\u003e\n\u003c!-- HTML h3 Title and Description --\u003e\n\u003ch3 align=\"center\"\u003e\n   Mesh Ethereum\n\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\nThis repository contains a sample implementation of Mesh API for the Ethereum blockchain.\n\u003c/p\u003e\n\u003c!-- Badges --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://actions-badge.atrox.dev/coinbase/mesh-ethereum/goto?ref=master\"\u003e\u003cimg alt=\"Build Status\" src=\"https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fcoinbase%2Fmesh-ethereum%2Fbadge%3Fref%3Dmaster\u0026style=popout\" /\u003e\u003c/a\u003e\n  \u003c!-- \u003ca href=\"https://circleci.com/gh/coinbase/mesh-ethereum/tree/master\"\u003e\u003cimg src=\"https://circleci.com/gh/coinbase/mesh-ethereum/tree/master.svg?style=shield\" /\u003e\u003c/a\u003e --\u003e\n  \u003ca href=\"https://coveralls.io/github/coinbase/mesh-ethereum\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/coinbase/mesh-ethereum/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/coinbase/mesh-ethereum\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/coinbase/mesh-ethereum\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/coinbase/mesh-ethereum/blob/master/LICENSE.txt\"\u003e\u003cimg src=\"https://img.shields.io/github/license/coinbase/mesh-ethereum.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/coinbase/mesh-ethereum?tab=overview\"\u003e\u003cimg src=\"https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=shield\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- Mesh Tagline --\u003e\n\u003cp align=\"center\"\u003e\nBuild once.\nIntegrate your blockchain everywhere.\n\u003c/p\u003e\n\u003c!-- Release cycle information --\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003e\nMESH-ETHEREUM IS CONSIDERED \u003ca href=\"https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha\"\u003eALPHA SOFTWARE\u003c/a\u003e.\nUSE AT YOUR OWN RISK.\n\u003c/b\u003e\u003c/p\u003e\n\n\u003c!-- Short License Info --\u003e\n\u003cp align=\"center\"\u003eThis project is available open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).\u003c/p\u003e\n\n\u003c!-- Overview --\u003e\n## Overview\n\nThe `mesh-ethereum` repository provides an implementation sample of the Mesh API for Ethereum in Golang. We created this repository for developers of Ethereum-like (a.k.a., account-based) blockchains, who may find it easier to fork this implementation sample than write one from scratch.\n\n[Mesh](https://docs.cdp.coinbase.com/mesh/docs/welcome/) is an open-source specification and set of tools that makes integrating with blockchains simpler, faster, and more reliable. The Mesh API is specified in the [OpenAPI 3.0 format](https://www.openapis.org).\n\nYou can craft requests and responses with auto-generated code using [Swagger Codegen](https://swagger.io/tools/swagger-codegen) or [OpenAPI Generator](https://openapi-generator.tech). These requests and responses must be human-readable (easy to debug and understand), and able to be used in servers and browsers.\n\nJump to:\n\n* [How to Use This Repo](#How-to-Use-This-Repo)\n* [Docker Deployment](#Docker-Deployment)\n* [Testing](#Testing)\n* [Documentation](#Documentation)\n* [Related Projects](#Related-Projects)\n\u003c!-- h2 How to Use This Repo --\u003e\n## How to Use This Repo\n\n1. Fork the repo.\n2. Start playing with the code.\n3. [Deploy a node in Docker](#docker-deployment) to begin testing.\n\u003c!-- h3 System Requirements --\u003e\n### System Requirements\n\nRAM: 16 MB minimum\n\nWe tested `mesh-ethereum` on an [AWS c5.2xlarge instance](https://aws.amazon.com/ec2/instance-types/c5).\nThis instance type has 8 vCPU and 16 GB of RAM. If you use a computer with less than 16 GB of RAM, it is possible that `mesh-ethereum` will exit with an OOM error.\n\u003c!-- h3 Network Settings --\u003e\n### Network Settings\n\nTo increase the load `mesh-ethereum` can handle, we recommend these actions:\n\n1. Tune your OS settings to allow for more connections. On a linux-based OS, run the following commands to do so ([source](http://www.tweaked.io/guide/kernel)):\n\n```text\nsysctl -w net.ipv4.tcp_tw_reuse=1\nsysctl -w net.core.rmem_max=16777216\nsysctl -w net.core.wmem_max=16777216\nsysctl -w net.ipv4.tcp_max_syn_backlog=10000\nsysctl -w net.core.somaxconn=10000\nsysctl -p (when done)\n```\n_We have not tested `mesh-ethereum` with `net.ipv4.tcp_tw_recycle` and do not recommend enabling it._\n\n2. Modify your open file settings to `100000`. You can do this on a linux-based OS with the command: `ulimit -n 100000`.\n\n### Memory-Mapped Files\n`mesh-ethereum` uses [memory-mapped files](https://en.wikipedia.org/wiki/Memory-mapped_file) to persist data in the `indexer`. As a result, you **must** run `mesh-ethereum` on a 64-bit architecture (the virtual address space easily exceeds 100s of GBs).\n\nIf you receive a kernel OOM, you may need to increase the allocated size of swap space on your OS. There is a great tutorial for how to do this on Linux [here](https://linuxize.com/post/create-a-linux-swap-file/).\n\u003c!-- h2 Configuration --\u003e\n\u003c!-- ## Configuration --\u003e\n\u003c!-- h2 Features --\u003e\n## Features\n\n* Comprehensive tracking of all ETH balance changes\n* Stateless, offline, curve-based transaction construction (with address checksum validation)\n* Atomic balance lookups using go-ethereum's GraphQL Endpoint\n* Idempotent access to all transaction traces and receipts\n\u003c!-- h2 Development --\u003e\n## Development\n\nHelpful commands for development:\n\n### Install dependencies\n```\nmake deps\n```\n\n### Run Tests\n```\nmake test\n```\n\n### Lint the Source Code\n```\nmake lint\n```\n\n### Security Check\n```\nmake salus\n```\n\n### Build a Docker Image from the Local Context\n```\nmake build-local\n```\n\n### Generate a Coverage Report\n```\nmake coverage-local\n```\n\n\u003c!-- h2 Image Installation --\u003e\n### Image Installation\n\nRunning the following commands will create a Docker image called `mesh-ethereum:latest`.\n\n#### Installing from GitHub\n\nTo download the pre-built Docker image from the latest release, run:\n\n```text\ncurl -sSfL https://raw.githubusercontent.com/coinbase/mesh-ethereum/master/install.sh | sh -s\n```\n_Do not try to install mesh-ethereum using GitHub Packages!_\n\n#### Installing from Source\n\nAfter cloning this repository, run:\n\n```text\nmake build-local\n```\n\u003c!-- h3 Configuring the Environment Variables --\u003e\n### Configuring the Environment Variables\n\n#### Required Arguments\n\n**`MODE`**\n**Type:** `String`\n**Options:** `ONLINE`, `OFFLINE`\n**Default:** None\n\n`MODE` determines if Mesh can make outbound connections.\n\n**`NETWORK`**\n**Type:** `String`\n**Options:** `MAINNET`, `ROPSTEN`, `RINKEBY`, `GOERLI` or `TESTNET`\n**Default:** `ROPSTEN`, but only for backwards compatibility if you use `TESTNET`\n\n`NETWORK` is the Ethereum network to launch or communicate with.\n\n**`PORT`**\n**Type:** `Integer`\n**Options:** `8080`, any compatible port number\n**Default:** None\n\n`PORT` is the port to use for Mesh.\n\n#### Optional Arguments\n\n**`GETH`**\n**Type:** `String`\n**Options:** A node URL\n**Default:** None\n\n`GETH` points to a remote `geth` node instead of initializing one\n\n**`SKIP_GETH_ADMIN`**\n**Type:** `Boolean`\n**Options:** `TRUE`, `FALSE`\n**Default:** `FALSE`\n\n`SKIP_GETH_ADMIN` instructs Mesh to not use the `geth` `admin` RPC calls. This is typically disabled by hosted blockchain node services.\n\u003c!-- h3 Run Docker --\u003e\n### Run Docker\n\nRunning the commands below will start a Docker container in\n[detached mode](https://docs.docker.com/engine/reference/run/#detached--d), with\na data directory at `\u003cworking directory\u003e/ethereum-data` and the Mesh API accessible at port `8080`.\n\n#### Example Commands\n\nYou can run these commands from the command line. If you cloned the repository, you can use the `make` commands shown after the examples.\n\n**`Mainnet:Online`**\n\nUncloned repo:\n```text\ndocker run -d --rm --ulimit \"nofile=100000:100000\" -v \"$(pwd)/ethereum-data:/data\" -e \"MODE=ONLINE\" -e \"NETWORK=MAINNET\" -e \"PORT=8080\" -p 8080:8080 -p 30303:30303 mesh-ethereum:latest\n```\n\nCloned repo:\n```text\nmake run-mainnet-online\n```\n\n**`Mainnet:Online`** (Remote)\n\nUncloned repo:\n```text\ndocker run -d --rm --ulimit \"nofile=100000:100000\" -e \"MODE=ONLINE\" -e \"NETWORK=MAINNET\" -e \"PORT=8080\" -e \"GETH=\u003cNODE URL\u003e\" -p 8080:8080 -p 30303:30303 mesh-ethereum:latest\n```\n\nCloned repo:\n```text\nmake run-mainnet-remote geth=\u003cNODE URL\u003e\n```\n\n**`Mainnet:Offline`**\n\nUncloned repo:\n```text\ndocker run -d --rm -e \"MODE=OFFLINE\" -e \"NETWORK=MAINNET\" -e \"PORT=8081\" -p 8081:8081 mesh-ethereum:latest\n```\n\nCloned repo:\n```text\nmake run-mainnet-offline\n```\n\n**`Testnet:Online`**\n\nUncloned repo:\n```text\ndocker run -d --rm --ulimit \"nofile=100000:100000\" -v \"$(pwd)/ethereum-data:/data\" -e \"MODE=ONLINE\" -e \"NETWORK=TESTNET\" -e \"PORT=8080\" -p 8080:8080 -p 30303:30303 mesh-ethereum:latest\n```\n\nCloned repo:\n```text\nmake run-testnet-online\n// to send some funds into your testnet account you can use the following commands\ngeth attach http://127.0.0.1:8545\n\u003e eth.sendTransaction({from: eth.coinbase, to: \"0x9C639954BC9956598Df734994378A36f73cfba0C\", value: web3.toWei(50, \"ether\")})\n```\n\n**`Testnet:Online`** (Remote)\n\nUncloned repo:\n```text\ndocker run -d --rm --ulimit \"nofile=100000:100000\" -e \"MODE=ONLINE\" -e \"NETWORK=TESTNET\" -e \"PORT=8080\" -e \"GETH=\u003cNODE URL\u003e\" -p 8080:8080 -p 30303:30303 mesh-ethereum:latest\n```\n\nCloned repo:\n```text\nmake run-testnet-remote geth=\u003cNODE URL\u003e\n```\n\n**`Testnet:Offline`**\n\nUncloned repo:\n```text\ndocker run -d --rm -e \"MODE=OFFLINE\" -e \"NETWORK=TESTNET\" -e \"PORT=8081\" -p 8081:8081 mesh-ethereum:latest\n```\n\nCloned repo:\n```text\nmake run-testnet-offline\n```\n\u003c!-- h2 Testing --\u003e\n## Test the Implementation with mesh-cli\n\nTo validate `mesh-ethereum`, [install `mesh-cli`](https://github.com/coinbase/mesh-cli#install)\nand run one of the following commands:\n\n* `mesh-cli check:data --configuration-file mesh-cli-conf/testnet/config.json` - This command validates that the Data API implementation is correct using the ethereum `testnet` node. It also ensures that the implementation does not miss any balance-changing operations.\n* `mesh-cli check:construction --configuration-file mesh-cli-conf/testnet/config.json` - This command validates the Construction API implementation. It also verifies transaction construction, signing, and submissions to the `testnet` network.\n* `mesh-cli check:data --configuration-file mesh-cli-conf/mainnet/config.json` - This command validates that the Data API implementation is correct using the ethereum `mainnet` node. It also ensures that the implementation does not miss any balance-changing operations.\n\nRead the [How to Test your Mesh Implementation](https://docs.cdp.coinbase.com/mesh/docs/mesh-test/) documentation for additional details.\n\u003c!-- h2 Contributing --\u003e\n## Contributing\n\nYou may contribute to the `mesh-ethereum` project in various ways:\n\n* [Asking Questions](CONTRIBUTING.md/#asking-questions)\n* [Providing Feedback](CONTRIBUTING.md/#providing-feedback)\n* [Reporting Issues](CONTRIBUTING.md/#reporting-issues)\n\nRead our [Contributing](CONTRIBUTING.MD) documentation for more information.\n\nYou can also find community implementations for a variety of blockchains in the [mesh-ecosystem](https://github.com/coinbase/mesh-ecosystem) repository.\n\u003c!-- h2 Documentation --\u003e\n## Documentation\n\nYou can find the Mesh API documentation [here](https://docs.cdp.coinbase.com/mesh/docs/welcome/).\n\nCheck out the [Getting Started](https://docs.cdp.coinbase.com/mesh/docs/getting-started/) section to start diving into Mesh.\n\n\u003c!-- h2 Related Projects --\u003e\n## Related Projects\n\n* [mesh-geth-sdk](https://github.com/coinbase/mesh-geth-sdk) — This SDK helps accelerate Mesh API implementation on go-ethereum based chains.\n* [mesh-sdk-go](https://github.com/coinbase/mesh-sdk-go) — The `mesh-sdk-go` SDK provides a collection of packages used for interaction with the Mesh API specification.\n* [mesh-specifications](https://github.com/coinbase/mesh-specifications) — Much of the SDKs’ code is generated from this repository.\n* [mesh-cli](https://github.com/coinbase/mesh-ecosystem) — Use the `mesh-cli` tool to test your Mesh API implementation. The tool also provides the ability to look up block contents and account balances.\n\u003c!-- h3 Other Implementation Samples --\u003e\n### Other Implementation Samples\n\nYou can find community implementations for a variety of blockchains in the [mesh-ecosystem](https://github.com/coinbase/mesh-ecosystem) repository.\n\n\u003c!-- h2 License and Copyright --\u003e\n## License\n\nThis project is available open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).\n\n© 2022 Coinbase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fmesh-ethereum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinbase%2Fmesh-ethereum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fmesh-ethereum/lists"}