Skip to content

Commit

Permalink
ethereum replace flare
Browse files Browse the repository at this point in the history
  • Loading branch information
yoozo committed Jun 12, 2024
1 parent b16b7aa commit 3e7e42f
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 24 deletions.
9 changes: 7 additions & 2 deletions Flare/flare-starter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
retries: 5

subquery-node:
image: onfinality/subql-node-flare:latest
image: subquerynetwork/subql-node-ethereum:latest
depends_on:
"postgres":
condition: service_healthy
Expand All @@ -32,16 +32,21 @@ services:
volumes:
- ./:/app
command:
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests
- -f=/app
- --db-schema=app
- --workers=4
- --batch-size=30
- --unfinalized-blocks=true

healthcheck:
test: ["CMD", "curl", "-f", "http://subquery-node:3000/ready"]
interval: 3s
timeout: 5s
retries: 10

graphql-engine:
image: onfinality/subql-query:latest
image: subquerynetwork/subql-query:latest
ports:
- 3000:3000
depends_on:
Expand Down
6 changes: 3 additions & 3 deletions Flare/flare-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"prepack": "rm -rf dist && npm run build",
"test": "jest"
},
"homepage": "https://github.com/subquery/flare-starter",
"repository": "github:subquery/flare-starter",
"homepage": "https://github.com/subquery/ethereum-subql-starter",
"repository": "github:subquery/ethereum-subql-starter",
"files": [
"dist",
"schema.graphql",
Expand All @@ -22,7 +22,7 @@
"license": "MIT",
"dependencies": {
"@subql/common": "latest",
"@subql/types-flare": "latest",
"@subql/types-ethereum": "latest",
"@subql/validator": "latest",
"assert": "^2.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions Flare/flare-starter/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
EthereumProject,
EthereumDatasourceKind,
EthereumHandlerKind,
} from "@subql/types-flare";
} from "@subql/types-ethereum";

// Can expand the Datasource processor types via the generic param
const project: EthereumProject = {
Expand All @@ -12,7 +12,7 @@ const project: EthereumProject = {
description: "This project can be use as a starting point for developing your new Flare SubQuery project",
runner: {
node: {
name: "@subql/node-flare",
name: "@subql/node-ethereum",
version: ">=3.0.0",
},
query: {
Expand Down
8 changes: 4 additions & 4 deletions Flare/flare-starter/src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FlareTransaction, FlareLog, FlareBlock } from "@subql/types-flare";
import { EthereumTransaction, EthereumLog, EthereumBlock } from "@subql/types-ethereum";
import { BigNumber } from "@ethersproject/bignumber";
import { HashSubmittedEvent, SubmitHash } from "../types";
import assert from "assert";
Expand All @@ -17,13 +17,13 @@ type SubmitHashCallArgs = [BigNumber, string] & {
};

/*
export async function handleBlock(block: FlareBlock): Promise<void> {
export async function handleBlock(block: EthereumBlock): Promise<void> {
// do something with each and every block
}
*/

export async function handleLog(
log: FlareLog<HashSubmittedEventArgs>
log: EthereumLog<HashSubmittedEventArgs>
): Promise<void> {
assert(log.args, "No log.args" )
const transaction = HashSubmittedEvent.create({
Expand All @@ -39,7 +39,7 @@ export async function handleLog(
}

export async function handleTransaction(
transaction: FlareTransaction<SubmitHashCallArgs>
transaction: EthereumTransaction<SubmitHashCallArgs>
): Promise<void> {

assert(transaction.args, "No transaction.args" )
Expand Down
2 changes: 1 addition & 1 deletion Flare/flare-starter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"include": [
"src/**/*",
"node_modules/@subql/types-flare/dist/global.d.ts",
"node_modules/@subql/types-ethereum/dist/global.d.ts",
"node_modules/@subql/types-core/dist/global.d.ts"
]
}
9 changes: 7 additions & 2 deletions Flare/songbird-starter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
retries: 5

subquery-node:
image: onfinality/subql-node-flare:latest
image: subquerynetwork/subql-node-ethereum:latest
depends_on:
"postgres":
condition: service_healthy
Expand All @@ -32,16 +32,21 @@ services:
volumes:
- ./:/app
command:
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests
- -f=/app
- --db-schema=app
- --workers=4
- --batch-size=30
- --unfinalized-blocks=true

healthcheck:
test: ["CMD", "curl", "-f", "http://subquery-node:3000/ready"]
interval: 3s
timeout: 5s
retries: 10

graphql-engine:
image: onfinality/subql-query:latest
image: subquerynetwork/subql-query:latest
ports:
- 3000:3000
depends_on:
Expand Down
6 changes: 3 additions & 3 deletions Flare/songbird-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"prepack": "rm -rf dist && npm run build",
"test": "jest"
},
"homepage": "https://github.com/subquery/flare-starter",
"repository": "github:subquery/flare-starter",
"homepage": "https://github.com/subquery/ethereum-subql-starter",
"repository": "github:subquery/ethereum-subql-starter",
"files": [
"dist",
"schema.graphql",
Expand All @@ -22,7 +22,7 @@
"license": "MIT",
"dependencies": {
"@subql/common": "latest",
"@subql/types-flare": "latest",
"@subql/types-ethereum": "latest",
"@subql/validator": "latest",
"assert": "^2.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions Flare/songbird-starter/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
EthereumProject,
EthereumDatasourceKind,
EthereumHandlerKind,
} from "@subql/types-flare";
} from "@subql/types-ethereum";

// Can expand the Datasource processor types via the generic param
const project: EthereumProject = {
Expand All @@ -12,7 +12,7 @@ const project: EthereumProject = {
description: "This project can be use as a starting point for developing your new Flare Songbird SubQuery project",
runner: {
node: {
name: "@subql/node-flare",
name: "@subql/node-ethereum",
version: ">=3.0.0",
},
query: {
Expand Down
8 changes: 4 additions & 4 deletions Flare/songbird-starter/src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FlareTransaction, FlareLog, FlareBlock } from "@subql/types-flare";
import { EthereumTransaction, EthereumLog, EthereumBlock } from "@subql/types-ethereum";
import { BigNumber } from "@ethersproject/bignumber";
import { HashSubmittedEvent, SubmitHash } from "../types";
import assert from "assert";
Expand All @@ -17,13 +17,13 @@ type SubmitHashCallArgs = [BigNumber, string] & {
};

/*
export async function handleBlock(block: FlareBlock): Promise<void> {
export async function handleBlock(block: EthereumBlock): Promise<void> {
// do something with each and every block
}
*/

export async function handleLog(
log: FlareLog<HashSubmittedEventArgs>
log: EthereumLog<HashSubmittedEventArgs>
): Promise<void> {
assert(log.args, "No log.args" )

Expand All @@ -40,7 +40,7 @@ export async function handleLog(
}

export async function handleTransaction(
transaction: FlareTransaction<SubmitHashCallArgs>
transaction: EthereumTransaction<SubmitHashCallArgs>
): Promise<void> {

assert(transaction.args, "No transaction.args" )
Expand Down
2 changes: 1 addition & 1 deletion Flare/songbird-starter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"include": [
"src/**/*",
"node_modules/@subql/types-flare/dist/global.d.ts",
"node_modules/@subql/types-ethereum/dist/global.d.ts",
"node_modules/@subql/types-core/dist/global.d.ts"
]
}

0 comments on commit 3e7e42f

Please sign in to comment.