Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Aug 28, 2023
2 parents 82d2a33 + 8568a89 commit 444fdcc
Show file tree
Hide file tree
Showing 53 changed files with 1,322 additions and 1,090 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
sleep 1
done
- name: Restore DB backup
run: PGPASSWORD=postgres psql -h localhost -p 5443 -U postgres -d givethio < /tmp/backups/givethio-staging/db_backup.sql
# - name: Restore DB backup
# run: PGPASSWORD=postgres psql -h localhost -p 5443 -U postgres -d givethio < /tmp/backups/givethio-staging/db_backup.sql

- name: Use Node.js
uses: actions/setup-node@v1
Expand Down Expand Up @@ -124,12 +124,17 @@ jobs:
deploy:
needs: publish
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Staging deploy
uses: garygrossgarten/github-action[email protected]
- name: SSH and Redeploy
uses: appleboy/ssh-action@v1.0.0
with:
command: cd impact-graph && git checkout staging && git pull && docker-compose -f docker-compose-staging.yml pull && docker-compose -f docker-compose-staging.yml down && docker-compose -f docker-compose-staging.yml up -d && docker image prune -a --force;
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USERNAME }}
privateKey: ${{ secrets.STAGING_PRIVATE_KEY}}
host: ${{ secrets.STAGING_HOST_ALL }}
username: ${{ secrets.STAGING_USERNAME_ALL }}
key: ${{ secrets.STAGING_PRIVATE_KEY_ALL }}
port: ${{ secrets.SSH_PORT }}
script: |
cd giveth-all
docker-compose stop impact-graph
docker-compose pull impact-graph
docker-compose up -d impact-graph
docker image prune -a --force
9 changes: 7 additions & 2 deletions config/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ PROJECT_REVOKE_SERVICE_ACTIVE=true
PROJECT_UPDATES_FIRST_REVOKE_BATCH_DATE=2022-10-22

FILL_POWER_SNAPSHOT_SERVICE_ACTIVE=true
FILL_BLOCK_NUMBERS_OF_SNAPSHOTS_CRONJOB_EXPRESSION=0 0 * * *

#Every 30 minutes
UPDATE_POWER_ROUND_CRONJOB_EXPRESSION=10 */30 * * * *
Expand Down Expand Up @@ -189,10 +188,16 @@ ENABLE_INSTANT_BOOSTING_UPDATE=true
# OPTIONAL - default: Every 5 minutes
INSTANT_BOOSTING_UPDATE_CRONJOB_EXPRESSION=0 */5 * * * *

// Gitcoin API
# Gitcoin API
GITCOIN_ADAPTER=mock
GITCOIN_PASSPORT_API=
GITCOIN_SCORER_ID=

# OPTIONAL - default: Every 10 minutes
CHECK_QF_ROUND_ACTIVE_STATUS_CRONJOB_EXPRESSION=*/10 * * * *

BALANCE_AGGREGATOR_BASE_URL=https://dev.serve.giveth.io/givpower-balance-aggregator
POWER_BALANCE_AGGREGATOR_ADAPTER=powerBalanceAggregator
#POWER_BALANCE_AGGREGATOR_ADAPTER=mock
NUMBER_OF_BALANCE_AGGREGATOR_BATCH=20

10 changes: 7 additions & 3 deletions config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ TRACE_FILE_UPLOADER_PASSWORD=hello_trace
API_GIV_PASSWORD=123
API_GIV_USERNAME=testApiGive

AUTH_MICROSERVICE_AUTHENTICATION_URL=https://serve.giveth.io/siweauthmicroservice/v1/authentication
AUTH_MICROSERVICE_AUTHORIZATION_URL=https://serve.giveth.io/siweauthmicroservice/v1/authorization
AUTH_MICROSERVICE_NONCE_URL=https://serve.giveth.io/siweauthmicroservice/v1/nonce
AUTH_MICROSERVICE_AUTHENTICATION_URL=https://auth.serve.giveth.io/v1/authentication
AUTH_MICROSERVICE_AUTHORIZATION_URL=https://auth.serve.giveth.io/v1/authorization
AUTH_MICROSERVICE_NONCE_URL=https://auth.serve.giveth.io/v1/nonce
PRIVATE_ETHERS_TEST_KEY=8ab0e165c2ea461b01cdd49aec882d179dccdbdb5c85c3f9c94c448aa65c5ace
PUBLIC_ETHERS_TEST_KEY=0x53bFf74b9Af2E3853f758A8D2Bd61CD115d27782

Expand Down Expand Up @@ -167,3 +167,7 @@ DONATION_VERIFICAITON_EXPIRATION_HOURS=24
# We need it for monoswap
POLYGON_MAINNET_NODE_HTTP_URL=https://polygon-rpc.com
OPTIMISM_NODE_HTTP_URL=https://optimism-mainnet.public.blastapi.io

BALANCE_AGGREGATOR_BASE_URL=https://dev.serve.giveth.io/givpower-balance-aggregator
POWER_BALANCE_AGGREGATOR_ADAPTER=mock
NUMBER_OF_BALANCE_AGGREGATOR_BATCH=7
6 changes: 3 additions & 3 deletions docker-compose-local-postgres-redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ services:

redis-giveth:
# it's better to not using the latest tag, maybe latest tag have some breaking changes
image: bitnami/redis:5.0.9-debian-10-r142
image: redis:7.2.0-alpine3.18
container_name: redis-giveth
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_ALLOW_EMPTY_PASSWORD=yes
restart: always
ports:
- "6379:6379"
volumes:
- redis-data:/bitnami/redis/data
- redis-data:/data

volumes:
db-data:
Expand Down
8 changes: 4 additions & 4 deletions docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ services:
- redis-giveth

redis-giveth:
# it's better to not using latest tag, maybe latest tag have some breaking changes
image: bitnami/redis:5.0.9-debian-10-r142
# it's better to not using the latest tag, maybe latest tag have some breaking changes
image: redis:7.2.0-alpine3.18
container_name: redis-giveth
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_ALLOW_EMPTY_PASSWORD=yes
restart: always
volumes:
- redis-data:/bitnami/redis/data
- redis-data:/data

volumes:
redis-data:
8 changes: 4 additions & 4 deletions docker-compose-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ services:
- redis-giveth

redis-giveth:
# it's better to not using latest tag, maybe latest tag have some breaking changes
image: bitnami/redis:5.0.9-debian-10-r142
# it's better to not using the latest tag, maybe latest tag have some breaking changes
image: redis:7.2.0-alpine3.18
container_name: redis-giveth
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_ALLOW_EMPTY_PASSWORD=yes
restart: always
volumes:
- redis-data:/bitnami/redis/data
- redis-data:/data

volumes:
redis-data:
27 changes: 27 additions & 0 deletions migration/1692623384774-MigrateToBalanceAggregator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class MigrateToBalanceAggregator1692623384774
implements MigrationInterface
{
async up(queryRunner: QueryRunner): Promise<void> {
// Drop instant power balance table and recreate it with new schema
await queryRunner.query(`
DELETE FROM public.instant_power_balance;
ALTER TABLE IF EXISTS public.instant_power_balance
DROP COLUMN "chainUpdatedAt",
ADD COLUMN "balanceAggregatorUpdatedAt" timestamp without time zone NOT NULL;
`);

// Drop InstantPowerFetchState table and create new one
await queryRunner.query(`
DELETE from public.instant_power_fetch_state;
ALTER TABLE IF EXISTS public.instant_power_fetch_state
DROP COLUMN "latestBlockNumber",
DROP COLUMN "latestBlockTimestamp",
ADD COLUMN "maxFetchedUpdateAtTimestampMS" bigint NOT NULL;
`);
}

async down(queryRunner: QueryRunner): Promise<void> {}
}
Loading

0 comments on commit 444fdcc

Please sign in to comment.