diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..15bf54e7
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,2 @@
+./node_modules
+./dist
diff --git a/.env.example b/.env.example
new file mode 100644
index 00000000..79f5006d
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,37 @@
+# Node
+NODE_ENV=development
+
+# Pocket-js keys
+GATEWAY_CLIENT_PUBLIC_KEY=
+GATEWAY_CLIENT_PRIVATE_KEY=v3rys3cr3tk3yud0nt3venkn0w
+GATEWAY_CLIENT_PASSPHRASE=v3rys3cr3tp4ssphr4ze
+
+# Mongodb env
+MONGO_ENDPOINT=mongodb://mongouser:mongopassword@db:27017/gateway?authSource=admin
+DATABASE_ENCRYPTION_KEY=00000000000000000000000000000000
+
+# cache
+REDIS_ENDPOINT=cache:6379
+REDIS_PORT=6379
+
+# tsdb env
+PG_CONNECTION=postgres://pguser:pgpassword@metricsdb:5432/gateway
+PG_CERTIFICATE=PG_PRODUCTION_CERTIFICATE
+
+# logz
+LOGZ_TOKEN=12345
+
+# pocket protocol dispatch and fallback nodes
+DISPATCH_URL=https://node1.mainnet.pokt.network,https://node2.mainnet.pokt.network,https://node3.mainnet.pokt.network,https://node4.mainnet.pokt.network,https://node5.mainnet.pokt.network,https://node6.mainnet.pokt.network,https://node7.mainnet.pokt.network,https://node8.mainnet.pokt.network,https://node9.mainnet.pokt.network,https://node10.mainnet.pokt.network,https://node11.mainnet.pokt.network,https://node12.mainnet.pokt.network,https://node13.mainnet.pokt.network,https://node14.mainnet.pokt.network,https://node15.mainnet.pokt.network,https://node16.mainnet.pokt.network,https://node17.mainnet.pokt.network,https://node18.mainnet.pokt.network,https://node19.mainnet.pokt.network,https://node20.mainnet.pokt.network
+ALTRUIST={"0001":"https://user:pass@backups.example.org:18081","0003":"https://user:pass@backups.example.org:19650","0004":"https://user:pass@backups.example.org:18552","0005":"https://user:pass@backups.example.org:18553","0009":"https://user:pass@backups.example.org:18554","0010":"https://user:pass@backups.example.org:18552","0021":"https://user:pass@backups.example.org:18545","0022":"https://user:pass@backups.example.org:18545","0023":"https://user:pass@backups.example.org:18557","0024":"https://user:pass@backups.example.org:18548","0025":"https://user:pass@backups.example.org:18555","0026":"https://user:pass@backups.example.org:18556","0027":"https://user:pass@backups.example.org:18546","0028":"https://user:pass@backups.example.org:18545","000A":"https://user:pass@backups.example.org:18553"}
+POCKET_SESSION_BLOCK_FREQUENCY=4
+POCKET_BLOCK_TIME=1038000
+POCKET_RELAY_RETRIES=0
+
+# Choose your AAT plan
+# values: freemium, premium
+AAT_PLAN=freemium
+
+# Development environment
+WATCH=true
+NODE_ENV=development
diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md
index 49854854..a06c76dd 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.md
+++ b/.github/ISSUE_TEMPLATE/bug-report.md
@@ -4,6 +4,7 @@ about: Create a report to help us improve
title: "[BUG REPORT]"
labels: bug
assignees: ''
+
---
**Describe the bug**
diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md
index 1e2d9ba9..b336750c 100644
--- a/.github/ISSUE_TEMPLATE/feature-request.md
+++ b/.github/ISSUE_TEMPLATE/feature-request.md
@@ -4,6 +4,7 @@ about: Request a feature
title: "[FEATURE REQUEST]"
labels: enhancement
assignees: ''
+
---
**Is your feature request related to a problem? Please describe.**
diff --git a/.github/ISSUE_TEMPLATE/new-shape-up-request.md b/.github/ISSUE_TEMPLATE/new-shape-up-request.md
new file mode 100644
index 00000000..4f821148
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new-shape-up-request.md
@@ -0,0 +1,26 @@
+---
+name: New Shape Up Request
+about: A shape up request details
+title: "[Request]"
+labels: request:general, request:chain-up
+assignees: Leke-Ariyo
+
+---
+
+### In 2-4 sentences write a self-contained summary of idea and benefits.
+
+### In 2-4 sentences describe the problem the user faces that this idea addresses.
+
+### In 2-4 sentences describe how the propose idea address' these pain points.
+
+### In 2-3 sentences describe how someone would get started using this.
+
+(If this is baked into an exisiting product, describe this)
+
+### Write a quote here that you would answer to someone asking, that describes why they like the feature release. Would be used as a snippet in Public Relations.
+
+### Write a hypothetical customer quote about why they liked this new feature or idea.
+
+### Write a 1-2 sentence call-to-action for how to grab a users attention to this new feature or idea.
+
+### Internal FAQ
diff --git a/.github/workflows/production-ap-southeast-1.yml b/.github/workflows/production-ap-southeast-1.yml
index 010488ad..d8b9a0b4 100644
--- a/.github/workflows/production-ap-southeast-1.yml
+++ b/.github/workflows/production-ap-southeast-1.yml
@@ -2,7 +2,7 @@ name: Production Deployment ap-southeast-1
on:
push:
- branches: [ master-off ]
+ branches: [ master ]
jobs:
deploy:
@@ -39,13 +39,15 @@ jobs:
envkey_AWS_S3_LOGS_BUCKET: pocket-gateway
envkey_AWS_S3_LOGS_FOLDER: logs/mainnet
envkey_AWS_S3_LOGS_REGION: us-west-2
- envkey_DISPATCH_URL: https://node1.mainnet.pokt.network,https://node2.mainnet.pokt.network,https://node3.mainnet.pokt.network,https://node4.mainnet.pokt.network,https://node5.mainnet.pokt.network,https://node6.mainnet.pokt.network,https://node7.mainnet.pokt.network,https://node8.mainnet.pokt.network,https://node9.mainnet.pokt.network,https://node10.mainnet.pokt.network,https://node11.mainnet.pokt.network,https://node12.mainnet.pokt.network,https://node13.mainnet.pokt.network,https://node14.mainnet.pokt.network,https://node15.mainnet.pokt.network,https://node16.mainnet.pokt.network,https://node17.mainnet.pokt.network,https://node18.mainnet.pokt.network,https://node19.mainnet.pokt.network,https://node20.mainnet.pokt.network
- envkey_FALLBACK_URL: https://alt1.mainnet.pokt.network,https://alt2.mainnet.pokt.network,https://alt3.mainnet.pokt.network,https://alt4.mainnet.pokt.network,https://alt5.mainnet.pokt.network,https://alt6.mainnet.pokt.network,https://alt7.mainnet.pokt.network,https://alt8.mainnet.pokt.network,https://alt9.mainnet.pokt.network,https://alt10.mainnet.pokt.network
+ envkey_DISPATCH_URL: https://mainnet-1.nodes.pokt.network:4201,https://mainnet-2.nodes.pokt.network:4202,https://mainnet-3.nodes.pokt.network:4203,https://mainnet-4.nodes.pokt.network:4204,https://mainnet-5.nodes.pokt.network:4205,https://mainnet-6.nodes.pokt.network:4206,https://mainnet-7.nodes.pokt.network:4207,https://mainnet-8.nodes.pokt.network:4208,https://mainnet-9.nodes.pokt.network:4209,https://mainnet-10.nodes.pokt.network:4210,https://mainnet-11.nodes.pokt.network:4211,https://mainnet-12.nodes.pokt.network:4212,https://mainnet-13.nodes.pokt.network:4213,https://mainnet-14.nodes.pokt.network:4214,https://mainnet-15.nodes.pokt.network:4215,https://mainnet-16.nodes.pokt.network:4216,https://mainnet-17.nodes.pokt.network:4217,https://mainnet-18.nodes.pokt.network:4218,https://mainnet-19.nodes.pokt.network:4219,https://mainnet-20.nodes.pokt.network:4220,https://mainnet-21.nodes.pokt.network:4221,https://mainnet-22.nodes.pokt.network:4222,https://mainnet-23.nodes.pokt.network:4223,https://mainnet-24.nodes.pokt.network:4224
+ envkey_ALTRUISTS: ${{ secrets.POCKET_NETWORK_PRODUCTION_ALTRUISTS }}
envkey_REDIS_ENDPOINT: dashboard.y2p8qe.ng.0001.apse1.cache.amazonaws.com:6379
envkey_REDIS_PORT: 6379
envkey_POCKET_SESSION_BLOCK_FREQUENCY: 4
envkey_POCKET_BLOCK_TIME: 1038000
envkey_POCKET_RELAY_RETRIES: 0
+ envkey_AAT_PLAN: 'premium'
+ envkey_NODE_ENV: 'production'
file_name: .env
- name: Build, tag, and push image to Amazon ECR
diff --git a/.github/workflows/production-eu-west-1.yml b/.github/workflows/production-eu-west-1.yml
index adbc48d5..3fa09770 100644
--- a/.github/workflows/production-eu-west-1.yml
+++ b/.github/workflows/production-eu-west-1.yml
@@ -2,7 +2,7 @@ name: Production Deployment eu-west-1
on:
push:
- branches: [ master-off ]
+ branches: [ master ]
jobs:
deploy:
@@ -34,13 +34,20 @@ jobs:
envkey_PG_CONNECTION: ${{ secrets.PG_PRODUCTION_CONNECTION }}
envkey_PG_CERTIFICATE: ${{ secrets.PG_PRODUCTION_CERTIFICATE }}
envkey_LOGZ_TOKEN: ${{ secrets.LOGZ_TOKEN }}
- envkey_DISPATCH_URL: https://node1.mainnet.pokt.network,https://node2.mainnet.pokt.network,https://node3.mainnet.pokt.network,https://node4.mainnet.pokt.network,https://node5.mainnet.pokt.network,https://node6.mainnet.pokt.network,https://node7.mainnet.pokt.network,https://node8.mainnet.pokt.network,https://node9.mainnet.pokt.network,https://node10.mainnet.pokt.network,https://node11.mainnet.pokt.network,https://node12.mainnet.pokt.network,https://node13.mainnet.pokt.network,https://node14.mainnet.pokt.network,https://node15.mainnet.pokt.network,https://node16.mainnet.pokt.network,https://node17.mainnet.pokt.network,https://node18.mainnet.pokt.network,https://node19.mainnet.pokt.network,https://node20.mainnet.pokt.network
- envkey_FALLBACK_URL: https://alt1.mainnet.pokt.network,https://alt2.mainnet.pokt.network,https://alt3.mainnet.pokt.network,https://alt4.mainnet.pokt.network,https://alt5.mainnet.pokt.network,https://alt6.mainnet.pokt.network,https://alt7.mainnet.pokt.network,https://alt8.mainnet.pokt.network,https://alt9.mainnet.pokt.network,https://alt10.mainnet.pokt.network
+ envkey_AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
+ envkey_AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
+ envkey_AWS_S3_LOGS_BUCKET: pocket-gateway
+ envkey_AWS_S3_LOGS_FOLDER: logs/mainnet
+ envkey_AWS_S3_LOGS_REGION: eu-west-1
+ envkey_DISPATCH_URL: https://mainnet-1.nodes.pokt.network:4201,https://mainnet-2.nodes.pokt.network:4202,https://mainnet-3.nodes.pokt.network:4203,https://mainnet-4.nodes.pokt.network:4204,https://mainnet-5.nodes.pokt.network:4205,https://mainnet-6.nodes.pokt.network:4206,https://mainnet-7.nodes.pokt.network:4207,https://mainnet-8.nodes.pokt.network:4208,https://mainnet-9.nodes.pokt.network:4209,https://mainnet-10.nodes.pokt.network:4210,https://mainnet-11.nodes.pokt.network:4211,https://mainnet-12.nodes.pokt.network:4212,https://mainnet-13.nodes.pokt.network:4213,https://mainnet-14.nodes.pokt.network:4214,https://mainnet-15.nodes.pokt.network:4215,https://mainnet-16.nodes.pokt.network:4216,https://mainnet-17.nodes.pokt.network:4217,https://mainnet-18.nodes.pokt.network:4218,https://mainnet-19.nodes.pokt.network:4219,https://mainnet-20.nodes.pokt.network:4220,https://mainnet-21.nodes.pokt.network:4221,https://mainnet-22.nodes.pokt.network:4222,https://mainnet-23.nodes.pokt.network:4223,https://mainnet-24.nodes.pokt.network:4224
+ envkey_ALTRUISTS: ${{ secrets.POCKET_NETWORK_PRODUCTION_ALTRUISTS }}
envkey_REDIS_ENDPOINT: gateway.dj2dgc.ng.0001.euw1.cache.amazonaws.com:6379
envkey_REDIS_PORT: 6379
envkey_POCKET_SESSION_BLOCK_FREQUENCY: 4
envkey_POCKET_BLOCK_TIME: 1038000
envkey_POCKET_RELAY_RETRIES: 0
+ envkey_AAT_PLAN: 'premium'
+ envkey_NODE_ENV: 'production'
file_name: .env
- name: Build, tag, and push image to Amazon ECR
diff --git a/.github/workflows/production-us-east-2.yml b/.github/workflows/production-us-east-2.yml
index f866d075..5e740ffa 100644
--- a/.github/workflows/production-us-east-2.yml
+++ b/.github/workflows/production-us-east-2.yml
@@ -2,7 +2,7 @@ name: Production Deployment us-east-2
on:
push:
- branches: [ master-off ]
+ branches: [ master ]
jobs:
deploy:
@@ -34,13 +34,20 @@ jobs:
envkey_PG_CONNECTION: ${{ secrets.PG_PRODUCTION_CONNECTION }}
envkey_PG_CERTIFICATE: ${{ secrets.PG_PRODUCTION_CERTIFICATE }}
envkey_LOGZ_TOKEN: ${{ secrets.LOGZ_TOKEN }}
- envkey_DISPATCH_URL: https://node1.mainnet.pokt.network,https://node2.mainnet.pokt.network,https://node3.mainnet.pokt.network,https://node4.mainnet.pokt.network,https://node5.mainnet.pokt.network,https://node6.mainnet.pokt.network,https://node7.mainnet.pokt.network,https://node8.mainnet.pokt.network,https://node9.mainnet.pokt.network,https://node10.mainnet.pokt.network,https://node11.mainnet.pokt.network,https://node12.mainnet.pokt.network,https://node13.mainnet.pokt.network,https://node14.mainnet.pokt.network,https://node15.mainnet.pokt.network,https://node16.mainnet.pokt.network,https://node17.mainnet.pokt.network,https://node18.mainnet.pokt.network,https://node19.mainnet.pokt.network,https://node20.mainnet.pokt.network
- envkey_FALLBACK_URL: https://alt1.mainnet.pokt.network,https://alt2.mainnet.pokt.network,https://alt3.mainnet.pokt.network,https://alt4.mainnet.pokt.network,https://alt5.mainnet.pokt.network,https://alt6.mainnet.pokt.network,https://alt7.mainnet.pokt.network,https://alt8.mainnet.pokt.network,https://alt9.mainnet.pokt.network,https://alt10.mainnet.pokt.network
+ envkey_AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
+ envkey_AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
+ envkey_AWS_S3_LOGS_BUCKET: pocket-gateway
+ envkey_AWS_S3_LOGS_FOLDER: logs/mainnet
+ envkey_AWS_S3_LOGS_REGION: us-east-2
+ envkey_DISPATCH_URL: https://mainnet-1.nodes.pokt.network:4201,https://mainnet-2.nodes.pokt.network:4202,https://mainnet-3.nodes.pokt.network:4203,https://mainnet-4.nodes.pokt.network:4204,https://mainnet-5.nodes.pokt.network:4205,https://mainnet-6.nodes.pokt.network:4206,https://mainnet-7.nodes.pokt.network:4207,https://mainnet-8.nodes.pokt.network:4208,https://mainnet-9.nodes.pokt.network:4209,https://mainnet-10.nodes.pokt.network:4210,https://mainnet-11.nodes.pokt.network:4211,https://mainnet-12.nodes.pokt.network:4212,https://mainnet-13.nodes.pokt.network:4213,https://mainnet-14.nodes.pokt.network:4214,https://mainnet-15.nodes.pokt.network:4215,https://mainnet-16.nodes.pokt.network:4216,https://mainnet-17.nodes.pokt.network:4217,https://mainnet-18.nodes.pokt.network:4218,https://mainnet-19.nodes.pokt.network:4219,https://mainnet-20.nodes.pokt.network:4220,https://mainnet-21.nodes.pokt.network:4221,https://mainnet-22.nodes.pokt.network:4222,https://mainnet-23.nodes.pokt.network:4223,https://mainnet-24.nodes.pokt.network:4224
+ envkey_ALTRUISTS: ${{ secrets.POCKET_NETWORK_PRODUCTION_ALTRUISTS }}
envkey_REDIS_ENDPOINT: gateway.pzdhdc.ng.0001.use2.cache.amazonaws.com:6379
envkey_REDIS_PORT: 6379
envkey_POCKET_SESSION_BLOCK_FREQUENCY: 4
envkey_POCKET_BLOCK_TIME: 1038000
envkey_POCKET_RELAY_RETRIES: 0
+ envkey_AAT_PLAN: 'premium'
+ envkey_NODE_ENV: 'production'
file_name: .env
- name: Build, tag, and push image to Amazon ECR
diff --git a/.github/workflows/production-us-west-2.yml b/.github/workflows/production-us-west-2.yml
index 08da61e2..68ff48d5 100644
--- a/.github/workflows/production-us-west-2.yml
+++ b/.github/workflows/production-us-west-2.yml
@@ -2,7 +2,7 @@ name: Production Deployment us-west-2
on:
push:
- branches: [ master-off ]
+ branches: [ master ]
jobs:
deploy:
@@ -33,20 +33,16 @@ jobs:
envkey_DATABASE_ENCRYPTION_KEY: ${{ secrets.DATABASE_PRODUCTION_ENCRYPTION_KEY }}
envkey_PG_CONNECTION: ${{ secrets.PG_PRODUCTION_CONNECTION }}
envkey_PG_CERTIFICATE: ${{ secrets.PG_PRODUCTION_CERTIFICATE }}
-
envkey_LOGZ_TOKEN: ${{ secrets.LOGZ_TOKEN }}
- envkey_AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
- envkey_AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
- envkey_AWS_S3_LOGS_BUCKET: pocket-gateway
- envkey_AWS_S3_LOGS_FOLDER: logs/mainnet
- envkey_AWS_S3_LOGS_REGION: us-west-2
- envkey_DISPATCH_URL: https://node1.mainnet.pokt.network,https://node2.mainnet.pokt.network,https://node3.mainnet.pokt.network,https://node4.mainnet.pokt.network,https://node5.mainnet.pokt.network,https://node6.mainnet.pokt.network,https://node7.mainnet.pokt.network,https://node8.mainnet.pokt.network,https://node9.mainnet.pokt.network,https://node10.mainnet.pokt.network,https://node11.mainnet.pokt.network,https://node12.mainnet.pokt.network,https://node13.mainnet.pokt.network,https://node14.mainnet.pokt.network,https://node15.mainnet.pokt.network,https://node16.mainnet.pokt.network,https://node17.mainnet.pokt.network,https://node18.mainnet.pokt.network,https://node19.mainnet.pokt.network,https://node20.mainnet.pokt.network
- envkey_FALLBACK_URL: https://alt1.mainnet.pokt.network,https://alt2.mainnet.pokt.network,https://alt3.mainnet.pokt.network,https://alt4.mainnet.pokt.network,https://alt5.mainnet.pokt.network,https://alt6.mainnet.pokt.network,https://alt7.mainnet.pokt.network,https://alt8.mainnet.pokt.network,https://alt9.mainnet.pokt.network,https://alt10.mainnet.pokt.network
+ envkey_DISPATCH_URL: https://mainnet-1.nodes.pokt.network:4201,https://mainnet-2.nodes.pokt.network:4202,https://mainnet-3.nodes.pokt.network:4203,https://mainnet-4.nodes.pokt.network:4204,https://mainnet-5.nodes.pokt.network:4205,https://mainnet-6.nodes.pokt.network:4206,https://mainnet-7.nodes.pokt.network:4207,https://mainnet-8.nodes.pokt.network:4208,https://mainnet-9.nodes.pokt.network:4209,https://mainnet-10.nodes.pokt.network:4210,https://mainnet-11.nodes.pokt.network:4211,https://mainnet-12.nodes.pokt.network:4212,https://mainnet-13.nodes.pokt.network:4213,https://mainnet-14.nodes.pokt.network:4214,https://mainnet-15.nodes.pokt.network:4215,https://mainnet-16.nodes.pokt.network:4216,https://mainnet-17.nodes.pokt.network:4217,https://mainnet-18.nodes.pokt.network:4218,https://mainnet-19.nodes.pokt.network:4219,https://mainnet-20.nodes.pokt.network:4220,https://mainnet-21.nodes.pokt.network:4221,https://mainnet-22.nodes.pokt.network:4222,https://mainnet-23.nodes.pokt.network:4223,https://mainnet-24.nodes.pokt.network:4224
+ envkey_ALTRUISTS: ${{ secrets.POCKET_NETWORK_PRODUCTION_ALTRUISTS }}
envkey_REDIS_ENDPOINT: dashboard.js6zbp.ng.0001.usw2.cache.amazonaws.com
envkey_REDIS_PORT: 6379
envkey_POCKET_SESSION_BLOCK_FREQUENCY: 4
envkey_POCKET_BLOCK_TIME: 1038000
envkey_POCKET_RELAY_RETRIES: 0
+ envkey_AAT_PLAN: 'premium'
+ envkey_NODE_ENV: 'production'
file_name: .env
- name: Build, tag, and push image to Amazon ECR
diff --git a/.github/workflows/staging-us-west-2.yml b/.github/workflows/staging-us-west-2.yml
index 59397a27..46f7be74 100644
--- a/.github/workflows/staging-us-west-2.yml
+++ b/.github/workflows/staging-us-west-2.yml
@@ -2,7 +2,7 @@ name: Staging Deployment us-west-2
on:
push:
- branches: [ master-off ]
+ branches: [ staging ]
jobs:
deploy:
@@ -34,20 +34,22 @@ jobs:
envkey_PG_CONNECTION: ${{ secrets.PG_PRODUCTION_CONNECTION }}
envkey_PG_CERTIFICATE: ${{ secrets.PG_PRODUCTION_CERTIFICATE }}
envkey_LOGZ_TOKEN: ${{ secrets.LOGZ_TOKEN }}
- envkey_DISPATCH_URL: https://node1.mainnet.pokt.network,https://node2.mainnet.pokt.network,https://node3.mainnet.pokt.network,https://node4.mainnet.pokt.network,https://node5.mainnet.pokt.network,https://node6.mainnet.pokt.network,https://node7.mainnet.pokt.network,https://node8.mainnet.pokt.network,https://node9.mainnet.pokt.network,https://node10.mainnet.pokt.network,https://node11.mainnet.pokt.network,https://node12.mainnet.pokt.network,https://node13.mainnet.pokt.network,https://node14.mainnet.pokt.network,https://node15.mainnet.pokt.network,https://node16.mainnet.pokt.network,https://node17.mainnet.pokt.network,https://node18.mainnet.pokt.network,https://node19.mainnet.pokt.network,https://node20.mainnet.pokt.network
- envkey_FALLBACK_URL: https://alt1.mainnet.pokt.network,https://alt2.mainnet.pokt.network,https://alt3.mainnet.pokt.network,https://alt4.mainnet.pokt.network,https://alt5.mainnet.pokt.network,https://alt6.mainnet.pokt.network,https://alt7.mainnet.pokt.network,https://alt8.mainnet.pokt.network,https://alt9.mainnet.pokt.network,https://alt10.mainnet.pokt.network
+ envkey_DISPATCH_URL: https://mainnet-1.nodes.pokt.network:4201,https://mainnet-2.nodes.pokt.network:4202,https://mainnet-3.nodes.pokt.network:4203,https://mainnet-4.nodes.pokt.network:4204,https://mainnet-5.nodes.pokt.network:4205,https://mainnet-6.nodes.pokt.network:4206,https://mainnet-7.nodes.pokt.network:4207,https://mainnet-8.nodes.pokt.network:4208,https://mainnet-9.nodes.pokt.network:4209,https://mainnet-10.nodes.pokt.network:4210,https://mainnet-11.nodes.pokt.network:4211,https://mainnet-12.nodes.pokt.network:4212,https://mainnet-13.nodes.pokt.network:4213,https://mainnet-14.nodes.pokt.network:4214,https://mainnet-15.nodes.pokt.network:4215,https://mainnet-16.nodes.pokt.network:4216,https://mainnet-17.nodes.pokt.network:4217,https://mainnet-18.nodes.pokt.network:4218,https://mainnet-19.nodes.pokt.network:4219,https://mainnet-20.nodes.pokt.network:4220,https://mainnet-21.nodes.pokt.network:4221,https://mainnet-22.nodes.pokt.network:4222,https://mainnet-23.nodes.pokt.network:4223,https://mainnet-24.nodes.pokt.network:4224
+ envkey_ALTRUISTS: ${{ secrets.POCKET_NETWORK_PRODUCTION_ALTRUISTS }}
envkey_REDIS_ENDPOINT: dashboard.js6zbp.ng.0001.usw2.cache.amazonaws.com
envkey_REDIS_PORT: 6379
envkey_POCKET_SESSION_BLOCK_FREQUENCY: 4
envkey_POCKET_BLOCK_TIME: 1038000
envkey_POCKET_RELAY_RETRIES: 0
+ envkey_AAT_PLAN: 'premium'
+ envkey_NODE_ENV: 'production'
file_name: .env
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
- ECR_REPOSITORY: gateway
+ ECR_REPOSITORY: gateway-staging
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
diff --git a/.github/workflows/testnet.yml b/.github/workflows/testnet.yml
index ae686408..e376261f 100644
--- a/.github/workflows/testnet.yml
+++ b/.github/workflows/testnet.yml
@@ -2,7 +2,7 @@ name: Testnet Deployment
on:
push:
- branches: [ staging-off ]
+ branches: [ testnet ]
jobs:
deploy:
@@ -35,12 +35,13 @@ jobs:
envkey_PG_CERTIFICATE: ${{ secrets.PG_TESTNET_CERTIFICATE }}
envkey_LOGZ_TOKEN: ${{ secrets.LOGZ_TOKEN }}
envkey_DISPATCH_URL: https://node1.testnet.pokt.network,https://node2.testnet.pokt.network,https://node3.testnet.pokt.network
- envkey_FALLBACK_URL: https://node1.testnet.pokt.network,https://node2.testnet.pokt.network,https://node3.testnet.pokt.network
+ envkey_ALTRUISTS: ${{ secrets.POCKET_NETWORK_PRODUCTION_ALTRUISTS }}
envkey_REDIS_ENDPOINT: dashboard-testnet.js6zbp.ng.0001.usw2.cache.amazonaws.com
envkey_REDIS_PORT: 6379
envkey_POCKET_SESSION_BLOCK_FREQUENCY: 4
envkey_POCKET_BLOCK_TIME: 900000
envkey_POCKET_RELAY_RETRIES: 5
+ envkey_AAT_PLAN: 'premium'
file_name: .env
- name: Build, tag, and push image to Amazon ECR
diff --git a/.gitignore b/.gitignore
index 08cd70e2..f65cc8a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,4 +13,18 @@
# Dependency directories (remove the comment below to include it)
# vendor/
-node_modules
\ No newline at end of file
+node_modules
+
+# editor files
+*.swp
+*/**/*.swp
+
+# build artifacts
+dist
+
+# env files
+.env
+.tasks.env
+
+# ts configs
+tsconfig.tsbuildinfo
diff --git a/.tasks.env.example b/.tasks.env.example
new file mode 100644
index 00000000..921243ee
--- /dev/null
+++ b/.tasks.env.example
@@ -0,0 +1,9 @@
+# Mongo Instance to Export Data From
+MONGO_SRC_CONNECTION=mongodb+srv://xxx:xxx@xxx/gateway?authSource=admin
+
+# Mongo Instance to Write Imports to
+MONGO_DEST_CONNECTION=mongodb://mongouser:mongopassword@localhost:27017/gateway?authSource=admin
+
+MONGO_INITDB_ROOT_USERNAME=mongouser
+MONGO_INITDB_ROOT_PASSWORD=mongopassword
+MONGO_INITDB_DATABASE=gateway
diff --git a/Dockerfile b/Dockerfile
index dcd5a252..b3089905 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,32 +1,33 @@
# Check out https://hub.docker.com/_/node to select a new base image
FROM node:10-slim
+# Bind to all network interfaces so that it can be mapped to the host OS
+ENV WATCH=true
+ENV HOST=0.0.0.0
+ENV PORT=3000
+ENV PATH="${PATH}:/usr/src/gateway/node_modules/.bin"
+
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git
-# Set to a non-root built-in user `node`
-USER node
+RUN mkdir -p /usr/src/gateway
-# Create app directory (with user `node`)
-RUN mkdir -p /home/node/app
+WORKDIR /usr/src/gateway
-WORKDIR /home/node/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
-COPY --chown=node package*.json ./
+COPY package*.json ./
RUN npm install
# Bundle app source code
-COPY --chown=node . .
+COPY . .
# NPM build
RUN npm run build
-# Bind to all network interfaces so that it can be mapped to the host OS
-ENV HOST=0.0.0.0 PORT=3000
-
EXPOSE ${PORT}
+
CMD [ "node", "." ]
diff --git a/README.md b/README.md
index 1a0afffd..6890c6cd 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,27 @@
# pocket-gateway
+
+#### Populate environment variables
+```
+$ cp .tasks.env.example .tasks.env
+$ cp .env.example .env
+```
+
+#### Importing production data
+1. To retrieve production data
+```
+$ docker-compose -f tasks.yml up download-production-data
+```
+
+2. To import the retrieved data
+```
+$ docker-compose -f tasks.yml up import-production-data
+```
+
+##### Spin up all services locally
+```
+$ npm install
+$ npm run services:all:up
+```
+
+#### Missing
+[ ] Nodemon and hot reload for dev purposes.
\ No newline at end of file
diff --git a/dist/__tests__/acceptance/home-page.acceptance.d.ts b/dist/__tests__/acceptance/home-page.acceptance.d.ts
deleted file mode 100644
index cb0ff5c3..00000000
--- a/dist/__tests__/acceptance/home-page.acceptance.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/dist/__tests__/acceptance/home-page.acceptance.js b/dist/__tests__/acceptance/home-page.acceptance.js
deleted file mode 100644
index 9cd44925..00000000
--- a/dist/__tests__/acceptance/home-page.acceptance.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const test_helper_1 = require("./test-helper");
-describe('HomePage', () => {
- let app;
- let client;
- before('setupApplication', async () => {
- ({ app, client } = await test_helper_1.setupApplication());
- });
- after(async () => {
- await app.stop();
- });
- it('exposes a default home page', async () => {
- await client
- .get('/')
- .expect(200)
- .expect('Content-Type', /text\/html/);
- });
- it('exposes self-hosted explorer', async () => {
- await client
- .get('/explorer/')
- .expect(200)
- .expect('Content-Type', /text\/html/)
- .expect(/
LoopBack API Explorer/);
- });
-});
-//# sourceMappingURL=home-page.acceptance.js.map
\ No newline at end of file
diff --git a/dist/__tests__/acceptance/home-page.acceptance.js.map b/dist/__tests__/acceptance/home-page.acceptance.js.map
deleted file mode 100644
index a24dfbc0..00000000
--- a/dist/__tests__/acceptance/home-page.acceptance.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"home-page.acceptance.js","sourceRoot":"","sources":["../../../src/__tests__/acceptance/home-page.acceptance.ts"],"names":[],"mappings":";;AAEA,+CAA+C;AAE/C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,IAAI,GAA6B,CAAC;IAClC,IAAI,MAAc,CAAC;IAEnB,MAAM,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QACpC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,MAAM,8BAAgB,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,MAAM;aACT,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CAAC,GAAG,CAAC;aACX,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,MAAM;aACT,GAAG,CAAC,YAAY,CAAC;aACjB,MAAM,CAAC,GAAG,CAAC;aACX,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC;aACpC,MAAM,CAAC,8BAA8B,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/__tests__/acceptance/ping.controller.acceptance.d.ts b/dist/__tests__/acceptance/ping.controller.acceptance.d.ts
deleted file mode 100644
index cb0ff5c3..00000000
--- a/dist/__tests__/acceptance/ping.controller.acceptance.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/dist/__tests__/acceptance/ping.controller.acceptance.js b/dist/__tests__/acceptance/ping.controller.acceptance.js
deleted file mode 100644
index 47a67be0..00000000
--- a/dist/__tests__/acceptance/ping.controller.acceptance.js
+++ /dev/null
@@ -1,19 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const testlab_1 = require("@loopback/testlab");
-const test_helper_1 = require("./test-helper");
-describe('PingController', () => {
- let app;
- let client;
- before('setupApplication', async () => {
- ({ app, client } = await test_helper_1.setupApplication());
- });
- after(async () => {
- await app.stop();
- });
- it('invokes GET /ping', async () => {
- const res = await client.get('/ping?msg=world').expect(200);
- testlab_1.expect(res.body).to.containEql({ greeting: 'Hello from LoopBack' });
- });
-});
-//# sourceMappingURL=ping.controller.acceptance.js.map
\ No newline at end of file
diff --git a/dist/__tests__/acceptance/ping.controller.acceptance.js.map b/dist/__tests__/acceptance/ping.controller.acceptance.js.map
deleted file mode 100644
index 7f55e9fd..00000000
--- a/dist/__tests__/acceptance/ping.controller.acceptance.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ping.controller.acceptance.js","sourceRoot":"","sources":["../../../src/__tests__/acceptance/ping.controller.acceptance.ts"],"names":[],"mappings":";;AAAA,+CAAiD;AAEjD,+CAA+C;AAE/C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,GAA6B,CAAC;IAClC,IAAI,MAAc,CAAC;IAEnB,MAAM,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QACpC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,MAAM,8BAAgB,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5D,gBAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAC,QAAQ,EAAE,qBAAqB,EAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/__tests__/acceptance/test-helper.d.ts b/dist/__tests__/acceptance/test-helper.d.ts
deleted file mode 100644
index e0b8f0a3..00000000
--- a/dist/__tests__/acceptance/test-helper.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { PocketGatewayApplication } from '../..';
-import { Client } from '@loopback/testlab';
-export declare function setupApplication(): Promise;
-export interface AppWithClient {
- app: PocketGatewayApplication;
- client: Client;
-}
diff --git a/dist/__tests__/acceptance/test-helper.js b/dist/__tests__/acceptance/test-helper.js
deleted file mode 100644
index 88059057..00000000
--- a/dist/__tests__/acceptance/test-helper.js
+++ /dev/null
@@ -1,22 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const __1 = require("../..");
-const testlab_1 = require("@loopback/testlab");
-async function setupApplication() {
- const restConfig = testlab_1.givenHttpServerConfig({
- // Customize the server configuration here.
- // Empty values (undefined, '') will be ignored by the helper.
- //
- // host: process.env.HOST,
- // port: +process.env.PORT,
- });
- const app = new __1.PocketGatewayApplication({
- rest: restConfig,
- });
- await app.boot();
- await app.start();
- const client = testlab_1.createRestAppClient(app);
- return { app, client };
-}
-exports.setupApplication = setupApplication;
-//# sourceMappingURL=test-helper.js.map
\ No newline at end of file
diff --git a/dist/__tests__/acceptance/test-helper.js.map b/dist/__tests__/acceptance/test-helper.js.map
deleted file mode 100644
index ea5281bb..00000000
--- a/dist/__tests__/acceptance/test-helper.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"test-helper.js","sourceRoot":"","sources":["../../../src/__tests__/acceptance/test-helper.ts"],"names":[],"mappings":";;AAAA,6BAA+C;AAC/C,+CAI2B;AAEpB,KAAK,UAAU,gBAAgB;IACpC,MAAM,UAAU,GAAG,+BAAqB,CAAC;IACvC,2CAA2C;IAC3C,8DAA8D;IAC9D,EAAE;IACF,0BAA0B;IAC1B,2BAA2B;KAC5B,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,IAAI,4BAAwB,CAAC;QACvC,IAAI,EAAE,UAAU;KACjB,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IACjB,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;IAElB,MAAM,MAAM,GAAG,6BAAmB,CAAC,GAAG,CAAC,CAAC;IAExC,OAAO,EAAC,GAAG,EAAE,MAAM,EAAC,CAAC;AACvB,CAAC;AAnBD,4CAmBC"}
\ No newline at end of file
diff --git a/dist/application.d.ts b/dist/application.d.ts
deleted file mode 100644
index 27cf6d09..00000000
--- a/dist/application.d.ts
+++ /dev/null
@@ -1,249 +0,0 @@
-import { ApplicationConfig } from '@loopback/core';
-import { RestApplication } from '@loopback/rest';
-declare const PocketGatewayApplication_base: (new (...args: any[]) => {
- projectRoot: string;
- bootOptions?: import("@loopback/boot").BootOptions | undefined;
- booted: boolean;
- start(): Promise;
- boot(): Promise;
- booters(...booterCls: import("@loopback/core").Constructor[]): import("@loopback/boot").Binding[];
- applicationBooter(subApp: import("@loopback/core").Application & import("@loopback/boot").Bootable, filter?: import("@loopback/core").BindingFilter | undefined): import("@loopback/boot").Binding;
- component(componentCtor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding;
- mountComponentBooters(componentInstanceOrClass: import("@loopback/core").Constructor | import("@loopback/boot").InstanceWithBooters): void;
- readonly options: ApplicationConfig;
- readonly state: string;
- controller: (controllerCtor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- server: (ctor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- servers: (ctors: import("@loopback/core").Constructor[]) => import("@loopback/boot").Binding[];
- getServer: (target: string | import("@loopback/core").Constructor) => Promise;
- stop: () => Promise;
- setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
- lifeCycleObserver: (ctor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- service: (cls: import("@loopback/core").Constructor>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined) => import("@loopback/boot").Binding;
- interceptor: (interceptor: import("@loopback/core").Interceptor | import("@loopback/core").Constructor>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => import("@loopback/boot").Binding;
- readonly name: string;
- readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
- readonly parent: import("@loopback/core").Context | undefined;
- emitEvent: (type: string, event: T_6) => void;
- emitError: (err: unknown) => void;
- bind: (key: import("@loopback/core").BindingAddress) => import("@loopback/boot").Binding;
- add: (binding: import("@loopback/boot").Binding) => import("@loopback/core").Application;
- configure: (key?: string | import("@loopback/core").BindingKey | undefined) => import("@loopback/boot").Binding;
- getConfigAsValueOrPromise: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise;
- getConfig: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise;
- getConfigSync: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3 | undefined;
- unbind: (key: import("@loopback/core").BindingAddress) => boolean;
- subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
- unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
- close: () => void;
- isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
- createView: (filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined) => import("@loopback/core").ContextView;
- contains: (key: import("@loopback/core").BindingAddress) => boolean;
- isBound: (key: import("@loopback/core").BindingAddress) => boolean;
- getOwnerContext: (key: import("@loopback/core").BindingAddress) => import("@loopback/core").Context | undefined;
- find: (pattern?: string | RegExp | import("@loopback/core").BindingFilter | undefined) => Readonly>[];
- findByTag: (tagFilter: string | RegExp | Record) => Readonly>[];
- get: {
- (keyWithPath: import("@loopback/core").BindingAddress, session?: import("@loopback/core").ResolutionSession | undefined): Promise;
- (keyWithPath: import("@loopback/core").BindingAddress, options: import("@loopback/core").ResolutionOptions): Promise;
- };
- getSync: {
- (keyWithPath: import("@loopback/core").BindingAddress, session?: import("@loopback/core").ResolutionSession | undefined): ValueType_5;
- (keyWithPath: import("@loopback/core").BindingAddress, options?: import("@loopback/core").ResolutionOptions | undefined): ValueType_6 | undefined;
- };
- getBinding: {
- (key: import("@loopback/core").BindingAddress): import("@loopback/boot").Binding;
- (key: import("@loopback/core").BindingAddress, options?: {
- optional?: boolean | undefined;
- } | undefined): import("@loopback/boot").Binding | undefined;
- };
- findOrCreateBinding: (key: import("@loopback/core").BindingAddress, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => import("@loopback/boot").Binding;
- getValueOrPromise: (keyWithPath: import("@loopback/core").BindingAddress, optionsOrSession?: import("@loopback/core").ResolutionSession | import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise;
- toJSON: () => import("@loopback/core").JSONObject;
- inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
- on: {
- (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
- (event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
- };
- once: {
- (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
- (event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
- };
- addListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- prependListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- prependOnceListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- removeListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- off: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- removeAllListeners: (event?: string | symbol | undefined) => import("@loopback/core").Application;
- setMaxListeners: (n: number) => import("@loopback/core").Application;
- getMaxListeners: () => number;
- listeners: (event: string | symbol) => Function[];
- rawListeners: (event: string | symbol) => Function[];
- emit: (event: string | symbol, ...args: any[]) => boolean;
- eventNames: () => (string | symbol)[];
- listenerCount: (type: string | symbol) => number;
-}) & (new (...args: any[]) => {
- serviceProvider(provider: import("@loopback/core").Constructor>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined): import("@loopback/boot").Binding;
- component(componentCtor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding;
- mountComponentServices(component: import("@loopback/core").Constructor, componentBindingKey?: string | import("@loopback/core").BindingKey | undefined): void;
- readonly options: ApplicationConfig;
- readonly state: string;
- controller: (controllerCtor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- server: (ctor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- servers: (ctors: import("@loopback/core").Constructor[]) => import("@loopback/boot").Binding[];
- getServer: (target: string | import("@loopback/core").Constructor) => Promise;
- start: () => Promise;
- stop: () => Promise;
- setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
- lifeCycleObserver: (ctor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- service: (cls: import("@loopback/core").Constructor>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined) => import("@loopback/boot").Binding;
- interceptor: (interceptor: import("@loopback/core").Interceptor | import("@loopback/core").Constructor>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => import("@loopback/boot").Binding;
- readonly name: string;
- readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
- readonly parent: import("@loopback/core").Context | undefined;
- emitEvent: (type: string, event: T_8_1) => void;
- emitError: (err: unknown) => void;
- bind: (key: import("@loopback/core").BindingAddress) => import("@loopback/boot").Binding;
- add: (binding: import("@loopback/boot").Binding) => import("@loopback/core").Application;
- configure: (key?: string | import("@loopback/core").BindingKey | undefined) => import("@loopback/boot").Binding;
- getConfigAsValueOrPromise: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise;
- getConfig: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise;
- getConfigSync: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3_1 | undefined;
- unbind: (key: import("@loopback/core").BindingAddress) => boolean;
- subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
- unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
- close: () => void;
- isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
- createView: (filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined) => import("@loopback/core").ContextView;
- contains: (key: import("@loopback/core").BindingAddress) => boolean;
- isBound: (key: import("@loopback/core").BindingAddress) => boolean;
- getOwnerContext: (key: import("@loopback/core").BindingAddress) => import("@loopback/core").Context | undefined;
- find: (pattern?: string | RegExp | import("@loopback/core").BindingFilter | undefined) => Readonly>[];
- findByTag: (tagFilter: string | RegExp | Record) => Readonly>[];
- get: {
- (keyWithPath: import("@loopback/core").BindingAddress, session?: import("@loopback/core").ResolutionSession | undefined): Promise;
- (keyWithPath: import("@loopback/core").BindingAddress, options: import("@loopback/core").ResolutionOptions): Promise;
- };
- getSync: {
- (keyWithPath: import("@loopback/core").BindingAddress, session?: import("@loopback/core").ResolutionSession | undefined): ValueType_5_1;
- (keyWithPath: import("@loopback/core").BindingAddress, options?: import("@loopback/core").ResolutionOptions | undefined): ValueType_6_1 | undefined;
- };
- getBinding: {
- (key: import("@loopback/core").BindingAddress): import("@loopback/boot").Binding;
- (key: import("@loopback/core").BindingAddress, options?: {
- optional?: boolean | undefined;
- } | undefined): import("@loopback/boot").Binding | undefined;
- };
- findOrCreateBinding: (key: import("@loopback/core").BindingAddress, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => import("@loopback/boot").Binding;
- getValueOrPromise: (keyWithPath: import("@loopback/core").BindingAddress, optionsOrSession?: import("@loopback/core").ResolutionSession | import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise;
- toJSON: () => import("@loopback/core").JSONObject;
- inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
- on: {
- (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
- (event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
- };
- once: {
- (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
- (event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
- };
- addListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- prependListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- prependOnceListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- removeListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- off: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- removeAllListeners: (event?: string | symbol | undefined) => import("@loopback/core").Application;
- setMaxListeners: (n: number) => import("@loopback/core").Application;
- getMaxListeners: () => number;
- listeners: (event: string | symbol) => Function[];
- rawListeners: (event: string | symbol) => Function[];
- emit: (event: string | symbol, ...args: any[]) => boolean;
- eventNames: () => (string | symbol)[];
- listenerCount: (type: string | symbol) => number;
-}) & (new (...args: any[]) => {
- repository>(repoClass: import("@loopback/repository").Class, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding;
- getRepository>(repo: import("@loopback/repository").Class): Promise;
- dataSource(dataSource: D | import("@loopback/repository").Class, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding;
- model>(modelClass: M): import("@loopback/boot").Binding;
- component(componentCtor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding;
- mountComponentRepositories(componentInstanceOrClass: import("@loopback/repository").RepositoryComponent | import("@loopback/repository").Class): void;
- mountComponentModels(component: import("@loopback/repository").RepositoryComponent): void;
- migrateSchema(options?: import("@loopback/repository").SchemaMigrationOptions | undefined): Promise;
- readonly options: ApplicationConfig;
- readonly state: string;
- controller: (controllerCtor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- server: (ctor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- servers: (ctors: import("@loopback/core").Constructor[]) => import("@loopback/boot").Binding[];
- getServer: (target: string | import("@loopback/core").Constructor) => Promise;
- start: () => Promise;
- stop: () => Promise;
- setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
- lifeCycleObserver: (ctor: import("@loopback/core").Constructor, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding;
- service: (cls: import("@loopback/core").Constructor>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined) => import("@loopback/boot").Binding;
- interceptor: (interceptor: import("@loopback/core").Interceptor | import("@loopback/core").Constructor>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => import("@loopback/boot").Binding;
- readonly name: string;
- readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
- readonly parent: import("@loopback/core").Context | undefined;
- emitEvent: (type: string, event: T_6_2) => void;
- emitError: (err: unknown) => void;
- bind: (key: import("@loopback/core").BindingAddress) => import("@loopback/boot").Binding;
- add: (binding: import("@loopback/boot").Binding) => import("@loopback/core").Application;
- configure: (key?: string | import("@loopback/core").BindingKey | undefined) => import("@loopback/boot").Binding;
- getConfigAsValueOrPromise: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise;
- getConfig: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise;
- getConfigSync: (key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3_2 | undefined;
- unbind: (key: import("@loopback/core").BindingAddress) => boolean;
- subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
- unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
- close: () => void;
- isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
- createView: (filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined) => import("@loopback/core").ContextView;
- contains: (key: import("@loopback/core").BindingAddress) => boolean;
- isBound: (key: import("@loopback/core").BindingAddress) => boolean;
- getOwnerContext: (key: import("@loopback/core").BindingAddress) => import("@loopback/core").Context | undefined;
- find: (pattern?: string | RegExp | import("@loopback/core").BindingFilter | undefined) => Readonly>[];
- findByTag: (tagFilter: string | RegExp | Record) => Readonly>[];
- get: {
- (keyWithPath: import("@loopback/core").BindingAddress, session?: import("@loopback/core").ResolutionSession | undefined): Promise;
- (keyWithPath: import("@loopback/core").BindingAddress, options: import("@loopback/core").ResolutionOptions): Promise;
- };
- getSync: {
- (keyWithPath: import("@loopback/core").BindingAddress, session?: import("@loopback/core").ResolutionSession | undefined): ValueType_5_2;
- (keyWithPath: import("@loopback/core").BindingAddress, options?: import("@loopback/core").ResolutionOptions | undefined): ValueType_6_2 | undefined;
- };
- getBinding: {
- (key: import("@loopback/core").BindingAddress): import("@loopback/boot").Binding;
- (key: import("@loopback/core").BindingAddress, options?: {
- optional?: boolean | undefined;
- } | undefined): import("@loopback/boot").Binding | undefined;
- };
- findOrCreateBinding: (key: import("@loopback/core").BindingAddress, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => import("@loopback/boot").Binding;
- getValueOrPromise: (keyWithPath: import("@loopback/core").BindingAddress, optionsOrSession?: import("@loopback/core").ResolutionSession | import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise;
- toJSON: () => import("@loopback/core").JSONObject;
- inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
- on: {
- (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
- (event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
- };
- once: {
- (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
- (event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
- };
- addListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- prependListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- prependOnceListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- removeListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- off: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
- removeAllListeners: (event?: string | symbol | undefined) => import("@loopback/core").Application;
- setMaxListeners: (n: number) => import("@loopback/core").Application;
- getMaxListeners: () => number;
- listeners: (event: string | symbol) => Function[];
- rawListeners: (event: string | symbol) => Function[];
- emit: (event: string | symbol, ...args: any[]) => boolean;
- eventNames: () => (string | symbol)[];
- listenerCount: (type: string | symbol) => number;
-}) & typeof RestApplication;
-export declare class PocketGatewayApplication extends PocketGatewayApplication_base {
- constructor(options?: ApplicationConfig);
- loadPocket(): Promise;
-}
-export {};
diff --git a/dist/application.js b/dist/application.js
deleted file mode 100644
index 44cd576c..00000000
--- a/dist/application.js
+++ /dev/null
@@ -1,155 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const tslib_1 = require("tslib");
-const boot_1 = require("@loopback/boot");
-const repository_1 = require("@loopback/repository");
-const rest_1 = require("@loopback/rest");
-const service_proxy_1 = require("@loopback/service-proxy");
-const sequence_1 = require("./sequence");
-const account_1 = require("@pokt-network/pocket-js/dist/keybase/models/account");
-const relay_profiler_1 = require("./services/relay-profiler");
-const path = tslib_1.__importStar(require("path"));
-const logger = require('./services/logger');
-const pocketJS = require('@pokt-network/pocket-js');
-const { Pocket, Configuration, HttpRpcProvider } = pocketJS;
-const Redis = require('ioredis');
-const crypto = require('crypto');
-const os = require('os');
-const process = require('process');
-const pg = require('pg');
-const got = require('got');
-require('log-timestamp');
-require('dotenv').config();
-class PocketGatewayApplication extends boot_1.BootMixin(service_proxy_1.ServiceMixin(repository_1.RepositoryMixin(rest_1.RestApplication))) {
- constructor(options = {}) {
- super(options);
- this.sequence(sequence_1.GatewaySequence);
- this.static('/', path.join(__dirname, '../public'));
- this.projectRoot = __dirname;
- this.bootOptions = {
- controllers: {
- dirs: ['controllers'],
- extensions: ['.controller.js'],
- nested: true,
- },
- };
- }
- async loadPocket() {
- var _a, _b, _c, _d, _e, _f, _g, _h;
- // Requirements; for Production these are stored in GitHub repo secrets
- //
- // For Dev, you need to pass them in via .env file
- const dispatchURL = (_a = process.env.DISPATCH_URL) !== null && _a !== void 0 ? _a : '';
- const fallbackURL = (_b = process.env.FALLBACK_URL) !== null && _b !== void 0 ? _b : '';
- const clientPrivateKey = (_c = process.env.GATEWAY_CLIENT_PRIVATE_KEY) !== null && _c !== void 0 ? _c : '';
- const clientPassphrase = (_d = process.env.GATEWAY_CLIENT_PASSPHRASE) !== null && _d !== void 0 ? _d : '';
- const pocketSessionBlockFrequency = (_e = parseInt(process.env.POCKET_SESSION_BLOCK_FREQUENCY)) !== null && _e !== void 0 ? _e : 0;
- const pocketBlockTime = (_f = parseInt(process.env.POCKET_BLOCK_TIME)) !== null && _f !== void 0 ? _f : 0;
- const relayRetries = (_g = parseInt(process.env.POCKET_RELAY_RETRIES)) !== null && _g !== void 0 ? _g : 0;
- const databaseEncryptionKey = (_h = process.env.DATABASE_ENCRYPTION_KEY) !== null && _h !== void 0 ? _h : '';
- if (!dispatchURL) {
- throw new rest_1.HttpErrors.InternalServerError('DISPATCH_URL required in ENV');
- }
- if (!fallbackURL) {
- throw new rest_1.HttpErrors.InternalServerError('FALLBACK_URL required in ENV');
- }
- if (!clientPrivateKey) {
- throw new rest_1.HttpErrors.InternalServerError('GATEWAY_CLIENT_PRIVATE_KEY required in ENV');
- }
- if (!clientPassphrase) {
- throw new rest_1.HttpErrors.InternalServerError('GATEWAY_CLIENT_PASSPHRASE required in ENV');
- }
- if (!pocketSessionBlockFrequency || pocketSessionBlockFrequency === 0) {
- throw new rest_1.HttpErrors.InternalServerError('POCKET_SESSION_BLOCK_FREQUENCY required in ENV');
- }
- if (!pocketBlockTime || pocketBlockTime === 0) {
- throw new rest_1.HttpErrors.InternalServerError('POCKET_BLOCK_TIME required in ENV');
- }
- if (!databaseEncryptionKey) {
- throw new rest_1.HttpErrors.InternalServerError('DATABASE_ENCRYPTION_KEY required in ENV');
- }
- // Load Redis for cache
- const redisEndpoint = process.env.REDIS_ENDPOINT || '';
- const redisPort = process.env.REDIS_PORT || '';
- if (!redisEndpoint) {
- throw new rest_1.HttpErrors.InternalServerError('REDIS_ENDPOINT required in ENV');
- }
- if (!redisPort) {
- throw new rest_1.HttpErrors.InternalServerError('REDIS_PORT required in ENV');
- }
- const redis = new Redis(redisPort, redisEndpoint);
- this.bind('redisInstance').to(redis);
- // Load Postgres for TimescaleDB metrics
- const pgConnection = process.env.PG_CONNECTION || '';
- const pgCertificate = process.env.PG_CERTIFICATE || '';
- if (!pgConnection) {
- throw new rest_1.HttpErrors.InternalServerError('PG_CONNECTION required in ENV');
- }
- if (!pgCertificate) {
- throw new rest_1.HttpErrors.InternalServerError('PG_CERTIFICATE required in ENV');
- }
- // Pull public certificate from Redis or s3 if not there
- const cachedCertificate = await redis.get('timescaleDBCertificate');
- let publicCertificate;
- if (!cachedCertificate) {
- try {
- const s3Certificate = await got(pgCertificate);
- publicCertificate = s3Certificate.body;
- }
- catch (e) {
- throw new rest_1.HttpErrors.InternalServerError('Invalid Certificate');
- }
- redis.set('timescaleDBCertificate', publicCertificate, 'EX', 600);
- }
- else {
- publicCertificate = cachedCertificate;
- }
- const pgPool = new pg.Pool({
- connectionString: pgConnection,
- ssl: {
- rejectUnauthorized: false,
- ca: publicCertificate,
- },
- });
- this.bind('pgPool').to(pgPool);
- this.bind('databaseEncryptionKey').to(databaseEncryptionKey);
- // Create the Pocket instance
- const dispatchers = [];
- if (dispatchURL.indexOf(",")) {
- const dispatcherArray = dispatchURL.split(",");
- dispatcherArray.forEach(function (dispatcher) {
- dispatchers.push(new URL(dispatcher));
- });
- }
- else {
- dispatchers.push(new URL(dispatchURL));
- }
- const configuration = new Configuration(0, 100000, 0, 120000, false, pocketSessionBlockFrequency, pocketBlockTime, 1, undefined, true);
- const rpcProvider = new HttpRpcProvider(dispatchers);
- const relayProfiler = new relay_profiler_1.RelayProfiler(pgPool);
- const pocket = new Pocket(dispatchers, rpcProvider, configuration, undefined, relayProfiler);
- // Bind to application context for shared re-use
- this.bind('pocketInstance').to(pocket);
- this.bind('pocketConfiguration').to(configuration);
- this.bind('relayRetries').to(relayRetries);
- this.bind('fallbackURL').to(fallbackURL);
- this.bind('logger').to(logger);
- // Unlock primary client account for relay signing
- try {
- const importAccount = await pocket.keybase.importAccount(Buffer.from(clientPrivateKey, 'hex'), clientPassphrase);
- if (importAccount instanceof account_1.Account) {
- await pocket.keybase.unlockAccount(importAccount.addressHex, clientPassphrase, 0);
- }
- }
- catch (e) {
- logger.log('error', e);
- throw new rest_1.HttpErrors.InternalServerError('Unable to import or unlock base client account');
- }
- // Create a UID for this process
- const parts = [os.hostname(), process.pid, +new Date()];
- const hash = crypto.createHash('md5').update(parts.join(''));
- this.bind('processUID').to(hash.digest('hex'));
- }
-}
-exports.PocketGatewayApplication = PocketGatewayApplication;
-//# sourceMappingURL=application.js.map
\ No newline at end of file
diff --git a/dist/application.js.map b/dist/application.js.map
deleted file mode 100644
index 2f778964..00000000
--- a/dist/application.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";;;AAAA,yCAAyC;AAEzC,qDAAqD;AACrD,yCAA2D;AAC3D,2DAAqD;AACrD,yCAA2C;AAC3C,iFAA4E;AAC5E,8DAAwD;AAExD,mDAA6B;AAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACpD,MAAM,EAAC,MAAM,EAAE,aAAa,EAAE,eAAe,EAAC,GAAG,QAAQ,CAAC;AAE1D,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACjC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,OAAO,CAAC,eAAe,CAAC,CAAC;AACzB,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3B,MAAa,wBAAyB,SAAQ,gBAAS,CACrD,4BAAY,CAAC,4BAAe,CAAC,sBAAe,CAAC,CAAC,CAC/C;IACC,YAAY,UAA6B,EAAE;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,CAAC,0BAAe,CAAC,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;QAEpD,IAAI,CAAC,WAAW,GAAG,SAA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AC,CACF,CAAC;aACH;SACF;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,iBAAU,CAAC,mBAAmB,CACtC,gDAAgD,CACjD,CAAC;SACH;QAED,gCAAgC;QAChC,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;CACF;AAvLD,4DAuLC"}
\ No newline at end of file
diff --git a/dist/controllers/blockchains.controller.d.ts b/dist/controllers/blockchains.controller.d.ts
deleted file mode 100644
index 8810c6da..00000000
--- a/dist/controllers/blockchains.controller.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Count, Filter, FilterExcludingWhere, Where } from '@loopback/repository';
-import { Blockchains } from '../models';
-import { BlockchainsRepository } from '../repositories';
-export declare class BlockchainsController {
- blockchainsRepository: BlockchainsRepository;
- constructor(blockchainsRepository: BlockchainsRepository);
- create(blockchains: Blockchains): Promise;
- count(where?: Where): Promise;
- find(filter?: Filter): Promise