Skip to content
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

Fix issue with LndHub & Polar which runs regtest instances #379

Open
bilthon opened this issue Feb 21, 2022 · 3 comments
Open

Fix issue with LndHub & Polar which runs regtest instances #379

bilthon opened this issue Feb 21, 2022 · 3 comments

Comments

@bilthon
Copy link

bilthon commented Feb 21, 2022

I'm experimenting with LndHub and a regtest bitcoin & lightning network powered by polar.

Regtest addresses it turns out have different prefix than testnet (bcrt), this causes the balance presented by LndHub to be always zero when no bitcoin core node is specified.

This happens because decodeRawTx takes only mainnet as default parameter.

I'd propose being able to set the network type in the configuration file as well in order to facilitate development on regtest and testnet. This might solve/respond issue #369 as well.

@ChayanonSaelee
Copy link

that means I must edit in class User.js from const decodedTx = decodeRawHex(tx.raw_tx_hex); to
const decodedTx = decodeRawHex(tx.raw_tx_hex, config.network); and in config.js add
const bitcoin = require('bitcoinjs-lib')
network: bitcoin.networks.testnet and change .bitcoin to .testnet ?

but I tried it not working it still show 0 balance.

I want to show balance in testnet and use balance in testnet for testing pay invoice form starblock website.

@bilthon
Copy link
Author

bilthon commented Feb 21, 2022

Bear in mind that you should also remove bitcoin core from the config file, as _getChainTransactions is only called if there's no bitcoind field in config.

@zzzhan
Copy link

zzzhan commented Aug 19, 2022

I propose the lightning info need to pass to the class User.js, then get the network type from it and pass to the decodeRawHex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants