use of io.nuls.kernel.MicroKernelBootstrap in project nuls by nuls-io.
the class BlockHeaderStorageServiceImplTest method init.
@Before
public void init() {
MicroKernelBootstrap mk = MicroKernelBootstrap.getInstance();
mk.init();
mk.start();
LevelDbModuleBootstrap bootstrap = new LevelDbModuleBootstrap();
bootstrap.init();
bootstrap.start();
service = NulsContext.getServiceBean(BlockHeaderStorageService.class);
BlockHeaderPo po = new BlockHeaderPo();
po.setHash(NulsDigestData.calcDigestData("hashhash".getBytes()));
po.setHeight(1286L);
po.setExtend("extends".getBytes());
po.setMerkleHash(NulsDigestData.calcDigestData("merkleHash".getBytes()));
po.setPreHash(NulsDigestData.calcDigestData("prehash".getBytes()));
try {
po.setPackingAddress("address".getBytes());
} catch (Exception e) {
e.printStackTrace();
assertTrue(false);
}
po.setScriptSign(new BlockSignature());
po.setTime(12345678901L);
po.setTxCount(3);
List<NulsDigestData> txHashList = new ArrayList<>();
txHashList.add(NulsDigestData.calcDigestData("first-tx-hash".getBytes()));
txHashList.add(NulsDigestData.calcDigestData("second-tx-hash".getBytes()));
txHashList.add(NulsDigestData.calcDigestData("third-tx-hash".getBytes()));
po.setTxHashList(txHashList);
this.entity = po;
}
use of io.nuls.kernel.MicroKernelBootstrap in project nuls by nuls-io.
the class BlockServiceImplTest method init.
@Before
public void init() {
MicroKernelBootstrap mk = MicroKernelBootstrap.getInstance();
mk.init();
mk.start();
LevelDbModuleBootstrap bootstrap = new LevelDbModuleBootstrap();
bootstrap.init();
bootstrap.start();
UtxoLedgerModuleBootstrap ledgerModuleBootstrap = new UtxoLedgerModuleBootstrap();
ledgerModuleBootstrap.init();
ledgerModuleBootstrap.start();
service = NulsContext.getServiceBean(BlockService.class);
Block block = new Block();
BlockHeader blockHeader = new BlockHeader();
blockHeader.setHash(NulsDigestData.calcDigestData("hashhash".getBytes()));
blockHeader.setHeight(1286L);
blockHeader.setExtend("extends".getBytes());
blockHeader.setMerkleHash(NulsDigestData.calcDigestData("merkleHash".getBytes()));
blockHeader.setPreHash(NulsDigestData.calcDigestData("prehash".getBytes()));
try {
blockHeader.setPackingAddress("address".getBytes());
} catch (Exception e) {
e.printStackTrace();
assertTrue(false);
}
blockHeader.setBlockSignature(new BlockSignature());
blockHeader.setTime(12345678901L);
blockHeader.setTxCount(3);
List<NulsDigestData> txHashList = new ArrayList<>();
txHashList.add(NulsDigestData.calcDigestData("first-tx-hash".getBytes()));
txHashList.add(NulsDigestData.calcDigestData("second-tx-hash".getBytes()));
txHashList.add(NulsDigestData.calcDigestData("third-tx-hash".getBytes()));
// block.setTxHashList(txHashList);
// this.model = blockHeader;
}
use of io.nuls.kernel.MicroKernelBootstrap in project nuls by nuls-io.
the class BaseTest method initMicroKernel.
@BeforeClass
public static void initMicroKernel() {
MicroKernelBootstrap mk = MicroKernelBootstrap.getInstance();
mk.init();
mk.start();
}
use of io.nuls.kernel.MicroKernelBootstrap in project nuls by nuls-io.
the class RpcServerManagerTest method startServer.
public void startServer() {
MicroKernelBootstrap bootstrap = MicroKernelBootstrap.getInstance();
bootstrap.init();
bootstrap.start();
RpcServerManager.getInstance().startServer("127.0.0.1", 8080);
assertTrue(true);
}
use of io.nuls.kernel.MicroKernelBootstrap in project nuls by nuls-io.
the class TestNetwork method init.
@Before
public void init() {
try {
MicroKernelBootstrap mk = MicroKernelBootstrap.getInstance();
mk.init();
mk.start();
LevelDbModuleBootstrap dbModuleBootstrap = new LevelDbModuleBootstrap();
dbModuleBootstrap.init();
dbModuleBootstrap.start();
BaseProtocolsModuleBootstrap protocolsModuleBootstrap = new BaseProtocolsModuleBootstrap();
protocolsModuleBootstrap.init();
protocolsModuleBootstrap.start();
MessageBusModuleBootstrap messageBusModuleBootstrap = new MessageBusModuleBootstrap();
messageBusModuleBootstrap.init();
messageBusModuleBootstrap.start();
NettyNetworkModuleBootstrap networkModuleBootstrap = new NettyNetworkModuleBootstrap();
networkModuleBootstrap.init();
networkModuleBootstrap.start();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations