我想要实现的是在 aws EC2 实例上运行 ethereum/client-go 并能够从远程客户端访问它,以使用 Rinkeby 测试网络
我正在尝试在awsgeth
上的 ec2 实例上运行 docker 映像。
当我使用以下命令运行 docker 时,出现以下错误。
sudo docker run -it -p 8545:8545 -p 30303:30303 ethereum/client-go --rpc --rinkeby --syncmode "fast" --rpc --rpcapi 'db,eth,net,web3,personal' --rpcaddr XXX.XX.XXX.XXX --cache=1024
其中--rpcaddr XXX.XX.XXX.XXX是我的弹性 IP
INFO [04-17|10:24:08] Maximum peer count ETH=25 LES=0 total=25
INFO [04-17|10:24:08] Starting peer-to-peer node instance=Geth/v1.8.4-unstable-92c6d130/linux-amd64/go1.10.1
INFO [04-17|10:24:08] Allocated cache and file handles database=/root/.ethereum/rinkeby/geth/chaindata cache=768 handles=1024
INFO [04-17|10:24:08] Writing custom genesis block
INFO [04-17|10:24:08] Persisted trie from memory database nodes=355 size=65.27kB time=1.082517ms gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [04-17|10:24:08] Initialised chain configuration config="{ChainID: 4 Homestead: 1 DAO: <nil> DAOSupport: true EIP150: 2 EIP155: 3 EIP158: 3 Byzantium: 1035301 Constantinople: <nil> Engine: clique}"
INFO [04-17|10:24:08] Initialising Ethereum protocol versions="[63 62]" network=4
INFO [04-17|10:24:08] Loaded most recent local header number=0 hash=6341fd…67e177 td=1
INFO [04-17|10:24:08] Loaded most recent local full block number=0 hash=6341fd…67e177 td=1
INFO [04-17|10:24:08] Loaded most recent local fast block number=0 hash=6341fd…67e177 td=1
INFO [04-17|10:24:08] Regenerated local transaction journal transactions=0 accounts=0
INFO [04-17|10:24:08] Starting P2P networking
INFO [04-17|10:24:10] UDP listener up self=enode://350e33a2680260f24bd1837e59610173769023f6cf609ab59b1aca63dc867cce5d7cb520343ed9a04b8a98d5a7d08f57f9e2ee258502312fafad42d005179aab@[::]:30303
INFO [04-17|10:24:10] IPC endpoint opened url=/root/.ethereum/rinkeby/geth.ipc
INFO [04-17|10:24:10] IPC endpoint closed endpoint=/root/.ethereum/rinkeby/geth.ipc
INFO [04-17|10:24:10] Blockchain manager stopped
INFO [04-17|10:24:10] Stopping Ethereum protocol
INFO [04-17|10:24:10] RLPx listener up self=enode://350e33a2680260f24bd1837e59610173769023f6cf609ab59b1aca63dc867cce5d7cb520343ed9a04b8a98d5a7d08f57f9e2ee258502312fafad42d005179aab@[::]:30303
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa6e76b]
goroutine 76 [running]:
github.com/ethereum/go-ethereum/eth/filters.(*EventSystem).eventLoop(0xc42c694d00)
/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/eth/filters/filter_system.go:434 +0x2eb
created by github.com/ethereum/go-ethereum/eth/filters.NewEventSystem
/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/eth/filters/filter_system.go:113 +0x104
- 任何人都可以帮忙,是什么导致了上述问题?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa6e76b]
当我运行同一个 docker 时,--rpcaddr 127.0.0.1
它工作正常,但无法从远程客户端访问,
sudo docker run -it -p 8545:8545 -p 30303:30303 ethereum/client-go --rpc --rinkeby --syncmode "fast" --rpc --rpcapi 'db,eth,net,web3,personal' --rpcaddr 127.0.0.1 --cache=1024
我试过使用,
- 公共 DNS (IPv4),
- IPv4 公共 IP 和
- 弹性IP
对于 --rpcaddr 值
此外,我还授予了 aws TCP 入站和出站端口的安全权限。
我这样做对吗?这是运行 web3 提供程序的正确方法吗?