|
|
|
@ -37,6 +37,7 @@ type Harmony struct { |
|
|
|
|
// TODO(ricl): this is never set. Will result in nil pointer bug
|
|
|
|
|
// RPCGasCap is the global gas cap for eth-call variants.
|
|
|
|
|
RPCGasCap *big.Int `toml:",omitempty"` |
|
|
|
|
shardID uint32 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
// 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() |
|
|
|
|
hmy := &Harmony{ |
|
|
|
|
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), |
|
|
|
|
nodeAPI: nodeAPI, |
|
|
|
|
networkID: 1, // TODO(ricl): this should be from config
|
|
|
|
|
shardID: shardID, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hmy.APIBackend = &APIBackend{hmy} |
|
|
|
|