如果每次都向某個節點同步區塊,可以手動的添加為靜態節點,這樣可以大大的提高同步效率
這里套用一下https://blog.csdn.net/weixin_40903789/article/details/79619646的私鏈,感謝,我就不用再創建虛擬機了做靜態節點了
作用默認大家已經安裝好了mist,下載地址,它是一個集web3和錢包的工具,默認也會有geth的安裝,當然也可以使用上述地址geth的安裝方法
創世的文件來一個,必須套用別人的,地址
下載完成后,為了方便我把它放在了geth的同級目錄下,然后輸入以下命令
C:\Users\Administrator\AppData\Roaming\Mist\binaries\Geth\unpacked>geth.exe --datadir "d:\geth" init genesis.json
然后果斷的使用選擇網絡后果斷的進入控制台
C:\Users\Administrator\AppData\Roaming\Mist\binaries\Geth\unpacked>geth --datadir "d:\geth" --networkid 72 --nodiscover console
再然后添加別人提供的私鏈
admin.addPeer("enode://f1030923b597e47148e6824756aa2d43039cae0da4db20f23e60fe819d526401999008452f4946f7418bbe3edc00c6afeb9c6767e7e91eb4c3ccede90aa996ac@193.112.92.214:30303")
添加一個用戶設置密碼為123456
personal.newAccount("123456")
開始挖礦,先啟一下線程做個樣子
miner.start(1)
通過miner.stop()停止挖礦后進入錢包,進入錢包的時候一定要datadir
D:\Ethereum-Wallet-win64-0-11-1>"Ethereum Wallet.exe" --datadir "d:\geth"
然后就能看到剛剛的成果了,雖然是假的,但還是很開心吶