BlueWallet / rn-ldk

Lightweight lightning node for React Native
MIT License
136 stars 25 forks source link

how to make rn-ldk run in Testnet #38

Open sgiammy opened 2 years ago

sgiammy commented 2 years ago

I'd like to run the iOS example on testnet instead of mainnet.

Even after changing the network parameter in the ChannelManagerConstructor from LDKNetwork_Bitcoin to LDKNetwork_Testnet here, after clicking openChannelStep1, the generated address to fund is still a bitcoin one.

From my understanding the address is generated by the lightning dev kit binaries, so I was wondering what else should I do to make it generate a Testnet address.

Overtorment commented 2 years ago

as seen here https://github.com/BlueWallet/rn-ldk/blob/aefb83eabf6704fb4662199a1a49aff4b499abbb/src/index.tsx#L389 result of channel opening is bitcoin script, not address. Script is then turned into address via simple lambda function on server ( https://github.com/BlueWallet/rn-ldk/blob/aefb83eabf6704fb4662199a1a49aff4b499abbb/src/index.tsx#L242 ), but you can override that behaviour by injecting your own implementation (see provideScript2addressFunc)

amitrana22 commented 2 years ago

I'd like to run the iOS example on testnet instead of mainnet.

Even after changing the network parameter in the ChannelManagerConstructor from LDKNetwork_Bitcoin to LDKNetwork_Testnet here, after clicking openChannelStep1, the generated address to fund is still a bitcoin one.

From my understanding the address is generated by the lightning dev kit binaries, so I was wondering what else should I do to make it generate a Testnet address.

please help if you got solution for it.