diff --git a/chainTypes/pezkuwi.json b/chainTypes/pezkuwi.json new file mode 100644 index 0000000..88f171f --- /dev/null +++ b/chainTypes/pezkuwi.json @@ -0,0 +1,53 @@ +{ + "types": { + "DispatchErrorModule": "DispatchErrorModuleU8", + "FullIdentification": "()", + "Keys": "SessionKeys7B", + "Weight": "WeightV1" + }, + "typesBundle": { + "spec": { + "pezkuwi": { + "types": [ + { + "minmax": [0, 200], + "types": { + "DispatchErrorModule": "DispatchErrorModuleU8", + "FullIdentification": "()", + "Keys": "SessionKeys7B", + "Weight": "WeightV1", + "AccountInfo": "AccountInfoWithDualRefCount", + "Address": "AccountId", + "LookupSource": "AccountId" + } + }, + { + "minmax": [201, 214], + "types": { + "DispatchErrorModule": "DispatchErrorModuleU8", + "FullIdentification": "()", + "Keys": "SessionKeys7B", + "Weight": "WeightV1", + "AccountInfo": "AccountInfoWithDualRefCount" + } + }, + { + "minmax": [215, 228], + "types": { + "DispatchErrorModule": "DispatchErrorModuleU8", + "FullIdentification": "()", + "Keys": "SessionKeys6", + "Weight": "WeightV1" + } + }, + { + "minmax": [229, null], + "types": { + "Weight": "WeightV1" + } + } + ] + } + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 07d70bf..26ffca2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,12 @@ version: "3" services: postgres: - container_name: "postgres-${PROJECT_PATH}" + container_name: "postgres-pezkuwi" image: postgres:16-alpine ports: - 5432:5432 volumes: - .data/postgres:/var/lib/postgresql/data - - ./docker/init:/docker-entrypoint-initdb.d/ healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s @@ -17,8 +16,10 @@ services: POSTGRES_PASSWORD: postgres subquery-node: - container_name: "node-${PROJECT_PATH}" - image: onfinality/subql-node:v5.6.0 + container_name: "node-pezkuwi" + build: + context: ./docker + dockerfile: Dockerfile.node depends_on: postgres: condition: service_healthy @@ -28,16 +29,16 @@ services: DB_PASS: postgres DB_DATABASE: postgres DB_HOST: postgres - DB_POST: 5432 + DB_PORT: 5432 volumes: - - ./:/app + - ./:/app/project command: - - -f=/app/${PROJECT_PATH} + - -f=/app/project/pezkuwi.yaml - --disable-historical=true - - --batch-size=1 + - --batch-size=30 graphql-engine: - container_name: "query-${PROJECT_PATH}" + container_name: "query-pezkuwi" image: onfinality/subql-query:v1.5.0 ports: - 3000:3000 diff --git a/docker/Dockerfile.node b/docker/Dockerfile.node new file mode 100644 index 0000000..4c2778c --- /dev/null +++ b/docker/Dockerfile.node @@ -0,0 +1,23 @@ +FROM node:20-alpine + +WORKDIR /app + +# Install @subql/node with @polkadot aliased to @pezkuwi +RUN npm init -y && \ + npm install @subql/node \ + @polkadot/api@npm:@pezkuwi/api@^16.5.36 \ + @polkadot/api-augment@npm:@pezkuwi/api-augment@^16.5.36 \ + @polkadot/api-derive@npm:@pezkuwi/api-derive@^16.5.36 \ + @polkadot/types@npm:@pezkuwi/types@^16.5.36 \ + @polkadot/types-augment@npm:@pezkuwi/types-augment@^16.5.36 \ + @polkadot/types-codec@npm:@pezkuwi/types-codec@^16.5.36 \ + @polkadot/types-create@npm:@pezkuwi/types-create@^16.5.36 \ + @polkadot/types-known@npm:@pezkuwi/types-known@^16.5.36 \ + @polkadot/rpc-core@npm:@pezkuwi/rpc-core@^16.5.36 \ + @polkadot/rpc-provider@npm:@pezkuwi/rpc-provider@^16.5.36 \ + @polkadot/util@npm:@pezkuwi/util@^14.0.25 \ + @polkadot/util-crypto@npm:@pezkuwi/util-crypto@^14.0.25 \ + @polkadot/keyring@npm:@pezkuwi/keyring@^14.0.25 \ + @polkadot/networks@npm:@pezkuwi/networks@^14.0.25 + +ENTRYPOINT ["/app/node_modules/.bin/subql-node"] diff --git a/package.json b/package.json index 62b06c1..b95d430 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ }, "devDependencies": { "@subql/cli": "latest", + "@subql/common-substrate": "^4.5.5", "@subql/types": "latest", "@types/jest": "^29.5.1", "jest": "^29.5.0", diff --git a/pezkuwi.yaml b/pezkuwi.yaml index 11084c3..d7bff53 100644 --- a/pezkuwi.yaml +++ b/pezkuwi.yaml @@ -17,6 +17,8 @@ network: endpoint: - wss://rpc.pezkuwichain.io - wss://mainnet.pezkuwichain.io + chaintypes: + file: ./chainTypes/pezkuwi.json dataSources: - name: main kind: substrate/Runtime diff --git a/yarn.lock b/yarn.lock index 90bf1f6..9646623 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2322,6 +2322,19 @@ __metadata: languageName: node linkType: hard +"@subql/common-substrate@npm:^4.5.5": + version: 4.5.5 + resolution: "@subql/common-substrate@npm:4.5.5" + dependencies: + "@subql/common": "npm:~5.8.2" + "@subql/types": "npm:~3.15.0" + peerDependencies: + class-transformer: ^0.5.1 + class-validator: 0.14.1 + checksum: 10c0/e2c1e5cb2fc80ce1a7abf3b1540126c541397e4a462dcc9ec6d5a74c991aae5298a18ca1bcf6335ee5e82f56bb1138493c5370c092985a5aa9bc094027eb0b7d + languageName: node + linkType: hard + "@subql/common@npm:~5.8.2": version: 5.8.2 resolution: "@subql/common@npm:5.8.2" @@ -2395,7 +2408,7 @@ __metadata: languageName: node linkType: hard -"@subql/types@npm:latest": +"@subql/types@npm:latest, @subql/types@npm:~3.15.0": version: 3.15.0 resolution: "@subql/types@npm:3.15.0" dependencies: @@ -8159,6 +8172,7 @@ __metadata: "@pezkuwi/util": "npm:^14.0.25" "@pezkuwi/util-crypto": "npm:^14.0.25" "@subql/cli": "npm:latest" + "@subql/common-substrate": "npm:^4.5.5" "@subql/types": "npm:latest" "@types/jest": "npm:^29.5.1" jest: "npm:^29.5.0"