Skip to content

Commit ad53645

Browse files
authored
feat(sdk): add ontrace interface, improve test env setting (stephenh#93)
1 parent c3a7eab commit ad53645

File tree

10 files changed

+407
-63
lines changed

10 files changed

+407
-63
lines changed

protos/processor.proto

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ service Processor {
2121
// It will also return a flag indicate if new contract config is added during the process
2222
rpc ProcessLogs(ProcessLogsRequest) returns (ProcessLogsResponse);
2323

24+
rpc ProcessTraces(ProcessTracesRequest) returns (ProcessTracesResponse);
25+
2426
// Not implemented yet
2527
rpc ProcessTransactions(ProcessTransactionsRequest) returns (ProcessTransactionsResponse);
2628

@@ -108,6 +110,14 @@ message ProcessLogsResponse {
108110
bool config_updated = 4;
109111
}
110112

113+
message ProcessTracesRequest {
114+
repeated LogBinding log_bindings = 1;
115+
}
116+
117+
message ProcessTracesResponse {
118+
O11yResult result = 1;
119+
}
120+
111121
message ProcessTransactionsRequest {
112122
Transaction transaction = 1;
113123
}
@@ -133,11 +143,20 @@ message ProcessBlocksResponse {
133143
}
134144

135145
message LogBinding {
136-
Log log = 1;
146+
RawLog log = 1;
147+
int32 handler_id = 2;
148+
}
149+
150+
message RawLog {
151+
bytes raw = 1;
152+
}
153+
154+
message TraceBinding {
155+
RawTrace trace = 1;
137156
int32 handler_id = 2;
138157
}
139158

140-
message Log {
159+
message RawTrace {
141160
bytes raw = 1;
142161
}
143162

@@ -155,11 +174,11 @@ message Instruction {
155174
}
156175

157176
message BlockBinding {
158-
Block block = 1;
177+
RawBlock block = 1;
159178
repeated int32 handler_ids = 2; // TODO consider make log binds contain list of handler id as well
160179
}
161180

162-
message Block {
181+
message RawBlock {
163182
bytes raw = 1;
164183
}
165184

@@ -202,6 +221,7 @@ enum HandlerType {
202221
BLOCK = 2;
203222
TRANSACTION = 3;
204223
INSTRUCTION = 4;
224+
TRACE = 5;
205225
}
206226

207227
message RuntimeInfo {

sdk/chains-config.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
{
22
"1": {
33
"ChainID": "1",
4-
"Https": [
5-
"https://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2",
6-
"https://eth-mainnet.alchemyapi.io/v2/BJQpOPPKYT7mr3X6iRL3IawOJPnyiG-P"
7-
],
8-
"WebSockets": [
9-
"wss://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2",
10-
"wss://eth-mainnet.alchemyapi.io/v2/BJQpOPPKYT7mr3X6iRL3IawOJPnyiG-P"
11-
],
4+
"Https": ["https://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2"],
5+
"WebSockets": ["wss://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2"],
126
"ChainServer": "",
137
"BatchSize": 2000,
148
"ReorgThresholdBlocks": 30,
@@ -49,8 +43,8 @@
4943
"TimestampSampleInterval": 50000,
5044
"ProcessingDelayBlocks": 5
5145
},
52-
"SOL:mainnet": {
53-
"ChainID": "SOL:mainnet",
46+
"SOL_mainnet": {
47+
"ChainID": "SOL_mainnet",
5448
"Https": [
5549
"https://solana-mainnet.g.alchemy.com/v2/AIM3Qp8rkxBoAjRCNeazPaNKdjYgLdzc",
5650
"https://try-rpc.mainnet.solana.blockdaemon.tech"

0 commit comments

Comments
 (0)