Skip to content

Commit

Permalink
refactor/add events
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroShkvorets committed Apr 9, 2024
1 parent 2086dbd commit dc2542c
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 76 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "antelope_tokens"
version = "0.3.8"
version = "0.4.0"
authors = [
"Denis <[email protected]>",
"Yaro <[email protected]>",
Expand Down
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,84 +16,84 @@ $ make gui

```mermaid
graph TD;
map_transfers[map: map_transfers];
sf.antelope.type.v1.Block[source: sf.antelope.type.v1.Block] --> map_transfers;
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_transfers --> graph_out;
map_events --> graph_out;
ch_out[map: ch_out];
map_accounts --> ch_out;
map_stat --> ch_out;
map_transfers --> ch_out;
map_events --> ch_out;
```

### Modules

```yaml
Package name: antelope_tokens
Version: v0.3.8
Version: v0.4.0
Doc: Antelope `eosio.token` based action traces & database operations.
Modules:
----
Name: map_transfers
----
Name: map_events
Initial block: 0
Kind: map
Input: source: sf.antelope.type.v1.Block
Output Type: proto:antelope.eosio.token.v1.TransferEvents
Hash: 68580bd87f70567d5a794b7ed2c42829563c17a6
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: dc10dd69bc5bc0ae08a87724995a97e728158dbd
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: 8124e7464c489fe27ee13e4f1ed80abb4c8b6763
Hash: c3ba86b0f3f4fdb79e7e51d82fc114df45abc4f9

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

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

Sink config:
----
----
type: sf.substreams.sink.sql.v1.Service
configs:
- schema: (6376 bytes) MD5SUM: 6c54c43f4c19f465e51cf36c415bc9f6 [LOADED_FILE]
- dbt_config:
- files: (empty) [ZIPPED_FOLDER]
- run_interval_seconds: 0
- enabled: false
- wire_protocol_access: false
- hasura_frontend:
- enabled: false
- postgraphile_frontend:
- enabled: false
- pgweb_frontend:
- enabled: false
- engine: 2
- schema: (6814 bytes) MD5SUM: adf98a1becc37604e5f14ce2ed6a1629 [LOADED_FILE]
- dbt_config:
- files: (empty) [ZIPPED_FOLDER]
- run_interval_seconds: 0
- enabled: false
- wire_protocol_access: false
- hasura_frontend:
- enabled: false
- postgraphile_frontend:
- enabled: false
- pgweb_frontend:
- enabled: false
- engine: 2
```
86 changes: 80 additions & 6 deletions proto/v1/eosio.token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package antelope.eosio.token.v1;
import "google/protobuf/timestamp.proto";

message Accounts {
repeated Account items = 1;
repeated Account changes = 1;
}

message Account {
Expand Down Expand Up @@ -33,7 +33,7 @@ message Account {
}

message Stats {
repeated Stat items = 1;
repeated Stat changes = 1;
}

message Stat {
Expand Down Expand Up @@ -61,18 +61,20 @@ message Stat {
google.protobuf.Timestamp timestamp = 14;
}

message TransferEvents {
repeated TransferEvent items = 1;
message Events {
repeated Transfer transfers = 1;
repeated Issue issues = 2;
repeated Retire retires = 3;
repeated Create creates = 4;
}

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

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

// data payload
Expand All @@ -90,3 +92,75 @@ message TransferEvent {
uint64 block_num = 13;
google.protobuf.Timestamp timestamp = 14;
}

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

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

// data payload
string issuer = 5;
string to = 6;
string quantity = 7;
string memo = 8;

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

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

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

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

// data payload
string from = 6;
string quantity = 7;
string memo = 8;

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

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

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

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

// data payload
string issuer = 6;
string maximum_supply = 7;

// extras
uint32 precision = 8;
int64 amount = 9;
double value = 10;

// block information
uint64 block_num = 11;
google.protobuf.Timestamp timestamp = 12;
}
Loading

0 comments on commit dc2542c

Please sign in to comment.