{"id":20841225,"url":"https://github.com/iotexproject/iotex-transaction-service","last_synced_at":"2026-04-22T11:08:09.641Z","repository":{"id":207244449,"uuid":"596938546","full_name":"iotexproject/iotex-transaction-service","owner":"iotexproject","description":"Keeps track of transactions sent via Gnosis Safe contacts and confirmed transactions. It also keeps track of Ether and ERC20 token transfers to Safe contracts.","archived":false,"fork":false,"pushed_at":"2024-08-30T11:57:01.000Z","size":3807,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-27T21:57:24.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iotexproject.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-03T09:05:36.000Z","updated_at":"2024-08-29T12:19:05.000Z","dependencies_parsed_at":"2024-08-28T14:46:18.107Z","dependency_job_id":null,"html_url":"https://github.com/iotexproject/iotex-transaction-service","commit_stats":null,"previous_names":["protofire/iotex-transaction-service","iotexproject/iotex-transaction-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iotexproject/iotex-transaction-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-transaction-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-transaction-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-transaction-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-transaction-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iotexproject","download_url":"https://codeload.github.com/iotexproject/iotex-transaction-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-transaction-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32132996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"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":[],"created_at":"2024-11-18T01:19:20.026Z","updated_at":"2026-04-22T11:08:04.628Z","avatar_url":"https://github.com/iotexproject.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://github.com/safe-global/safe-transaction-service/workflows/Python%20CI/badge.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/safe-global/safe-transaction-service/badge.svg?branch=master)](https://coveralls.io/github/safe-global/safe-transaction-service?branch=master)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n![Python 3.10](https://img.shields.io/badge/Python-3.10-blue.svg)\n![Django 4](https://img.shields.io/badge/Django-4-blue.svg)\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/safeglobal/safe-transaction-service?label=Docker\u0026sort=semver)](https://hub.docker.com/r/safeglobal/safe-transaction-service)\n\n# Safe Transaction Service\nKeeps track of transactions sent via Safe contracts. It uses events and\n[tracing](https://openethereum.github.io/JSONRPC-trace-module) to index the txs.\n\nTransactions are detected in an automatic way, so there is no need of informing the service about the transactions\nas in previous versions of the *Transaction Service*.\n\nTransactions can also be sent to the service to allow offchain collecting of signatures or informing the owners about\na transaction that is pending to be sent to the blockchain.\n\n[Swagger (Mainnet version)](https://safe-transaction-mainnet.safe.global/)\n[Swagger (Göerli version)](https://safe-transaction-goerli.safe.global/)\n\n## Index of contents\n\n- [Docs](https://docs.gnosis-safe.io/backend/service-architecture)\n- [Deploying the service](https://github.com/safe-global/safe-infrastructure)\n\n## Setup for development\nUse a virtualenv if possible:\n\n```bash\npython -m venv venv\n```\n\nThen enter the virtualenv and install the dependencies:\n\n```bash\nsource venv/bin/activate\npip install -r requirements-dev.txt\npre-commit install -f\ncp .env.dev .env\n./run_tests.sh\n```\n\n## Setup for development using docker\n```bash\ndocker-compose -f docker-compose.yml -f docker-compose.dev.yml up\n```\n\n## Setup for production (event indexing)\nSince **version 3.0.0** transaction service can be configured to rely on **event indexing**\nwhen [SafeL2 version](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafeL2.sol) is used. **Only\ncontracts from v1.3.0 onwards with L2 events will be indexed.**\n\nAn example environment file can be used for the L2 setup:\n```bash\ncp .env.l2.sample .env\n```\n\nEdit `.env` file to add `ETHEREUM_NODE_URL` (on the example a `Polygon` public node is used)\nand remember to modify `DJANGO_SECRET_KEY` to **use a strong key**. The rest of the\nconfiguration does not need to be modified. Then:\n\n```bash\ndocker-compose build --force-rm\ndocker-compose up\n```\n\nFor more parameters check [base.py](config/settings/base.py) file.\n\n### Setup for a custom network\n\n- If the network is not supported yet [contracts can be deployed using the deployment instructions\n](https://github.com/safe-global/safe-contracts/tree/v1.3.0/contracts)\nand then a PR should be provided [adding the deployment block number and the address](https://github.com/safe-global/safe-eth-py/blob/master/gnosis/safe/addresses.py) (address will be the same for every network).\n- Only `ProxyFactory` and `GnosisSafeL2` must be configured. `+L2` must be added to the `Safe L2` contract versions, so the service knows the contract can be indexed using events. For us to accept the PR network must be on https://github.com/ethereum-lists/chains .\n- You can always set this up later using the **admin panel** if your network is not supported, going to the **Master Copies** and **Proxy Factories**.\n- **We recommend** using event indexing for every network where transaction fees are not relevant, so a tracing node is not required and everything can be indexed using events with the `Safe L2` version.\n\n\n## Setup for production (tracing mode)\nThis is the recommended configuration for running a production Transaction service. `docker-compose` is required\nfor running the project.\n\n``bash\ncp .env.tracing.sample .env\n``\n\nConfigure the parameters needed on `.env`. These parameters **need to be changed**:\n- `DJANGO_SECRET_KEY`: Use a **strong key**.\n- `ETHEREUM_NODE_URL`: Http/s address of a ethereum node. It can be the same than `ETHEREUM_TRACING_NODE_URL`.\n- `ETHEREUM_TRACING_NODE_URL`: Http/s address of an OpenEthereum node with\n[tracing enabled](https://openethereum.github.io/JSONRPC-trace-module).\n\nIf you don't want to use `trace_filter` for the internal tx indexing and just rely on `trace_block`, set:\n- `ETH_INTERNAL_NO_FILTER=1`\n\nFor more parameters check [base.py](config/settings/base.py) file.\n\nThen:\n```bash\ndocker-compose build --force-rm\ndocker-compose up\n```\n\nThe service should be running in `localhost:8000`. You can test everything is set up:\n\n```bash\ncurl 'http://localhost:8000/api/v1/about/'\n```\n\nYou can go to http://localhost:5555/ to check the status of the task queue, also you can configure\n[prometheus metrics](https://flower.readthedocs.io/en/latest/prometheus-integration.html).\n\nFor example, to set up a Göerli node:\n\nRun an OpenEthereum node in your local computer:\n```bash\nopenethereum --chain goerli --tracing on --db-path=/media/ethereum/openethereum --unsafe-expose\n```\n\nEdit `.env` so docker points to the host OpenEthereum node:\n```\nETHEREUM_NODE_URL=http://172.17.0.1:8545\nETHEREUM_TRACING_NODE_URL=http://172.17.0.1:8545\n```\n\nThen:\n```bash\ndocker-compose build --force-rm\ndocker-compose up\n```\n\n## Use admin interface\nServices come with a basic administration web ui (provided by Django) by default on http://localhost:8000/admin/\n\nA user must be created to get access:\n```bash\ndocker exec -it safe-transaction-service-web-1 python manage.py createsuperuser\n```\n\n## Safe Contract ABIs and addresses\n- [v1.3.0](https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.3.0/gnosis_safe.json)\n- [v1.3.0 L2](https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.3.0/gnosis_safe_l2.json)\n- [Other related contracts and previous Safe versions](https://github.com/safe-global/safe-deployments/blob/main/src/assets)\n\n## Service maintenance\n\nService can run into some issues when running in production:\n\n### Indexing issues\nYou can tell there are indexing issues if:\n- Executed transactions are missing from the API (`all-transactions`, `multisig-transactions`, `module-transactions`... endpoints). If you use the [Safe{Wallet} Web client](https://github.com/safe-global/safe-wallet-web) you should check what is the current state of the Safe Client Gateway cache as it might have outdated data.\n- Asset transfers (ERC20/721) are missing from `all-transactions` or `transfers` endpoints.\n- You see error logs such as \"Cannot remove owner\" or similar inconsistent errors when `worker-indexer` is processing decoded data.\n\nThere are multiple options for this. Connect to either `web` or `worker` instances. Running commands inside of `tmux` is recommended\n(installed by default):\n- `python manage.py check_index_problems`: it will try to automatically fix missing transactions.\nTokens related transactions (ERC20/721) will not be fixed with this method. This method will take a while, as it needs to compare\ndatabase data with blockchain data for every Safe.\n- `python manage.py reindex_master_copies --from-block-number X --addresses 0x111 0x222`: if you know the first problematic block,\nit's faster if you trigger a manual reindex. `--addresses` argument is optional, but if you know the problematic Safes providing\nthem will make reindexing **way** faster, as only those Safes will be reindexed (instead of the entire collection).\n\nIf you see ERC20/ERC721 transfers missing:\n- `python manage.py reindex_erc20 --from-block-number X --addresses 0x111 0x222`: same logic as with `reindex_master_copies`.\n\n## FAQ\n### Why `/v1/safes/{address}` endpoint shows a nonce that indicates that a transaction was executed but the transaction is not shown or marked as executed in the other endpoints?\n`/v1/safes/{address}` endpoint uses `eth_call` from the RPC to get the current information for a Safe, so there's\nno delay and as soon as a transaction is executed it will be updated. The other endpoints rely on polling, indexing\ndecoding and processing of traces/events and take longer (shouldn't be more than half a minute).\n\n### How do you handle reorgs?\nWhen indexed every block is marked as `not confirmed` unless it has some depth (configured via `ETH_REORG_BLOCKS` environment variable).\n`Not confirmed` blocks are checked periodically to check if the blockchain `blockHash` for that `number`\nchanged before it reaches the desired number of `confirmations`, if that's the case, all blocks from that block and the transactions related\nare deleted and indexing is restarted to the last `confirmed` block.\n\n### If I add my chain to [safe-eth-py](https://github.com/safe-global/safe-eth-py/blob/master/gnosis/safe/addresses.py) will you support it?\nNo, for a chain to be supported we need to set up a dedicated infra for that network\nand [have a proper RPC](https://docs.safe.global/learn/infrastructure/rpc-requirements)\n\n### How can I interact with service?\nAside from using standard HTTP requests:\n- [Safe API Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/safe-service-client)\n- [Safe-eth-py](https://github.com/safe-global/safe-eth-py)\n- [Safe CLI](https://github.com/5afe/safe-cli): It has a `tx-service` mode to gather offchain signatures.\n\n### What chains do you officially support?\nhttps://docs.safe.global/learn/safe-core/safe-core-api/available-services\n\n### What means banned field in SafeContract model?\nThe `banned` field in the `SafeContract` model is used to prevent indexing of certain Safes that have an unsupported `MasterCopy` or unverified proxies that have issues during indexing. This field does not remove the banned Safe and indexing can be resumed once the issue has been resolved.\n\n## Troubleshooting\n\n### Issues installing grpc on a Mac M1\n\nIf you face issues installing the `grpc` dependency locally (required by this project) on a M1 chip, set `GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1` and `GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1` and then try to install the dependency again.\n\n## Contributors\n[See contributors](https://github.com/safe-global/safe-transaction-service/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotexproject%2Fiotex-transaction-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiotexproject%2Fiotex-transaction-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotexproject%2Fiotex-transaction-service/lists"}