Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Required
STAGE=local
CLICKHOUSE_HOST=http://localhost:8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=""
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
BALANCES_DDB=true

# NOT REQUIRED
LLAMANODES_API_KEY=""
DEFILLAMA_PRICE_API_KEY=""
ANKR_API_KEY=""
API_URL=""
AWS_GATEWAY_API_ID_DEV=""
AWS_GATEWAY_API_ID_PROD=""
SENTRY_DSN=""
CLOUDFLARE_R2_PUBLIC_URL=""
NFTPORT_API_KEY=""
OPENSEA_API_KEY=""
ALCHEMY_API_KEY=""
NFTSCAN_API_KEY=""
INFURA_API_KEY=""
INFURA_API_KEY_SECRET=""
CENTER_API_KEY=""
RESERVOIR_API_KEY=""
QUICKNODE_API_KEY=""
QUICKNODE_HTTP_URL=""
ELEMENT_API_KEY:=""
ETHERSCAN_API_KEY=""
SLACK_TOKEN=""
SLACK_CHANNEL_ID=""
DEFILLAMA_LABELS_API_KEY=""
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ test/reports/*.json

_
/internal

# IDE
.idea
8 changes: 5 additions & 3 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ useDotenv: true
provider:
name: aws
runtime: nodejs18.x
stage: dev
region: eu-central-1
stage: local
region: us-east-1
endpointType: REGIONAL # Set to regional because the api gateway will be behind a cloudfront distribution
tracing:
apiGateway: true
Expand Down Expand Up @@ -44,9 +44,11 @@ provider:
- dynamodb:DeleteItem
- dynamodb:BatchGetItem
Resource:
- 'arn:aws:dynamodb:eu-central-1:610755237132:table/${self:custom.tableName}'
- 'arn:aws:dynamodb:table/${self:custom.tableName}'

environment:
AWS_ACCESS_KEY_ID: ${env:AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${env:AWS_SECRET_ACCESS_KEY}
CLICKHOUSE_HOST: ${env:CLICKHOUSE_HOST}
CLICKHOUSE_USER: ${env:CLICKHOUSE_USER}
CLICKHOUSE_PASSWORD: ${env:CLICKHOUSE_PASSWORD}
Expand Down
6 changes: 5 additions & 1 deletion src/db/dynamo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export function getDocClient() {
return docClient
}

client = new DynamoDBClient({})
client = new DynamoDBClient({
endpoint: environment.STAGE === 'local' ? 'http://localhost:8000' : undefined,
region: environment.STAGE === 'local' ? 'us-east-1' : undefined,
})

docClient = DynamoDBDocumentClient.from(client, translateConfig)

return docClient
Expand Down