官术网_书友最值得收藏!

Connecting to the mainnet network

Nodes in the Ethereum network, by default, communicate using 30303 port. But nodes are also free to listen on some other port numbers.

To connect to the mainnet network, you just need to run the geth command. Here is an example of how to specify the network ID explicitly and specify a custom directory where geth will store the downloaded blockchain:

    geth --datadir "/users/packt/ethereum" --networkid 1

The --datadir option is used to specify where to store the blockchain. If it's not provided, the default path is $HOME/.ethereum.

--networkid is used to specify the network ID. 1 is the ID of the mainnet network. If it's not provided, the default value is 1. The network ID of testnet is 2.

主站蜘蛛池模板: 英吉沙县| 胶州市| 广安市| 安新县| 稷山县| 乌恰县| 筠连县| 汪清县| 交城县| 衡南县| 土默特左旗| 吉木萨尔县| 潼南县| 根河市| 武宁县| 神木县| 武宁县| 炎陵县| 林芝县| 海兴县| 雷山县| 察哈| 临汾市| 大邑县| 温宿县| 怀安县| 辽阳市| 社旗县| 芦山县| 清苑县| 孙吴县| 石狮市| 安化县| 长沙县| 江西省| 义马市| 沅陵县| 普兰店市| 抚远县| 夏河县| 乐昌市|