Update as agreed. Fix Hanko confusion. Remove some extraneous stuff.

This commit is contained in:
JoelKatz
2011-11-09 16:17:53 -08:00
parent 8e2c103c67
commit eca7512d96

View File

@@ -1,13 +1,14 @@
CREATE TABLE Transactions ( -- trans in all state CREATE TABLE Transactions ( -- trans in all state
Hanko BLOB PRIMARY KEY, TransactionID BLOB PRIMARY KEY,
NodeHash BLOB, NodeHash BLOB,
Source BLOB, FromName BLOB, -- 20 byte hash of pub key
FromSeq BIGINT UNSIGNED, FromPubKey BLOB,
Dest BLOB, FromSeq BIGINT UNSIGNED, -- account seq
DestName BLOB, -- 20 byte hash of pub key
Ident BIGINT, Ident BIGINT,
SourceLedger BIGINT UNSIGNED, SourceLedger BIGINT UNSIGNED, -- ledger source expected
Signature BLOB, Signature BLOB,
LedgerCommited BIGINT UNSIGNED, -- 0 if none LedgerCommited BIGINT UNSIGNED, -- 0 if none
Status VARCHAR(12) NOT NULL Status VARCHAR(12) NOT NULL
@@ -24,36 +25,35 @@ CREATE TABLE PubKeys ( -- holds pub keys for nodes and accounts
CREATE TABLE AccountStatus ( -- holds balances and sequence numbers CREATE TABLE AccountStatus ( -- holds balances and sequence numbers
Row INTEGER PRIMARY KEY, AccountName BLOB, -- 20 byte hash
Hanko BLOB,
Balance BIGINT UNSIGNED, Balance BIGINT UNSIGNED,
Sequence BIGINT UNSIGNED, Seq BIGINT UNSIGNED,
FirstLedger BIGINT UNSIGNED, FirstLedger BIGINT UNSIGNED,
LastLedger BIGINT UNSIGNED -- 2^60 if still valid LastLedger BIGINT UNSIGNED -- 2^60 if still valid
); );
CREATE TABLE Ledgers ( -- closed ledgers CREATE TABLE Ledgers ( -- closed ledgers
Hash BLOB PRIMARY KEY, LedgerHash BLOB PRIMARY KEY,
LedgerSeq BIGINT UNSIGNED, LedgerSeq BIGINT UNSIGNED,
FeeHeld BIGINT UNSIGNED,
PrevHash BLOB, PrevHash BLOB,
AccountHash BLOB, FeeHeld BIGINT UNSIGNED,
TrasactionHash BLOB, AccountSetHash BLOB,
FullyStored VARCHAR(1), TransSetHash BLOB,
FullyStored VARCHAR(1), -- all data in our db
Status VARCHAR(1) Status VARCHAR(1)
); );
CREATE TABLE LedgerHashNodes ( CREATE TABLE AccountSetHashNodes (
NodeID BLOB, NodeID BLOB,
LedgerSeq BIGINT UNSIGNED, LedgerSeq BIGINT UNSIGNED,
Hashes BLOB Hashes BLOB -- 32 hashes, each 20 bytes
); );
CREATE TABLE TransactionHashNodes ( CREATE TABLE TransactionSetHashNodes (
NodeID BLOB, NodeID BLOB,
LedgerSeq BIGINT UNSIGNED, LedgerSeq BIGINT UNSIGNED,
Hashes BLOB Hashes BLOB -- 32 hashes, each 20 bytes
); );
@@ -66,15 +66,14 @@ CREATE TABLE LedgerConfirmations (
CREATE TABLE TrustedNodes ( CREATE TABLE TrustedNodes (
Hanko BLOB PRIMARY KEY, Hanko BLOB PRIMARY KEY,
Trust SMALLINT. TrustLevel SMALLINT,
Comment TEXT Comment TEXT
); );
CREATE TABLE KnownNodes ( CREATE TABLE KnownNodes (
Hanko BLOB PRIMARY KEY, Hanko BLOB PRIMARY KEY,
LastSeen TEXT, -- YYYY-MM-DD HH:MM:SS.SSS LastSeen TEXT, -- YYYY-MM-DD HH:MM:SS.SSS
LastSigned TEXT, LastIP BLOB, -- IPv4 or IPv6
LastIP BLOB,
LastPort BIGINT UNSIGNED, LastPort BIGINT UNSIGNED,
ContactObject BLOB ContactObject BLOB
); );
@@ -86,10 +85,10 @@ CREATE TABLE ByHash ( -- used to synch nodes
Object BLOB Object BLOB
); );
CREATE TABLE LocalAccounts ( CREATE TABLE LocalAccounts ( -- wallet
Hash BLOB PRIMARY KEY, Hash BLOB PRIMARY KEY,
CurrentBalance BIGINT UNSIGNED, CurrentBalance BIGINT UNSIGNED,
KeyFormat TEXT, KeyFormat TEXT, -- can be encrypted
PrivateKey BLOB PrivateKey BLOB
Comment TEXT
); );