【问题标题】:Geth 1.8.3, cant sync to rinkeby.io - Stuck at: IPC endpoint openedGeth 1.8.3,无法同步到 rinkeby.io - 卡在:IPC 端点打开
【发布时间】:2018-04-04 13:57:52
【问题描述】:

我似乎无法让最新版本的 Geth 1.8.3 正常工作。它会停止并且永远不会开始同步。

我正在尝试将它放到 rinkeby.io 测试网上进行智能合约测试。

在下载并使用ADD 将文件复制到映像后,我在 1.7.3 上取得了成功。但我想自动化构建,以便它可以在谷歌云中使用deployment.yml

目前我正在本地机器上进行测试,因为我知道防火墙适用于 1.7.3。 (没有具体的规定)

Dockerfile 构建得很好,我可以看到它出现在 rinkeby.io 节点列表中,但即使在 1 小时后,也没有一个块被同步。 它卡在:IPC endpoint opened

使用 1.7.3 开始同步需要 10-15 秒。

Dockerfile

# ----- 1st stage build -----
FROM golang:1.9-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git curl
WORKDIR /
RUN curl -o rinkeby.json https://www.rinkeby.io/rinkeby.json
RUN git clone https://github.com/ethereum/go-ethereum.git
RUN cd /go-ethereum && make geth

# ----- 2nd stage build -----
FROM alpine:latest

RUN apk add --no-cache ca-certificates    
COPY --from=builder rinkeby.json $HOME/rinkeby.json
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/   
VOLUME [ "/root/.rinkeby/geth/lightchaindata" ]
EXPOSE 8545 8546 30303 30304 30303/udp 30304/udp
RUN geth --datadir=$HOME/.rinkeby init rinkeby.json
CMD ["sh", "-c", "geth --networkid=4 --datadir=$HOME/.rinkeby --rpcaddr 0.0.0.0 --syncmode=fast --ethstats='Oxy:Respect my authoritah!@stats.rinkeby.io' --bootnodes=enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303?discport=30304"]

当我运行 docker 镜像时输出。

控制台:

INFO [04-04|13:14:10] Maximum peer count                       ETH=25 LES=0 total=25
INFO [04-04|13:14:10] Starting peer-to-peer node               instance=Geth/v1.8.4-unstable-6ab9f0a1/linux-amd64/go1.9.2
INFO [04-04|13:14:10] Allocated cache and file handles         database=/root/.rinkeby/geth/chaindata cache=768 handles=1024
WARN [04-04|13:14:10] Upgrading database to use lookup entries
INFO [04-04|13:14:10] Database deduplication successful        deduped=0
INFO [04-04|13:14:10] Initialised chain configuration          config="{ChainID: 4 Homestead: 1 DAO: <nil> DAOSupport: false EIP150: 2 EIP155: 3 EIP158: 3 Byzantium: 1035301 Constantinople: <nil> Engine: clique}"
INFO [04-04|13:14:10] Initialising Ethereum protocol           versions="[63 62]" network=4
INFO [04-04|13:14:10] Loaded most recent local header          number=0 hash=6341fd…67e177 td=1
INFO [04-04|13:14:10] Loaded most recent local full block      number=0 hash=6341fd…67e177 td=1
INFO [04-04|13:14:10] Loaded most recent local fast block      number=0 hash=6341fd…67e177 td=1
INFO [04-04|13:14:10] Regenerated local transaction journal    transactions=0 accounts=0
INFO [04-04|13:14:10] Starting P2P networking
INFO [04-04|13:14:12] UDP listener up                          self=enode://6d27f79b944aa75787213835ff512b03ec51434b2508a12735bb365210e57b0084795e5275150974cb976525811c65a49b756ac069ca78e4bd6929ea4d609b65@[::]:30303
INFO [04-04|13:14:12] Stats daemon started
INFO [04-04|13:14:12] RLPx listener up                         self=enode://6d27f79b944aa75787213835ff512b03ec51434b2508a12735bb365210e57b0084795e5275150974cb976525811c65a49b756ac069ca78e4bd6929ea4d609b65@[::]:30303
INFO [04-04|13:14:12] IPC endpoint opened                      url=/root/.rinkeby/geth.ipc

【问题讨论】:

    标签: docker geth


    【解决方案1】:

    从头开始重建 Dockerfile 后,我确实发现了问题所在。 在我的CMD 行的末尾有这个结尾。

    ?discport=30304

    通过删除它,它可以按预期工作。

    这是来自不同用户代码的残余。

    【讨论】:

      【解决方案2】:

      对我来说,问题是快速同步仍然运行数小时,需要很长时间并且永远不会自行停止。

      我运行了这个命令: **geth --rinkeby --syncmode "fast" --rpc --rpcapi db,eth,net,web3,personal --cache=1024 --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*" **

      消耗存储空间,因为它仍在运行(超过 5GB),有时我收到错误:设备上没有剩余空间,我删除了所有内容,然后重新开始。

      我运行 eth.syncing ,这是我得到的:

      https://imgur.com/a/fj2fvpy(同步 3 小时后)

      https://imgur.com/a/SqrnW8x(第一次 eth.syning 检查后 30 分钟)

      我试过100 * eth.syncing.currentBlock / eth.syncing.highestBlock,我得到了99.9969....然后它一直在减速和减少,从未达到99.9970

      我在 Ubuntu 16.04LTS 上运行 Geth/v1.8.4-stable-2423ae01/linux-amd64/go1.10

      【讨论】:

        【解决方案3】:

        兜兜转转后,我发现使用“--bootnodes”标志是让您的私有对等点通过网络相互识别的最简单方法:

        Geth.exe --bootnodes "enode://A@B:30303" --datadir="C:\Ledger"--nat=extip:192.168.0.9 ...

        在启动 IPC 管道时,指定一个可能始终处于启动状态的节点(可能是您的第一个 init 节点)。您还需要使用“--nat”标志非常明确地说明 IP 地址。在上面的示例中,A 是节点的 IP 地址,将用于自动检测所有其他节点并建立对等连接。

        我使用 Geth Github 网站上的 link 中的信息推导出了这种方法。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2018-05-15
          • 2019-05-14
          • 2022-11-12
          • 1970-01-01
          • 2013-07-16
          • 2011-04-24
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多