feature-798/enable-evm-celo-chain

This commit is contained in:
Julian Merlo 2023-12-05 10:20:19 -03:00
parent b6e3b00d54
commit 36c3691f61
8 changed files with 89 additions and 4 deletions

View File

@ -54,6 +54,13 @@
"__format": "json"
}
},
"celo": {
"network": "CELO_NETWORK",
"rpcs": {
"__name": "CELO_NETWORK",
"__format": "json"
}
},
"optimism": {
"network": "OPTIMISM_NETWORK",
"rpcs": {

View File

@ -10,6 +10,7 @@
"fantom",
"karura",
"acala",
"celo",
"optimism",
"base"
],
@ -72,6 +73,13 @@
"rpcs": ["https://eth-rpc-acala-testnet.aca-staging.network"],
"timeout": 10000
},
"celo": {
"name": "celo",
"network": "alfajores",
"chainId": 14,
"rpcs": ["https://alfajores-forno.celo-testnet.org"],
"timeout": 10000
},
"optimism": {
"name": "optimism",
"network": "goerli",

View File

@ -24,6 +24,10 @@
"network": "mainnet",
"rpcs": ["https://eth-rpc-acala.aca-api.network"]
},
"celo": {
"network": "mainnet",
"rpcs": ["https://forno.celo.org"]
},
"optimism": {
"network": "mainnet",
"rpcs": ["https://rpc.ankr.com/optimism"]

View File

@ -11,7 +11,8 @@
"build": "tsc",
"build:ncc": "ncc build src/start.ts -o lib",
"dev": "ts-node src/start.ts",
"dev:debug": "ts-node src/start.ts start --debug --watch",
"dev:debug-testnet": "ts-node src/start.ts start --debug --watch",
"dev:debug-mainnet": "NODE_ENV=mainnet ts-node src/start.ts start --debug --watch",
"prettier": "prettier --write ."
},
"author": "chase-45",

View File

@ -15,7 +15,7 @@ import { HttpClient } from "../rpc/http/HttpClient";
import { JobRepository } from "../../domain/repositories";
const SOLANA_CHAIN = "solana";
const EVM_CHAINS = ["ethereum", "avalanche", "fantom", "karura", "acala", "optimism", "base"];
const EVM_CHAINS = ["ethereum", "avalanche", "fantom", "karura", "acala", "celo", "optimism", "base"];
export class RepositoriesBuilder {
private cfg: Config;

View File

@ -40,6 +40,7 @@ describe("RepositoriesBuilder", () => {
"fantom",
"karura",
"acala",
"celo",
"optimism",
"base",
])
@ -53,6 +54,7 @@ describe("RepositoriesBuilder", () => {
expect(repos.getEvmBlockRepository("fantom")).toBeInstanceOf(EvmJsonRPCBlockRepository);
expect(repos.getEvmBlockRepository("karura")).toBeInstanceOf(EvmJsonRPCBlockRepository);
expect(repos.getEvmBlockRepository("acala")).toBeInstanceOf(EvmJsonRPCBlockRepository);
expect(repos.getEvmBlockRepository("celo")).toBeInstanceOf(EvmJsonRPCBlockRepository);
expect(repos.getEvmBlockRepository("optimism")).toBeInstanceOf(EvmJsonRPCBlockRepository);
expect(repos.getEvmBlockRepository("base")).toBeInstanceOf(EvmJsonRPCBlockRepository);
expect(repos.getMetadataRepository()).toBeInstanceOf(FileMetadataRepository);

View File

@ -45,16 +45,23 @@ export const configMock = (chains: string[] = []): Config => {
rpcs: ["http://localhost"],
timeout: 10000,
},
celo: {
name: "celo",
network: "alfajores",
chainId: 14,
rpcs: ["http://localhost"],
timeout: 10000,
},
optimism: {
name: "optimism",
network: "testnet",
network: "goerli",
chainId: 12,
rpcs: ["http://localhost"],
timeout: 10000,
},
base: {
name: "base",
network: "testnet",
network: "goerli",
chainId: 12,
rpcs: ["http://localhost"],
timeout: 10000,

View File

@ -91,6 +91,34 @@ data:
}
}
]
},
{
"id": "poll-log-message-published-celo",
"chain": "celo",
"source": {
"action": "PollEvmLogs",
"config": {
"blockBatchSize": 100,
"commitment": "latest",
"interval": 15000,
"addresses": ["0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"],
"chain": "celo"
}
},
"handlers": [
{
"action": "HandleEvmLogs",
"target": "sns",
"mapper": "evmLogMessagePublishedMapper",
"config": {
"abi": "event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel)",
"filter": {
"addresses": ["0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"],
"topics": ["0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2"]
}
}
}
]
}
]
mainnet-jobs.json: |-
@ -150,6 +178,34 @@ data:
}
}
]
},
{
"id": "poll-log-message-published-celo",
"chain": "celo",
"source": {
"action": "PollEvmLogs",
"config": {
"blockBatchSize": 100,
"commitment": "latest",
"interval": 5000,
"addresses": ["0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],
"chain": "celo"
}
},
"handlers": [
{
"action": "HandleEvmLogs",
"target": "sns",
"mapper": "evmLogMessagePublishedMapper",
"config": {
"abi": "event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel)",
"filter": {
"addresses": ["0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],
"topics": ["0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2"]
}
}
}
]
}
]
---