Skip to content

Commit

Permalink
move all events into map_events
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroShkvorets committed Apr 9, 2024
1 parent dc2542c commit 5ef48f2
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 338 deletions.
32 changes: 3 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,9 @@ $ make gui
graph TD;
map_events[map: map_events];
sf.antelope.type.v1.Block[source: sf.antelope.type.v1.Block] --> map_events;
map_accounts[map: map_accounts];
sf.antelope.type.v1.Block[source: sf.antelope.type.v1.Block] --> map_accounts;
map_stat[map: map_stat];
sf.antelope.type.v1.Block[source: sf.antelope.type.v1.Block] --> map_stat;
graph_out[map: graph_out];
map_accounts --> graph_out;
map_stat --> graph_out;
map_events --> graph_out;
ch_out[map: ch_out];
map_accounts --> ch_out;
map_stat --> ch_out;
map_events --> ch_out;
```

Expand All @@ -45,39 +37,21 @@ Initial block: 0
Kind: map
Input: source: sf.antelope.type.v1.Block
Output Type: proto:antelope.eosio.token.v1.Events
Hash: c85c7f8fad2a0d03984c00ee15d1ded54bfa700e

Name: map_accounts
Initial block: 0
Kind: map
Input: source: sf.antelope.type.v1.Block
Output Type: proto:antelope.eosio.token.v1.Accounts
Hash: e85688fa74de76ee66c793b77190025baa242b4a

Name: map_stat
Initial block: 0
Kind: map
Input: source: sf.antelope.type.v1.Block
Output Type: proto:antelope.eosio.token.v1.Stats
Hash: c3ba86b0f3f4fdb79e7e51d82fc114df45abc4f9
Hash: 8dd2fd12c9cb5ad0bb6f32f3b9defcce90090715

Name: graph_out
Initial block: 0
Kind: map
Input: map: map_accounts
Input: map: map_stat
Input: map: map_events
Output Type: proto:sf.substreams.sink.entity.v1.EntityChanges
Hash: 64faa1889da48de19fea8d3b68595f844bba32e9
Hash: b34452f9c92c173f7a9976534b622ad093dad242

Name: ch_out
Initial block: 0
Kind: map
Input: map: map_accounts
Input: map: map_stat
Input: map: map_events
Output Type: proto:sf.substreams.sink.database.v1.DatabaseChanges
Hash: f4573a7e43387bde4d3572bb649dc315e64f3913
Hash: 1515b91545f2d2812ac27fbe5f556dc117d57e20

Sink config:
----
Expand Down
110 changes: 52 additions & 58 deletions proto/v1/eosio.token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,13 @@ package antelope.eosio.token.v1;

import "google/protobuf/timestamp.proto";

message Accounts {
repeated Account changes = 1;
}

message Account {
// trace information
string trx_id = 1;
uint32 action_index = 2;

// contract & scope
string contract = 3;
string symcode = 4;

// data payload
string account = 5;
string balance = 6;
int64 balance_delta = 7;

// extras
uint32 precision = 10;
int64 amount = 11;
double value = 12;

// block information
uint64 block_num = 13;
google.protobuf.Timestamp timestamp = 14;
}

message Stats {
repeated Stat changes = 1;
}

message Stat {
// trace information
string trx_id = 1;
uint32 action_index = 2;

// contract & scope
string contract = 3;
string symcode = 4;

// data payload
string issuer = 5;
string max_supply = 6;
string supply = 7;
int64 supply_delta = 8;

// extras
uint32 precision = 10;
int64 amount = 11;
double value = 12;

// block information
uint64 block_num = 13;
google.protobuf.Timestamp timestamp = 14;
}

message Events {
repeated Transfer transfers = 1;
repeated Issue issues = 2;
repeated Retire retires = 3;
repeated Create creates = 4;
repeated BalanceChange balance_changes = 5;
repeated SupplyChange supply_changes = 6;
}

message Transfer {
Expand Down Expand Up @@ -163,4 +108,53 @@ message Create {
// block information
uint64 block_num = 11;
google.protobuf.Timestamp timestamp = 12;
}
}

message BalanceChange {
// trace information
string trx_id = 1;
uint32 action_index = 2;

// contract & scope
string contract = 3;
string symcode = 4;

// data payload
string account = 5;
string balance = 6;
int64 balance_delta = 7;

// extras
uint32 precision = 10;
int64 amount = 11;
double value = 12;

// block information
uint64 block_num = 13;
google.protobuf.Timestamp timestamp = 14;
}

message SupplyChange {
// trace information
string trx_id = 1;
uint32 action_index = 2;

// contract & scope
string contract = 3;
string symcode = 4;

// data payload
string issuer = 5;
string max_supply = 6;
string supply = 7;
int64 supply_delta = 8;

// extras
uint32 precision = 10;
int64 amount = 11;
double value = 12;

// block information
uint64 block_num = 13;
google.protobuf.Timestamp timestamp = 14;
}
Loading

0 comments on commit 5ef48f2

Please sign in to comment.