bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.86k stars 2.09k forks source link

Can bitcore-node run with bitcoin core prune mode? #2798

Open HarryMarch opened 4 years ago

HarryMarch commented 4 years ago

Due to slow sync with mainnet from block 300,000, so I decided to run btc full node in the prune mode (and I need to turn off -txindex for prune mode), deleted all synced data in bitcore database (mongo) and started bitcore again. But something weird happened to bitcore-node server. The console log is

0|bitcore | {"message":"2020-04-19 13:16:34.825 UTC | Connected to peer: 127.0.0.1:8333 | Chain: BCH | Network: mainnet","level":"info"} 0|bitcore | {"message":"2020-04-19 13:16:35.652 UTC | Not connected to peer: 127.0.0.1:8333 | Chain: BCH | Network: mainnet","level":"warn"} 0|bitcore | {"message":"2020-04-19 13:17:09.825 UTC | Connected to peer: 127.0.0.1:8333 | Chain: BCH | Network: mainnet","level":"info"} 0|bitcore | {"message":"2020-04-19 13:17:10.664 UTC | Not connected to peer: 127.0.0.1:8333 | Chain: BCH | Network: mainnet","level":"warn"} 0|bitcore | {"message":"2020-04-19 13:17:44.825 UTC | Connected to peer: 127.0.0.1:8333 | Chain: BCH | Network: mainnet","level":"info"} 0|bitcore | {"message":"2020-04-19 13:17:45.679 UTC | Not connected to peer: 127.0.0.1:8333 | Chain: BCH | Network: mainnet","level":"warn"}

And there was no synced data at all. So Can I run bitcore-node with prune mode?

maektwain commented 4 years ago

Could you run verify:db it seems like you have to restart the sync, I have been running node on pruning and it works pretty well.

If that doesn't work try sync:db

micahriggan commented 4 years ago

Try deleting the state entry in db.collections.state.

maektwain commented 4 years ago

Yes, that is also true, try removing the state, I think it should be automatically restarted once it's gone stale.

HarryMarch commented 4 years ago

Try deleting the state entry in db.collections.state.

I deleted the entire of database, but nothing changed

uvios commented 4 years ago

I am facing same issue running prune mode ? can anyone help ?

micahriggan commented 4 years ago

We've had some recent changes to the p2p library, that could be related to the Connected, Not Connected issue. I'll check into this today

micahriggan commented 4 years ago

To answer the question about prune, bitcore-node can sync without txindex.

Our production node for api.bitcore.io is talking to a pruned btc node.

uvios commented 4 years ago

We've had some recent changes to the p2p library, that could be related to the Connected, Not Connected issue. I'll check into this today For me it was working fine with regtest but now as I am trying to connect with mainnet I am facing connect disconnect issues

shahrizalz commented 3 years ago

To answer the question about prune, bitcore-node can sync without txindex.

Our production node for api.bitcore.io is talking to a pruned btc node.

Hi, which bitcore version is it?