-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e8d891
commit abaa915
Showing
11 changed files
with
282 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
specVersion: 1.0.0 | ||
name: '@acala-network/evm-subql' | ||
version: 1.0.0 | ||
runner: | ||
node: | ||
name: '@subql/node' | ||
version: 1.21.2 | ||
query: | ||
name: '@subql/query' | ||
version: 1.4.0 | ||
description: 'subquery for Acala EVM+' | ||
repository: 'https://github.com/AcalaNetwork/bodhi.js/tree/master/evm-subql' | ||
schema: | ||
file: ./schema.graphql | ||
network: | ||
# Acala | ||
chainId: '0xfc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c' | ||
endpoint: ws://chopsticks:8000 | ||
chaintypes: | ||
file: ./dist/chain-types/index.js | ||
dataSources: | ||
- kind: substrate/Runtime | ||
startBlock: 5108461 | ||
mapping: | ||
file: ./dist/index.js | ||
handlers: | ||
- handler: handleBlock | ||
kind: substrate/BlockHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
specVersion: 1.0.0 | ||
name: '@acala-network/evm-subql' | ||
version: 1.0.0 | ||
runner: | ||
node: | ||
name: '@subql/node' | ||
version: 1.21.2 | ||
query: | ||
name: '@subql/query' | ||
version: 1.4.0 | ||
description: 'subquery for Karura EVM+' | ||
repository: 'https://github.com/AcalaNetwork/bodhi.js/tree/master/evm-subql' | ||
schema: | ||
file: ./schema.graphql | ||
network: | ||
# Karura | ||
chainId: '0xbaf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b' | ||
endpoint: ws://chopsticks:8000 | ||
chaintypes: | ||
file: ./dist/chain-types/index.js | ||
dataSources: | ||
- kind: substrate/Runtime | ||
startBlock: 5853808 | ||
mapping: | ||
file: ./dist/index.js | ||
handlers: | ||
- handler: handleBlock | ||
kind: substrate/BlockHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
version: '3' | ||
|
||
services: | ||
chopsticks: | ||
image: oven/bun | ||
container_name: chopsticks-node | ||
volumes: | ||
- ./:/home/bun/app | ||
- ./.bunx-cache:/root/.bun/install/cache | ||
command: bunx @acala-network/chopsticks@latest -c ./configs/acala.yml | ||
ports: | ||
- 8000:8000 | ||
|
||
postgres: | ||
image: postgres:12-alpine | ||
container_name: postgres | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
|
||
subquery-node: | ||
image: acala/evm-subql:2.7.16 | ||
volumes: | ||
- ./configs/subql/karura.yaml:/app/karura.yaml | ||
- ./configs/subql/acala.yaml:/app/acala.yaml | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- chopsticks | ||
- postgres | ||
restart: always | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
environment: | ||
DB_USER: postgres | ||
DB_PASS: postgres | ||
DB_DATABASE: postgres | ||
DB_HOST: host.docker.internal | ||
DB_PORT: 5432 | ||
command: | ||
- -f=./acala.yaml | ||
- --network-endpoint=ws://chopsticks:8000 | ||
- --db-schema=acala_evm | ||
- --log-level=debug | ||
- --unsafe | ||
- --disable-historical | ||
|
||
graphql-engine: | ||
image: onfinality/subql-query:v1.4.0 | ||
container_name: graphql-engine | ||
ports: | ||
- 3001:3001 | ||
depends_on: | ||
- subquery-node | ||
restart: always | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
environment: | ||
DB_USER: postgres | ||
DB_PASS: postgres | ||
DB_DATABASE: postgres | ||
DB_HOST: host.docker.internal | ||
DB_PORT: 5432 | ||
PORT: 3001 | ||
command: | ||
- --name=acala_evm | ||
- --playground | ||
- --indexer=http://subquery-node:3000 | ||
|
||
eth-rpc-adapter: | ||
image: acala/eth-rpc-adapter:2.7.16 | ||
environment: | ||
- SUBQL_URL=http://graphql-engine:3001 | ||
- ENDPOINT_URL=ws://chopsticks:8000 | ||
command: yarn start | ||
ports: | ||
- 8545:8545 | ||
restart: always | ||
depends_on: | ||
- chopsticks | ||
extra_hosts: | ||
- host.docker.internal:host-gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
version: '3' | ||
|
||
services: | ||
chopsticks: | ||
image: oven/bun | ||
container_name: chopsticks-node | ||
volumes: | ||
- ./:/home/bun/app | ||
- ./.bunx-cache:/root/.bun/install/cache | ||
command: bunx @acala-network/chopsticks@latest -c ./configs/karura.yml | ||
ports: | ||
- 8000:8000 | ||
|
||
postgres: | ||
image: postgres:12-alpine | ||
container_name: postgres | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
|
||
subquery-node: | ||
image: acala/evm-subql:2.7.16 | ||
volumes: | ||
- ./configs/subql/karura.yaml:/app/karura.yaml | ||
- ./configs/subql/acala.yaml:/app/acala.yaml | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- chopsticks | ||
- postgres | ||
restart: always | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
environment: | ||
DB_USER: postgres | ||
DB_PASS: postgres | ||
DB_DATABASE: postgres | ||
DB_HOST: host.docker.internal | ||
DB_PORT: 5432 | ||
command: | ||
- -f=./karura.yaml | ||
- --network-endpoint=ws://chopsticks:8000 | ||
- --db-schema=acala_evm | ||
- --log-level=debug | ||
- --unsafe | ||
- --disable-historical | ||
|
||
graphql-engine: | ||
image: onfinality/subql-query:v1.4.0 | ||
container_name: graphql-engine | ||
ports: | ||
- 3001:3001 | ||
depends_on: | ||
- subquery-node | ||
restart: always | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
environment: | ||
DB_USER: postgres | ||
DB_PASS: postgres | ||
DB_DATABASE: postgres | ||
DB_HOST: host.docker.internal | ||
DB_PORT: 5432 | ||
PORT: 3001 | ||
command: | ||
- --name=acala_evm | ||
- --playground | ||
- --indexer=http://subquery-node:3000 | ||
|
||
eth-rpc-adapter: | ||
image: acala/eth-rpc-adapter:2.7.16 | ||
environment: | ||
- SUBQL_URL=http://graphql-engine:3001 | ||
- ENDPOINT_URL=ws://chopsticks:8000 | ||
command: yarn start | ||
ports: | ||
- 8545:8545 | ||
restart: always | ||
depends_on: | ||
- chopsticks | ||
extra_hosts: | ||
- host.docker.internal:host-gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Function to get block number from a given JSON RPC URL | ||
getBlockNumber() { | ||
local rpcUrl=$1 | ||
local networkName=$2 | ||
|
||
response=$(curl -s -H "Content-Type: application/json" --data \ | ||
'{"jsonrpc":"2.0", "method":"chain_getHeader", "params":[], "id":1}' \ | ||
$rpcUrl) | ||
|
||
# Extract the block number in hexadecimal, removing the "0x" prefix | ||
blockNumberHex=$(echo $response | jq -r '.result.number' | sed 's/0x//') | ||
|
||
# Convert the hexadecimal block number to decimal | ||
blockNumberDecimal=$((16#$blockNumberHex)) | ||
|
||
# Print the block number | ||
echo "$networkName Block Number: $blockNumberDecimal" | ||
} | ||
|
||
# Call the function with Karura and Acala URLs | ||
getBlockNumber "https://karura-rpc.aca-api.network" "karura" | ||
getBlockNumber "https://acala-rpc.aca-api.network" "acala" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.