-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting up with BCH #578
Comments
Its quite easy
But there is a problem with bitcore-lib which come pre-installed(the network properties belongs to bitcoin) , either you can change that before installing bitcore by switching to cash branch.(to be clear bitcore-lib is this https://github.com/bitpay/bitcore-lib/blob/master/lib/networks.js) Now once everything is done. Fire up. It will work |
@maektwain what version of insight-api are you using with that config ^^^ ? |
Been trying to get this working for a couple days now - just tried the strategy above, no luck. it runs and connects to the bitcoin-abc node but i get "Invalid address" when i try to request data for a bitcoin cash address. Is there something else that needs to happen? |
@phewitt @dviramontes did either of you get this working? |
@dviramontes I am using the latest clone from the git.
This is how I did it.
Remove your existing AddressTranslator.translate function to this
|
You can add usecashaddr=0 to bitcoin.conf to use legacy addresses. |
@maektwain can you tell me how to Setting up with bitcoin cash node , i can't find node_modules/insight-api/lib/addresstranslator.js |
@maektwain "But there is a problem with bitcore-lib which come pre-installed(the network properties belongs to bitcoin) , either you can change that before installing bitcore by switching to cash branch" |
I was able to get it to work with [email protected] and adding usecashaddr=0 to my bitcoin.conf. I used this bitcoin cash node https://api.github.com/repos/bitprim/bitcoin-abc/tarball/tag0.17.1-bitcore. Hope that helps! Basically. |
Does this branch work? or I have to do all the above? |
@phewitt Thanks a bunch for your steps -- I pretty much did the exact same thing and everything works great except I'm having trouble with specific insight-api methods like
I can't seem to find anywhere the ability to change this config. |
@psiofxt Could you make like a very simple step by step guide to achieve this? Also.. How big is the blockchain size in GB once synced? Thanks! |
@joadr Absolutely. I'll type something up either tonight or tomorrow. I'm also planning on writing an even more detailed blog post/guide next week on setting up bitcore with litecoin/bitcoin/bitcoin cash all on the same server -- I'll post it here. Currently I'm only testing with BCH testnet so it's a mere 13GB. edit: To clarify, this is with the |
@psiofxt if you just place it in your specified "datadir" it will not overwrite if one already exists. So, what I did is make my own place it where I specify my "datadir" directory and then fire up the node. Same goes for the bitcore-node.config just make your own place it where in the bitcore-node project directory and it should use it. Hope this helps |
Place your "bitcore-node.json" file in your Mynode directory or whatever you named the local node you ran bitcore-node create on. here is my config for reference.
and just point datadir where you want to store chaindata and have your bitcoin.conf and point exec at the bitcoin-abc binary. I think we may have made a softlink called bitcoind instead of point directly at bitcoin-abc either way that's how I did it! Also, I setup litecoin aswell and it is a little more involved. You can't use bitpays default repos you have to modify them. I used this fork https://github.com/litecoin-project/litecore-node. Hope it helps. |
@phewitt Hmm, I believe I'm doing that except I renamed all of the Bitcoin-ABC files to It definitely runs just fine and syncs up with the BCH testnet chain, insight is just producing strange results for anything that isn't
edit: Did you change any of your |
@psiofxt No I didn't have to change any of that because I am using the old cash address (aka bitcoin addresses) with the usecashaddr=0 in the .config. What are the results? I might be able to help you if I know your error messages or anything else. |
Here is my bitcoin.conf file. for the bitcoin-abc node.
|
I honestly haven't used testnet either. Not sure if or why that would cause any issues. But it is worth my pointing out. |
@phewitt Your help is immensely appreciated, thank you. I'm going to re-index my node and try again. I'll get back to you with results, but it is highly likely testnet may be causing the issues. If I do |
@phewitt Okay so method not found issues means your underlying node doesn't have the correct RPC calls. You have to download that modified version I linked above because the normal nodes do not have all the RPC methods that Insight uses. Bitpay actually forked bitcoin and added certain RPC methods that they use. I saw this issue many times and generally means that either your insight is not pointed at the correct bitcoind / bitcoin-abc that you want OR the bitcoind /bitcoin-abc you installed doesn't actually have the additional RPC methods. Here is a commit list of some of the additional RPC methods I have seen added to nodes. This is BTG however the same RPC methods are needed on whatever node you plan to use insight with. BTCGPU/BTCGPU@1c1d93d |
@phewitt Aha! You are a god, I didn't even notice it was a bitcore specific fork of bitcoin-abc. My bitcoin abc |
Hope this helps others too. I wish bitpay would have made more of an effort documenting this stuff. I understand it's a lot of extra work on their end with no real gain for them though. You should look into the bitcore V8.0.0 branch too it's really neat looking and seems like it will be fixing a lot of problems with standing up other nodes other than bitcoin. https://github.com/bitpay/bitcore/tree/v8.0.0. I've been dabbling with it and it doesn't have all the same endpoints that the older api has yet, but it seems like it is more active and a MUCH better architecture IMO. Here is a high level article on some of it's advantages. https://blog.bitpay.com/bitcore-node-v8-beta/ |
@phewitt Do you know where I could find the binary for the |
@phewitt After compiling the bitcore fork of @osagga I looked for that option as well when I was deploying, had to build the binaries myself.
|
@phewitt Thanks for sharing the link to the custom @psiofxt I have just made a guide on how to setup bitcore with BCH according the steps in this thread, you can check it out here: https://github.com/osagga/bch-bitcore-setup/blob/master/README.md, feel free to add to it or fix a mistake. Also I manged to modify the API to show BCH addresses (explained in the guide), so the setup should be complete now. |
@osagga The bitcore-abc((https://github.com/bitprim/bitcoin-abc/tree/tag0.17.1-bitcore) add some rpc metheod to default bitcore-abc (eg: https://download.bitcoinabc.org/0.17.1/linux/bitcoin-abc-0.17.1-x86_64-linux-gnu.tar.gz), it can work together withe insight-api(v0.4.3) that supporting |
@hxzqlh So for Both options work so far, it's just a design decision to chose which version. Hopefully |
@osagga I understand, as for now, there are two ways to support cash addr for bitcore-node:
as you said, you are managing to work on another insight-api( |
@hxzqlh The second way doesn't support BCH addresses by default (using insight-api v0.4.3), it can only support BTC legacy addresses. use
|
@osagga Thanks I'm using your insight-api#cash_v4. Got my node syncing now, I noticed that when I try to make a request to My bitcoin.conf
Then when trying to use the same url to look up the legacy address equivalent I get Any suggestions? |
@haydencarlson that's weird, can you post your |
@osagga Ok sounds good I'll open this there. Edit: Looks like I'm unable to open an issue there, it's not enabled.
If you re-enable it I'll repost to your fork. |
@haydencarlson issues should be open now |
I also encountered the problem that bch insight /addr could not access. Return me Method not found. Code:-32601, can you ask how this is solved? |
Hi All. I have the Bitcoin node with insight-api. And I have a problem with 556034 block, Insight-api can not download 556034 block, because it is large (32 Mb). Could anybody help me?
bitcore-node.json:
|
Hi, Bitcore v8 was able to handle 32mb blocks without any problem. The older version had a hard time handling them. You need to up the mem to 7.5GB and wait a long time (around 1hr) to process the 32GB on a regular server hardware. If possible, migrate to v8 to work for BCH. |
What do you mean by "migrate to v8 to work for BCH." ? |
We up the memory to 14 gb, but the issue still remain.. |
Hi @osagga, Is there anything that can be followed for bitcoin sv. bch-bitcore-setup guide was helpful, I was looking for something similar for bsv. I could already run the test node. However, I a stuck with insight-api integration so that I can explore programatically. Any kind of help is highly appreciated. Thanks |
I literally have looked everywhere on how to setup insight-api with bitcoin cash. I see that you guys have a cash branch on a lot of your repos, however I have no idea how these tie into getting them to work with insight-api. I also have seem many other people asking for this. Is there ANYWHERE I can find some guidance on how to at least begin setting up BCH to work with insight.
The text was updated successfully, but these errors were encountered: