{"id":20060634,"url":"https://github.com/oasisprotocol/oasis-web3-gateway","last_synced_at":"2026-01-12T02:58:46.294Z","repository":{"id":36965722,"uuid":"409403451","full_name":"oasisprotocol/oasis-web3-gateway","owner":"oasisprotocol","description":"Web3 Gateway for the Oasis SDK EVM ParaTime module.","archived":false,"fork":false,"pushed_at":"2025-04-30T17:16:53.000Z","size":20699,"stargazers_count":28,"open_issues_count":30,"forks_count":16,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-30T17:48:09.097Z","etag":null,"topics":["blockchain","ethereum","evm","gateway","go","oasis","official","paratime","postgresql","web3"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oasisprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-23T01:06:34.000Z","updated_at":"2025-04-30T17:15:33.000Z","dependencies_parsed_at":"2024-02-12T09:30:51.454Z","dependency_job_id":"9211ebbe-7a95-43e7-9e6d-269301a459b4","html_url":"https://github.com/oasisprotocol/oasis-web3-gateway","commit_stats":null,"previous_names":["oasisprotocol/emerald-web3-gateway","oasisprotocol/oasis-evm-web3-gateway"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Foasis-web3-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Foasis-web3-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Foasis-web3-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Foasis-web3-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oasisprotocol","download_url":"https://codeload.github.com/oasisprotocol/oasis-web3-gateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252524293,"owners_count":21762070,"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":["blockchain","ethereum","evm","gateway","go","oasis","official","paratime","postgresql","web3"],"created_at":"2024-11-13T13:16:05.815Z","updated_at":"2026-01-12T02:58:46.283Z","avatar_url":"https://github.com/oasisprotocol.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oasis-web3-gateway\n\n[![ci-lint](https://github.com/oasisprotocol/oasis-web3-gateway/actions/workflows/ci-lint.yml/badge.svg)](https://github.com/oasisprotocol/oasis-web3-gateway/actions/workflows/ci-lint.yml)\n[![ci-test](https://github.com/oasisprotocol/oasis-web3-gateway/actions/workflows/ci-test.yaml/badge.svg)](https://github.com/oasisprotocol/oasis-web3-gateway/actions/workflows/ci-test.yaml)\n[![codecov](https://codecov.io/gh/oasisprotocol/oasis-web3-gateway/branch/main/graph/badge.svg?token=WMx1Bg91Hm)](https://codecov.io/gh/oasisprotocol/oasis-web3-gateway)\n\n\nWeb3 Gateway for Oasis-SDK Paratime EVM module.\n\n## Building and Testing\n\n### Prerequisites\n\n- [Go](https://go.dev/) (at least version 1.25).\n- [PostgreSQL](https://www.postgresql.org/) (at least version 13.3).\n\nAdditionally, for testing:\n- [Oasis Core](https://github.com/oasisprotocol/oasis-core) at least version 24.0.x.\n- [Emerald Paratime](https://github.com/oasisprotocol/emerald-paratime) at least version 11.x.x.\n- (or) [Sapphire Paratime](https://github.com/oasisprotocol/sapphire-paratime) at least version 0.7.3.\n\n### Build\n\nTo build the binary run:\n\n```bash\nmake build\n```\n\n### Testing on Localnet\n\nThe Docker containers can be used to test changes to the gateway or run tests by\nbind-mounting the runtime state directory (`/serverdir/node`) into your local\nfilesystem.\n\n```bash\ndocker run --rm -ti -p5432:5432 -p8544-8548:8544-8548 -v /tmp/eth-runtime-test:/serverdir/node ghcr.io/oasisprotocol/sapphire-localnet:local\n```\n\nIf needed, the `oasis-web3-gateway` or `sapphire-paratime` executables could also be\nbind-mounted into the container, allowing for quick turnaround time when testing\nthe full gateway \u0026 paratime stack together.\n\n### Running tests\n\nFor running tests, start the docker network without the gateway, by setting the `OASIS_DOCKER_NO_GATEWAY=yes` environment variable:\n\n```bash\ndocker run --rm -ti -e OASIS_DOCKER_NO_GATEWAY=yes -p5432:5432 -p8544-8548:8544-8548 -v /tmp/eth-runtime-test:/serverdir/node ghcr.io/oasisprotocol/sapphire-localnet:local\n```\n\nOnce bootstrapped, run the tests:\n\n```bash\nmake test\n```\n\n[oasis-core]: https://github.com/oasisprotocol/oasis-core\n\n## Localnet Docker images\n\nYou can also build `emerald-dev` and `sapphire-dev` docker images with a\ncomplete confidential and non-confidential Localnet Oasis stack respectively\nfor development, CI and testing.\n\n```bash\nmake docker\n```\n\nCheck out [docker folder] for more information.\n\n[docker folder]: docker/README.md\n\n## Running the Gateway on Testnet/Mainnet\n\nThe gateway connects to an Emerald/Sapphire enabled [Oasis ParaTime Client Node].\n\nIn addition to the general instructions for setting up an Oasis ParaTime Client\nNode update the node configuration (e.g. `config.yml`) as follows:\n\n```yaml\n# ... sections not relevant are omitted ...\nruntime:\n  mode: client\n  paths:\n    - \u003corc_bundle_path\u003e\n\n  config:\n    \"\u003cparatime_id\u003e\":\n      # The following allows the gateway to perform gas estimation of smart\n      # contract calls (not allowed by default).\n      estimate_gas_by_simulating_contracts: true\n      # The following allows some more resource-intensive queries to be called\n      # by the gateway (not allowed by default).\n      allowed_queries:\n        - all_expensive: true\n```\n\nSet up the config file (e.g. `gateway.yml`) appropriately:\n\n```yaml\nruntime_id: \u003cparatime_id\u003e\nnode_address: \"unix:\u003cpath-to-oasis-node-unix-socket\u003e\"\nenable_pruning: false\npruning_step: 100000\nindexing_start: 0\n\nlog:\n  level: debug\n  format: json\n\ndatabase:\n  host: \u003cpostgresql_host\u003e\n  port: \u003cpostgresql_port\u003e\n  db: \u003cpostgresql_db\u003e\n  user: \u003cpostgresql_user\u003e\n  password: \u003cpostgresql_password\u003e\n  dial_timeout: 5\n  read_timeout: 10\n  write_timeout: 5\n  max_open_conns: 0\n\ngateway:\n  chain_id: \u003cchain_id\u003e\n  http:\n    host: \u003cgateway_listen_interface\u003e\n    port: \u003cgateway_listen_port\u003e\n    cors: [\"*\"]\n  ws:\n    host: \u003cgateway_listen_interface\u003e\n    port: \u003cgateway_listen_websocket_port\u003e\n    origins: [\"*\"]\n  method_limits:\n    get_logs_max_rounds: 100\n  oasis_rpcs: true # Enable Oasis-specific requests for confidentiality etc.\n```\n\nNote: all configuration settings can also be set via environment variables. For example to set the database password use:\n\n```bash\nDATABASE__PASSWORD: \u003cpostgresql_password\u003e\n```\n\nenvironment variable.\n\nStart the gateway by running the `oasis-web3-gateway` binary:\n\n```bash\noasis-web3-gateway --config gateway.yml\n```\n\n[Oasis ParaTime Client Node]: https://docs.oasis.io/node/run-your-node/paratime-client-node\n\n### Wipe state to force a complete reindex\n\nTo wipe the DB state and force a reindexing use the `truncate-db` subcommand:\n\n```bash\noasis-web3-gateway truncate-db --config gateway.yml --unsafe\n```\n\n**Warning: this will wipe all existing state in the Postgres DB and can\nlead to extended downtime while the Web3 Gateway is reindexing the blocks.**\n\n## Contributing\n\nSee our [Contributing Guidelines](CONTRIBUTING.md).\n\n### Versioning\n\nSee our [Versioning] document.\n\n[Versioning]: docs/versioning.md\n\n### Release Process\n\nSee our [Release Process] document.\n\n[Release Process]: docs/release-process.md\n\n## Credits\n\nParts of the code heavily based on [go-ethereum](https://github.com/ethereum/go-ethereum).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Foasis-web3-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foasisprotocol%2Foasis-web3-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Foasis-web3-gateway/lists"}