Blockchain

RPC 呼叫在 testnet 模式下失敗,但不是正常模式?

  • April 5, 2014

我在 debian web 伺服器上執行 bitcoind。如果我在正常模式下執行,即“bitcoind -daemon”,那麼它似乎工作得很好。

[birdseye]$ ./bitcoind -daemon
Bitcoin server starting
[birdseye]$ ./bitcoind getinfo
{
   "version" : 80600,
   "protocolversion" : 70001,
   "walletversion" : 60000,
   "balance" : 0.00000000,
   "blocks" : 184222,
   "timeoffset" : 0,
   "connections" : 1,
   "proxy" : "",
   "difficulty" : 1583177.84744401,
   "testnet" : false,
   "keypoololdest" : 1396494743,
   "keypoolsize" : 101,
   "paytxfee" : 0.00000000,
   "errors" : ""
}
[birdseye]$

但是如果我用“-testnet”(我需要)執行它,它會啟動……但沒有回應。曾經。

[birdseye]$ ./bitcoind -daemon -testnet
Bitcoin server starting
[birdseye]$ ./bitcoind getinfo
error: couldn't connect to server
[birdseye]$ ./bitcoind stop
error: couldn't connect to server
[birdseye]$ ./bitcoind help
error: couldn't connect to server
[birdseye]$

我有點不知所措。這裡發生了什麼?

更新1:

最近的 .bitcoin/debug.log

2014-04-03 16:57:36 getblocks 101541 to 000000000001ac70cc5a1d15886a46f56f45b9c58b7f1a01e83b9f29e11fc3ae limit 500
2014-04-03 16:57:36   getblocks stopping at 101589 000000000001ac70cc5a1d15886a46f56f45b9c58b7f1a01e83b9f29e11fc3ae
2014-04-03 16:57:36 received block 000000000000043ad22dd84318ca2671e5b6046746056b6e87e231b725147a34
2014-04-03 16:57:36 SetBestChain: new best=000000000000043ad22dd84318ca2671e5b6046746056b6e87e231b725147a34  height=184882  log2_work=68.274512  tx=4195579  date=2012-06-16 23:53:21 progress=0.044423
2014-04-03 16:57:36 ProcessBlock: ACCEPTED
2014-04-03 16:57:36 stored orphan tx f90973582dbd0843532d9f633fd9dfbd55415206e901e889d9cfa1a515ea075c (mapsz 44)
2014-04-03 16:57:36 getblocks 101541 to 00000000000161cdee61f93a1273ed30430a8dc291b39cff7b141a6e795732a6 limit 500
2014-04-03 16:57:36   getblocks stopping at 101596 00000000000161cdee61f93a1273ed30430a8dc291b39cff7b141a6e795732a6
2014-04-03 16:57:36 received block 00000000000005206a91cb78e77786950eef356915fdfd65846c1bbdb95cc3c1
2014-04-03 16:57:36 SetBestChain: new best=00000000000005206a91cb78e77786950eef356915fdfd65846c1bbdb95cc3c1  height=184883  log2_work=68.274539  tx=4195806  date=2012-06-17 00:00:59 progress=0.044426
2014-04-03 16:57:36 ProcessBlock: ACCEPTED
2014-04-03 16:57:36 getblocks 101541 to 000000000002d1c84a22fc060a77ab23e639901ba88799ba6967681e8963de58 limit 500
2014-04-03 16:57:36   getblocks stopping at 101599 000000000002d1c84a22fc060a77ab23e639901ba88799ba6967681e8963de58
2014-04-03 16:57:36 received block 000000000000065eac0093fce961495df4af73a9c8dd5b85dbfe800fc76ef135
2014-04-03 16:57:36 SetBestChain: new best=000000000000065eac0093fce961495df4af73a9c8dd5b85dbfe800fc76ef135  height=184884  log2_work=68.274567  tx=4196263  date=2012-06-17 00:25:44 progress=0.044431
2014-04-03 16:57:36 ProcessBlock: ACCEPTED

最近的 .bitcoin/testnet3/debug.log

2014-04-03 16:55:22 SetBestChain: new best=000000004360c981d6d3d03d1958387603756a8e81525f0fff3abdc07e4c3020  height=205584  log2_work=58.170804  tx=1261027  date=2014-03-20 13:43:14 progress=0.996614
2014-04-03 16:55:22 SetBestChain: new best=00000000233a20dac8d9d2bc567cd0310c131d6c0e30f0303852bcc7acad94cf  height=205585  log2_work=58.170804  tx=1261032  date=2014-03-20 14:03:28 progress=0.996617
2014-04-03 16:55:23 SetBestChain: new best=00000000c7e3c0ec5c9754255a5ef8fff30012cb9b41393515a2cb1582d5c563  height=205586  log2_work=58.170804  tx=1261082  date=2014-03-20 14:24:16 progress=0.996621
2014-04-03 16:55:25 SetBestChain: new best=00000000c004c6a0df7518bc7ed9e40c64dee5fd5a8368b5105c357504fbf04c  height=205587  log2_work=58.170804  tx=1261175  date=2014-03-20 14:44:43 progress=0.996625
2014-04-03 16:55:25 SetBestChain: new best=000000000003288e241b9a9728a7dd9944a24e8df7b7521a15254e0a46fb9bd7  height=205588  log2_work=58.170856  tx=1261207  date=2014-03-20 14:37:50 progress=0.996623
2014-04-03 16:55:25 SetBestChain: new best=000000000004a9078edbc6c6634d77dad567c92264123e8c7037ff6f1a9b128f  height=205589  log2_work=58.170909  tx=1261219  date=2014-03-20 14:45:13 progress=0.996625
2014-04-03 16:55:30 SetBestChain: new best=00000000d52dff17b26e6e01e7617ce8799188560c89992bde146cb8dcf0f8b5  height=205590  log2_work=58.170909  tx=1261328  date=2014-03-20 15:05:17 progress=0.996628
2014-04-03 16:55:30 SetBestChain: new best=000000000001571e38ac949a3a81473548af9851c1244596beae02b061cfb842  height=205591  log2_work=58.170961  tx=1261343  date=2014-03-20 15:12:13 progress=0.996630

測試網只是 setbestchain,setbestchain ……一遍又一遍。Google沒有就可能導致這種情況的原因給出非常明確的答案。

更新 2: Litecoind不會出現此問題。我的 litecoin.conf 文件幾乎與我的 bitcoin.conf 相同,除了 litecoin 包含這些行。

daemon=1
server=1
gen=0

更新 3:我刪除了整個“testnet3”目錄並重新執行 ./bitcoind -testnet -daemon。它執行良好並響應 RPC 呼叫,直到它將塊下載到比它之前掛起的點大約 10mb 的點……然後它再次停止響應,不久之後,停止下載塊。仍然沒有解決方案。

回答我自己的問題。顯然,在區塊鏈中,守護程序開始佔用處理器空間,伺服器的資源看門狗立即將其殺死。開始它

nice --20 ./bitcoind -daemon -testnet

似乎或多或少使整個問題消失了。

我現在覺得有點傻。

連接到守護程序時,您還需要使用 -testnet。嘗試

./bitcoind -testnet getinfo

引用自:https://bitcoin.stackexchange.com/questions/24279