{"id":13614596,"url":"https://github.com/coinbase/mesh-sdk-go","last_synced_at":"2025-05-16T05:05:05.351Z","repository":{"id":37568631,"uuid":"251698700","full_name":"coinbase/mesh-sdk-go","owner":"coinbase","description":"Mesh Client Go SDK","archived":false,"fork":false,"pushed_at":"2024-11-27T22:53:24.000Z","size":7674,"stargazers_count":197,"open_issues_count":31,"forks_count":136,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-04-08T15:06:48.361Z","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-03-31T18:40:37.000Z","updated_at":"2025-03-18T21:49:02.000Z","dependencies_parsed_at":"2024-01-17T00:19:06.109Z","dependency_job_id":"ef2f1e38-666b-4929-8ea8-bf888ef650cf","html_url":"https://github.com/coinbase/mesh-sdk-go","commit_stats":{"total_commits":1368,"total_committers":40,"mean_commits":34.2,"dds":"0.20687134502923976","last_synced_commit":"06d0fe98bcea6f5455e82e26154b34dfd269b534"},"previous_names":["coinbase/mesh-sdk-go","coinbase/rosetta-sdk-go"],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmesh-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coinbase","download_url":"https://codeload.github.com/coinbase/mesh-sdk-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"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-08-01T20:01:03.622Z","updated_at":"2025-05-16T05:05:05.319Z","avatar_url":"https://github.com/coinbase.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003c!-- Repository Title and Description --\u003e\n\u003ch3 align=\"center\"\u003e\n   Mesh SDK\n\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\nGo SDK to create and interact with Mesh API implementations\n\u003c/p\u003e\n\u003c!-- Badges --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://circleci.com/gh/coinbase/mesh-sdk-go/tree/master\"\u003e\u003cimg src=\"https://circleci.com/gh/coinbase/mesh-sdk-go/tree/master.svg?style=shield\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/coinbase/mesh-sdk-go\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/coinbase/mesh-sdk-go/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/coinbase/mesh-sdk-go\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/coinbase/mesh-sdk-go\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/coinbase/mesh-sdk-go/blob/master/LICENSE.txt\"\u003e\u003cimg src=\"https://img.shields.io/github/license/coinbase/mesh-sdk-go.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/coinbase/mesh-sdk-go?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\n\u003c!-- h2 Overview --\u003e\n## Overview\n\nThe `mesh-sdk-go` provides a collection of packages used for interaction with the Mesh API specification. Much of the code in this repository is generated from the [mesh-specifications](https://github.com/coinbase/mesh-specifications) repository.\n\nJump to:\n\n* [Getting Started](#Getting-Started)\n* [Quick Examples](#Quick-Examples)\n* [Testing](#Testing)\n* [Documentation](#Documentation)\n* [Related Projects](#Related-Projects)\n\nIf you have a blockchain based on go-ethereum, we recommend that you use our [mesh-geth-sdk](https://github.com/coinbase/mesh-geth-sdk) SDK.\n \n\u003c!-- h2 Getting Started Heading --\u003e\n## Getting Started\n\n This Golang project provides a [server package](https://github.com/coinbase/mesh-sdk-go/tree/master/server) that empowers a developer to write a full Mesh Data API server by only implementing an interface. This package automatically validates client requests and calls the functions you implement with pre-parsed requests (instead of in raw JSON).\n\n If you plan to use a language other than Golang, you will need to either codegen a server (using [Swagger Codegen](https://swagger.io/tools/swagger-codegen) or [OpenAPI Generator](https://openapi-generator.tech/)) or write one from scratch. If you choose to write an implementation in another language, we ask that you create a separate repository in an SDK-like format for all the code you generate so that other developers can use it.\n\n\u003c!-- h3 Installation Guide --\u003e\n### Installation Guide\n\nThis command installs the Server package.\n```shell\ngo get github.com/coinbase/mesh-sdk-go/server\n```\n\u003c!-- h3 Additional Sections (Components) --\u003e\n### Components\n#### Router\nThe router is a [Mux](https://github.com/gorilla/mux) router that routes traffic to the correct controller.\n\n#### Controller\nControllers are automatically generated code that specify an interface that a service must implement.\n\n#### Services\nServices are implemented by you to populate responses. These services are invoked by controllers.\n\n### Recommended Folder Structure\n```\nmain.go\n/services\n  block_service.go\n  network_service.go\n  ...\n```\n\n\u003c!-- h2 Quick Examples --\u003e\n## Quick Examples\n\u003c!-- h3 Complete SDK Example --\u003e\n### Complete SDK Example\n\nThis is an [example](https://github.com/coinbase/mesh-sdk-go/tree/master/examples/server) of how to write an implementation using the Server package in mesh-sdk-go.\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/coinbase/mesh-sdk-go/asserter\"\n\t\"github.com/coinbase/mesh-sdk-go/examples/server/services\"\n\t\"github.com/coinbase/mesh-sdk-go/server\"\n\t\"github.com/coinbase/mesh-sdk-go/types\"\n)\n\nconst (\n\tserverPort = 8080\n)\n\n// NewBlockchainRouter creates a Mux http.Handler from a collection\n// of server controllers.\nfunc NewBlockchainRouter(\n\tnetwork *types.NetworkIdentifier,\n\tasserter *asserter.Asserter,\n) http.Handler {\n\tnetworkAPIService := services.NewNetworkAPIService(network)\n\tnetworkAPIController := server.NewNetworkAPIController(\n\t\tnetworkAPIService,\n\t\tasserter,\n\t)\n\n\tblockAPIService := services.NewBlockAPIService(network)\n\tblockAPIController := server.NewBlockAPIController(\n\t\tblockAPIService,\n\t\tasserter,\n\t)\n\n\treturn server.NewRouter(networkAPIController, blockAPIController)\n}\n\nfunc main() {\n\tnetwork := \u0026types.NetworkIdentifier{\n\t\tBlockchain: \"Mesh\",\n\t\tNetwork:    \"Testnet\",\n\t}\n\n\t// The asserter automatically rejects incorrectly formatted\n\t// requests.\n\tasserter, err := asserter.NewServer(\n\t\t[]string{\"Transfer\", \"Reward\"},\n\t\tfalse,\n\t\t[]*types.NetworkIdentifier{network},\n\t\tnil,\n\t\tfalse,\n\t\t\"\",\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Create the main router handler then apply the logger and Cors\n\t// middlewares in sequence.\n\trouter := NewBlockchainRouter(network, asserter)\n\tloggedRouter := server.LoggerMiddleware(router)\n\tcorsRouter := server.CorsMiddleware(loggedRouter)\n\tlog.Printf(\"Listening on port %d\\n\", serverPort)\n\tlog.Fatal(http.ListenAndServe(fmt.Sprintf(\":%d\", serverPort), corsRouter))\n}\n```\n\n\u003c!-- h2 SDK Packages --\u003e\n## SDK Packages\n\n* [Types](types): Auto-generated Mesh types\n* [Client](client): Low-level communication with any Mesh server\n* [Server](server): Simplified Mesh API server development\n* [Asserter](asserter): Validation of Mesh types\n* [Fetcher](fetcher): Simplified and validated communication with any Mesh server\n* [Parser](parser): Tool for parsing Mesh blocks\n* [Syncer](syncer): Sync Mesh blocks with customizable handling\n* [Reconciler](reconciler): Compare derived balances with node balances\n* [Keys](keys): Cryptographic operations for Mesh-supported curves\n* [Constructor](constructor): Coordinate the construction and broadcast of transactions\n\nThese packages are demoed extensively in [examples](examples) and are utilized throughout the [mesh-cli](https://github.com/coinbase/mesh-cli) tool.\n\n### Syncer\n\nThe core of any integration is syncing blocks reliably. The [syncer](https://github.com/coinbase/mesh-sdk-go/tree/master/syncer) serially processes blocks from a Data API implementation (automatically handling re-orgs) with user-defined handling logic and pluggable storage. After a block is processed, store it to a DB or send a push notification—the decision is up to you!\n\n### Parser\n\nWhen reading the operations in a block, it's helpful to apply higher-level groupings to related operations, or match operations in a transaction to some set of generic descriptions (i.e., ensure there are two operations of equal but opposite amounts). The [parser](https://github.com/coinbase/mesh-sdk-go/tree/master/parser) empowers any integrator to build abstractions on top of the building blocks that the Mesh API exposes.\n\n\u003c!-- h3 Configuring the SDK --\u003e\n\u003c!-- See the [Configuration](https://github.com/coinbase/mesh-geth-sdk/blob/master/configuration/configuration.go) file for more information on how to configure the SDK. --\u003e\n\n\u003c!-- h2 Development --\u003e\n## Development\n\nHelpful commands for development:\n\u003c!-- Use the command action as the h3 header --\u003e\n### Install Dependencies\n```\nmake deps\n```\n\n### Generate Types, Client and Server\n```\nmake gen\n```\nIf you want to modify client and server, please modify files under `templates/client` and `templates/server` then run `make gen`\n\n### Run Tests\n```\nmake test\n```\n\n### Lint the Source Code\nThis includes the generated code.\n```\nmake lint\n```\n\n### Code Check\n```\nmake release\n```\n\n\u003c!-- h2 Testing Guide --\u003e\n## Testing\n\nTo validate `mesh-sdk-go`, [install `mesh-cli`](https://github.com/coinbase/mesh-cli#install) and 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 bitcoin `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 bitcoin `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\n\u003c!-- h2 Contributing Guide --\u003e\n## Contributing\n\nYou may contribute to the `mesh-sdk-go` 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\n\u003c!-- h2 Documentation links --\u003e\n## Documentation\n\nYou can find the Mesh API documentation [here](https://docs.cdp.coinbase.com/mesh/docs/api-reference/).\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-specifications](https://github.com/coinbase/mesh-specifications) — The `mesh-specifications` repository generates the SDK code in the `mesh-sdk-go` repository.\n* [mesh-cli](https://github.com/coinbase/mesh-cli) — 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* [mesh-geth-sdk](https://github.com/coinbase/mesh-geth-sdk) – The `mesh-geth-sdk` repository provides a collection of packages used for interaction with the Mesh API specification. The goal of this SDK is to help accelerate Mesh API implementation on go-ethereum based chains.\n\u003c!-- h3 Sample Implementations --\u003e\n### Sample Implementations\n\nTo help you with examples, we developed complete Mesh API sample implementations for [Bitcoin](https://github.com/coinbase/mesh-bitcoin) and [Ethereum](https://github.com/coinbase/mesh-ethereum). Developers of Bitcoin-like or Ethereum-like blockchains may find it easier to fork these implementation samples than to write an implementation from scratch.\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 License --\u003e\n## License\nThis project is available open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).\n\u003c!-- Copyright {© year Coinbase} --\u003e\n© 2022 Coinbase","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fmesh-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinbase%2Fmesh-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fmesh-sdk-go/lists"}