mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-07-28 19:12:06 +00:00
Store event data in a separate column in db
This commit is contained in:
parent
b69116b2bf
commit
d0d6f68a21
@ -37,6 +37,13 @@ columns:
|
|||||||
columnOptions:
|
columnOptions:
|
||||||
- option: length
|
- option: length
|
||||||
value: 42
|
value: 42
|
||||||
|
- name: eventName
|
||||||
|
pgType: varchar
|
||||||
|
tsType: string
|
||||||
|
columnType: Column
|
||||||
|
columnOptions:
|
||||||
|
- option: length
|
||||||
|
value: 256
|
||||||
- name: topic0
|
- name: topic0
|
||||||
pgType: varchar
|
pgType: varchar
|
||||||
tsType: string
|
tsType: string
|
||||||
@ -71,13 +78,10 @@ columns:
|
|||||||
value: 66
|
value: 66
|
||||||
- option: nullable
|
- option: nullable
|
||||||
value: true
|
value: true
|
||||||
- name: eventName
|
- name: data
|
||||||
pgType: varchar
|
pgType: varchar
|
||||||
tsType: string
|
tsType: string
|
||||||
columnType: Column
|
columnType: Column
|
||||||
columnOptions:
|
|
||||||
- option: length
|
|
||||||
value: 256
|
|
||||||
- name: eventInfo
|
- name: eventInfo
|
||||||
pgType: text
|
pgType: text
|
||||||
tsType: string
|
tsType: string
|
||||||
|
@ -670,7 +670,7 @@ export class Indexer {
|
|||||||
let eventName = UNKNOWN_EVENT_NAME;
|
let eventName = UNKNOWN_EVENT_NAME;
|
||||||
let eventInfo = {};
|
let eventInfo = {};
|
||||||
const tx = transactionMap[txHash];
|
const tx = transactionMap[txHash];
|
||||||
const extraInfo: { [key: string]: any } = { topics, data, tx, logIndex };
|
const extraInfo: { [key: string]: any } = { tx, logIndex };
|
||||||
|
|
||||||
const [topic0, topic1, topic2, topic3] = topics as string[];
|
const [topic0, topic1, topic2, topic3] = topics as string[];
|
||||||
|
|
||||||
@ -695,11 +695,12 @@ export class Indexer {
|
|||||||
index: this._upstreamConfig.ethServer.isFEVM ? li : logIndex,
|
index: this._upstreamConfig.ethServer.isFEVM ? li : logIndex,
|
||||||
txHash,
|
txHash,
|
||||||
contract,
|
contract,
|
||||||
|
eventName,
|
||||||
topic0,
|
topic0,
|
||||||
topic1,
|
topic1,
|
||||||
topic2,
|
topic2,
|
||||||
topic3,
|
topic3,
|
||||||
eventName,
|
data,
|
||||||
eventInfo: JSONbigNative.stringify(eventInfo),
|
eventInfo: JSONbigNative.stringify(eventInfo),
|
||||||
extraInfo: JSONbigNative.stringify(extraInfo),
|
extraInfo: JSONbigNative.stringify(extraInfo),
|
||||||
proof: JSONbigNative.stringify({
|
proof: JSONbigNative.stringify({
|
||||||
|
@ -61,11 +61,12 @@ export interface EventInterface {
|
|||||||
txHash: string;
|
txHash: string;
|
||||||
index: number;
|
index: number;
|
||||||
contract: string;
|
contract: string;
|
||||||
|
eventName: string;
|
||||||
topic0: string;
|
topic0: string;
|
||||||
topic1: string | null;
|
topic1: string | null;
|
||||||
topic2: string | null;
|
topic2: string | null;
|
||||||
topic3: string | null;
|
topic3: string | null;
|
||||||
eventName: string;
|
data: string;
|
||||||
eventInfo: string;
|
eventInfo: string;
|
||||||
extraInfo: string;
|
extraInfo: string;
|
||||||
proof: string;
|
proof: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user