-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Impl postgres getter setter into evm exporter (#15)
* defined postgres tables * impl postgres setter and getter * make the image can be builed * make redis and postgres dependencies within into evm-exporter only * let the rocksdb-exporter using new evm-exporter getter and setter settings * let getter and setter using &self instead of &mut self * let web3-service can be compiled * let rocksdb-exporter can be compiled
- Loading branch information
Showing
35 changed files
with
1,563 additions
and
955 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE IF NOT EXISTS allowances ( | ||
id BIGSERIAL PRIMARY KEY, | ||
owner CHARACTER VARYING(64) NOT NULL, | ||
spender CHARACTER VARYING(64) NOT NULL, | ||
value CHARACTER VARYING(128) NOT NULL, | ||
height BIGSERIAL NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS allowances_owner_idx ON allowances(owner); | ||
CREATE INDEX IF NOT EXISTS allowances_spender_idx ON allowances(spender); | ||
CREATE INDEX IF NOT EXISTS allowances_height_idx ON allowances(height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE IF NOT EXISTS balance ( | ||
id BIGSERIAL PRIMARY KEY, | ||
balance CHARACTER VARYING(128) NOT NULL, | ||
address CHARACTER VARYING(64) NOT NULL, | ||
height BIGSERIAL NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS balance_address_idx ON balance(address); | ||
CREATE INDEX IF NOT EXISTS balance_height_idx ON balance(height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE IF NOT EXISTS block_info ( | ||
id BIGSERIAL PRIMARY KEY, | ||
block_hash CHARACTER VARYING(128) NOT NULL, | ||
block_height CHARACTER VARYING(128) NOT NULL, | ||
block JSONB NOT NULL, | ||
receipt JSONB NOT NULL, | ||
statuses JSONB NOT NULL, | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS block_info_block_hash_idx ON block_info(block_hash); | ||
CREATE INDEX IF NOT EXISTS block_info_block_height_idx ON block_info(block_height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE IF NOT EXISTS byte_code ( | ||
id BIGSERIAL PRIMARY KEY, | ||
code TEXT NOT NULL, | ||
address CHARACTER VARYING(64) NOT NULL, | ||
height BIGSERIAL NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS byte_code_address_idx ON byte_code(address); | ||
CREATE INDEX IF NOT EXISTS byte_code_height_idx ON byte_code(height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE IF NOT EXISTS common ( | ||
latest_height BIGSERIAL NOT NULL, | ||
lowest_height BIGSERIAL NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS common_latest_height_idx ON common(latest_height); | ||
CREATE INDEX IF NOT EXISTS common_lowest_height_idx ON common(lowest_height); | ||
|
||
INSERT INTO common(latest_height, lowest_height) VALUES (0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE IF NOT EXISTS issuance ( | ||
id BIGSERIAL PRIMARY KEY, | ||
value CHARACTER VARYING(128) NOT NULL, | ||
height BIGSERIAL NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS issuance_height_idx ON issuance(height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE IF NOT EXISTS nonce ( | ||
id BIGSERIAL PRIMARY KEY, | ||
nonce CHARACTER VARYING(128) NOT NULL, | ||
address CHARACTER VARYING(64) NOT NULL, | ||
height BIGSERIAL NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS nonce_address_idx ON nonce(address); | ||
CREATE INDEX IF NOT EXISTS nonce_height_idx ON nonce(height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE IF NOT EXISTS pending_byte_code ( | ||
id BIGSERIAL PRIMARY KEY, | ||
code JSONB NOT NULL, | ||
address CHARACTER VARYING(64) NOT NULL, | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS pending_byte_code_address_idx ON pending_byte_code(address); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE IF NOT EXISTS pending_state ( | ||
id BIGSERIAL PRIMARY KEY, | ||
value CHARACTER VARYING(128) NOT NULL, | ||
idx CHARACTER VARYING(128) NOT NULL, | ||
address CHARACTER VARYING(64) NOT NULL, | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS pending_state_address_idx ON pending_state(address); | ||
CREATE INDEX IF NOT EXISTS pending_state_idx_idx ON pending_state(idx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TABLE IF NOT EXISTS pending_transactions ( | ||
id BIGSERIAL PRIMARY KEY, | ||
sign_address CHARACTER VARYING(64) NOT NULL, | ||
pending_balance CHARACTER VARYING(128) NOT NULL, | ||
pending_nonce CHARACTER VARYING(128) NOT NULL, | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS pending_transactions_sign_address_idx ON pending_transactions(sign_address); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE IF NOT EXISTS state ( | ||
id BIGSERIAL PRIMARY KEY, | ||
value CHARACTER VARYING(128) NOT NULL, | ||
idx CHARACTER VARYING(128) NOT NULL, | ||
address CHARACTER VARYING(64) NOT NULL, | ||
height BIGSERIAL NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS state_address_idx ON state(address); | ||
CREATE INDEX IF NOT EXISTS state_height_idx ON state(height); | ||
CREATE INDEX IF NOT EXISTS state_idx_idx ON state(idx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE IF NOT EXISTS transactions ( | ||
id BIGSERIAL PRIMARY KEY, | ||
transaction_hash CHARACTER VARYING(128) NOT NULL, | ||
transaction_index JSONB NOT NULL, | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS transactions_transaction_hash_idx ON transactions(transaction_hash); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.