![](/img/trans.png)
[英]Connect with javascript to remote geth node with HTTP authentication enabled
[英]Geth light node does not sync
我想用geth console
檢查錢包的余額。 因此我確實試圖在光模式下使用geth。 但是當我使用時:
geth console --syncmode light
它被卡在0號塊,它不會開始同步。 以下是一些結果:
web3.eth.syncing
- false
eth.blockNumber
- 0
我使用的版本是: 1.7.3
任何人都知道如何強迫它開始同步?
這是我得到的輸出:
WARN [12-01|12:02:28] No etherbase set and no accounts found as default
INFO [12-01|12:02:28] Starting peer-to-peer node instance=Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9
INFO [12-01|12:02:28] Allocated cache and file handles database=/root/.ethereum/geth/lightchaindata cache=128 handles=1024
INFO [12-01|12:02:28] Writing default main-net genesis block
INFO [12-01|12:02:29] Initialised chain configuration config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Engine: ethash}"
INFO [12-01|12:02:29] Disk storage enabled for ethash caches dir=/root/.ethereum/geth/ethash count=3
INFO [12-01|12:02:29] Disk storage enabled for ethash DAGs dir=/root/.ethash count=2
INFO [12-01|12:02:29] Added trusted checkpoint chain name="ETH mainnet"
INFO [12-01|12:02:29] Loaded most recent local header number=0 hash=d4e567…cb8fa3 td=17179869184
INFO [12-01|12:02:29] Starting P2P networking
INFO [12-01|12:02:31] UDP listener up self=enode://56ff89f879fea8caee295e2e60086b5b1d4e56e0a6135a351f35a092cfdbbc9b7c32261396e0be61998b773ba565e8ef05ed1d3cc1ac7e479ebbccefac754b65@[::]:30303
WARN [12-01|12:02:31] Light client mode is an experimental feature
INFO [12-01|12:02:31] RLPx listener up self=enode://56ff89f879fea8caee295e2e60086b5b1d4e56e0a6135a351f35a092cfdbbc9b7c32261396e0be61998b773ba565e8ef05ed1d3cc1ac7e479ebbccefac754b65@[::]:30303
INFO [12-01|12:02:31] IPC endpoint opened: /root/.ethereum/geth.ipc
提前致謝!
問題是Geth完整節點默認不提供輕型對等體。 這導致輕客戶端找不到任何對等方。
現在,我有兩個想法如何解決這個問題。 你可能不會兩個都喜歡:P
如果您可以訪問任何Geth完整節點,請使用--lightserv 90
運行它,這將為90%的節點帶寬提供服務。 現在嘗試使用admin.addPeer()
將light客戶端硬連接到整個節點。 顯然,如果您無法訪問完整節點,則無法選擇此選項。
如果你不依賴於Geth,你可以嘗試Parity ,它也有一個輕客戶端實現,也不是超級穩定,但Parity客戶端默認服務器輕客戶端。 只需嘗試使用parity --light
,看看你是否可以從同行那里獲取最新的標題。
披露:我為Parity工作。
您需要等待最多10分鍾才能從輕節點開始接收來自完整節點的更新,我也有這個問題; 大約需要5分鍾才能顯示日志。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.