From 96b70e6992620e17a1a64663d87d565e09dc1308 Mon Sep 17 00:00:00 2001 From: Meng-Ying Yang Date: Wed, 2 Jan 2019 16:32:43 +0800 Subject: Indexer plugin extension and custom flags support (#117) * indexer: ReadOnlyBlockchain returns underlying engine * indexer: plugin configs support custom flags --- indexer/blockchain.go | 2 ++ indexer/config.go | 3 +++ 2 files changed, 5 insertions(+) (limited to 'indexer') diff --git a/indexer/blockchain.go b/indexer/blockchain.go index a762ef67d..421535184 100644 --- a/indexer/blockchain.go +++ b/indexer/blockchain.go @@ -7,6 +7,7 @@ import ( coreTypes "github.com/dexon-foundation/dexon-consensus/core/types" "github.com/dexon-foundation/dexon/common" + "github.com/dexon-foundation/dexon/consensus" "github.com/dexon-foundation/dexon/core" "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/core/types" @@ -24,6 +25,7 @@ type ReadOnlyBlockChain interface { CurrentBlock() *types.Block CurrentFastBlock() *types.Block CurrentHeader() *types.Header + Engine() consensus.Engine GasLimit() uint64 Genesis() *types.Block GetAncestor(common.Hash, uint64, uint64, *uint64) (common.Hash, uint64) diff --git a/indexer/config.go b/indexer/config.go index 3b626272a..396a23b66 100644 --- a/indexer/config.go +++ b/indexer/config.go @@ -11,6 +11,9 @@ type Config struct { // Plugin path for building components. Plugin string + + // PluginFlags for construction if needed. + PluginFlags string } // NewIndexerFromConfig initialize exporter according to given config. -- cgit v1.2.3