fix CI
This commit is contained in:
parent
844d1719db
commit
f749c8abc4
@ -9,9 +9,9 @@ services:
|
|||||||
POSTGRES_DB: "vulcanize_testing_v2"
|
POSTGRES_DB: "vulcanize_testing_v2"
|
||||||
POSTGRES_PASSWORD: "password"
|
POSTGRES_PASSWORD: "password"
|
||||||
volumes:
|
volumes:
|
||||||
- geth_node:/var/lib/postgresql/data
|
- v2_data:/var/lib/postgresql/data
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:5432:5432"
|
- "127.0.0.1:5433:5432"
|
||||||
|
|
||||||
ipld-eth-db-v3:
|
ipld-eth-db-v3:
|
||||||
restart: always
|
restart: always
|
||||||
@ -21,9 +21,10 @@ services:
|
|||||||
POSTGRES_DB: "vulcanize_testing_v3"
|
POSTGRES_DB: "vulcanize_testing_v3"
|
||||||
POSTGRES_PASSWORD: "password"
|
POSTGRES_PASSWORD: "password"
|
||||||
volumes:
|
volumes:
|
||||||
- geth_node:/var/lib/postgresql/data
|
- v3_data:/var/lib/postgresql/data
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:5433:5432"
|
- "127.0.0.1:5432:5432"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
geth_node:
|
v2_data:
|
||||||
|
v3_data:
|
||||||
|
@ -57,7 +57,7 @@ var DefaultConfig = Config{
|
|||||||
// DefaultV2Config are default parameters for connecting to a v3 Postgres DB
|
// DefaultV2Config are default parameters for connecting to a v3 Postgres DB
|
||||||
var DefaultV2Config = Config{
|
var DefaultV2Config = Config{
|
||||||
Hostname: "localhost",
|
Hostname: "localhost",
|
||||||
Port: 5432,
|
Port: 5433,
|
||||||
DatabaseName: "vulcanize_testing_v2",
|
DatabaseName: "vulcanize_testing_v2",
|
||||||
Username: "vdbm",
|
Username: "vdbm",
|
||||||
Password: "password",
|
Password: "password",
|
||||||
@ -66,7 +66,7 @@ var DefaultV2Config = Config{
|
|||||||
// DefaultV3Config are default parameters for connecting to a v3 Postgres DB
|
// DefaultV3Config are default parameters for connecting to a v3 Postgres DB
|
||||||
var DefaultV3Config = Config{
|
var DefaultV3Config = Config{
|
||||||
Hostname: "localhost",
|
Hostname: "localhost",
|
||||||
Port: 5433,
|
Port: 5432,
|
||||||
DatabaseName: "vulcanize_testing_v3",
|
DatabaseName: "vulcanize_testing_v3",
|
||||||
Username: "vdbm",
|
Username: "vdbm",
|
||||||
Password: "password",
|
Password: "password",
|
||||||
|
@ -78,7 +78,7 @@ func (w *Writer) InsertHeaderCID(tx interfaces.Tx, header *models.HeaderModel) (
|
|||||||
header.Reward, header.StateRoot, header.TxRoot, header.RctRoot, header.UncleRoot, header.Bloom,
|
header.Reward, header.StateRoot, header.TxRoot, header.RctRoot, header.UncleRoot, header.Bloom,
|
||||||
header.Timestamp, header.MhKey, 1, header.BaseFee).Scan(&headerID)
|
header.Timestamp, header.MhKey, 1, header.BaseFee).Scan(&headerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("error inserting header_cids entry: %v", err)
|
return 0, fmt.Errorf("v2 error inserting header_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
writerV2Metrics.Blocks.Inc(1)
|
writerV2Metrics.Blocks.Inc(1)
|
||||||
return headerID, nil
|
return headerID, nil
|
||||||
@ -93,7 +93,7 @@ func (w *Writer) InsertUncleCID(tx interfaces.Tx, uncle *models.UncleModel) erro
|
|||||||
_, err := tx.Exec(w.DB.Context(), w.DB.InsertUncleStm(),
|
_, err := tx.Exec(w.DB.Context(), w.DB.InsertUncleStm(),
|
||||||
uncle.BlockHash, uncle.HeaderID, uncle.ParentHash, uncle.CID, uncle.Reward, uncle.MhKey)
|
uncle.BlockHash, uncle.HeaderID, uncle.ParentHash, uncle.CID, uncle.Reward, uncle.MhKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting uncle_cids entry: %v", err)
|
return fmt.Errorf("v2 error inserting uncle_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -107,9 +107,9 @@ func (w *Writer) InsertTransactionCID(tx interfaces.Tx, transaction *models.TxMo
|
|||||||
var txID int64
|
var txID int64
|
||||||
err := tx.QueryRow(w.DB.Context(), w.DB.InsertTxStm(),
|
err := tx.QueryRow(w.DB.Context(), w.DB.InsertTxStm(),
|
||||||
transaction.HeaderID, transaction.TxHash, transaction.CID, transaction.Dst, transaction.Src, transaction.Index,
|
transaction.HeaderID, transaction.TxHash, transaction.CID, transaction.Dst, transaction.Src, transaction.Index,
|
||||||
transaction.MhKey, transaction.Data, transaction.Type).Scan(&txID)
|
transaction.MhKey, transaction.Data, []byte{transaction.Type}).Scan(&txID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("error inserting transaction_cids entry: %v", err)
|
return 0, fmt.Errorf("v2 error inserting transaction_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
writerV2Metrics.Transactions.Inc(1)
|
writerV2Metrics.Transactions.Inc(1)
|
||||||
return txID, nil
|
return txID, nil
|
||||||
@ -124,7 +124,7 @@ func (w *Writer) InsertAccessListElement(tx interfaces.Tx, accessListElement *mo
|
|||||||
_, err := tx.Exec(w.DB.Context(), w.DB.InsertAccessListElementStm(),
|
_, err := tx.Exec(w.DB.Context(), w.DB.InsertAccessListElementStm(),
|
||||||
accessListElement.TxID, accessListElement.Index, accessListElement.Address, accessListElement.StorageKeys)
|
accessListElement.TxID, accessListElement.Index, accessListElement.Address, accessListElement.StorageKeys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting access_list_element entry: %v", err)
|
return fmt.Errorf("v2 error inserting access_list_element entry: %v", err)
|
||||||
}
|
}
|
||||||
writerV2Metrics.AccessListEntries.Inc(1)
|
writerV2Metrics.AccessListEntries.Inc(1)
|
||||||
return nil
|
return nil
|
||||||
@ -140,7 +140,7 @@ func (w *Writer) InsertReceiptCID(tx interfaces.Tx, rct *models.ReceiptModel) (i
|
|||||||
err := tx.QueryRow(w.DB.Context(), w.DB.InsertRctStm(),
|
err := tx.QueryRow(w.DB.Context(), w.DB.InsertRctStm(),
|
||||||
rct.TxID, rct.LeafCID, rct.Contract, rct.ContractHash, rct.LeafMhKey, rct.PostState, rct.PostStatus, rct.LogRoot).Scan(&receiptID)
|
rct.TxID, rct.LeafCID, rct.Contract, rct.ContractHash, rct.LeafMhKey, rct.PostState, rct.PostStatus, rct.LogRoot).Scan(&receiptID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("error inserting receipt_cids entry: %w", err)
|
return 0, fmt.Errorf("v2 error inserting receipt_cids entry: %w", err)
|
||||||
}
|
}
|
||||||
writerV2Metrics.Receipts.Inc(1)
|
writerV2Metrics.Receipts.Inc(1)
|
||||||
return receiptID, nil
|
return receiptID, nil
|
||||||
@ -157,7 +157,7 @@ func (w *Writer) InsertLogCID(tx interfaces.Tx, logs []*models.LogsModel) error
|
|||||||
log.LeafCID, log.LeafMhKey, log.ReceiptID, log.Address, log.Index, log.Topic0, log.Topic1, log.Topic2,
|
log.LeafCID, log.LeafMhKey, log.ReceiptID, log.Address, log.Index, log.Topic0, log.Topic1, log.Topic2,
|
||||||
log.Topic3, log.Data)
|
log.Topic3, log.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting logs entry: %w", err)
|
return fmt.Errorf("v2 error inserting logs entry: %w", err)
|
||||||
}
|
}
|
||||||
writerV2Metrics.Logs.Inc(1)
|
writerV2Metrics.Logs.Inc(1)
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ func (w *Writer) InsertStateCID(tx interfaces.Tx, stateNode *models.StateNodeMod
|
|||||||
err := tx.QueryRow(w.DB.Context(), w.DB.InsertStateStm(),
|
err := tx.QueryRow(w.DB.Context(), w.DB.InsertStateStm(),
|
||||||
stateNode.HeaderID, stateKey, stateNode.CID, stateNode.Path, stateNode.NodeType, true, stateNode.MhKey).Scan(&stateID)
|
stateNode.HeaderID, stateKey, stateNode.CID, stateNode.Path, stateNode.NodeType, true, stateNode.MhKey).Scan(&stateID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("error inserting state_cids entry: %v", err)
|
return 0, fmt.Errorf("v2 error inserting state_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
return stateID, nil
|
return stateID, nil
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ func (w *Writer) InsertStateAccount(tx interfaces.Tx, stateAccount *models.State
|
|||||||
stateAccount.StateID, stateAccount.Balance, stateAccount.Nonce, stateAccount.CodeHash,
|
stateAccount.StateID, stateAccount.Balance, stateAccount.Nonce, stateAccount.CodeHash,
|
||||||
stateAccount.StorageRoot)
|
stateAccount.StorageRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting state_accounts entry: %v", err)
|
return fmt.Errorf("v2 error inserting state_accounts entry: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -212,7 +212,7 @@ func (w *Writer) InsertStorageCID(tx interfaces.Tx, storageCID *models.StorageNo
|
|||||||
storageCID.StateID, storageKey, storageCID.CID, storageCID.Path, storageCID.NodeType,
|
storageCID.StateID, storageKey, storageCID.CID, storageCID.Path, storageCID.NodeType,
|
||||||
true, storageCID.MhKey)
|
true, storageCID.MhKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting storage_cids entry: %v", err)
|
return fmt.Errorf("v2 error inserting storage_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ func (w *Writer) InsertTransactionCID(tx interfaces.Tx, transaction *models.TxMo
|
|||||||
transaction.HeaderID, transaction.TxHash, transaction.CID, transaction.Dst, transaction.Src, transaction.Index,
|
transaction.HeaderID, transaction.TxHash, transaction.CID, transaction.Dst, transaction.Src, transaction.Index,
|
||||||
transaction.MhKey, transaction.Data, transaction.Type, transaction.Value)
|
transaction.MhKey, transaction.Data, transaction.Type, transaction.Value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting transaction_cids entry: %v", err)
|
return fmt.Errorf("v3 error inserting transaction_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
writerV3Metrics.Transactions.Inc(1)
|
writerV3Metrics.Transactions.Inc(1)
|
||||||
return nil
|
return nil
|
||||||
@ -121,7 +121,7 @@ func (w *Writer) InsertAccessListElement(tx interfaces.Tx, accessListElement *mo
|
|||||||
_, err := tx.Exec(w.DB.Context(), w.DB.InsertAccessListElementStm(),
|
_, err := tx.Exec(w.DB.Context(), w.DB.InsertAccessListElementStm(),
|
||||||
accessListElement.TxID, accessListElement.Index, accessListElement.Address, accessListElement.StorageKeys)
|
accessListElement.TxID, accessListElement.Index, accessListElement.Address, accessListElement.StorageKeys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting access_list_element entry: %v", err)
|
return fmt.Errorf("v3 error inserting access_list_element entry: %v", err)
|
||||||
}
|
}
|
||||||
writerV3Metrics.AccessListEntries.Inc(1)
|
writerV3Metrics.AccessListEntries.Inc(1)
|
||||||
return nil
|
return nil
|
||||||
@ -136,7 +136,7 @@ func (w *Writer) InsertReceiptCID(tx interfaces.Tx, rct *models.ReceiptModel) er
|
|||||||
_, err := tx.Exec(w.DB.Context(), w.DB.InsertRctStm(),
|
_, err := tx.Exec(w.DB.Context(), w.DB.InsertRctStm(),
|
||||||
rct.TxID, rct.LeafCID, rct.Contract, rct.ContractHash, rct.LeafMhKey, rct.PostState, rct.PostStatus, rct.LogRoot)
|
rct.TxID, rct.LeafCID, rct.Contract, rct.ContractHash, rct.LeafMhKey, rct.PostState, rct.PostStatus, rct.LogRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting receipt_cids entry: %w", err)
|
return fmt.Errorf("v3 error inserting receipt_cids entry: %w", err)
|
||||||
}
|
}
|
||||||
writerV3Metrics.Receipts.Inc(1)
|
writerV3Metrics.Receipts.Inc(1)
|
||||||
return nil
|
return nil
|
||||||
@ -153,7 +153,7 @@ func (w *Writer) InsertLogCID(tx interfaces.Tx, logs []*models.LogsModel) error
|
|||||||
log.LeafCID, log.LeafMhKey, log.ReceiptID, log.Address, log.Index, log.Topic0, log.Topic1, log.Topic2,
|
log.LeafCID, log.LeafMhKey, log.ReceiptID, log.Address, log.Index, log.Topic0, log.Topic1, log.Topic2,
|
||||||
log.Topic3, log.Data)
|
log.Topic3, log.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting logs entry: %w", err)
|
return fmt.Errorf("v3 error inserting logs entry: %w", err)
|
||||||
}
|
}
|
||||||
writerV3Metrics.Logs.Inc(1)
|
writerV3Metrics.Logs.Inc(1)
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ func (w *Writer) InsertStateCID(tx interfaces.Tx, stateNode *models.StateNodeMod
|
|||||||
_, err := tx.Exec(w.DB.Context(), w.DB.InsertStateStm(),
|
_, err := tx.Exec(w.DB.Context(), w.DB.InsertStateStm(),
|
||||||
stateNode.HeaderID, stateKey, stateNode.CID, stateNode.Path, stateNode.NodeType, true, stateNode.MhKey)
|
stateNode.HeaderID, stateKey, stateNode.CID, stateNode.Path, stateNode.NodeType, true, stateNode.MhKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting state_cids entry: %v", err)
|
return fmt.Errorf("v3 error inserting state_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ func (w *Writer) InsertStateAccount(tx interfaces.Tx, stateAccount *models.State
|
|||||||
stateAccount.HeaderID, stateAccount.StatePath, stateAccount.Balance, stateAccount.Nonce, stateAccount.CodeHash,
|
stateAccount.HeaderID, stateAccount.StatePath, stateAccount.Balance, stateAccount.Nonce, stateAccount.CodeHash,
|
||||||
stateAccount.StorageRoot)
|
stateAccount.StorageRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting state_accounts entry: %v", err)
|
return fmt.Errorf("v3 error inserting state_accounts entry: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ func (w *Writer) InsertStorageCID(tx interfaces.Tx, storageCID *models.StorageNo
|
|||||||
storageCID.HeaderID, storageCID.StatePath, storageKey, storageCID.CID, storageCID.Path, storageCID.NodeType,
|
storageCID.HeaderID, storageCID.StatePath, storageKey, storageCID.CID, storageCID.Path, storageCID.NodeType,
|
||||||
true, storageCID.MhKey)
|
true, storageCID.MhKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error inserting storage_cids entry: %v", err)
|
return fmt.Errorf("v3 error inserting storage_cids entry: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user