|
|
@ -37,6 +37,7 @@ type Harmony struct { |
|
|
|
// TODO(ricl): this is never set. Will result in nil pointer bug
|
|
|
|
// TODO(ricl): this is never set. Will result in nil pointer bug
|
|
|
|
// RPCGasCap is the global gas cap for eth-call variants.
|
|
|
|
// RPCGasCap is the global gas cap for eth-call variants.
|
|
|
|
RPCGasCap *big.Int `toml:",omitempty"` |
|
|
|
RPCGasCap *big.Int `toml:",omitempty"` |
|
|
|
|
|
|
|
shardID uint32 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NodeAPI is the list of functions from node used to call rpc apis.
|
|
|
|
// NodeAPI is the list of functions from node used to call rpc apis.
|
|
|
@ -50,7 +51,7 @@ type NodeAPI interface { |
|
|
|
|
|
|
|
|
|
|
|
// New creates a new Harmony object (including the
|
|
|
|
// New creates a new Harmony object (including the
|
|
|
|
// initialisation of the common Harmony object)
|
|
|
|
// initialisation of the common Harmony object)
|
|
|
|
func New(nodeAPI NodeAPI, txPool *core.TxPool, eventMux *event.TypeMux) (*Harmony, error) { |
|
|
|
func New(nodeAPI NodeAPI, txPool *core.TxPool, eventMux *event.TypeMux, shardID uint32) (*Harmony, error) { |
|
|
|
chainDb := nodeAPI.Blockchain().ChainDB() |
|
|
|
chainDb := nodeAPI.Blockchain().ChainDB() |
|
|
|
hmy := &Harmony{ |
|
|
|
hmy := &Harmony{ |
|
|
|
shutdownChan: make(chan bool), |
|
|
|
shutdownChan: make(chan bool), |
|
|
@ -63,6 +64,7 @@ func New(nodeAPI NodeAPI, txPool *core.TxPool, eventMux *event.TypeMux) (*Harmon |
|
|
|
bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks, params.BloomConfirms), |
|
|
|
bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks, params.BloomConfirms), |
|
|
|
nodeAPI: nodeAPI, |
|
|
|
nodeAPI: nodeAPI, |
|
|
|
networkID: 1, // TODO(ricl): this should be from config
|
|
|
|
networkID: 1, // TODO(ricl): this should be from config
|
|
|
|
|
|
|
|
shardID: shardID, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
hmy.APIBackend = &APIBackend{hmy} |
|
|
|
hmy.APIBackend = &APIBackend{hmy} |
|
|
|