safe-global / safe-infrastructure

One `docker-compose.yml` file to rule them all
MIT License
56 stars 92 forks source link

Additional steps to fully launch on a new chain #133

Open svanegmond opened 5 months ago

svanegmond commented 5 months ago

I wanted to provide some notes on what we went through deploying Safe, finally, on the Shyft network, in addition to the steps described to add an official entry in safe-deployments.

I'm not sure that these are sensible as a PR, except maybe safe-global/safe-transaction-service#3:

  1. Nethermind requires additional configuration settings besides just turning off pruning. Bug filed separately about that.
  2. We had to add an entry to cgw.env mapping the chain ID for our chain to the name it is known as at coingecko: prices.chains.7341.nativeCoin=SHFT This was incredibly difficult to figure out.
  3. The default nginx 502 error page is unsightly, and is shown for several minutes while the ui server does a build and run (!). Separately, the chain logo is not kept in the docker image we upload it to. These changes address this point:

docker-compose.yml:

add to cfg-web volumes:
      - ./docker/media_chains:/app/staticfiles/chains/

add to nginx volumes:
      - ./docker/pages:/pages

revise docker/nginx/nginx.conf:

server {
...
    error_page 500 502 503 504 /500.html ;
    location /500.html {
        root /pages/;
    }
    location /cfg/media {
        alias /nginx-cfg/staticfiles/chains;
    }
...
}

Create docker/pages/500.html with the desired 500 error page and docker/media_chains/7341/currency_logo.png (where 7341 is our chain ID) with our chain logo.

Manually log into the cfg-db container, and revise the logo. This is not possible with the django UI as it is. update chains_chain set chain_logo_uri='7341/currency_logo.png' where id=7341

moisses89 commented 4 months ago

Thanks for the feedback, we really apreciate it. Could you link the bug issue that you mentions in the point 1?

svanegmond commented 4 months ago

Yes. That's https://github.com/safe-global/safe-docs/issues/434

bertux commented 4 months ago

When I tried on my install without uploading manually the logo and updating manually the database, I can't configure anymore a chain because it throws the error [Errno 2] No such file or directory: '/app/src/media/chains/10242/currency_logo_fETmRCD.png' so it confirms it's not possible to upload the logo with the Django UI but I didn't expect it to break the possibility to configure the chain.

bertux commented 4 months ago

I've made it for the logo without modifying cfg-web by just modifying nginx configuration to serve /cfg/media/chains from a new media-chains mounted volume added in docker-compose.yml I will create a PR for that to let others review it.