rn-ldk icon indicating copy to clipboard operation
rn-ldk copied to clipboard

how to make rn-ldk run in Testnet

Open sgiammy opened this issue 3 years ago • 2 comments

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.

sgiammy avatar Dec 15 '21 14:12 sgiammy

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)

Overtorment avatar Dec 15 '21 17:12 Overtorment

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.

amitrana22 avatar May 27 '22 10:05 amitrana22