Data Structure - zoobc/zoobc-core GitHub Wiki
Data Structure
This page contains the Protobuf and SQLite database structure used in the source code.
The format of the table for each data structure is [database-structure | protobuf/application structure]
No |
Key |
Value |
1 |
table name |
{chaintype}_block |
2 |
model name |
Block |
No |
Field |
Type |
Field |
Type |
1 |
id (pk) |
INTEGER |
ID |
int64 |
2 |
block_hash |
BLOB |
BlockHash |
[]byte |
3 |
previous_block_hash |
BLOB |
PreviousBlockHash |
[]byte |
4 |
height |
INTEGER |
Height |
uint32 |
5 |
timestamp |
INTEGER |
Timestamp |
int64 |
6 |
block_seed |
BLOB |
BlockSeed |
[]byte |
7 |
block_signature |
BLOB |
BlockSignature |
[]byte |
8 |
cumulative_difficulty |
VARCHAR |
CumulativeDifficulty |
string |
9 |
smith_scale |
INTEGER |
SmithScale |
int64 |
10 |
blocksmith_address |
VARCHAR(255) |
BlocksmithAddress |
string |
11 |
total_amount |
INTEGER |
TotalAmount |
int64 |
12 |
total_fee |
INTEGER |
TotalFee |
int64 |
13 |
total_coinbase |
INTEGER |
TotalCoinbase |
int64 |
14 |
version |
INTEGER |
Version |
uint32 |
15 |
- |
- |
Transactions |
[]Transaction |
16 |
payload_length |
INTEGER |
PayloadLength |
uint32 |
17 |
payload_hash |
BLOB |
PayloadHash |
[]byte |
No |
Key |
Value |
1 |
table name |
transaction |
2 |
model name |
Transaction |
No |
Field |
Type |
Field |
Type |
1 |
version |
INTEGER |
Version |
uint32 |
2 |
id (pk) |
INTEGER |
ID |
int64 |
3 |
block_id |
INTEGER |
BlockID |
int64 |
4 |
block_height |
INTEGER |
Height |
uint32 |
5 |
sender_account_address |
BLOB |
SenderAccount |
[]byte |
6 |
recipient_account_address |
BLOB |
RecipientAccount |
[]byte |
7 |
transaction_type |
INTEGER |
TransactionType |
uint32 |
8 |
fee |
INTEGER |
Fee |
int64 |
9 |
timestamp |
INTEGER |
Timestamp |
int64 |
10 |
transaction_hash |
BLOB |
TransactionHash |
[]byte |
11 |
transaction_body_length |
INTEGER |
TransactionBodyLength |
uint32 |
12 |
transaction_body_bytes |
BLOB |
TransactionBodyBytes |
[]byte |
13 |
signature |
BLOB |
Signature |
[]byte |
14 |
- |
- |
TransactionBody |
TransactionBody |
15 |
transaction_index |
INTEGER |
TransactionIndex |
uint32 |
16 |
- |
- |
Escrow |
Escrow |
No |
Key |
Value |
1 |
table name |
mempool |
2 |
model name |
MempoolTransaction |
No |
Field |
Type |
Field |
Type |
1 |
id (pk) |
INTEGER |
ID |
int64 |
2 |
fee_per_byte |
INTEGER |
FeePerByte |
int32 |
3 |
arrival_timestamp |
INTEGER |
ArrivalTimestamp |
int64 |
4 |
transaction_bytes |
INTEGER |
TransactionBytes |
[]byte |
5 |
sender_account_address |
BLOB |
SenderAccount |
[]byte |
6 |
recipient_account_address |
BLOB |
RecipientAccount |
[]byte |
No |
Key |
Value |
1 |
table name |
account_balance |
2 |
model name |
AccountBalance |
No |
Field |
Type |
Field |
Type |
1 |
id (pk) |
BLOB |
ID |
[]byte |
2 |
account_address |
BLOB |
AccountAddress |
[]byte |
3 |
block_height |
INTEGER |
BlockHeight |
uint32 |
4 |
spendable_balance |
INTEGER |
SpendableBalance |
int64 |
5 |
balance |
INTEGER |
Balance |
int64 |
6 |
pop_revenue |
INTEGER |
PopRevenue |
int64 |
7 |
latest |
INTEGER |
Latest |
bool |
No |
Key |
Value |
1 |
table name |
node_registry |
2 |
model name |
NodeRegistration |
No |
Field |
Type |
Field |
Type |
1 |
id (pk) |
INTEGER |
NodeID |
int64 |
2 |
node_public_key |
BLOB |
NodePublicKey |
[]byte |
3 |
account_address |
BLOB |
AccountAddress |
[]byte |
4 |
registration_height |
INTEGER |
RegistrationHeight |
uint32 |
5 |
node_address |
varchar(255) |
NodeAddress |
string |
6 |
locked_balance |
INTEGER |
LockedBalance |
int64 |
7 |
ququed |
INTEGER |
Queued |
bool |
8 |
latest |
INTEGER |
Latest |
bool |
9 |
height |
INTEGER |
Height |
uint32 |
No |
Key |
Value |
1 |
table name |
participation_score |
2 |
model name |
ParticipationScore |
No |
Field |
Type |
Field |
Type |
1 |
node_id (pk) |
INTEGER |
NodeID |
int64 |
2 |
score |
INTEGER |
Score |
int64 |
3 |
latest |
INTEGER |
Latest |
bool |
4 |
height |
INTEGER |
Height |
uint32 |
No |
Key |
Value |
1 |
table name |
account_dataset |
2 |
model name |
AccountDataset |
No |
Field |
Type |
Field |
Type |
1 |
setter_account_address |
BLOB |
SetterAccountAddress |
[]byte |
2 |
recipient_account_address |
BLOB |
RecipientAccountAddress |
[]byte |
3 |
property |
TEXT |
Property |
string |
4 |
value |
TEXT |
Value |
string |
5 |
is_active |
INTEGER |
IsActive |
bool |
6 |
height |
INTEGER |
Height |
uint32 |
7 |
latest |
INTEGER |
Latest |
bool |
No |
Key |
Value |
1 |
table name |
escrow_transaction |
2 |
model name |
Escrow |
No |
Field |
Type |
Field |
Type |
1 |
id |
INTEGER |
ID |
int64 |
2 |
sender_address |
BLOB |
SenderAdress |
[]byte |
3 |
recipient_address |
BLOB |
RecipientAddress |
[]byte |
4 |
approver_address |
BLOB |
ApproverAddress |
[]byte |
5 |
amount |
INTEGER |
Amount |
int64 |
6 |
commission |
INTEGER |
Commission |
int64 |
7 |
timeout |
INTEGER |
Timeout |
uint64 |
8 |
status |
INTEGER |
Status |
EscrowStatus |
9 |
instruction |
VARCHAR(255) |
Instruction |
string |
-
Fee Vote Commitment Transaction
No |
Key |
Value |
1 |
table name |
fee_vote_commit_vote |
2 |
model name |
FeeVoteCommitmentVote |
No |
Field |
Type |
Field |
Type |
1 |
vote_hash |
BLOB |
VoteHash |
[]byte |
2 |
voter_address |
BLOB |
VoterAddress |
[]byte |
3 |
block_height(pk) |
INTEGER |
BlockHeight |
uint32 |
-
Fee Vote Reveal Transaction
No |
Key |
Value |
1 |
table name |
fee_vote_reveal_vote |
2 |
model name |
FeeVoteRevealVote |
No |
Field |
Type |
Field |
Type |
1 |
recent_block_hash |
BLOB |
FeeVoteInfo.RecentBlockHash |
[]byte |
2 |
recent_block_height |
VARCHAR(255) |
FeeVoteInfo.RecentBlockHeight |
uint32 |
3 |
fee_vote |
INTEGER |
FeeVoteInfo.FeeVote |
int64 |
4 |
voter_address |
BLOB |
VoterAddress |
[]byte |
5 |
voter_signature |
BLOB |
VoterSignature |
[]byte |
6 |
block_height(pk) |
INTEGER |
BlockHeight |
uint32 |