Всего за 349 руб. Купить полную версию
Здесь мы с помощью параметра datadir должны указать путь к рабочему каталогу, а в параметре init путь к файлу первичного блока genesis.json.
Команда выполнит инициализацию и выведет на консоль результаты своей работы:
INFO [02-13|08:43:53.934] Maximum peer count ETH=25 LES=0 total=25
INFO [02-13|08:43:53.936] Allocated cache and file handles database=/home/book/node1/geth/chaindata cache=16 handles=16
INFO [02-13|08:43:53.950] Writing custom genesis block
INFO [02-13|08:43:53.950] Persisted trie from memory database nodes=0 size=0.00B time=28.058µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [02-13|08:43:53.951] Successfully wrote genesis state database=chaindata hash=a5e5bc3f490e
INFO [02-13|08:43:53.951] Allocated cache and file handles database=/home/book/node1/geth/lightchaindata cache=16 handles=16
INFO [02-13|08:43:53.955] Writing custom genesis block
INFO [02-13|08:43:53.955] Persisted trie from memory database nodes=0 size=0.00B time=1.778µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [02-13|08:43:53.956] Successfully wrote genesis state database=lightchaindata hash=a5e5bc3f490e
Для работы с узлом вам нужно будет открыть две консоли, подключившись в каждой консоли пользователем book.
Чтобы запустить узел, выполните в первой консоли следующую команду:
$ geth etherbase "0x4f744742ac711fd111c7a983176db1d48d29f413" datadir node1 nodiscover mine minerthreads 1 maxpeers 0 verbosity 3 networkid 98760 rpc rpcapi="db,eth,net,web3,personal,web3" console
В качестве параметра etherbase нужно ввести адрес узла, полученный при первоначальном создании аккаунта.
На экране появится множество сообщений о ходе инициализации. В ходе этого процесса будет запущена генерация файла DAG. Вам нужно будет дождаться завершения процесса генерации:
INFO [02-13|08:51:16.647] Maximum peer count ETH=0 LES=0 total=0
INFO [02-13|08:51:16.649] Starting peer-to-peer node instance=Geth/v1.8.22-stable-7fa3509e/linux-amd64/go1.10.4
INFO [02-13|08:51:16.649] Allocated cache and file handles database=/home/book/node1/geth/chaindata cache=512 handles=524288
INFO [02-13|08:51:16.662]
Initialised chain configuration config="{ChainID: 1999 Homestead: 0 DAO: DAOSupport: false EIP150: EIP155: 0 EIP158: 0 Byzantium: Constantinople: ConstantinopleFix: Engine: unknown}"
INFO [02-13|08:51:16.663] Disk storage enabled for ethash caches dir=/home/book/node1/geth/ethash count=3
INFO [02-13|08:51:16.663] Disk storage enabled for ethash DAGs dir=/home/book/.ethash count=2
INFO [02-13|08:51:16.663] Initialising Ethereum protocol versions="[63 62]" network=98760
INFO [02-13|08:51:16.724] Loaded most recent local header number=0 hash=a5e5bc3f490e td=10 age=49y10mo16h
INFO [02-13|08:51:16.724] Loaded most recent local full block number=0 hash=a5e5bc3f490e td=10 age=49y10mo16h
INFO [02-13|08:51:16.724] Loaded most recent local fast block number=0 hash=a5e5bc3f490e td=10 age=49y10mo16h
INFO [02-13|08:51:16.724] Loaded local transaction journal transactions=0 dropped=0
INFO [02-13|08:51:16.725] Regenerated local transaction journal transactions=0 accounts=0
INFO [02-13|08:51:16.732] New local node record seq=3 id=eae4aa1f2059eed4 ip=127.0.0.1 udp=0 tcp=30303
INFO [02-13|08:51:16.732] Started P2P networking self="enode://5ac26687728e3e3f4575e5e8feab33748bbc467951e1841b2063cc201dcb6ed4e9b9e26ca322fc935cc5b6b042ebbb6126f5bd7d6cf6903c1e19600cf7f6c8b5@127.0.0.1:30303?discport=0"
INFO [02-13|08:51:16.732] IPC endpoint opened url=/home/book/node1/geth.ipc
INFO [02-13|08:51:16.733] HTTP endpoint opened url=http://127.0.0.1:8545 cors= vhosts=localhost
INFO [02-13|08:51:16.733] Transaction pool price threshold updated price=1000000000
INFO [02-13|08:51:16.733] Updated mining threads threads=1
INFO [02-13|08:51:16.733] Transaction pool price threshold updated price=1000000000
INFO [02-13|08:51:16.734] Commit new mining work number=1 sealhash=5c4116c8c1bf uncles=0 txs=0 gas=0 fees=0 elapsed=562.141µs
INFO [02-13|08:51:16.779] Mapped network port proto=tcp extport=30303 intport=30303 interface=NAT-PMP(192.168.0.1)
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.22-stable-7fa3509e/linux-amd64/go1.10.4
coinbase: 0x4f744742ac711fd111c7a983176db1d48d29f413
at block: 0 (Wed, 31 Dec 1969 16:00:00 PST)
datadir: /home/book/node1
modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> INFO [02-13|08:51:18.459] Generating DAG in progress epoch=0 percentage=0 elapsed=983.779ms
INFO [02-13|08:51:19.420] Generating DAG in progress epoch=0 percentage=1 elapsed=1.944s
INFO [02-13|08:51:20.395] Generating DAG in progress epoch=0 percentage=2 elapsed=2.919s