[Blockchain Watcher] Feature 798/enable evm acala chain (#837)
* Add fantom chain * Mapped all chains in prod-mainnet * Add fantom test * feature-798/enable-evm-acala-chain * Run prettier * Resolve comment in PR * Replace mainnet url --------- Co-authored-by: Julian Merlo <julianmerlo@MacBook-Pro-de-Julian.local>
This commit is contained in:
parent
2836f4ffc2
commit
912049a0a8
|
@ -3,7 +3,7 @@
|
||||||
"port": 9090,
|
"port": 9090,
|
||||||
"logLevel": "debug",
|
"logLevel": "debug",
|
||||||
"dryRun": true,
|
"dryRun": true,
|
||||||
"supportedChains": ["ethereum", "solana", "fantom", "karura"],
|
"supportedChains": ["ethereum", "solana", "fantom", "karura", "acala"],
|
||||||
"sns": {
|
"sns": {
|
||||||
"topicArn": "arn:aws:sns:us-east-1:000000000000:localstack-topic.fifo",
|
"topicArn": "arn:aws:sns:us-east-1:000000000000:localstack-topic.fifo",
|
||||||
"region": "us-east-1",
|
"region": "us-east-1",
|
||||||
|
@ -48,6 +48,13 @@
|
||||||
"chainId": 11,
|
"chainId": 11,
|
||||||
"rpcs": ["https://eth-rpc-karura-testnet.aca-staging.network"],
|
"rpcs": ["https://eth-rpc-karura-testnet.aca-staging.network"],
|
||||||
"timeout": 10000
|
"timeout": 10000
|
||||||
|
},
|
||||||
|
"acala": {
|
||||||
|
"name": "acala",
|
||||||
|
"network": "testnet",
|
||||||
|
"chainId": 12,
|
||||||
|
"rpcs": ["https://eth-rpc-acala-testnet.aca-staging.network"],
|
||||||
|
"timeout": 10000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
"karura": {
|
"karura": {
|
||||||
"network": "mainnet",
|
"network": "mainnet",
|
||||||
"rpcs": ["https://eth-rpc-karura.aca-api.network"]
|
"rpcs": ["https://eth-rpc-karura.aca-api.network"]
|
||||||
|
},
|
||||||
|
"acala": {
|
||||||
|
"network": "mainnet",
|
||||||
|
"rpcs": ["https://eth-rpc-acala.aca-api.network"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,13 @@
|
||||||
"chainId": 11,
|
"chainId": 11,
|
||||||
"rpcs": ["https://eth-rpc-karura.aca-api.network"],
|
"rpcs": ["https://eth-rpc-karura.aca-api.network"],
|
||||||
"timeout": 10000
|
"timeout": 10000
|
||||||
|
},
|
||||||
|
"acala": {
|
||||||
|
"name": "acala",
|
||||||
|
"network": "mainnet",
|
||||||
|
"chainId": 12,
|
||||||
|
"rpcs": ["https://eth-rpc-acala.aca-api.network"],
|
||||||
|
"timeout": 10000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { HttpClient } from "./http/HttpClient";
|
||||||
import { JobRepository } from "../domain/repositories";
|
import { JobRepository } from "../domain/repositories";
|
||||||
|
|
||||||
const SOLANA_CHAIN = "solana";
|
const SOLANA_CHAIN = "solana";
|
||||||
const EVM_CHAINS = ["ethereum", "fantom", "karura"];
|
const EVM_CHAINS = ["ethereum", "fantom", "karura", "acala"];
|
||||||
|
|
||||||
export class RepositoriesBuilder {
|
export class RepositoriesBuilder {
|
||||||
private cfg: Config;
|
private cfg: Config;
|
||||||
|
|
|
@ -32,7 +32,9 @@ describe("RepositoriesBuilder", () => {
|
||||||
|
|
||||||
it("should be return all repositories instances", async () => {
|
it("should be return all repositories instances", async () => {
|
||||||
// When
|
// When
|
||||||
const repos = new RepositoriesBuilder(configMock(["solana", "ethereum", "fantom", "karura"]));
|
const repos = new RepositoriesBuilder(
|
||||||
|
configMock(["solana", "ethereum", "fantom", "karura", "acala"])
|
||||||
|
);
|
||||||
// Then
|
// Then
|
||||||
const job = repos.getJobsRepository();
|
const job = repos.getJobsRepository();
|
||||||
expect(job).toBeTruthy();
|
expect(job).toBeTruthy();
|
||||||
|
@ -40,6 +42,7 @@ describe("RepositoriesBuilder", () => {
|
||||||
expect(repos.getEvmBlockRepository("ethereum")).toBeInstanceOf(EvmJsonRPCBlockRepository);
|
expect(repos.getEvmBlockRepository("ethereum")).toBeInstanceOf(EvmJsonRPCBlockRepository);
|
||||||
expect(repos.getEvmBlockRepository("fantom")).toBeInstanceOf(EvmJsonRPCBlockRepository);
|
expect(repos.getEvmBlockRepository("fantom")).toBeInstanceOf(EvmJsonRPCBlockRepository);
|
||||||
expect(repos.getEvmBlockRepository("karura")).toBeInstanceOf(EvmJsonRPCBlockRepository);
|
expect(repos.getEvmBlockRepository("karura")).toBeInstanceOf(EvmJsonRPCBlockRepository);
|
||||||
|
expect(repos.getEvmBlockRepository("acala")).toBeInstanceOf(EvmJsonRPCBlockRepository);
|
||||||
expect(repos.getMetadataRepository()).toBeInstanceOf(FileMetadataRepository);
|
expect(repos.getMetadataRepository()).toBeInstanceOf(FileMetadataRepository);
|
||||||
expect(repos.getSnsEventRepository()).toBeInstanceOf(SnsEventRepository);
|
expect(repos.getSnsEventRepository()).toBeInstanceOf(SnsEventRepository);
|
||||||
expect(repos.getStatsRepository()).toBeInstanceOf(PromStatRepository);
|
expect(repos.getStatsRepository()).toBeInstanceOf(PromStatRepository);
|
||||||
|
|
|
@ -31,6 +31,13 @@ export const configMock = (chains: string[] = []): Config => {
|
||||||
rpcs: ["http://localhost"],
|
rpcs: ["http://localhost"],
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
},
|
},
|
||||||
|
acala: {
|
||||||
|
name: "acala",
|
||||||
|
network: "testnet",
|
||||||
|
chainId: 12,
|
||||||
|
rpcs: ["http://localhost"],
|
||||||
|
timeout: 10000,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const snsConfig: SnsConfig = {
|
const snsConfig: SnsConfig = {
|
||||||
|
|
|
@ -135,6 +135,41 @@ data:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "poll-log-message-published-acala",
|
||||||
|
"chain": "acala",
|
||||||
|
"source": {
|
||||||
|
"action": "PollEvmLogs",
|
||||||
|
"config": {
|
||||||
|
"blockBatchSize": 100,
|
||||||
|
"commitment": "latest",
|
||||||
|
"interval": 15000,
|
||||||
|
"addresses": [
|
||||||
|
"0x4377B49d559c0a9466477195C6AdC3D433e265c0"
|
||||||
|
],
|
||||||
|
"chain": "acala",
|
||||||
|
"topics": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"handlers": [
|
||||||
|
{
|
||||||
|
"action": "HandleEvmLogs",
|
||||||
|
"target": "sns",
|
||||||
|
"mapper": "evmLogMessagePublishedMapper",
|
||||||
|
"config": {
|
||||||
|
"abi": "event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel)",
|
||||||
|
"filter": {
|
||||||
|
"addresses": [
|
||||||
|
"0x4377B49d559c0a9466477195C6AdC3D433e265c0"
|
||||||
|
],
|
||||||
|
"topics": [
|
||||||
|
"0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
mainnet-jobs.json: |-
|
mainnet-jobs.json: |-
|
||||||
|
@ -237,6 +272,41 @@ data:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "poll-log-message-published-acala",
|
||||||
|
"chain": "acala",
|
||||||
|
"source": {
|
||||||
|
"action": "PollEvmLogs",
|
||||||
|
"config": {
|
||||||
|
"blockBatchSize": 100,
|
||||||
|
"commitment": "latest",
|
||||||
|
"interval": 15000,
|
||||||
|
"addresses": [
|
||||||
|
"0xa321448d90d4e5b0A732867c18eA198e75CAC48E"
|
||||||
|
],
|
||||||
|
"chain": "acala",
|
||||||
|
"topics": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in New Issue