safe-global / safe-infrastructure Goto Github PK
View Code? Open in Web Editor NEWOne `docker-compose.yml` file to rule them all
License: MIT License
One `docker-compose.yml` file to rule them all
License: MIT License
To reproduce add a chain, see it working on the front end. Then change or remove the chain, then add a new one with a different name. The original chain shows on the frontend even after clearing the cache. It seems that only the initial configuration set for chain and webhooks is set and changing them does not take effect at the application level.
This issue is created to track the migration in this project to the new implementation of client-gateway https://github.com/safe-global/safe-client-gateway-nest.
Upon working with the current docker-compose.yml
, I have noticed that some services are starting before their dependencies are ready. This leads to initial startup failures and makes the docker-compose process less reliable.
Specifically, I observed that services depending on the Redis instances and PostgreSQL databases were starting before these dependencies were fully initialized. Additionally, the PostgreSQL services (txs-db
and cfg-db
) did not have health checks, which is necessary for reliably determining when these services are ready to accept connections.
To address these problems, I propose the following changes:
txs-db
and cfg-db
services, using the pg_isready -U postgres
command to determine if the PostgreSQL servers are accepting connections.service_healthy
condition to all services that depend on txs-db
or cfg-db
, to ensure they only start after the databases are ready.txs-redis
and cgw-redis
services, using the redis-cli ping
command to determine if the Redis server is up.service_healthy
condition to all services that depend on txs-redis
and cgw-redis
, to ensure they only start after Redis is ready.I tested https://github.com/safe-global/safe-infrastructure and network Goerli without problem. Then I test the new network apothem which was added to https://github.com/safe-global/safe-deployments/ in v1.18.0. Below is my .env file:
REVERSE_PROXY_PORT=8000
REVERSE_PROXY_UI_PORT=8080
CFG_VERSION=latest
CGW_VERSION=latest
TXS_VERSION=latest
UI_VERSION=latest
RPC_NODE_URL=https://erpc.apothem.network
npm_package_version=1.0.0
When I click create butten:
The console of web browser report error:
I also notice https://github.com/safe-global/web-core/blob/dev/package.json is using "@gnosis.pm/safe-deployments": "^1.17.0"
, and there is no v1.18.0 on npmjs. Is this the problem reason?
I'm running safe-infrastructure in my VM with XDC network now. I can create safe on web browser successfully. How to verify that the safe works properly?
BTW, does one safe-infrastructure support multiple chains at same time ?
While following this guide: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md
And doing this:
"Set the Url field to http://nginx:8000/cgw/v1/chains/1/hooks/events"
It asks to "Enter a valid URL"
it wont accept: http://nginx:8000/cgw/v1/chains/1/hooks/events
as a correct parameter.
after i follow up the guide to deploy lcoally , I could access the web ,but it failed when "Processing" , the reason is it trying to call
tx service /v1/chains/5001/safes/{address} , the return code is 42 , and it shows 404
I read some doc ,but didn't know how to confirm tx service is working as expectly , the only place to config the tx service is in safe-confg ui , when I add chains , seems the key issue is after I create safe wallet on my chain , tx service failed to query the status from my chain , not sure if this is ture or not
The comments in #1 should be documented in the README.md
file as a form of cheat sheet for the setup.
It is common docker
knowledge, but there is still value on having this documented for first time users.
We should cover the steps to be implemented in the script in #4, basically:
ChainInfo
I’m trying to run this service locally and add a custom chain. In Step 3 of the process (Add your ChainInfo at http://localhost:8000/cfg/admin/chains/chain/add/), there’s an input field for the Block explorer URI API template.
This field expects the chain’s explorer API to use query parameters like:
https://api-apothem.blocksscan.io/api?module={{module}}&action={{action}}&address={{address}}&apiKey={{apiKey}}
.
However, my custom chain uses path parameters instead, such as:
https://explorerapi.wemix.com/api/ext/v1/accounts/{address_hash}/transactions
.
Desc:
The log prompts this error after updating the information in the cfg.
Log:
safe-infrastructure-cfg-web-1 | 2022-10-13 07:35:31,031 MT::GET::admin/safe_apps/safeapp/<path:object_id>/change/::317::200::/cfg/admin/safe_apps/safeapp/1/change/
safe-infrastructure-cfg-web-1 | - - [13/Oct/2022:07:35:31 +0000] "GET /admin/safe_apps/safeapp/1/change/ HTTP/1.0" 200 16633 "https://<domain>/cfg/admin/safe_apps/safeapp/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
safe-infrastructure-cfg-web-1 | 2022-10-13 07:35:31,427 MT::GET::admin/jsi18n/::186::200::/cfg/admin/jsi18n/
safe-infrastructure-cfg-web-1 | - - [13/Oct/2022:07:35:31 +0000] "GET /admin/jsi18n/ HTTP/1.0" 200 3343 "https://<domain>/cfg/admin/safe_apps/safeapp/1/change/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
safe-infrastructure-cfg-web-1 | 2022-10-13 07:35:35,886 [INFO] [MainProcess] Clearing safe-apps cache
safe-infrastructure-cfg-web-1 | 2022-10-13 07:35:35,887 [DEBUG] [MainProcess] Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
safe-infrastructure-cfg-web-1 | 2022-10-13 07:35:35,888 [DEBUG] [MainProcess] Starting new HTTP connection (1): nginx:8000
safe-infrastructure-nginx-1 | 2022/10/13 07:35:35 [error] 32#32: *85 open() "/etc/nginx/html/v2/flush" failed (2: No such file or directory), client: 172.23.0.5, server: , request: "POST /v2/flush HTTP/1.1", host: "nginx:8000"
safe-infrastructure-cfg-web-1 | 2022-10-13 07:35:35,890 [DEBUG] [MainProcess] http://nginx:8000 "POST /v2/flush HTTP/1.1" 404 153
safe-infrastructure-cfg-web-1 | 2022-10-13 07:35:35,890 [ERROR] [MainProcess] 404 Client Error: Not Found for url: http://nginx:8000/v2/flush
Version:
CFG_VERSION=v2.27.0
CGW_VERSION=v3.35.1
TXS_VERSION=v4.10.2
@Uxio0 Thanks a lot for your efficient work, is it possible to upgrade the docker images in this repo so we will be able to use the latest images directly
Per @Uxio0 's comment and after discussing privately, we thought giving a try to his 2nd proposal, namely allowing access through 3 different paths like so:
http://localhost/cfg
http://localhost/txs
http://localhost/cgw
https://github.com/safe-global/safe-react has been replaced by https://github.com/safe-global/web-core . And there is no docker image of web-core under safeglobal.
We started working today on rolling out the Gnosis ecosystem on Kubernetes and are basing our manifests on the docker-compose.yaml in this repository. For the most part we are able to wire everything up without issues, but are running into trouble with the NGINX reverse proxy. We would prefer to be able to strip this out completely and just drop the service into our service mesh (as we do with all other services we deploy) to take care of routing, load balancing and auth.
However, it doesn't look like it is as simple as just removing NGINX since the individual safe services appear to have been tightly coupled with it. In particular the entrypoint files seem to require certain shared resources. We are currently trying to figure out what we need to remove / rewrite in order to decouple the safe services from NGINX. Could someone assist with this effort?
Is there deploy tutorial for production enviroment especially without docker ?
This step is not loading the chain
fixture: https://github.com/gnosis/safe-infrastructure#step-3-add-your-chaininfo . Either we tell the users to use the admin interface to add the chain (I vote for that) or we make sure that we keep the fixture updated.
More info: https://ethereum.stackexchange.com/questions/120537/error-in-step-3-of-safe-infrastructure
safe-infrastructure/docs/chain_info.md
Line 11 in 6d9d999
https://safe-config.gnosis.io/api/v1/chains/
appears to be deprecated, and if so I'm not sure what the latest correct url would be
I think this repository is quite useful when deploying safe-infrastructure on a new chain. But when deploying in production (like on AWS for some other cloud provider) there are issues I faced, which I could have avoided incase a guide for production was provided.
Few issues are as follows -
Again these issues are quite small but resolving them will help developers, that are unaware of safe architecture, deploy in-production faster.
set up the safe-infrastructure with a local node. everything is working fine however when creating singed transaction. Indexing is very slow (around 1 hour) any idea what is happening?
Could it be related to my webhook not set properly http://nginx:8000/cgw/v1/chains/4201/hooks/events where 4201 is the chainId?
I just followed all steps;
setup docker running_local and register a new chainID/RPC network, it works with my metamask, but:
1- When I try to "Create new safe" after choosing the name of safe, using my wallet as owner, set threshold, when Next button is clicked, the following javascript error shows:
EthersAdapter.js:112 Uncaught (in promise) Error: Invalid CompatibilityFallbackHandler contract address at t.default.getCompatibilityFallbackHandlerContract (EthersAdapter.js:112:19) at k (safeContracts.ts:179:21) at index.tsx:58:29 at s (runtime.js:45:40) at Generator._invoke (runtime.js:274:22) at P.forEach.e.<computed> [as next] (runtime.js:97:21) at r (_async_to_generator.mjs:3:20) at s (_async_to_generator.mjs:25:9) at _async_to_generator.mjs:32:7 at new Promise (<anonymous>)
What I need to do next/what is the issue?
1- Using safe-contracts repo:
~/safe-contracts$ yarn deploy-all custom yarn run v1.22.19 $ hardhat deploy-contracts --network custom Nothing to compile An unexpected error occurred: Error: ERROR processing /home/ubuntu/safe-contracts/src/deploy/deploy_accessors.ts: Error: **Safe factory not found for network 245022926. You can request a new deployment at https://github.com/safe-global/safe-singleton-factory.** For more information, see https://github.com/safe-global/safe-contracts#replay-protection-eip-155
2- I just opened a issue requesting a new safe-factory:
safe-global/safe-singleton-factory#107
From safe-singleton-factory I just did `yarn deploy-all custom`, it generates a json file:
{ "gasPrice": 1000000000, "gasLimit": 16154360, "signerAddress": "0x5def6d46B26c1C672110FF9DdE09233E309c964f", "transaction": "0xf8a880843b9aca0083f67ef88080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3841d3581bfa049a9e05fd2ed60f0cc9a1b62d5dbdd651a297d715241067e246347046c9425a0a07e749bb77541e02c2858c324d5e0b83e0216927305481f7cfd67788ae09bdefe", "address": "0x7753Ee72051D187B208008cFa37669B7ED98Bf8c" }
and yarn submit
What is next to have this safe in my own infrastructure with my own RPC server?
Were the steps shown here correct?
Regards,
Juliano
please help to build latest image with safe-deployments 1.30
The first build step of docker-compose build --force-rm
rejects everything, because every container is set to use an image. It would be useful to know what to do in the obvious use case, where you want to work with a private fork of -react
The -react UI is causing Metamask to switch to Goerli. The provided sample chain definition is for rinkeby which, in any case, I did not load. The sample chain definition should mention the {{address}} and {{txHash}} variables that belong in the BX URLs. A good default would be to start with the lowest chain ID among those configured.
I am coming at this having tried and failed to set up the tx gateway, and I know that I must teach the safe gateway about the deployed contract addresses. Presently that must be done with private modifications to @gnosis.pm/safe-deployments eventually to be merged in. The defaultAddress in safe-deployments/src/assets/v1.3.0/proxy_factory.json is not used. I believe this belongs as part of the chain config JSON.
reqwest::Error { kind: Request, url: Url { scheme: "http", host: Some(Ipv4(52.74.121.192)), port: Some(8000), path: "/txs/api/v1/safes/0x3DBa9E9EF6ac3B9F6394FA0E050cb9f60A295D1e/", query: None, fragment: None }, source: TimedOut }"
Using this test safe:
$ yarn safe info 0xd82c4FBB253158b9b7d809C41561365762B28dBB
Point at the safe-cli
and safe-tasks
repos for aiding local testing
I just create an AWS ec2 with safe-infrastructure with DNS already, but when I logged into my domain:
http://gnosis-test.asd.com:8000/cfg/admin/login/?next=/cfg/admin/chains/chain/add/
There is a Forbidden / CSRF verification failed. Request aborted.
There is any config for django and CSRF ?
Regards
I’m planning to run this service locally. When setting up the chain and web hook, some fields require the NGINX domain (e.g. http://nginx:8000/). However, I couldn’t access these addresses using my browser and started to think that I should use “localhost” instead (e.g. http://localhost:8000/).
Could the reason for not being able to connect to the NGINX domain from the browser be because it’s running inside a Docker container? Should I be using the NGINX domain instead of localhost?”
Hi team!👋 I'm using safe-infrastructure in a github workflow together with a hardhat node and I have trouble with the required manual configuration steps. Locally I'm using the txs admin UI to set the safe master copy address. Is there a (convenient) way to configure the safe master copy address programmatically?
Hello,
Got some issue trying to use the safe infrastructure
Step 0 require step 1 for first function cause .env is not configured
At step 2 after executing docker exec safe-infrastructure_cfg-web_1 python src/manage.py createsuperuser --noinput
and trying to reach http://localhost:8000/cfg/admin/
Got CRSF problem as image follow :
I have tried to add localhost:8000 & 127.0.0.1 in settings.py of django in the image but i still got the issue.
Do you got some ideas on how to fix it ?
docker exec safe-infrastructure_txs-web_1 python manage.py createsuperuser --noinput
Isn't working for me : CommandError: You must use --username with --noinput.
But a user root as been created with previous command.
Regards
This issue is created to add to safe-infrastructure the new safe-events https://github.com/safe-global/safe-events-service.
I just saw that web-core has been deprecated. Should we update the docker-compose?
Hi there!
I just tried to launch the local docker-compose version with pretty-much default settings.
After successful user creation via
docker exec -ti safe-infrastructure_txs-web_1 python manage.py createsuperuser --username root
I can't log in with localhost:8000/txs/admin
URL, with configured username/password, it just redirects me back to the same login window, without any error in docker logs, or on frontend, or in frontend-console.
BTW, localhost:8000/cfg/admin is working as expected.
Versions are:
CFG_VERSION=v2.23.0
CGW_VERSION=v3.26.0
TXS_VERSION=v4.4.2
Any ideas?
Thanks
First installation with the automated way is always unsuccessful. When I attempt to reinstall, the installation process completes without errors, which leaves me wondering why this is happening. If there is a problem, how can I solve it?
[+] Running 17/19
⠿ Network safe-infrastructure_default Created 0.0s
⠿ Volume "safe-infrastructure_nginx-shared-cfg" Cre... 0.0s
⠿ Volume "safe-infrastructure_nginx-shared-txs" Cre... 0.0s
⠿ Container safe-infrastructure-cfg-db-1 Started 1.7s
⠿ Container safe-infrastructure-txs-redis-1 Started 1.6s
⠿ Container safe-infrastructure-txs-rabbitmq-1 Star... 1.4s
⠿ Container safe-infrastructure-cgw-redis-1 Started 1.6s
⠿ Container safe-infrastructure-txs-db-1 Started 1.5s
⠿ Container safe-infrastructure-cgw-web-1 Started 1.6s
⠿ Container safe-infrastructure-cfg-web-1 Started 1.6s
⠿ Container safe-infrastructure-txs-web-1 Started 1.2s
⠿ Container safe-infrastructure-txs-worker-indexer-1 Started 1.5s
⠿ Container safe-infrastructure-txs-scheduler-1 Sta... 1.6s
⠿ Container safe-infrastructure-txs-worker-notifications-webhooks-1 Started 1.3s
⠿ Container safe-infrastructure-txs-worker-contracts-tokens-1 Started 1.1s
⠸ cgw-web The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
⠿ Container safe-infrastructure-nginx-1 Started 1.9s
⠿ Container safe-infrastructure-ui-1 Started 2.2s
⠹ ui The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
==> 16:52:11 ==> Creating super-user for Safe Config Service... (may take a while)
2023-02-23 07:52:12,137 [DEBUG] [MainProcess] Consider installing rusty-rlp to improve pyrlp performance with a rust based backend
Traceback (most recent call last):
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/python-deps/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "cfg-db" (172.18.0.5) and accepting
TCP/IP connections on port 5432?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/src/manage.py", line 22, in <module>
main()
File "/app/src/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/python-deps/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 88, in execute
return super().execute(*args, **options)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 447, in execute
self.check_migrations()
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 564, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in __init__
self.build_graph()
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
if self.has_table():
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 57, in has_table
with self.connection.cursor() as cursor:
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 281, in ensure_connection
with self.wrap_database_errors:
File "/python-deps/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/python-deps/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "cfg-db" (172.18.0.5) and accepting
TCP/IP connections on port 5432?
(base)
==> 16:59:56 ==> Starting up environment containers...
[+] Running 14/16
⠿ Container safe-infrastructure-txs-db-1 Started 7.2s
⠿ Container safe-infrastructure-txs-rabbitmq-1 Star... 6.9s
⠿ Container safe-infrastructure-cgw-redis-1 Started 7.0s
⠿ Container safe-infrastructure-cfg-db-1 Started 7.2s
⠿ Container safe-infrastructure-txs-redis-1 Started 7.1s
⠿ Container safe-infrastructure-txs-scheduler-1 Sta... 7.8s
⠿ Container safe-infrastructure-txs-worker-notifications-webhooks-1 Started 7.8s
⠿ Container safe-infrastructure-txs-web-1 Started 7.5s
⠿ Container safe-infrastructure-txs-worker-indexer-1 Started 7.2s
⠿ Container safe-infrastructure-txs-worker-contracts-tokens-1 Started 7.5s
⠿ Container safe-infrastructure-cfg-web-1 Started 7.0s
⠿ Container safe-infrastructure-cgw-web-1 Started 6.8s
⠙ cgw-web The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
⠿ Container safe-infrastructure-nginx-1 Started 6.4s
⠿ Container safe-infrastructure-ui-1 Started 6.6s
⠙ ui The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
==> 17:00:05 ==> Creating super-user for Safe Config Service... (may take a while)
2023-02-23 08:00:06,524 [DEBUG] [MainProcess] Consider installing rusty-rlp to improve pyrlp performance with a rust based backend
You have 64 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, chains, contenttypes, safe_apps, sessions.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/src/manage.py", line 22, in <module>
main()
File "/app/src/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/python-deps/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 88, in execute
return super().execute(*args, **options)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 109, in handle
default_username = get_default_username(database=database)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/__init__.py", line 163, in get_default_username
auth_app.User._default_manager.db_manager(database).get(
File "/python-deps/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 646, in get
num = len(clone)
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 376, in __len__
self._fetch_all()
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 1867, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 87, in __iter__
results = compiler.execute_sql(
File "/python-deps/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1398, in execute_sql
cursor.execute(sql, params)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/python-deps/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
(base)
==> 17:02:04 ==> Starting up environment containers...
[+] Running 14/14
⠿ Container safe-infrastructure-txs-rabbitmq-1 Running 0.0s
⠿ Container safe-infrastructure-cfg-db-1 Running 0.0s
⠿ Container safe-infrastructure-txs-db-1 Running 0.0s
⠿ Container safe-infrastructure-txs-redis-1 Running 0.0s
⠿ Container safe-infrastructure-cgw-redis-1 Running 0.0s
⠿ Container safe-infrastructure-cfg-web-1 Running 0.0s
⠿ Container safe-infrastructure-txs-scheduler-1 Running 0.0s
⠿ Container safe-infrastructure-txs-worker-contracts-tokens-1 Started 0.4s
⠿ Container safe-infrastructure-cgw-web-1 Running 0.0s
⠿ Container safe-infrastructure-txs-web-1 Running 0.0s
⠿ Container safe-infrastructure-txs-worker-indexer-1 Running 0.0s
⠿ Container safe-infrastructure-nginx-1 Running 0.0s
⠿ Container safe-infrastructure-txs-worker-notifications-webhooks-1 Started 0.4s
⠿ Container safe-infrastructure-ui-1 Running 0.0s
==> 17:02:05 ==> Creating super-user for Safe Config Service... (may take a while)
2023-02-23 08:02:06,141 [DEBUG] [MainProcess] Consider installing rusty-rlp to improve pyrlp performance with a rust based backend
Username (leave blank to use 'root'): s
Email address: [email protected]
Password:
Password (again):
This password is too short. It must contain at least 8 characters.
This password is entirely numeric.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.
==> 17:02:21 ==> Creating super-user for Safe Transaction Service... (may take a while)
Username (leave blank to use 'root'): s
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.
==> 17:02:42 ==> All set! You may want to add a ChainInfo into the Config service. Please use the link below to fill its data: http://localhost:8000/cfg/admin/chains/chain/add/
(base)
[+] Running 15/15
⠿ Network safe-infrastructure_default Created 0.0s
⠿ Container safe-infrastructure-cgw-redis-1 St... 11.7s
⠿ Container safe-infrastructure-cfg-db-1 Start... 11.8s
⠿ Container safe-infrastructure-txs-redis-1 St... 12.1s
⠿ Container safe-infrastructure-txs-rabbitmq-1 Started 12.1s
⠿ Container safe-infrastructure-txs-db-1 Start... 12.1s
⠿ Container safe-infrastructure-txs-scheduler-1 Started 2.8s
⠿ Container safe-infrastructure-txs-web-1 Star... 3.2s
⠿ Container safe-infrastructure-txs-worker-contracts-tokens-1 Started 3.1s
⠿ Container safe-infrastructure-txs-worker-notifications-webhooks-1 Started 3.5s
⠿ Container safe-infrastructure-txs-worker-indexer-1 Started 3.4s
⠿ Container safe-infrastructure-cfg-web-1 Star... 2.6s
⠿ Container safe-infrastructure-cgw-web-1 Star... 2.6s
⠿ Container safe-infrastructure-nginx-1 Starte... 4.0s
⠿ Container safe-infrastructure-ui-1 Started 4.7s
==> 06:05:00 ==> Creating super-user for Safe Config Service... (may take a while)
2023-02-23 06:05:03,339 [DEBUG] [MainProcess] Consider installing rusty-rlp to improve pyrlp performance with a rust based backend
You have 64 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, chains, contenttypes, safe_apps, sessions.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/src/manage.py", line 22, in <module>
main()
File "/app/src/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/python-deps/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 88, in execute
return super().execute(*args, **options)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 109, in handle
default_username = get_default_username(database=database)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/__init__.py", line 163, in get_default_username
auth_app.User._default_manager.db_manager(database).get(
File "/python-deps/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 646, in get
num = len(clone)
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 376, in __len__
self._fetch_all()
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 1867, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 87, in __iter__
results = compiler.execute_sql(
File "/python-deps/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1398, in execute_sql
cursor.execute(sql, params)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/python-deps/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
==> 07:15:48 ==> Starting up environment containers...
[+] Running 14/14
⠿ Container safe-infrastructure-txs-rabbitmq-1 Running 0.0s
⠿ Container safe-infrastructure-cgw-redis-1 Ru... 0.0s
⠿ Container safe-infrastructure-cgw-web-1 Runn... 0.0s
⠿ Container safe-infrastructure-txs-db-1 Runni... 0.0s
⠿ Container safe-infrastructure-txs-redis-1 Ru... 0.0s
⠿ Container safe-infrastructure-txs-web-1 Runn... 0.0s
⠿ Container safe-infrastructure-cfg-db-1 Runni... 0.0s
⠿ Container safe-infrastructure-cfg-web-1 Runn... 0.0s
⠿ Container safe-infrastructure-nginx-1 Runnin... 0.0s
⠿ Container safe-infrastructure-ui-1 Running 0.0s
⠿ Container safe-infrastructure-txs-worker-contracts-tokens-1 Started 0.5s
⠿ Container safe-infrastructure-txs-scheduler-1 Running 0.0s
⠿ Container safe-infrastructure-txs-worker-notifications-webhooks-1 Started 0.5s
⠿ Container safe-infrastructure-txs-worker-indexer-1 Running 0.0s
==> 07:15:49 ==> Creating super-user for Safe Config Service... (may take a while)
2023-02-23 07:15:50,332 [DEBUG] [MainProcess] Consider installing rusty-rlp to improve pyrlp performance with a rust based backend
Username (leave blank to use 'root'):s
Email address: [email protected]
Password:
Password (again):
This password is too short. It must contain at least 8 characters.
This password is entirely numeric.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.
==> 07:16:20 ==> Creating super-user for Safe Transaction Service... (may take a while)
Username (leave blank to use 'root'): s
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.
==> 07:16:39 ==> All set! You may want to add a ChainInfo into the Config service. Please use the link below to fill its data: http://localhost:8000/cfg/admin/chains/chain/add/
git clone https://github.com/safe-global/safe-infrastructure.git
cd safe-infrastructure
cp .env.sample .env
Edit the .env and set RPC_NODE_URL to the chain you want the services running against. (cf. Please note that this URL has not been added to safe-contracts through request pull and merge process.)
First run
cd scripts
sudo sh run_locally.sh
Second and third run
sh run_locally.sh
docker reported safe-infrastructure-txs-worker-notifications-webhooks-1 and safe-infrastructure-txs-worker-contracts-tokens-1 exited with code 1. I found both of them try to connect http://localhost:8545, but no service is listening on it obviously. It seems my config has some error.
Below are error messages:
safe-infrastructure-txs-worker-notifications-webhooks-1 | requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f720f5af5b0>: Failed to establish a new connection: [Errno 111] Connection refused'))
safe-infrastructure-txs-worker-notifications-webhooks-1 exited with code 1
safe-infrastructure-txs-worker-contracts-tokens-1 | requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbf2a9e4100>: Failed to establish a new connection: [Errno 111] Connection refused'))
safe-infrastructure-txs-worker-contracts-tokens-1 exited with code 1
file .env:
REVERSE_PROXY_PORT=8000
REVERSE_PROXY_UI_PORT=8080
CFG_VERSION=latest
CGW_VERSION=latest
TXS_VERSION=latest
UI_VERSION=latest
RPC_NODE_URL=https://erpc.apothem.network/
All latest images support XDC chain now.
file container_env_files/txs.env
PYTHONPATH=/app/
DJANGO_SETTINGS_MODULE=config.settings.production
DJANGO_SECRET_KEY='Very-secure-secret-string'
DEBUG=0
DATABASE_URL=psql://postgres:postgres@txs-db:5432/postgres
ETH_L2_NETWORK=1
REDIS_URL=redis://txs-redis:6379/0
CELERY_BROKER_URL=amqp://guest:guest@txs-rabbitmq/
DJANGO_ALLOWED_HOSTS="*"
FORCE_SCRIPT_NAME=/txs/
# CSRF_TRUSTED_ORIGINS="http://localhost:8000"
CSRF_TRUSTED_ORIGINS="http://localhost:8000,http://10.146.1.88:8000"
Only CSRF_TRUSTED_ORIGINS
is modified.
chain config:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"chainId": "51",
"chainName": "apothem",
"shortName": "txdc",
"description": "Xinfin Testnet Apothem",
"l2": true,
"rpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://erpc.apothem.network/"
},
"safeAppsRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://erpc.apothem.network/"
},
"publicRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://erpc.apothem.network/"
},
"blockExplorerUriTemplate": {
"address": "https://explorer.apothem.network/address/{{address}}",
"txHash": "https://explorer.apothem.network/txs/{{txHash}}",
"api": "https://api-apothem.blocksscan.io/api?module={{module}}&action={{action}}&address={{address}}&apiKey={{apiKey}}"
},
"nativeCurrency": {
"name": "TXDC",
"symbol": "TXDC",
"decimals": 18,
"logoUri": "/media/chains/51/currency_logo.png"
},
"transactionService": "http://nginx:8000/txs",
"vpcTransactionService": "http://nginx:8000/txs",
"theme": {
"textColor": "#ffffff",
"backgroundColor": "#000000"
},
"gasPrice": [
{
"type": "fixed",
"weiValue": "250000000"
}
],
"ensRegistryAddress": null,
"recommendedMasterCopyVersion": "1.3.0",
"disabledWallets": [],
"features": [
"CONTRACT_INTERACTION",
"ERC1155",
"ERC721",
"SAFE_APPS",
"SPENDING_LIMIT"
]
}
]
}
The same question has been posted on https://ethereum.stackexchange.com/questions/147811/run-the-safe-global-safe-infrastructure-service-for-a-sample-test.
My goal is to run the safe-infrastructure service for a sample test by following the Guide to run our services locally.
I believe I followed the instructions correctly on the main branch (or commit 476c42d) with the Georli chain, which is officially supported and should not have any compatibility or support issues.
However, the service isn’t working.
GET http://localhost:8000/cgw/v1/chains/5/safes/0x38b3aE5977220a8081De42a9045d8D2537e73871 404 (Not Found)
[General]
Request URL: http://localhost:8000/cgw/v1/chains/5/safes/0x38b3aE5977220a8081De42a9045d8D2537e73871
Request Method: GET
Status Code: 404 Not Found (from service worker)
Referrer Policy: strict-origin-when-cross-origin
[Response Headers]
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With, Content-Type, Authorization
access-control-allow-methods: POST, GET, OPTIONS
access-control-allow-origin: *
Connection: keep-alive
Content-Length: 26
Content-Type: application/json
Date: Wed, 22 Mar 2023 15:11:21 GMT
permissions-policy: interest-cohort=()
Server: nginx/1.23.3
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
[Request Headers]
Provisional headers are shown
Learn more
Referer: http://localhost:8080/
sec-ch-ua: "Brave";v="111", "Not(A:Brand";v="8", "Chromium";v="111"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "macOS"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
{"code":42,"message":""}
.env
REVERSE_PROXY_PORT=8000
REVERSE_PROXY_UI_PORT=8080
CFG_VERSION=latest
CGW_VERSION=latest
TXS_VERSION=latest
UI_VERSION=latest
RPC_NODE_URL=https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161
# Option #1 - Automated way
cd scripts
sh run_locally.sh
ChainInfo
Referred to the ChainInfo available in the official production information at https://safe-config.gnosis.io/api/v1/chains/
safe-infrastructure on main
❯ curl -s http://localhost:8000/cfg/api/v1/chains/ | jq
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"chainId": "5",
"chainName": "Goerli",
"shortName": "gor",
"description": "Ethereum Testnet Görli",
"l2": true,
"rpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
},
"safeAppsRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
},
"publicRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
},
"blockExplorerUriTemplate": {
"address": "https://goerli.etherscan.io/address/{{address}}",
"txHash": "https://goerli.etherscan.io/tx/{{txHash}}",
"api": "https://api-goerli.etherscan.io/api?module={{module}}&action={{action}}&address={{address}}&apiKey={{apiKey}}"
},
"nativeCurrency": {
"name": "Goerli Ether",
"symbol": "GOR",
"decimals": 18,
"logoUri": "/media/chains/5/currency_logo.png"
},
"transactionService": "http://nginx:8000/txs",
"vpcTransactionService": "http://nginx:8000/txs",
"theme": {
"textColor": "#ffffff",
"backgroundColor": "#000000"
},
"gasPrice": [
{
"type": "fixed",
"weiValue": "100000000000"
}
],
"ensRegistryAddress": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
"recommendedMasterCopyVersion": "1.3.0",
"disabledWallets": [],
"features": [
"CONTRACT_INTERACTION",
"DOMAIN_LOOKUP",
"ERC1155",
"ERC721",
"SAFE_APPS",
"SPENDING_LIMIT"
]
}
]
}
http://nginx:8000/cgw/v1/chains/5/hooks/events
Basic some_random_token
1. Connect to http://localhost:8080/welcome using a browser
2. Select the Goerli chain from the dropdown menu in the top right corner
3. Connect MetaMask wallet
4.1. Click the + Create New Safe
button
4.2. Select network and name your Safe -> Click the Next
button
4.3 Owners and confirmations -> Click the Next
button
4.4.1. Create new Safe -> Click the Next
button: the Est. network fee
is not being updated and is still showing the initial value of 0.001 GOR
4.4.2. Transaction
set up the safe-infrastructure with a local node.
everything is working fine however when creating a signed transaction. Indexing is very slow (around 1 hour) any idea what is happening? (even though when I check the transaction API, I can find my transaction there)
Could it be related to my webhook not being appropriately set http://nginx:8000/cgw/v1/chains/4201/hooks/events
where 4201 is the chainId and my authorization is Basic some_random_token
(have not changed it in the .env files)?
I tried looking at the log of the webhook, when the transaction is confirmed by my wallet:
2023-05-15 10:03:46,383 [INFO] [19466a2c/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[19466a2c-25d9-414d-8696-7ae56f4b0bbb] succeeded in 0.03691449999951146s: (0, 0)
2023-05-15 10:03:46,394 [INFO] [cc00d0c0/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[cc00d0c0-cd06-4e03-95fd-e81cf95778cf] succeeded in 0.03862212500007445s: (0, 0)
2023-05-15 10:03:46,405 [INFO] [f44d68a5/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[f44d68a5-4764-4d41-9ee4-6bab4c1ff5b4] succeeded in 0.010306166000191297s: (0, 0)
2023-05-15 10:03:46,413 [INFO] [04bbdd4e/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[04bbdd4e-7165-4fa1-8448-a333091237db] succeeded in 0.01722387500012701s: (0, 0)
2023-05-15 10:03:46,465 [INFO] [e3125c97/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[e3125c97-3974-438f-ac9c-7eed86260b27] succeeded in 0.006571916000211786s: (0, 0)
and this is what is happening at the client gateway level
2023-05-15 10:03:46,383 [INFO] [19466a2c/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[19466a2c-25d9-414d-8696-7ae56f4b0bbb] succeeded in 0.03691449999951146s: (0, 0)
2023-05-15 10:03:46,394 [INFO] [cc00d0c0/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[cc00d0c0-cd06-4e03-95fd-e81cf95778cf] succeeded in 0.03862212500007445s: (0, 0)
2023-05-15 10:03:46,405 [INFO] [f44d68a5/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[f44d68a5-4764-4d41-9ee4-6bab4c1ff5b4] succeeded in 0.010306166000191297s: (0, 0)
2023-05-15 10:03:46,413 [INFO] [04bbdd4e/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[04bbdd4e-7165-4fa1-8448-a333091237db] succeeded in 0.01722387500012701s: (0, 0)
2023-05-15 10:03:46,465 [INFO] [e3125c97/send_notification_task] Task safe_transaction_service.notifications.tasks.send_notification_task[e3125c97-3974-438f-ac9c-7eed86260b27] succeeded in 0.006571916000211786s: (0, 0)
Is there any documentation available? If not I will be happy to contribute the edition of one.
Updated to latest (stable) versions
v3.4.7
v2.6.0
v3.10.0
My objective is to deploy the Safe app on a custom EVM-compatible network, using the safe-infrastructure repository. I do not intend for the custom network to be listed alongside officially supported networks such as Polygon, Arbitrum, Volta, and Goerli.
Despite the nice documentation from the Gnosis Safe team, I am still not sure about the whole process and I need your help.
I would like to suggest having a discussion on this topic with individuals who share the same objective, as well as with the contributors of this repository.
It would be helpful to engage in discussions on the "safe-web" channel of the Gnosis Safe Discord at https://discord.com/channels/907968493134155807/908129365345312768
Flower is a web based tool for monitoring and administrating Celery clusters
The transaction-service has include flower in his docker-compose file I would like to include it also in this project example.
https://github.com/safe-global/safe-transaction-service/blob/master/docker-compose.yml#L81.
Desc:
I queried through txs api/v1/data-decoder/
api that dataDecoded is valuable.
And cgw.env FEATURE_FLAG_NESTED_DECODING=true;
is set, but I can find out that it is null through this interface: /v1/chains/<chain_id>/transactions/<transaction_id>
.
Version:
CFG_VERSION=latest
CGW_VERSION=latest
TXS_VERSION=latest
How can I get dataDecoded to return the data? Thanks
I'm attempting to run it using the 'Running our services locally' approach, but I'm stuck on step 3 because I'm unsure of how to write all the attributes correctly. I'm uncertain about the meaning of 'Block explorer uri address template,' to give an instance.
Can you provide an example case for typical EVM-compatible network?
I created safe with goerli chain successfully in local docker enviroment. But there is a problem when I create safe with Apothem chain locally which is added in safe-deployments v1.18.0.
http://103.101.129.240:8080/new-safe/create
http://103.101.129.240:8080/txdc:0xE62B3D7850F09d5fc78b39Acda05e62b88020181/home
Table history_safelaststatus, history_safemastercopy and history_safestatus in txs-db are all empty.
docker log:
safe-infrastructure-cgw-web-1 | [2023-01-29T06:45:49Z INFO _] Response succeeded.
safe-infrastructure-txs-scheduler-1 | 2023-01-29 06:45:51,264 [INFO] [???/???] Scheduler: Sending due task Index Safe events (L2) (safe_transaction_service.history.tasks.index_safe_events_task)
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:51,267 [INFO] [754a724b/index_safe_events_task] Start indexing of Safe events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:51,490 [INFO] [754a724b/index_safe_events_task] Find Safe events processed 0 events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:51,498 [INFO] [754a724b/index_safe_events_task] Task safe_transaction_service.history.tasks.index_safe_events_task[754a724b-be7c-4b3a-aa8d-c6d36d8f930d] succeeded in 0.2321154389937874s: 0
safe-infrastructure-txs-scheduler-1 | 2023-01-29 06:45:52,353 [INFO] [???/???] Scheduler: Sending due task Index ERC20/721 Events (safe_transaction_service.history.tasks.index_erc20_events_task)
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:52,356 [INFO] [9e7a1a6c/index_erc20_events_task] Start indexing of erc20/721 events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:52,584 [INFO] [9e7a1a6c/index_erc20_events_task] Indexing of erc20/721 events task processed 0 events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:52,591 [INFO] [9e7a1a6c/index_erc20_events_task] Task safe_transaction_service.history.tasks.index_erc20_events_task[9e7a1a6c-5cd4-4862-ae7f-b9d86f2ba20d] succeeded in 0.23622819599404465s: 0
safe-infrastructure-txs-scheduler-1 | 2023-01-29 06:45:54,347 [INFO] [???/???] Scheduler: Sending due task Index new Proxies (safe_transaction_service.history.tasks.index_new_proxies_task)
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:54,350 [INFO] [d0bc8092/index_new_proxies_task] Start indexing of new proxies
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:54,573 [INFO] [d0bc8092/index_new_proxies_task] Proxy indexing found 0 proxies
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:54,580 [INFO] [d0bc8092/index_new_proxies_task] Task safe_transaction_service.history.tasks.index_new_proxies_task[d0bc8092-a7f0-4d8b-8e3f-2de8f19733ac] succeeded in 0.23139733000425622s: 0
safe-infrastructure-txs-scheduler-1 | 2023-01-29 06:45:56,264 [INFO] [???/???] Scheduler: Sending due task Index Safe events (L2) (safe_transaction_service.history.tasks.index_safe_events_task)
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:56,267 [INFO] [43470db9/index_safe_events_task] Start indexing of Safe events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:56,494 [INFO] [43470db9/index_safe_events_task] Find Safe events processed 0 events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:45:56,502 [INFO] [43470db9/index_safe_events_task] Task safe_transaction_service.history.tasks.index_safe_events_task[43470db9-c724-49b6-bcc7-9896f6e5c294] succeeded in 0.23528148300829343s: 0
safe-infrastructure-txs-scheduler-1 | 2023-01-29 06:46:01,265 [INFO] [???/???] Scheduler: Sending due task Index Safe events (L2) (safe_transaction_service.history.tasks.index_safe_events_task)
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:46:01,267 [INFO] [ab221dff/index_safe_events_task] Start indexing of Safe events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:46:01,497 [INFO] [ab221dff/index_safe_events_task] Find Safe events processed 0 events
safe-infrastructure-txs-worker-indexer-1 | 2023-01-29 06:46:01,504 [INFO] [ab221dff/index_safe_events_task] Task safe_transaction_service.history.tasks.index_safe_events_task[ab221dff-2b1d-4207-952c-394793dd0984] succeeded in 0.2376209159992868s: 0
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO rocket::server] GET /v1/chains/51/safes/0xE62B3D7850F09d5fc78b39Acda05e62b88020181:
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO _] Matched: (get_safe_info) GET /v1/chains/<chain_id>/safes/<safe_address>
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z ERROR safe_client_gateway::utils::errors] ERR::404::/v1/chains/51/safes/0xE62B3D7850F09d5fc78b39Acda05e62b88020181::ApiErrorMessage: code:42; message:Some(""); arguments:None
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO _] Outcome: Success
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO safe_client_gateway::monitoring::performance] MT::GET::/v1/chains/<chain_id>/safes/<safe_address>::1::404::/v1/chains/51/safes/0xE62B3D7850F09d5fc78b39Acda05e62b88020181::51::38.6.226.47
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO _] Response succeeded.
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO rocket::server] GET /v1/chains/51/safe-apps?client_url=http%3A%2F%2F103.101.129.240%3A8080:
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO _] Matched: (get_safe_apps) GET /v1/chains/<chain_id>/safe-apps?<client_url>&<url>
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO _] Outcome: Success
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO safe_client_gateway::monitoring::performance] MT::GET::/v1/chains/<chain_id>/safe-apps?<client_url>&<url>::0::200::/v1/chains/51/safe-apps?client_url=http%3A%2F%2F103.101.129.240%3A8080::51::38.6.226.51
safe-infrastructure-cgw-web-1 | [2023-01-29T06:46:05Z INFO _] Response succeeded.
chain info
curl -s http://103.101.129.240:8000/cfg/api/v1/chains/ | jq
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"chainId": "51",
"chainName": "apothem",
"shortName": "txdc",
"description": "Xinfin Testnet Apothem",
"l2": true,
"rpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://erpc.apothem.network/"
},
"safeAppsRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://erpc.apothem.network/"
},
"publicRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://erpc.apothem.network/"
},
"blockExplorerUriTemplate": {
"address": "https://explorer.apothem.network/address/{{address}}",
"txHash": "https://explorer.apothem.network/txs/{{txHash}}",
"api": "https://api-apothem.blocksscan.io/api?module={{module}}&action={{action}}&address={{address}}&apiKey=GnosisSafe"
},
"nativeCurrency": {
"name": "TXDC",
"symbol": "TXDC",
"decimals": 18,
"logoUri": "/media/chains/51/currency_logo_B6iU4tx.png"
},
"transactionService": "http://nginx:8000/txs",
"vpcTransactionService": "http://nginx:8000/txs",
"theme": {
"textColor": "#ffffff",
"backgroundColor": "#000000"
},
"gasPrice": [
{
"type": "fixed",
"weiValue": "250000000"
}
],
"ensRegistryAddress": null,
"recommendedMasterCopyVersion": "1.3.0",
"disabledWallets": [],
"features": [
"CONTRACT_INTERACTION",
"ERC1155",
"ERC721",
"SAFE_APPS",
"SPENDING_LIMIT"
]
}
]
}
file .env
REVERSE_PROXY_PORT=8000
REVERSE_PROXY_UI_PORT=8080
CFG_VERSION=latest
CGW_VERSION=latest
TXS_VERSION=latest
UI_VERSION=dev
RPC_NODE_URL=https://erpc.apothem.network
npm_package_version=1.0.0
Here I use dev for UI, so web-core can use latest safe-core-sdk to support chain apothem.
file container_env_files/ui.env
NEXT_PUBLIC_INFURA_TOKEN=
NEXT_PUBLIC_GATEWAY_URL_PRODUCTION=http://103.101.129.240:8000/cgw
# infura token used by Safe Apps
NEXT_PUBLIC_SAFE_APPS_INFURA_TOKEN=
# Transaction simulation
NEXT_PUBLIC_TENDERLY_SIMULATE_ENDPOINT_URL=
NEXT_PUBLIC_TENDERLY_PROJECT_NAME=
NEXT_PUBLIC_TENDERLY_ORG_NAME=
# Flag to switch to the production environment (redirect urls, gateway url, etc)
NEXT_PUBLIC_IS_PRODUCTION=true
### Optional variables ###
# These variables are required only if you require a certain feature in the interface (e.g. Portis wallet)
# Or overwrite the fallback values (set a different WalletConnect bridge)
# Latest supported safe version, used for upgrade prompts
NEXT_PUBLIC_SAFE_VERSION=1.3.0
# Access keys
NEXT_PUBLIC_SENTRY_DSN=
NEXT_PUBLIC_BEAMER_ID=
# Wallet specific variables
NEXT_PUBLIC_WC_BRIDGE=
NEXT_PUBLIC_FORTMATIC_KEY=
NEXT_PUBLIC_PORTIS_KEY=
NEXT_PUBLIC_CYPRESS_MNEMONIC=
Is there any wrong configuration ?
Add a script that could do the basic setup commands such as:
ChainInfo
I have deployed all the contracts from the v1.3.0
of the safe-contract repo (https://github.com/safe-global/safe-contracts/tree/v1.3.0-libs.0). I have used a non deterministic approach because we did not create a PR yet.
The deployment was sucessful as you can see on the screenshot below:
For some reason, every time I try to import a safe I get the following error:
Am I using the wrong safe-contract version? if so which one should I use?
Thanks!
Checked in the console the 404 I am getting
{"code":42,"message":"{\"message\":\"Params 'module' and 'action' are required parameters\",\"result\":null,\"status\":\"0\"}"}
I deploy a local test enviroment according to guide: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md with commit 0802ae9. But below problem occurs when I open http://localhost:8080/ and create a new safe:
Click button Get started
After a few minutes
File .env
REVERSE_PROXY_PORT=8000
REVERSE_PROXY_UI_PORT=8080
CFG_VERSION=latest
CGW_VERSION=latest
TXS_VERSION=latest
RPC_NODE_URL=https://rpc.ankr.com/eth_goerli
npm_package_version=1.0.0
Chain config
curl -s http://localhost:8000/cgw/v1/chains/5/ | jq
{
"transactionService": "http://nginx:8000/txs",
"chainId": "5",
"chainName": "Goerli",
"shortName": "gor",
"l2": true,
"description": "Ethereum Testnet Görli",
"rpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://rpc.ankr.com/eth_goerli"
},
"safeAppsRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://rpc.ankr.com/eth_goerli"
},
"publicRpcUri": {
"authentication": "NO_AUTHENTICATION",
"value": "https://rpc.ankr.com/eth_goerli"
},
"blockExplorerUriTemplate": {
"address": "https://goerli.etherscan.io/address/{{address}}",
"txHash": "https://goerli.etherscan.io/tx/{{txHash}}",
"api": "https://api-goerli.etherscan.io/api?module={{module}}&action={{action}}&address={{address}}&apiKey={{apiKey}}"
},
"nativeCurrency": {
"name": "Görli Ether",
"symbol": "GOR",
"decimals": 18,
"logoUri": "/media/chains/5/currency_logo.png"
},
"theme": {
"textColor": "#ffffff",
"backgroundColor": "#4D99EB"
},
"ensRegistryAddress": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
"gasPrice": [
{
"type": "FIXED",
"weiValue": "100000000000"
},
{
"type": "FIXED",
"weiValue": "24000000000"
}
],
"disabledWallets": [],
"features": [
"CONTRACT_INTERACTION",
"DOMAIN_LOOKUP",
"ERC1155",
"ERC721",
"SAFE_APPS",
"SPENDING_LIMIT"
]
}
Web Hook
http://nginx:8000/cgw/v1/chains/5/hooks/events
Basic some_random_token
ChainInfo
for the container instance of the tx serviceA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.