当前位置: 首页>>代码示例>>Java>>正文


Java CLIInterface类代码示例

本文整理汇总了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();
        }
    }
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:25,代码来源:Start.java

示例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();
    }
}
 
开发者ID:rsksmart,项目名称:rskj,代码行数:65,代码来源:Start.java


注:本文中的org.ethereum.cli.CLIInterface类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。