{"id":15697201,"url":"https://github.com/noot/go-relayer","last_synced_at":"2026-01-11T22:07:05.251Z","repository":{"id":61625423,"uuid":"532124030","full_name":"noot/go-relayer","owner":"noot","description":"EIP2771-compatible ethereum transaction relayer ","archived":false,"fork":false,"pushed_at":"2023-04-26T17:48:09.000Z","size":206,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-14T04:32:58.654Z","etag":null,"topics":["eip2771","ethereum","metatransactions","relayer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-09-03T01:26:21.000Z","updated_at":"2024-11-09T04:01:16.000Z","dependencies_parsed_at":"2023-07-19T02:00:43.527Z","dependency_job_id":null,"html_url":"https://github.com/noot/go-relayer","commit_stats":null,"previous_names":["athanorlabs/go-relayer"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/noot/go-relayer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noot%2Fgo-relayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noot%2Fgo-relayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noot%2Fgo-relayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noot%2Fgo-relayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noot","download_url":"https://codeload.github.com/noot/go-relayer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noot%2Fgo-relayer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28325020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["eip2771","ethereum","metatransactions","relayer"],"created_at":"2024-10-03T19:13:52.109Z","updated_at":"2026-01-11T22:07:05.224Z","avatar_url":"https://github.com/noot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-relayer\n\n[EIP2771-compatible](https://eips.ethereum.org/EIPS/eip-2771) transaction relayer library for Ethereum. The core of the library is bindings to a compatible forwarder contract. \n\nComponents:\n- `cmd/relayer`: example CLI that uses impls/minimal_forwarder\n- `impls`: example implementations of forwarder and recipient contracts, as well as Go\n  bindings, required interface implementations, and unit tests\n\t- `impls/gsn_forwarder`: an implementation using OpenGSN's [forwarder contract](https://github.com/opengsn/gsn/tree/master/packages/contracts/src/forwarder).\n\t- `impls/minimal_forwarder`: an implementation using OpenZeppelin's [minimal forwarder](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/metatx/MinimalForwarder.sol).\n- `examples/mock_recipient`: an implementation of a EIP2771-compatible recipient contract\n  which can receive calls from a forwarder.\n- `relayer`: functionality to call forwarder contracts\n- `rpc`: rpc server for an end-user to submit txs to, accepts a `*relayer.Relayer`\n\n## Requirements\n\n- go 1.20+\n- abigen: can install using `./scripts/install-abigen.sh`\n\n## Usage\n\n### As an application\n\nSee `cmd/relayer/main.go` for an example app using the `impls/gsnforwarder` package.\n\nThe app can be built using `make build`.\n\nFirst, install and run ganache using:\n```\nganache --deterministic --accounts=50\n```\n\nCreate a key file using a deterministic ganache key\n```bash\necho \"4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d\" \u003e eth.key\n```\n\nTo run and automatically deploy the relayer contract to the ganache network, you can use:\n```bash\n$ ./bin/relayer --deploy\n2022-09-24T07:43:32.499-0400\tINFO\tmain\tcmd/main.go:131\tstarting relayer with ethereum endpoint http://localhost:8545 and chain ID 1337\n2022-09-24T07:43:32.541-0400\tINFO\tmain\tcmd/main.go:207\tdeployed Forwarder.sol to 0xCfEB869F69431e42cdB54A4F4f105C19C080A601\n2022-09-24T07:43:32.542-0400\tINFO\trpc\trpc/server.go:62\tstarting RPC server on http://localhost:7799\n```\n\nBy default, the relayer server runs on port `7799`.\n\n### Implementing a custom forwarder\n\nSee the forwarder examples in `impls/` for a full implementation.\n\nThere are three main components needed:\n- Go bindings to the forwarder contract (generated by abigen)\n- implementing the `Forwarder` interface below (by the forwarder contract)\n- implementing the `ForwardRequest` interface below (by the request type contained in the contract)\n\n```go\n// Forwarder must be implemented by a forwarder contract used by a *relayer.Relayer.\n// These methods are wrappers around the methods auto-generated by abigen.\n//\n// See `impls/gsn_forwarder/i_forwarder_wrapped.go` or \n// `impls/minimal_forwarder/i_minimal_forwarder_wrapped.go`for examples.\ntype Forwarder interface {\n\tGetNonce(opts *bind.CallOpts, from ethcommon.Address) (*big.Int, error)\n\n\tVerify(\n\t\topts *bind.CallOpts,\n\t\treq ForwardRequest,\n\t\tdomainSeparator,\n\t\trequestTypeHash [32]byte,\n\t\tsuffixData,\n\t\tsignature []byte,\n\t) (bool, error)\n\n\tExecute(\n\t\topts *bind.TransactOpts,\n\t\treq ForwardRequest,\n\t\tdomainSeparator,\n\t\trequestTypeHash [32]byte,\n\t\tsuffixData,\n\t\tsignature []byte,\n\t) (*types.Transaction, error)\n}\n\n// ForwardRequest must be implemented by a request type used by a forwarder contract.\n//\n// See `impls/gsn_forwarder/request.go` or `impls/minimal_forwarder/request.go`\n// for examples.\ntype ForwardRequest interface {\n\t// FromSubmitTransactionRequest set the type underlying the ForwardRequest\n\t// using a *SubmitTransactionRequest.\n\t//\n\t// Note: not all fields in the *SubmitTransactionRequest need be used depending\n\t// on the implementation.\n\tFromSubmitTransactionRequest(*SubmitTransactionRequest)\n\n\t// Pack uses ABI encoding to pack the underlying ForwardRequest, appending\n\t// optional `suffixData` to the end.\n\t//\n\t// See examples/gsn_forwarder/IForwarderForwardRequest.Pack() or\n\t// examples/minimal_forwarder/IMinimalForwarderForwardRequest.Pack()\n\t// for details.\n\tPack(suffixData []byte) ([]byte, error)\n}\n```\n\nAdditionally, to create a new `*relayer.Relayer`, you need to implement a function that returns your `ForwardRequest`. For example:\n\n```go\nfunc NewIForwarderForwardRequest() common.ForwardRequest {\n\treturn \u0026IForwarderForwardRequest{}\n}\n\ncfg := \u0026relayer.Config{\n\t// fields omitted\n\tNewForwardRequestFunc: NewIForwarderForwardRequest,\n}\n\n_, _ = relayer.NewRelayer(cfg)\n```\n\n## Interacting with the relayer\n\nWhen running a relayer with an RPC server, it accepts transactions submission requests, returning a transaction hash if the transaction is successfully submitted:\n\n```go\nfunc (s *RelayerService) SubmitTransaction(\n\t_ *http.Request,\n\treq *common.SubmitTransactionRequest,\n\tresp *common.SubmitTransactionResponse,\n) error \n```\n\nSee [go-relayer-client](https://github.com/AthanorLabs/go-relayer-client) for client library and example usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoot%2Fgo-relayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoot%2Fgo-relayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoot%2Fgo-relayer/lists"}