Skip to content

Commit

Permalink
Move pro conf to a separate repo; +linux make targets (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus authored Oct 11, 2020
1 parent 948d1d4 commit 9076574
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TZKT_ConnectionStrings__DefaultConnection=server=127.0.0.1;port=5432;database=tzkt_db;username=tzkt;password=qwerty;
TZKT_TezosNode__ChainId=NetXdQprcVkpaWU
TZKT_TezosNode__Endpoint=https://mainnet-tezos.giganode.io/
TZKT_TezosNode_Timeout=60
TZKT_Logging__LogLevel__Default=Debug
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bld/

# Visual Studio 2015/2017 cache/options directory
.vs/
.vscode/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

Expand Down Expand Up @@ -341,4 +342,6 @@ healthchecksdb

*/Properties/launchSettings.json

.sonarqube
.sonarqube
.ionide
.env
32 changes: 7 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,12 @@ update:
clean:
docker system prune --force

pro-init:
docker run --name tzkt-snapshot bakingbad/tzkt-snapshot:latest
docker cp tzkt-snapshot:/tzkt_db.backup .
docker rm tzkt-snapshot
docker rmi bakingbad/tzkt-snapshot
docker-compose -f docker-compose.pro.yml up -d db
docker-compose -f docker-compose.pro.yml exec -T db psql -U tzkt postgres -c '\l'
docker-compose -f docker-compose.pro.yml exec -T db dropdb -U tzkt --if-exists tzkt_db
docker-compose -f docker-compose.pro.yml exec -T db createdb -U tzkt -T template0 tzkt_db
docker-compose -f docker-compose.pro.yml exec -T db pg_restore -U tzkt -O -x -v -d tzkt_db -1 < tzkt_db.backup
docker-compose -f docker-compose.pro.yml exec -T db dropuser -U tzkt pro_user --if-exists
docker-compose -f docker-compose.pro.yml exec -T db createuser -U tzkt pro_user -I -L
docker-compose -f docker-compose.pro.yml exec -T db psql -U tzkt tzkt_db -c 'GRANT CONNECT ON DATABASE tzkt_db TO pro_user;'
docker-compose -f docker-compose.pro.yml exec -T db psql -U tzkt tzkt_db -c 'GRANT USAGE ON SCHEMA public TO pro_user;'
docker-compose -f docker-compose.pro.yml exec -T db psql -U tzkt tzkt_db -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO pro_user;'
rm tzkt_db.backup
docker-compose -f docker-compose.pro.yml build

pro-start:
docker-compose -f docker-compose.pro.yml up -d
db:
docker-compose up -d db

pro-stop:
docker-compose -f docker-compose.pro.yml down
migration:
# Install EF: dotnet tool install --global dotnet-ef
cd Tzkt.Data && dotnet-ef database update -s ../Tzkt.Sync/Tzkt.Sync.csproj

pro-update:
git pull
docker-compose -f docker-compose.pro.yml build
sync:
export $$(cat .env | xargs) && dotnet run -p Tzkt.Sync -v normal
40 changes: 0 additions & 40 deletions docker-compose.pro.yml

This file was deleted.

0 comments on commit 9076574

Please sign in to comment.