Skip to content

Commit

Permalink
feat(sdk): add ontrace interface, improve test env setting (stephenh#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 authored Sep 14, 2022
1 parent c3a7eab commit ad53645
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 63 deletions.
28 changes: 24 additions & 4 deletions protos/processor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ service Processor {
// It will also return a flag indicate if new contract config is added during the process
rpc ProcessLogs(ProcessLogsRequest) returns (ProcessLogsResponse);

rpc ProcessTraces(ProcessTracesRequest) returns (ProcessTracesResponse);

// Not implemented yet
rpc ProcessTransactions(ProcessTransactionsRequest) returns (ProcessTransactionsResponse);

Expand Down Expand Up @@ -108,6 +110,14 @@ message ProcessLogsResponse {
bool config_updated = 4;
}

message ProcessTracesRequest {
repeated LogBinding log_bindings = 1;
}

message ProcessTracesResponse {
O11yResult result = 1;
}

message ProcessTransactionsRequest {
Transaction transaction = 1;
}
Expand All @@ -133,11 +143,20 @@ message ProcessBlocksResponse {
}

message LogBinding {
Log log = 1;
RawLog log = 1;
int32 handler_id = 2;
}

message RawLog {
bytes raw = 1;
}

message TraceBinding {
RawTrace trace = 1;
int32 handler_id = 2;
}

message Log {
message RawTrace {
bytes raw = 1;
}

Expand All @@ -155,11 +174,11 @@ message Instruction {
}

message BlockBinding {
Block block = 1;
RawBlock block = 1;
repeated int32 handler_ids = 2; // TODO consider make log binds contain list of handler id as well
}

message Block {
message RawBlock {
bytes raw = 1;
}

Expand Down Expand Up @@ -202,6 +221,7 @@ enum HandlerType {
BLOCK = 2;
TRANSACTION = 3;
INSTRUCTION = 4;
TRACE = 5;
}

message RuntimeInfo {
Expand Down
14 changes: 4 additions & 10 deletions sdk/chains-config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{
"1": {
"ChainID": "1",
"Https": [
"https://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2",
"https://eth-mainnet.alchemyapi.io/v2/BJQpOPPKYT7mr3X6iRL3IawOJPnyiG-P"
],
"WebSockets": [
"wss://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2",
"wss://eth-mainnet.alchemyapi.io/v2/BJQpOPPKYT7mr3X6iRL3IawOJPnyiG-P"
],
"Https": ["https://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2"],
"WebSockets": ["wss://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2"],
"ChainServer": "",
"BatchSize": 2000,
"ReorgThresholdBlocks": 30,
Expand Down Expand Up @@ -49,8 +43,8 @@
"TimestampSampleInterval": 50000,
"ProcessingDelayBlocks": 5
},
"SOL:mainnet": {
"ChainID": "SOL:mainnet",
"SOL_mainnet": {
"ChainID": "SOL_mainnet",
"Https": [
"https://solana-mainnet.g.alchemy.com/v2/AIM3Qp8rkxBoAjRCNeazPaNKdjYgLdzc",
"https://try-rpc.mainnet.solana.blockdaemon.tech"
Expand Down
Loading

0 comments on commit ad53645

Please sign in to comment.