github.com/shyftnetwork/go-empyrean@v1.8.3-0.20191127201940-fbfca9338f04/shyft-config/shyft-cli/postgres_setup/create_tables.psql (about)

     1  CREATE TABLE IF NOT EXISTS blocks (
     2    hash text primary key,
     3    coinbase text,
     4    gasUsed numeric,
     5    gasLimit numeric,
     6    txCount numeric,
     7    uncleCount numeric,
     8    age timestamp,
     9    parentHash text,
    10    uncleHash text,
    11    difficulty bigint,
    12    size text,
    13    nonce numeric,
    14    rewards numeric,
    15    number bigint
    16  );
    17  
    18  CREATE TABLE IF NOT EXISTS txs (
    19    txHash text primary key unique,
    20    to_addr text,
    21    from_addr text,
    22    blockhash text references blocks(hash),
    23    blocknumber text,
    24    amount numeric,
    25    gasprice numeric,
    26    gas numeric,
    27    gasLimit numeric,
    28    txFee numeric,
    29    nonce numeric,
    30    txStatus text,
    31    isContract bool,
    32    age timestamp,
    33    data bytea
    34  );
    35  
    36  CREATE TABLE IF NOT EXISTS accounts (
    37    addr text primary key unique,
    38    balance numeric,
    39    accountNonce numeric
    40  );
    41  
    42  CREATE TABLE IF NOT EXISTS contracts (
    43    txHash text
    44  );
    45  
    46  CREATE TABLE IF NOT EXISTS internalTxs (
    47    id SERIAL PRIMARY KEY,
    48    txHash text references txs(txHash),
    49    action text,
    50    to_addr text,
    51    from_addr text,
    52    amount text,
    53    gas numeric,
    54    gasUsed numeric,
    55    time text,
    56    input text,
    57    output text
    58  );