### Build Docker Setup Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/docker_cheatsheet.md Builds and runs the entire Docker setup for the project. The `--force-rm` flag ensures that temporary build containers are removed. ```bash docker compose up ``` ```bash docker compose build --force-rm ``` -------------------------------- ### Manual Django Superuser Setup (Config Service) Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Manually starts Docker containers and creates a superuser for the Safe Config Service using a Docker exec command. This allows direct interaction with the service's management interface. ```bash docker compose pull docker compose down -v docker compose up docker compose exec cfg-web python src/manage.py createsuperuser --noinput ``` -------------------------------- ### Setup .env File Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Copies the sample environment file to .env and instructs to set the RPC_NODE_URL. This is a crucial step for configuring the services to run against a specific blockchain network. ```bash cp .env.sample .env ``` -------------------------------- ### Manual Django Superuser Setup (Transaction Service) Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Manually creates a superuser for the Safe Transaction Service using a Docker exec command. It highlights the different path to the manage.py file for this service. ```bash docker compose exec txs-web python manage.py createsuperuser --username root ``` -------------------------------- ### Connect to Redis CLI Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/docker_cheatsheet.md Starts the redis-cli and connects to the specified Redis container, allowing direct interaction with the Redis instance. ```bash docker compose exec -it cgw-redis redis-cli ``` ```bash docker compose exec -it txs-redis redis-cli ``` -------------------------------- ### Automated Django Superuser Setup Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Executes a shell script to automate the setup of Django superusers for the services. This simplifies the process of creating administrative credentials. ```sh cd scripts sh run_locally.sh ``` -------------------------------- ### Configure Safe Service Versions Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/README.md Sets the versions for various Safe backend services including Config Service, Client Gateway, Tx Service, UI, and Events Service. These versions can be adjusted in the .env file to target specific releases from Docker Hub. ```bash CFG_VERSION=v2.60.0 CGW_VERSION=v0.4.1 TXS_VERSION=v4.6.1 UI_VERSION=v1.2.0 EVENTS_VERSION=v0.5.0 ``` -------------------------------- ### Configure UI Environment Variables Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Details the configuration of environment variables for the Safe Web App, specifically `NEXT_PUBLIC_INFURA_TOKEN` and `NEXT_PUBLIC_GATEWAY_URL_PRODUCTION`. These settings control the app's connection to blockchain networks and the gateway service. ```bash # 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. The value of NEXT_PUBLIC_GATEWAY_URL_PRODUCTION defines the URL where the Safe CGW can be reached. ``` -------------------------------- ### Configure Webhooks for Events Service Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Provides step-by-step instructions to configure webhooks for the Events service via its admin panel. This includes setting the URL, description, authorization token, and enabling webhook options. ```bash # Set the Url field to http://nginx:8000/cgw/v1/hooks/events # Set description CGW # Enable Is Active field # Set the Authorization field to Basic , where corresponds to the value of AUTH_TOKEN in the container_env_files/cgw.env file of this repository # Leave chains field blank # Enable every webhook option and click Save ``` -------------------------------- ### Connect to PostgreSQL CLI Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/docker_cheatsheet.md Connects to the PostgreSQL instance using psql for the Safe Config and Safe Transaction services. The user is specified as 'postgres'. ```bash docker compose exec -it cfg-db psql -U postgres ``` ```bash docker compose exec -it txs-db psql -U postgres ``` -------------------------------- ### Configure Webhooks for Config Service Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Demonstrates how to configure webhook settings for the Config service by modifying environment files. This is necessary for cache invalidation between services. ```bash # Inside the file "container_env_files/cfg.env" #... CGW_URL=http://nginx:8000/cgw CGW_AUTH_TOKEN=some_random_token # Inside the file "container_env_files/cgw.env" AUTH_TOKEN=some_random_token ``` -------------------------------- ### Clean Docker Environment Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/running_locally.md Commands to clean up existing Docker containers and volumes, and to pull the latest service images. This ensures a fresh environment for local development. ```bash docker compose down -v docker compose rm -f -v docker compose pull ``` -------------------------------- ### Block Explorer URL Templates Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/chain_info.md URL templates used by the Safe web app to construct links to block explorers. Placeholders like {{address}} and {{txHash}} are used to dynamically insert relevant data. ```javascript { // ... "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}}" // ... } ``` -------------------------------- ### Access Web Container Bash Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/docker_cheatsheet.md Provides bash access to the web containers for debugging or inspection. Use Ctrl+d to exit the interactive mode. ```bash docker compose exec -it cfg-web bash ``` ```bash docker compose exec -it txs-web bash ``` -------------------------------- ### Transaction Service Connection Configuration Source: https://github.com/safe-global/safe-infrastructure/blob/main/docs/chain_info.md Configuration for connecting the Client Gateway (CGW) to Safe Transaction Service (TXS) instances. It includes fields for both VPC and standard transaction service URIs, allowing for private network configurations. ```javascript { // ... "vpc_transaction_service" : "http://nginx:8000/txs", "transaction_service" : "http://nginx:8000/txs", // ... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.