Adds logging for storage and RPC
This commit is contained in:
parent
0b9f29c300
commit
614ea3bba1
@ -121,7 +121,9 @@ func (storageWatcher StorageWatcher) processRow(diff utils.StorageDiff) {
|
|||||||
if queueErr != nil {
|
if queueErr != nil {
|
||||||
logrus.Warn(fmt.Sprintf("error queueing storage diff: %s", queueErr))
|
logrus.Warn(fmt.Sprintf("error queueing storage diff: %s", queueErr))
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
logrus.Debug("Storage diff persisted at block height: " + strconv.Itoa(row.BlockHeight))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (storageWatcher StorageWatcher) processQueue() {
|
func (storageWatcher StorageWatcher) processQueue() {
|
||||||
|
@ -18,6 +18,7 @@ package eth
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"math/big"
|
"math/big"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@ -25,6 +26,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
|
||||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||||
@ -58,6 +60,7 @@ func NewBlockChain(ethClient core.EthClient, rpcClient core.RPCClient, node core
|
|||||||
|
|
||||||
func (blockChain *BlockChain) GetBlockByNumber(blockNumber int64) (block core.Block, err error) {
|
func (blockChain *BlockChain) GetBlockByNumber(blockNumber int64) (block core.Block, err error) {
|
||||||
gethBlock, err := blockChain.ethClient.BlockByNumber(context.Background(), big.NewInt(blockNumber))
|
gethBlock, err := blockChain.ethClient.BlockByNumber(context.Background(), big.NewInt(blockNumber))
|
||||||
|
logrus.Debug("GetBlockByNumber called with block " + strconv.Itoa(int(blockNumber)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return block, err
|
return block, err
|
||||||
}
|
}
|
||||||
@ -66,6 +69,7 @@ func (blockChain *BlockChain) GetBlockByNumber(blockNumber int64) (block core.Bl
|
|||||||
|
|
||||||
func (blockChain *BlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error) {
|
func (blockChain *BlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error) {
|
||||||
gethLogs, err := blockChain.ethClient.FilterLogs(context.Background(), query)
|
gethLogs, err := blockChain.ethClient.FilterLogs(context.Background(), query)
|
||||||
|
logrus.Debug("GetEthLogsWithCustomQuery called")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []types.Log{}, err
|
return []types.Log{}, err
|
||||||
}
|
}
|
||||||
@ -73,6 +77,7 @@ func (blockChain *BlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQue
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (blockChain *BlockChain) GetHeaderByNumber(blockNumber int64) (header core.Header, err error) {
|
func (blockChain *BlockChain) GetHeaderByNumber(blockNumber int64) (header core.Header, err error) {
|
||||||
|
logrus.Debug("GetHeaderByNumber called with block " + strconv.Itoa(int(blockNumber)))
|
||||||
if blockChain.node.NetworkID == core.KOVAN_NETWORK_ID {
|
if blockChain.node.NetworkID == core.KOVAN_NETWORK_ID {
|
||||||
return blockChain.getPOAHeader(blockNumber)
|
return blockChain.getPOAHeader(blockNumber)
|
||||||
}
|
}
|
||||||
@ -80,6 +85,7 @@ func (blockChain *BlockChain) GetHeaderByNumber(blockNumber int64) (header core.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (blockChain *BlockChain) GetHeadersByNumbers(blockNumbers []int64) (header []core.Header, err error) {
|
func (blockChain *BlockChain) GetHeadersByNumbers(blockNumbers []int64) (header []core.Header, err error) {
|
||||||
|
logrus.Debug("GetHeadersByNumbers called")
|
||||||
if blockChain.node.NetworkID == core.KOVAN_NETWORK_ID {
|
if blockChain.node.NetworkID == core.KOVAN_NETWORK_ID {
|
||||||
return blockChain.getPOAHeaders(blockNumbers)
|
return blockChain.getPOAHeaders(blockNumbers)
|
||||||
}
|
}
|
||||||
@ -268,5 +274,6 @@ func (blockChain *BlockChain) getPOWHeaders(blockNumbers []int64) (headers []cor
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (blockChain *BlockChain) GetAccountBalance(address common.Address, blockNumber *big.Int) (*big.Int, error) {
|
func (blockChain *BlockChain) GetAccountBalance(address common.Address, blockNumber *big.Int) (*big.Int, error) {
|
||||||
|
logrus.Debug("GetAccountBalance called")
|
||||||
return blockChain.ethClient.BalanceAt(context.Background(), address, blockNumber)
|
return blockChain.ethClient.BalanceAt(context.Background(), address, blockNumber)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user