Go-Ethereum

乙太坊專用網路在 127.0.0.1:8545 上啟動,而不是在我指定的 ip 和埠上

  • January 1, 2022

我正在創建一個用於測試的私有區塊鍊網路,方法是執行所有初始步驟,例如創建創世塊和數據文件夾等。

這是我使用的一些初始命令

geth --datadir "./data" init genesis.json

執行此命令後,我得到以下輸出

WARN [01-15|17:37:00] No etherbase set and no accounts found as default
INFO [01-15|17:37:00] Allocated cache and file handles         database="E:\\my node\\data\\geth\\chaindata" cache=16 ha
ndles=16
INFO [01-15|17:37:00] Writing custom genesis block
INFO [01-15|17:37:00] Successfully wrote genesis state         database=chaindata                            hash=629461
.8c5a75
INFO [01-15|17:37:00] Allocated cache and file handles         database="E:\\my node\\data\\geth\\lightchaindata" cache=
16 handles=16
INFO [01-15|17:37:00] Writing custom genesis block
INFO [01-15|17:37:00] Successfully wrote genesis state         database=lightchaindata                            hash=6
29461.8c5a75 

之後我執行了以下命令

geth --networkid 1020 --datadir "./data" --nodiscover --port 30307 --rpc 8105 --rpcaddr 10.37.1.75 --rpccorsdomain "*" --rpcapi "eth,net,web3" console

並得到以下輸出

WARN [01-15|17:37:47] No etherbase set and no accounts found as default
INFO [01-15|17:37:47] Starting peer-to-peer node               instance=Geth/v1.6.7-stable-ab5646c5/windows-amd64/go1.8.
3
INFO [01-15|17:37:47] Allocated cache and file handles         database="E:\\my node\\data\\geth\\chaindata" cache=128 h
andles=1024
WARN [01-15|17:37:47] Upgrading chain database to use sequential keys
INFO [01-15|17:37:47] Initialised chain configuration          config="{ChainID: 1020 Homestead: <nil> DAO: <nil> DAOSup
port: false EIP150: <nil> EIP155: <nil> EIP158: <nil> Metropolis: <nil> Engine: unknown}"
INFO [01-15|17:37:47] Database conversion successful
INFO [01-15|17:37:47] Disk storage enabled for ethash caches   dir="E:\\my node\\data\\geth\\ethash" count=3
INFO [01-15|17:37:47] Disk storage enabled for ethash DAGs     dir=C:\\Users\\User(LPT-APR2015-02)\\AppData\\Ethash coun
t=2
WARN [01-15|17:37:47] Upgrading db log bloom bins
INFO [01-15|17:37:47] Bloom-bin upgrade completed              elapsed=4.000ms
INFO [01-15|17:37:47] Initialising Ethereum protocol           versions="[63 62]" network=1020
INFO [01-15|17:37:47] Loaded most recent local header          number=0 hash=629461.8c5a75 td=1024
INFO [01-15|17:37:47] Loaded most recent local full block      number=0 hash=629461.8c5a75 td=1024
INFO [01-15|17:37:47] Loaded most recent local fast block      number=0 hash=629461.8c5a75 td=1024
INFO [01-15|17:37:47] Starting P2P networking
INFO [01-15|17:37:47] RLPx listener up                         self="enode://900958e9480389b0abf1b41152f174fdbe6221fd9f7
8c72f1cfc4bf4c092933fced964356b20314faa3fdc4258fcd7eddcf30d8a68fb589d67ab6b0ab7d81258@[::]:30307?discport=0"
INFO [01-15|17:37:47] IPC endpoint opened: \\.\pipe\geth.ipc
INFO [01-15|17:37:47] HTTP endpoint opened: http://127.0.0.1:8545

現在的問題是我已將 IP 地址指定為 10.37.1.75 並將埠指定為 8105 那麼為什麼端點在 127.0.0.1:8545 打開

注意:在此之前我已經做了幾次,當時端點是在 10.37.1.75:8105 開始的

您想使用“–rpc –rpcaddr 10.37.1.75 –rpcport 8105”參數。

啟動geth時,必須指定IP和埠,

引用自:https://ethereum.stackexchange.com/questions/36333