Skip to content

Commit

Permalink
Merge pull request #65 from moonstream-to/add-b3
Browse files Browse the repository at this point in the history
Add chains and deploys.
  • Loading branch information
Andrei-Dolgolev authored Sep 13, 2024
2 parents 89207a4 + 6b76b68 commit 5e98930
Show file tree
Hide file tree
Showing 17 changed files with 3,801 additions and 3 deletions.
845 changes: 845 additions & 0 deletions blockchain/b3/b3.go

Large diffs are not rendered by default.

912 changes: 912 additions & 0 deletions blockchain/b3/b3_index_types.pb.go

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions blockchain/b3/b3_index_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
syntax = "proto3";

option go_package = "github.com/moonstream-to/seer/blockchain/b3";


message B3TransactionAccessList {
string address = 1;
repeated string storage_keys = 2;
}

// Represents a single transaction within a block
message B3Transaction {
string hash = 1;
uint64 block_number = 2;
string from_address = 3;
string to_address = 4;
string gas = 5; // using string to handle big numeric values
string gas_price = 6;
string max_fee_per_gas = 7;
string max_priority_fee_per_gas = 8;
string input = 9; // could be a long text
string nonce = 10;
uint64 transaction_index = 11;
uint64 transaction_type = 12;
string value = 13; // using string to handle big numeric values
uint64 indexed_at = 14; // using uint64 to represent timestamp
uint64 block_timestamp = 15; // using uint64 to represent timestam
string block_hash = 16; // Added field for block hash
string chain_id = 17; // Used as a field to match potential EIP-1559 transaction types
string v = 18; // Used as a field to match potential EIP-1559 transaction types
string r = 19; // Used as a field to match potential EIP-1559 transaction types
string s = 20; // Used as a field to match potential EIP-1559 transaction types
repeated B3TransactionAccessList access_list = 21;
string y_parity = 22; // Used as a field to match potential EIP-1559 transaction types
repeated B3EventLog logs = 23;
}

// Represents a single blockchain block
message B3Block {
uint64 block_number = 1;
uint64 difficulty = 2;
string extra_data = 3;
uint64 gas_limit = 4;
uint64 gas_used = 5;
string base_fee_per_gas = 6; // using string to handle big numeric values
string hash = 7;
string logs_bloom = 8;
string miner = 9;
string nonce = 10;
string parent_hash = 11;
string receipts_root = 12;
string sha3_uncles = 13;
uint64 size = 14;
string state_root = 15;
uint64 timestamp = 16;
string total_difficulty = 17;
string transactions_root = 18;
uint64 indexed_at = 19; // using uint64 to represent timestamp
repeated B3Transaction transactions = 20;
}

message B3EventLog {
string address = 1; // The address of the contract that generated the log
repeated string topics = 2; // Topics are indexed parameters during log generation
string data = 3; // The data field from the log
uint64 block_number = 4; // The block number where this log was in
string transaction_hash = 5; // The hash of the transaction that generated this log
string block_hash = 6; // The hash of the block where this log was in
bool removed = 7; // True if the log was reverted due to a chain reorganization
uint64 log_index = 8; // The index of the log in the block
uint64 transaction_index = 9; // The index of the transaction in the block
}

message B3BlocksBatch {
repeated B3Block blocks = 1;

string seer_version = 2;
}
Loading

0 comments on commit 5e98930

Please sign in to comment.