Search in sources :

Example 1 with BroadcastNewBlockHandler

use of org.aion.zero.impl.sync.handler.BroadcastNewBlockHandler in project aion by aionnetwork.

the class AionHub method registerCallback.

private void registerCallback() {
    List<Handler> cbs = new ArrayList<>();
    cbs.add(new ReqStatusHandler(syncLog, this.blockchain, this.p2pMgr, cfg.getGenesis().getHash()));
    cbs.add(new ResStatusHandler(syncLog, this.p2pMgr, this.syncMgr));
    cbs.add(new ReqBlocksHeadersHandler(syncLog, this.blockchain, this.p2pMgr, cfg.getSync().getBlocksImportMax()));
    cbs.add(new ResBlocksHeadersHandler(syncLog, this.syncMgr));
    cbs.add(new ReqBlocksBodiesHandler(syncLog, this.blockchain, this.p2pMgr, cfg.getSync().getBlocksImportMax()));
    cbs.add(new ResBlocksBodiesHandler(syncLog, this.syncMgr));
    cbs.add(new BroadcastTxHandler(syncLog, this.mempool, this.p2pMgr));
    cbs.add(new BroadcastNewBlockHandler(syncLog, this.propHandler));
    this.p2pMgr.register(cbs);
}
Also used : BlockPropagationHandler(org.aion.zero.impl.sync.handler.BlockPropagationHandler) BroadcastNewBlockHandler(org.aion.zero.impl.sync.handler.BroadcastNewBlockHandler) Handler(org.aion.p2p.Handler) BroadcastNewBlockHandler(org.aion.zero.impl.sync.handler.BroadcastNewBlockHandler)

Example 2 with BroadcastNewBlockHandler

use of org.aion.zero.impl.sync.handler.BroadcastNewBlockHandler in project aion by aionnetwork.

the class AionHub method registerCallback.

private void registerCallback() {
    List<Handler> cbs = new ArrayList<>();
    cbs.add(new ReqStatusHandler(syncLOG, blockchain, mempool, p2pMgr, cfg.getGenesis().getHash(), apiVersion));
    cbs.add(new ResStatusHandler(syncLOG, surveyLOG, p2pMgr, syncMgr));
    boolean inSyncOnlyMode = cfg.getNet().getP2p().inSyncOnlyMode();
    cbs.add(new ReqBlocksHeadersHandler(syncLOG, blockchain, p2pMgr, inSyncOnlyMode));
    cbs.add(new ResBlocksHeadersHandler(syncLOG, surveyLOG, syncMgr));
    cbs.add(new ReqBlocksBodiesHandler(syncLOG, blockchain, syncMgr, p2pMgr, inSyncOnlyMode));
    cbs.add(new ResBlocksBodiesHandler(syncLOG, surveyLOG, syncMgr, p2pMgr));
    cbs.add(new BroadcastTxHandler(syncLOG, mempool, p2pMgr, inSyncOnlyMode));
    cbs.add(new BroadcastNewBlockHandler(syncLOG, surveyLOG, propHandler, p2pMgr));
    this.p2pMgr.register(cbs);
}
Also used : ReqStatusHandler(org.aion.zero.impl.sync.handler.ReqStatusHandler) ResBlocksBodiesHandler(org.aion.zero.impl.sync.handler.ResBlocksBodiesHandler) ArrayList(java.util.ArrayList) BroadcastNewBlockHandler(org.aion.zero.impl.sync.handler.BroadcastNewBlockHandler) Handler(org.aion.p2p.Handler) ResBlocksHeadersHandler(org.aion.zero.impl.sync.handler.ResBlocksHeadersHandler) ReqStatusHandler(org.aion.zero.impl.sync.handler.ReqStatusHandler) BroadcastTxHandler(org.aion.zero.impl.sync.handler.BroadcastTxHandler) ResStatusHandler(org.aion.zero.impl.sync.handler.ResStatusHandler) BlockPropagationHandler(org.aion.zero.impl.sync.handler.BlockPropagationHandler) ReqBlocksBodiesHandler(org.aion.zero.impl.sync.handler.ReqBlocksBodiesHandler) ReqBlocksHeadersHandler(org.aion.zero.impl.sync.handler.ReqBlocksHeadersHandler) ResBlocksBodiesHandler(org.aion.zero.impl.sync.handler.ResBlocksBodiesHandler) ReqBlocksBodiesHandler(org.aion.zero.impl.sync.handler.ReqBlocksBodiesHandler) ReqBlocksHeadersHandler(org.aion.zero.impl.sync.handler.ReqBlocksHeadersHandler) ResBlocksHeadersHandler(org.aion.zero.impl.sync.handler.ResBlocksHeadersHandler) ResStatusHandler(org.aion.zero.impl.sync.handler.ResStatusHandler) BroadcastTxHandler(org.aion.zero.impl.sync.handler.BroadcastTxHandler) BroadcastNewBlockHandler(org.aion.zero.impl.sync.handler.BroadcastNewBlockHandler)

Aggregations

Handler (org.aion.p2p.Handler)2 BlockPropagationHandler (org.aion.zero.impl.sync.handler.BlockPropagationHandler)2 BroadcastNewBlockHandler (org.aion.zero.impl.sync.handler.BroadcastNewBlockHandler)2 ArrayList (java.util.ArrayList)1 BroadcastTxHandler (org.aion.zero.impl.sync.handler.BroadcastTxHandler)1 ReqBlocksBodiesHandler (org.aion.zero.impl.sync.handler.ReqBlocksBodiesHandler)1 ReqBlocksHeadersHandler (org.aion.zero.impl.sync.handler.ReqBlocksHeadersHandler)1 ReqStatusHandler (org.aion.zero.impl.sync.handler.ReqStatusHandler)1 ResBlocksBodiesHandler (org.aion.zero.impl.sync.handler.ResBlocksBodiesHandler)1 ResBlocksHeadersHandler (org.aion.zero.impl.sync.handler.ResBlocksHeadersHandler)1 ResStatusHandler (org.aion.zero.impl.sync.handler.ResStatusHandler)1