本文整理汇总了Java中org.ethereum.cli.CLIInterface类的典型用法代码示例。如果您正苦于以下问题:Java CLIInterface类的具体用法?Java CLIInterface怎么用?Java CLIInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CLIInterface类属于org.ethereum.cli包,在下文中一共展示了CLIInterface类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.ethereum.cli.CLIInterface; //导入依赖的package包/类
public static void main(String args[]) throws IOException, URISyntaxException {
CLIInterface.call(args);
final SystemProperties config = SystemProperties.getDefault();
final boolean actionBlocksLoader = !config.blocksLoader().equals("");
final boolean actionGenerateDag = !StringUtils.isEmpty(System.getProperty("ethash.blockNumber"));
if (actionBlocksLoader || actionGenerateDag) {
config.setSyncEnabled(false);
config.setDiscoveryEnabled(false);
}
if (actionGenerateDag) {
new Ethash(config, Long.parseLong(System.getProperty("ethash.blockNumber"))).getFullDataset();
// DAG file has been created, lets exit
System.exit(0);
} else {
Ethereum ethereum = EthereumFactory.createEthereum();
if (actionBlocksLoader) {
ethereum.getBlockLoader().loadBlocks();
}
}
}
示例2: startNode
import org.ethereum.cli.CLIInterface; //导入依赖的package包/类
public void startNode(String[] args) throws Exception {
logger.info("Starting RSK");
CLIInterface.call(rskSystemProperties, args);
logger.info("Running {}, core version: {}-{}", rskSystemProperties.genesisInfo(), rskSystemProperties.projectVersion(), rskSystemProperties.projectVersionModifier());
BuildInfo.printInfo();
channelManager.start();
txHandler.start();
messageHandler.start();
rsk.init();
if (logger.isInfoEnabled()) {
String versions = EthVersion.supported().stream().map(EthVersion::name).collect(Collectors.joining(", "));
logger.info("Capability eth version: [{}]", versions);
}
if (rskSystemProperties.isBlocksEnabled()) {
setupRecorder(rsk, rskSystemProperties.blocksRecorder());
setupPlayer(rsk, channelManager, blockchain, rskSystemProperties.blocksPlayer());
}
if (!"".equals(rskSystemProperties.blocksLoader())) {
rskSystemProperties.setSyncEnabled(Boolean.FALSE);
rskSystemProperties.setDiscoveryEnabled(Boolean.FALSE);
}
Metrics.registerNodeID(rskSystemProperties.nodeId());
if (rskSystemProperties.simulateTxs()) {
enableSimulateTxs();
}
if (rskSystemProperties.simulateTxsEx()) {
enableSimulateTxsEx();
}
if (rskSystemProperties.isRpcEnabled()) {
logger.info("RPC enabled");
enableRpc();
}
else {
logger.info("RPC disabled");
}
if (rskSystemProperties.isSyncEnabled()) {
syncPool.updateLowerUsefulDifficulty();
syncPool.start();
if (rskSystemProperties.waitForSync()) {
waitRskSyncDone(rsk);
}
}
if (rskSystemProperties.minerServerEnabled()) {
minerServer.start();
if (rskSystemProperties.minerClientEnabled()) {
minerClient.mine();
}
}
if (rskSystemProperties.peerDiscovery()) {
enablePeerDiscovery();
}
}