crosscoreRPCPrefix = "/rpc/"
)
-/*
-type consensusReactor interface {
- // for when we switch from blockchain reactor and fast sync to
- // the consensus machine
- SwitchToConsensus(*sm.State)
-}
-*/
-
// BlockchainReactor handles long-term catchup syncing.
type BlockchainReactor struct {
p2p.BaseReactor
-// state *sm.State
-// proxyAppConn proxy.AppConnConsensus // same as consensus.proxyAppConn
-// store *MemStore
chain *protocol.Chain
store *txdb.Store
accounts *account.Manager
requestsCh chan BlockRequest
timeoutsCh chan string
submitter txbuilder.Submitter
-// lastBlock *types.Block
evsw types.EventSwitch
}
LastPage bool `json:"last_page"`
}
-func NewBlockchainReactor(store *txdb.Store, chain *protocol.Chain, accounts *account.Manager, fastSync bool) *BlockchainReactor {
+func NewBlockchainReactor(store *txdb.Store, chain *protocol.Chain, accounts *account.Manager, assets *asset.Registry, fastSync bool) *BlockchainReactor {
requestsCh := make(chan BlockRequest, defaultChannelCapacity)
timeoutsCh := make(chan string, defaultChannelCapacity)
pool := NewBlockPool(
chain: chain,
store: store,
accounts: accounts,
+ assets: assets,
pool: pool,
mux: http.NewServeMux(),
fastSync: fastSync,
var ins Ins
ins.RootXPubs = []chainkd.XPub{xpub}
ins.Quorum = 1
- ins.Alias = "aa"
+ ins.Alias = "alice"
ins.Tags = map[string]interface{}{"test_tag": "v0",}
ins.ClientToken = args[0]
responses := make([]interface{}, 50)
var ins Ins
ins.RootXPubs = []chainkd.XPub{xpub}
ins.Quorum = 1
- ins.Alias = "aa"
+ ins.Alias = "bob"
ins.Tags = map[string]interface{}{"test_tag": "v0",}
ins.Definition = map[string]interface{}{"test_definition": "v0"}
ins.ClientToken = args[0]
"github.com/bytom/blockchain/txdb"
"github.com/bytom/net/http/reqid"
"github.com/bytom/protocol"
+ "github.com/bytom/blockchain/asset"
rpcserver "github.com/bytom/rpc/lib/server"
// "github.com/bytom/net/http/static"
// "github.com/bytom/generated/dashboard"
blockStore *txdb.Store
bcReactor *bc.BlockchainReactor
accounts *account.Manager
+ assets *asset.Registry
rpcListeners []net.Listener // rpc servers
}
accounts_db := dbm.NewDB("account", config.DBBackend, config.DBDir())
accounts := account.NewManager(accounts_db, chain)
- bcReactor := bc.NewBlockchainReactor(store, chain, accounts, fastSync)
+ assets_db := dbm.NewDB("asset", config.DBBackend, config.DBDir())
+ assets := asset.NewRegistry(assets_db, chain)
+ bcReactor := bc.NewBlockchainReactor(store, chain, accounts, assets, fastSync)
bcReactor.SetLogger(logger.With("module", "blockchain"))
sw.AddReactor("BLOCKCHAIN", bcReactor)
bcReactor: bcReactor,
blockStore: store,
accounts: accounts,
+ assets: assets,
}
node.BaseService = *cmn.NewBaseService(logger, "Node", node)
return node