Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
InoMurko committed Nov 29, 2021
1 parent af44f9f commit 92df3ea
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 9 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ COPY package.json ./

COPY yarn.lock ./

RUN yarn install
ADD src/ ./src
ADD config/ ./config
ADD patches/ ./patches
ADD scripts/ ./scripts
ADD public/ ./public
ADD docs/ ./docs

COPY . .
RUN yarn install

EXPOSE 3000

Expand Down
4 changes: 3 additions & 1 deletion boba_ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ Add users:
docker exec -it boba_ops-safe-transaction-service-1 python manage.py createsuperuser

Add chain:
./load_chain
<!-- Add chain:
http://localhost:8001/admin/chains/chain/add/
Add master records:
http://localhost:8000/admin/history/safemastercopy/add/
http://localhost:8000/admin/history/safemastercopy/add/ -->
54 changes: 54 additions & 0 deletions boba_ops/boba_chains.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
{
"model": "chains.chain",
"pk": 288,
"fields": {
"relevance": 1,
"name": "Boba",
"short_name": "boba",
"description": "Boba Network",
"l2": true,
"rpc_authentication": "API_KEY_PATH",
"rpc_uri": "https://mainnet.boba.network/",
"safe_apps_rpc_authentication": "NO_AUTHENTICATION",
"safe_apps_rpc_uri": "https://mainnet.boba.network/",
"block_explorer_uri_address_template": "https://blockexplorer.boba.network/address/{{address}}",
"block_explorer_uri_tx_hash_template": "https://blockexplorer.boba.network/tx/{{txHash}}",
"currency_name": "Ether",
"currency_symbol": "ETH",
"currency_decimals": 18,
"currency_logo_uri": "chains/1/currency_logo.png",
"transaction_service_uri": "http://nginx-safe-transaction-service:8000",
"vpc_transaction_service_uri": "http://nginx-safe-transaction-service:8000",
"theme_text_color": "#001428",
"theme_background_color": "#E8E7E6",
"recommended_master_copy_version": "1.3.0"
}
},
{
"model": "chains.chain",
"pk": 28,
"fields": {
"relevance": 2,
"name": "Boba Rinkeby",
"short_name": "boba_rinkeby",
"description": "Boba Network Rinkeby",
"l2": true,
"rpc_authentication": "NO_AUTHENTICATION",
"rpc_uri": "https://rinkeby.boba.network",
"safe_apps_rpc_authentication": "NO_AUTHENTICATION",
"safe_apps_rpc_uri": "https://rinkeby.boba.network",
"block_explorer_uri_address_template": "https://blockexplorer.rinkeby.boba.network/address/{{address}}",
"block_explorer_uri_tx_hash_template": "https://blockexplorer.rinkeby.boba.network/tx/{{txHash}}",
"currency_name": "Ether",
"currency_symbol": "ETH",
"currency_decimals": 18,
"currency_logo_uri": "chains/1/currency_logo.png",
"transaction_service_uri": "http://nginx-safe-transaction-service:8000",
"vpc_transaction_service_uri": "http://nginx-safe-transaction-service:8000",
"theme_text_color": "#ffffff",
"theme_background_color": "#E8673C",
"recommended_master_copy_version": "1.3.0"
}
}
]
3 changes: 3 additions & 0 deletions boba_ops/build-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DOCKER_BUILDKIT=1
COMPOSE_DOCKER_CLI_BUILD=1
docker-compose build -- safe-react safe-config-service safe-client-gateway safe-transaction-service
4 changes: 4 additions & 0 deletions boba_ops/create_user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

set -eo pipefail
docker exec -it boba_ops-safe-transaction-service-1 python manage.py createsuperuser
18 changes: 17 additions & 1 deletion boba_ops/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ services:
- "8888:8888"
volumes:
- nginx-shared:/nginx
restart: always
command: ./docker/web/run_web.sh

worker: &worker
Expand All @@ -74,6 +75,7 @@ services:
depends_on:
- db
- redis
restart: always
command: ./docker/web/celery/worker/run.sh

scheduler:
Expand Down Expand Up @@ -107,4 +109,18 @@ services:
env_file:
- envs/.env_safe_config_service
depends_on:
- db
- db

safe-react:
image: bobanetwork/safe-react
build:
context: ../
dockerfile: ./Dockerfile
env_file:
- envs/.env_safe_react
volumes:
- /app/node_modules
- ../:/app
restart: always
ports:
- 3000:3000
2 changes: 1 addition & 1 deletion boba_ops/envs/.env_safe_client_gateway
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ CHAIN_INFO_REQUEST_TIMEOUT=15000

# Exchange rate API: https://exchangeratesapi.io/
EXCHANGE_API_BASE_URI=http://api.exchangeratesapi.io/latest
EXCHANGE_API_KEY=your_exchange_rate_api_token
EXCHANGE_API_KEY=
2 changes: 2 additions & 0 deletions boba_ops/envs/.env_safe_react
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_NETWORK=BOBA_RINKEBY
NODE_ENV=test
1 change: 1 addition & 0 deletions boba_ops/envs/.env_safe_transaction_service
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ ETHEREUM_TRACING_NODE_URL=https://rinkeby.boba.network
ETH_L2_NETWORK=1
REDIS_URL=redis://redis:6379/0
CELERY_BROKER_URL=redis://redis:6379/1
DJANGO_ALLOWED_HOSTS="localhost,0.0.0.0,127.0.0.1,*,172.22.0.9"
5 changes: 5 additions & 0 deletions boba_ops/load_chain
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -eo pipefail
docker compose cp boba_chains.json safe-config-service:/tmp/boba_chains.json
./run manage loaddata /tmp/boba_chains.json
50 changes: 50 additions & 0 deletions boba_ops/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

set -eo pipefail

DC="${DC:-exec}"

# If we're running in CI we need to disable TTY allocation for docker-compose
# commands that enable it by default, such as exec and run.
TTY=""
if [[ ! -t 1 ]]; then
TTY="-T"
fi

# -----------------------------------------------------------------------------
# Helper functions start with _ and aren't listed in this script's help menu.
# -----------------------------------------------------------------------------

function _dc {
docker-compose "${DC}" ${TTY} "${@}"
}

# -----------------------------------------------------------------------------

function cmd {
# Run any command you want in the safe-config-service container
_dc safe-config-service "${@}"
}

function manage {
# Run any manage.py commands

# We need to collectstatic before we run our tests.
if [ "${1-''}" == "test" ]; then
cmd python src/manage.py collectstatic --no-input
fi

cmd python src/manage.py "${@}"
}

function help {
printf "%s <task> [args]\n\nTasks:\n" "${0}"

compgen -A function | grep -v "^_" | cat -n

printf "\nExtended help:\n Each task has comments for general usage\n"
}

# This idea is heavily inspired by: https://github.com/adriancooney/Taskfile
TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}"
7 changes: 4 additions & 3 deletions src/config/networks/boba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {
} from 'src/config/networks/network.d'

const baseConfig: EnvironmentSettings = {
clientGatewayUrl: 'http://127.0.0.1:8000/v1',
txServiceUrl: 'http://127.0.0.1:8001/api/v1',
safeUrl: 'http://localhost:3000/app',
//this is the frontend2backend url
clientGatewayUrl: 'http://127.0.0.1:8002/v1',
txServiceUrl: 'http://127.0.0.1:8000/api/v1',
safeUrl: 'http://gnosis-safe.mainnet.boba:3000/app',
gasPriceOracles: [
{
url: 'https://mainnet.boba.network/',
Expand Down
3 changes: 2 additions & 1 deletion src/config/networks/boba_rinkeby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {
} from 'src/config/networks/network.d'

const baseConfig: EnvironmentSettings = {
//this is the frontend2backend url
clientGatewayUrl: 'http://127.0.0.1:8002/v1',
txServiceUrl: 'http://127.0.0.1:8000/api/v1',
safeUrl: 'http://localhost:3000/app',
safeUrl: 'http://gnosis-safe.rinkeby.boba:3000/app',
gasPriceOracles: [
{
url: 'https://rinkeby.boba.network/',
Expand Down

0 comments on commit 92df3ea

Please sign in to comment.