Skip to content

Commit 405d250

Browse files
authored
feat: indexer's version 1 (#61)
1 parent 4e34a63 commit 405d250

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5134
-7346
lines changed

.env.example

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
## You can actually run the project without setting any enviroment varibles.
2-
## They are all optional and have default fallbacks.
1+
## You can actually run the project by just assigning Spiritnet nodes to `RPC_ENDPOINTS`.
2+
## All other environment variables are optional and have default fallbacks.
33

44

55
## Nevertheless, please duplicate this file on the same directory and rename it ".env".
66
## That will be the real .env-file that lets you configure this project.
77
## Then you can change variable values and follow instructions below according to your needs.
88

9+
## Remote procedure call Endpoints of the KILT Blockchain to index (comma separated ","):
10+
RPC_ENDPOINTS=
11+
12+
## Custom Host Machine Ports to map to the containers:
13+
## Defining them allows running several instances on the same machine.
14+
## Disclaimer: the tests only work with the default Postgres-Port `5432`
15+
POSTGRES_HOST_PORT=
16+
GRAPHQL_HOST_PORT=
17+
18+
## Set to "True" to work with the KILT-testnet "Peregrine"
19+
CRAWL_PEREGRINE=
920

1021
## Start your data base from a higher block
1122
## If this variable is not set, the starting block would be 1
12-
## WARNING: Setting a higher starting block leads to crashes when dependecies on previos entities can't be fulfilled.
23+
## WARNING: Setting a higher starting block leads to crashes when dependencies on previous entities can't be fulfilled.
1324
START_BLOCK=
1425

1526
## To delete a portion of the data base from the end:
@@ -20,20 +31,3 @@ START_BLOCK=
2031
## 5. Done! You can re-run the project normally again.
2132
#SUB_COMMAND=reindex
2233
#CUTOFF_HEIGHT=4300000
23-
24-
## Remote procedure call Endpoints of the KILT Blockchain to index (coma separated ","):
25-
RPC_ENDPOINTS=
26-
27-
## Custom Host Machine Ports to map to the containers:
28-
## Defining them allows running several instances on the same machine.
29-
POSTGRES_HOST_PORT=
30-
GRAPHQL_HOST_PORT=
31-
32-
## Set to "True" to work with the KILT-testnet "Peregrine"
33-
CRAWL_PEREGRINE=
34-
35-
## Use BOTLabs private peregrine node:
36-
## Only while running on internal server
37-
PRIVATE_NODE_ENABLE=
38-
PRIVATE_NODE_NET_NAME=
39-

.github/workflows/pr.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,31 @@ jobs:
88
pr:
99
name: pr
1010
runs-on: ubuntu-latest
11-
environment: production
11+
environment: test
12+
services:
13+
postgres:
14+
image: postgres:16-alpine
15+
ports:
16+
- 5432:5432
17+
env:
18+
POSTGRES_PASSWORD: postgres
19+
options: >-
20+
--health-cmd pg_isready
21+
--health-interval 10s
22+
--health-timeout 5s
23+
--health-retries 5
1224
env:
1325
RPC_ENDPOINTS: ${{ vars.RPC_ENDPOINTS }}
26+
DB_USER: postgres
27+
DB_PASS: postgres
28+
DB_DATABASE: postgres
29+
DB_HOST: localhost
30+
DB_PORT: 5432
31+
TZ: "UTC"
1432
steps:
1533
- uses: actions/checkout@v4
34+
- name: Enable btree btree_gist on postgres database
35+
run: psql "postgresql://$DB_USER:$DB_PASS@$DB_HOST:$DB_PORT/$DB_DATABASE" -c "CREATE EXTENSION IF NOT EXISTS btree_gist;"
1636
- name: Setup Node.js environment
1737
uses: actions/setup-node@v4
1838
with:
@@ -24,5 +44,5 @@ jobs:
2444
run: yarn codegen
2545
- name: Build
2646
run: yarn build
27-
# - name: Run tests with Subquery Node
28-
# run: yarn subql-node test -f ${{ github.workspace }}
47+
- name: Run tests with Subquery Node
48+
run: yarn subql-node test -f ${{ github.workspace }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/Hydrogen
1+
lts/Jod

0 commit comments

Comments
 (0)