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

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.

主站蜘蛛池模板: 徐闻县| 桐乡市| 东海县| 吉木萨尔县| 舒城县| 嘉黎县| 罗定市| 六枝特区| 遂宁市| 永吉县| 盘锦市| 湖口县| 元氏县| 云南省| 苍溪县| 贵州省| 阜阳市| 新沂市| 交口县| 镇远县| 修水县| 漳浦县| 获嘉县| 绥芬河市| 平昌县| 景谷| 苗栗县| 天水市| 宜宾市| 科技| 郓城县| 大邑县| 吉水县| 清镇市| 姜堰市| 吴旗县| 安乡县| 平乐县| 平定县| 分宜县| 泰州市|