首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ethereumj.starter在本地运行,但bestBlock始终保持在0

ethereumj.starter在本地运行,但bestBlock始终保持在0
EN

Ethereum用户
提问于 2017-05-17 20:11:59
回答 1查看 168关注 0票数 0

我运行了以下命令来获取ethereumj.starter代码并运行它。

代码语言:javascript
复制
%> git clone https://github.com/ether-camp/ethereumj.starter
%> cd ethereumj.starter
%> ./gradlew run

从日志文件和控制台输出中,我可以看到节点已启动,连接到对等节点,并且正在同步。但是,在另一个终端窗口中,以下命令的输出始终是0,如下所示。

代码语言:javascript
复制
%> curl -w "\n" -X GET http://localhost:8080/bestBlock
0

尽管日志文件显示了正在接收的事务,并且还记录了如下消息,但是这仍然存在,其中一些高块号被列为best block .

代码语言:javascript
复制
Peer V63: [ 267c54b3,    NODE_RETRIEVING, ping     95 ms, difficulty 270944163663211043882, best block 3723188 ]: (idle 3s of 20s) Geth/v1.6.0-stable-facc47cb/windows-amd64/go1.8.1    Nodes/sec: 3681.86, miss: 0.00

我是不是漏掉了什么?当本地节点同步时,curl命令报告的最佳块号不应该随着时间的增加而增加吗?

EN

回答 1

Ethereum用户

发布于 2017-11-21 19:49:08

通过编辑ethereumj.conf文件,我能够让ethereumj启动程序工作。我发现使用这个文件有效(在注释掉私钥之后):

https://gist.github.com/Glamdring/cc575d0998ecbf6c519a4d95ee5faaa3

下面是配置:

代码语言:javascript
复制
peer {
    # Network id (=1 real network)
    networkId = 3

    # Port on which ethereumj will listen
    # for incoming connections
    listen.port = 30304

    # Private key of the peer
    # The key is generated by default on the first run and stored in the database folder
    # If you have your own peer ID, specify its private key here
    #privateKey = 9feea28......

    # Test peers
    ip.list = [
        "94.242.229.4:40404",
        "94.242.229.203:30303",
        "128.199.55.137:30303",
        "52.169.94.142:30303"
    ]
}

sync.enabled = false

database {
    # place to save physical storage files
    # can be either absolute or relative path
    dir = database1
}

# Blockchain settings (constants and algorithms) which are
# not described in the genesis file (like MINIMUM_DIFFICULTY or Mining algorithm)
# The possible named presets are:
# - main : the main network (Frontier-Homestead-...)
# - ropsten: Ropsten test network
# - testnet: Ethercamp test network
# - olympic: pre-Frontier Olympic network
# For custom network settings please refer to 'blockchain.config.class'
blockchain.config.name = ropsten

# the folder resources/genesis
# contains several versions of
# genesis configuration according
# to the network the peer will run on
genesis = ropsten.json

如果EthereumJ初学者能够将他们的配置文件更新为有效的配置文件,那就太好了。

票数 1
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/16264

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档