我运行了以下命令来获取ethereumj.starter代码并运行它。
%> git clone https://github.com/ether-camp/ethereumj.starter
%> cd ethereumj.starter
%> ./gradlew run从日志文件和控制台输出中,我可以看到节点已启动,连接到对等节点,并且正在同步。但是,在另一个终端窗口中,以下命令的输出始终是0,如下所示。
%> curl -w "\n" -X GET http://localhost:8080/bestBlock
0尽管日志文件显示了正在接收的事务,并且还记录了如下消息,但是这仍然存在,其中一些高块号被列为best block .
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命令报告的最佳块号不应该随着时间的增加而增加吗?
发布于 2017-11-21 19:49:08
通过编辑ethereumj.conf文件,我能够让ethereumj启动程序工作。我发现使用这个文件有效(在注释掉私钥之后):
https://gist.github.com/Glamdring/cc575d0998ecbf6c519a4d95ee5faaa3
下面是配置:
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初学者能够将他们的配置文件更新为有效的配置文件,那就太好了。
https://ethereum.stackexchange.com/questions/16264
复制相似问题