Skip to content

Commit

Permalink
Update docker-compose files. Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
dmirgaleev committed Feb 5, 2024
1 parent 8ae8322 commit bfe9c75
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 43 deletions.
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ init:
docker-compose exec -T db createdb -U tzkt -T template0 tzkt_db
docker-compose exec -T db apt update
docker-compose exec -T db apt install -y wget
docker-compose exec -T db wget "https://snapshots.tzkt.io/tzkt_v1.12_mainnet.backup" -O tzkt_db.backup
docker-compose exec -T db wget "https://snapshots.tzkt.io/tzkt_v1.13_mainnet.backup" -O tzkt_db.backup
docker-compose exec -T db pg_restore -U tzkt -O -x -v -d tzkt_db -e -j 4 tzkt_db.backup
docker-compose exec -T db rm tzkt_db.backup
docker-compose exec -T db apt autoremove --purge -y wget
Expand Down Expand Up @@ -52,7 +52,7 @@ ghost-init:
docker-compose -f docker-compose.ghost.yml exec -T ghost-db createdb -U tzkt -T template0 tzkt_db
docker-compose -f docker-compose.ghost.yml exec -T ghost-db apt update
docker-compose -f docker-compose.ghost.yml exec -T ghost-db apt install -y wget
docker-compose -f docker-compose.ghost.yml exec -T ghost-db wget "https://snapshots.tzkt.io/tzkt_v1.12_ghostnet.backup" -O tzkt_db.backup
docker-compose -f docker-compose.ghost.yml exec -T ghost-db wget "https://snapshots.tzkt.io/tzkt_v1.13_ghostnet.backup" -O tzkt_db.backup
docker-compose -f docker-compose.ghost.yml exec -T ghost-db pg_restore -U tzkt -O -x -v -d tzkt_db -e -j 4 tzkt_db.backup
docker-compose -f docker-compose.ghost.yml exec -T ghost-db rm tzkt_db.backup
docker-compose -f docker-compose.ghost.yml exec -T ghost-db apt autoremove --purge -y wget
Expand Down Expand Up @@ -89,27 +89,27 @@ nairobi-stop:
nairobi-db-start:
docker-compose -f docker-compose.nairobi.yml up -d nairobi-db

mumbai-init:
docker-compose -f docker-compose.mumbai.yml up -d mumbai-db
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db psql -U tzkt postgres -c '\l'
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db dropdb -U tzkt --if-exists tzkt_db
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db createdb -U tzkt -T template0 tzkt_db
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db apt update
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db apt install -y wget
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db wget "https://snapshots.tzkt.io/tzkt_v1.12_mumbainet.backup" -O tzkt_db.backup
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db pg_restore -U tzkt -O -x -v -d tzkt_db -e -j 4 tzkt_db.backup
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db rm tzkt_db.backup
docker-compose -f docker-compose.mumbai.yml exec -T mumbai-db apt autoremove --purge -y wget
oxford-init:
docker-compose -f docker-compose.oxford.yml up -d oxford-db
docker-compose -f docker-compose.oxford.yml exec -T oxford-db psql -U tzkt postgres -c '\l'
docker-compose -f docker-compose.oxford.yml exec -T oxford-db dropdb -U tzkt --if-exists tzkt_db
docker-compose -f docker-compose.oxford.yml exec -T oxford-db createdb -U tzkt -T template0 tzkt_db
docker-compose -f docker-compose.oxford.yml exec -T oxford-db apt update
docker-compose -f docker-compose.oxford.yml exec -T oxford-db apt install -y wget
docker-compose -f docker-compose.oxford.yml exec -T oxford-db wget "https://snapshots.tzkt.io/tzkt_v1.13_oxfordnet.backup" -O tzkt_db.backup
docker-compose -f docker-compose.oxford.yml exec -T oxford-db pg_restore -U tzkt -O -x -v -d tzkt_db -e -j 4 tzkt_db.backup
docker-compose -f docker-compose.oxford.yml exec -T oxford-db rm tzkt_db.backup
docker-compose -f docker-compose.oxford.yml exec -T oxford-db apt autoremove --purge -y wget
docker-compose pull

mumbai-start:
docker-compose -f docker-compose.mumbai.yml up -d
oxford-start:
docker-compose -f docker-compose.oxford.yml up -d

mumbai-stop:
docker-compose -f docker-compose.mumbai.yml down
oxford-stop:
docker-compose -f docker-compose.oxford.yml down

mumbai-db-start:
docker-compose -f docker-compose.mumbai.yml up -d mumbai-db
oxford-db-start:
docker-compose -f docker-compose.oxford.yml up -d oxford-db
reset:
docker-compose -f docker-compose.mumbai.yml down --volumes
docker-compose -f docker-compose.mumbai.yml up -d mumbai-db
docker-compose -f docker-compose.oxford.yml down --volumes
docker-compose -f docker-compose.oxford.yml up -d oxford-db
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ sudo apt install -y dotnet-sdk-7.0
#### Install Postgresql

````
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt -y install postgresql postgresql-contrib
sudo apt -y install postgresql-16 postgresql-contrib
````

---
Expand All @@ -85,7 +87,7 @@ postgres=# \q
#### Download fresh snapshot (example for mainnet)

````
wget "https://snapshots.tzkt.io/tzkt_v1.12_mainnet.backup" -O /tmp/tzkt_db.backup
wget "https://snapshots.tzkt.io/tzkt_v1.13_mainnet.backup" -O /tmp/tzkt_db.backup
````

#### Restore database from the snapshot
Expand Down Expand Up @@ -255,11 +257,11 @@ That's it. If you want to run the API as a daemon, take a look at this guide: ht

In general the steps are the same as for the mainnet, you will just need to use a different RPC endpoint and DB snapshot. Here are presets for the current testnets:
- Ghostnet:
- Snapshot: https://snapshots.tzkt.io/tzkt_v1.12_ghostnet.backup
- Snapshot: https://snapshots.tzkt.io/tzkt_v1.13_ghostnet.backup
- RPC node: https://rpc.tzkt.io/ghostnet/
- Mumbainet:
- Snapshot: https://snapshots.tzkt.io/tzkt_v1.12_mumbainet.backup
- RPC node: https://rpc.tzkt.io/mumbainet/
- Oxfordnet:
- Snapshot: https://snapshots.tzkt.io/tzkt_v1.13_oxfordnet.backup
- RPC node: https://rpc.tzkt.io/oxfordnet/
- Nairobinet:
- Snapshot: https://snapshots.tzkt.io/tzkt_v1.12_nairobinet.backup
- RPC node: https://rpc.tzkt.io/nairobinet/
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.ghost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
ghost-db:
container_name: ghost-db
restart: always
image: postgres:13
image: postgres:16
environment:
POSTGRES_USER: ${POSTGRES_USER:-tzkt}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-qwerty}
Expand Down
28 changes: 14 additions & 14 deletions docker-compose.mumbai.yml → docker-compose.oxford.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
version: '3'

services:
mumbai-db:
container_name: mumbai-db
oxford-db:
container_name: oxford-db
restart: always
image: postgres:13
image: postgres:16
environment:
POSTGRES_USER: ${POSTGRES_USER:-tzkt}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-qwerty}
POSTGRES_DB: ${POSTGRES_DB:-tzkt_db}
volumes:
- mumbai-postgres:/var/lib/postgresql/data
- oxford-postgres:/var/lib/postgresql/data
ports:
- 127.0.0.1:5435:5432

mumbai-api:
container_name: mumbai-api
oxford-api:
container_name: oxford-api
restart: always
image: bakingbad/tzkt-api:latest
depends_on:
- mumbai-db
- oxford-db
environment:
ConnectionStrings__DefaultConnection: host=mumbai-db;port=5432;database=${POSTGRES_DB:-tzkt_db};username=${POSTGRES_USER:-tzkt};password=${POSTGRES_PASSWORD:-qwerty};command timeout=${COMMAND_TIMEOUT:-600};
ConnectionStrings__DefaultConnection: host=oxford-db;port=5432;database=${POSTGRES_DB:-tzkt_db};username=${POSTGRES_USER:-tzkt};password=${POSTGRES_PASSWORD:-qwerty};command timeout=${COMMAND_TIMEOUT:-600};
Kestrel__Endpoints__Http__Url: http://0.0.0.0:5000
ports:
- 0.0.0.0:5030:5000

mumbai-sync:
container_name: mumbai-sync
oxford-sync:
container_name: oxford-sync
restart: always
image: bakingbad/tzkt-sync:latest
environment:
ConnectionStrings__DefaultConnection: host=mumbai-db;port=5432;database=${POSTGRES_DB:-tzkt_db};username=${POSTGRES_USER:-tzkt};password=${POSTGRES_PASSWORD:-qwerty};command timeout=${COMMAND_TIMEOUT:-600};
ConnectionStrings__DefaultConnection: host=oxford-db;port=5432;database=${POSTGRES_DB:-tzkt_db};username=${POSTGRES_USER:-tzkt};password=${POSTGRES_PASSWORD:-qwerty};command timeout=${COMMAND_TIMEOUT:-600};
Kestrel__Endpoints__Http__Url: http://0.0.0.0:5001
TezosNode__Endpoint: https://rpc.tzkt.io/mumbainet/
TezosNode__Endpoint: https://rpc.tzkt.io/oxfordnet/
depends_on:
- mumbai-db
- oxford-db
ports:
- 0.0.0.0:5031:5001

volumes:
mumbai-postgres:
oxford-postgres:
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
db:
container_name: tzkt-db
restart: always
image: postgres:13
image: postgres:16
environment:
POSTGRES_USER: ${POSTGRES_USER:-tzkt}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-qwerty}
Expand Down

0 comments on commit bfe9c75

Please sign in to comment.