Skip to content

Commit

Permalink
Improve setup docs
Browse files Browse the repository at this point in the history
- Add missing information about chainInfo
- Add missing information about MasterCopies and Proxy Factories
  • Loading branch information
Uxio0 committed Jul 5, 2024
1 parent e4ba811 commit e68b3cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/chain_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ At any point, if you see a value that you are unsure how to supply, just look at

These values are meant to be provided in the admin panel `http://localhost:8000/cfg/admin` of the Safe Config Service (CFG)

## EIP-3779 Shortnames

They must match the ones in the [Safe SDK repo](https://github.com/safe-global/safe-core-sdk/blob/main/packages/protocol-kit/src/utils/eip-3770/config.ts).

## Connecting the Safe Client Gateway (CGW) to the Safe Transaction Service (TXS)

The CGW can forward requests to many independently running TXS instances pointing to different chains. The CFG has to keep a registry of every available instance of the TXS.
Expand Down
17 changes: 14 additions & 3 deletions docs/running_locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Brief Docker Crash Course](docker_cheatsheet.md)

**Important Note:** If you followed the guide some time ago, it's recommended to clean the existing data:

- Remove docker volumes: `docker-compose rm -f -v`.
- Remove `./data` folder, that holds the database.

Expand Down Expand Up @@ -62,15 +63,21 @@ Note 1: note that the path to `manage.py` is different. In case you need to run

We need to be able to define a `ChainInfo` object in the Safe Config service so that the Client Gateway knows the URL of the Safe Transaction service instance it needs to request against for a given safe.

You can do this in the admin interface of the Safe Config service: `http://localhost:8000/cfg/admin/chains/chain/add/`
Check this [section](chain_info.md) for a guide on the fields for `ChainInfo`.

You can do this in the admin interface of the Safe Config service: `http://localhost:8000/cfg/admin/chains/chain/add/`.

You can verify that your `ChainInfo` was successfully added by going to `http://localhost:8000/cfg/api/v1/chains`.

Remember to edit your `ChainInfo` json fields `transaction_service_uri` and `vpc_transaction_service_uri` to point to your local instance of the transaction service. The values should be `http://nginx:8000/txs`

Check this [section](chain_info.md) for a more complete guide on the fields for `ChainInfo`.
## Step 4: Add your `MasterCopies` and `ProxyFactories`

By default, tx service will auto setup `MasterCopies` and `Proxy Factories` for
[a of networks](https://github.com/safe-global/safe-eth-py/blob/main/gnosis/safe/addresses.py).
If your network is not supported you have to add the addresses manually in http://localhost:8000/txs/admin/

## Step 4: Add your webhooks
## Step 5: Add your webhooks

Our services invalidate the caches of the client gateway using webhooks. Both the Config and Events service need to be configured. For the Config service, unless you've changed the values in `cgw.env` and `cfg.env` then you don't need to do anything, otherwise:

Expand Down Expand Up @@ -106,3 +113,7 @@ The Safe Web app will be available at at http://localhost:8000/ although check t
Add your `NEXT_PUBLIC_INFURA_TOKEN` value if its required for the chain RCP uri in the [container_env_files/ui.env](../container_env_files/ui.env) file.

Additionally, the Safe Web app itself, defines which instance of the Safe CGW to use in this [container_env_files/ui.env](../container_env_files/ui.env) file. The value of `NEXT_PUBLIC_GATEWAY_URL_PRODUCTION` defines the URL where the Safe CGW can be reached. The default in this repo, points to the instance running as part of the `docker-compose.yml` file, but can be adjusted to point to our production instances, or your own hosted instance.

## Video tutorial

Not recorded by the Safe team, but [here you can find an example of setting up Avalanche Fuji C-Chain](https://www.youtube.com/watch?v=FUytj_xStDI)

0 comments on commit e68b3cc

Please sign in to comment.