diff --git a/core/shyft_tracer.go b/core/shyft_tracer.go index 391ada4257..56581b046f 100644 --- a/core/shyft_tracer.go +++ b/core/shyft_tracer.go @@ -4,7 +4,6 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/common" "fmt" - ) const ( @@ -16,6 +15,8 @@ const ( //var api *eth.PrivateDebugAPI +var EthereumObject interface{} + var Chaindb_global ethdb.Database func SetChainDB(db ethdb.Database){ @@ -52,4 +53,8 @@ func MyTraceTransaction(hash string) (interface{}) { fmt.Println(blockHash) fmt.Println(index) return 42 +} + +func setEthObject(ethobj interface{}){ + EthereumObject = ethobj } \ No newline at end of file diff --git a/eth/backend.go b/eth/backend.go index a3fd81d662..8e2f81bb6e 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -49,10 +49,10 @@ import ( "github.com/ethereum/go-ethereum/rpc" ) -var EthObject *Ethereum - var BlockchainObject *core.BlockChain +var DebugApi *PrivateDebugAPI + type LesServer interface { Start(srvr *p2p.Server) Stop() @@ -148,8 +148,6 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks), } - EthObject = eth - log.Info("Initialising Ethereum protocol", "versions", ProtocolVersions, "network", config.NetworkId) if !config.SkipBcVersionCheck { @@ -197,6 +195,9 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { } eth.ApiBackend.gpo = gasprice.NewOracle(eth.ApiBackend, gpoParams) + DebugApi.eth = eth + DebugApi.config = chainConfig + return eth, nil }