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

[V0.12] Support for mainnet wallet initialization in RGB v0.12 #289

Open
will-bitlightlabs opened this issue Feb 28, 2025 · 2 comments
Open

Comments

@will-bitlightlabs
Copy link

Description

While implementing tests for RGB v0.12, I noticed that the current implementation doesn't support initialization of mainnet wallets.

The current API appears to only provide testnet-related functionality. I understand this might be intentional as part of a phased development approach, focusing on testnet stability before adding mainnet support.

Current Limitation

In the Mound structure, there's currently no public API to initialize a mainnet wallet. The only available constructors are:

  • bitcoin_testnet()
  • with_testnet(consensus, persistence)
  • open_testnet(consensus, persistence)

All of these methods set testnet: true by default, with no option to set it to false for mainnet.

Impact

This limitation affects our ability to test scenarios where assets need to be transferred between testnet and mainnet wallets. For example, in our test case mainnet_wlt_receiving_test_asset, we're trying to test sending assets from a testnet wallet to a mainnet wallet:

#[test]
#[ignore = "fix needed"]
fn mainnet_wlt_receiving_test_asset() {
    initialize();

    let mut wlt_1 = get_wallet(&DescriptorType::Wpkh);
    // FIXME: Because the latest `Mound` structure in rgb does not support setting the mainnet,
    // The default `Mound.testnet` is eq true, which cannot correctly initialize the mainnet wallet,
    // So this test case cannot be executed temporarily
    let mut wlt_2 = get_mainnet_wallet();
    
    // Test implementation...
}

Proposed Solution

We could submit a PR to add the necessary API for initializing mainnet wallets, which would enable us to properly test these scenarios. However, we'd like to know whether it's better to submit these PRs now or wait until the overall API becomes more stable?

@bitlightlabs-dev
Copy link
Contributor

Not urgent for Mainnet support now - let's focus on Regtest/Testnet3/Testnet4 env first.

@dr-orlovsky
Copy link
Member

Yes, the idea is to support mainnet only when we have a fully tested and production-ready version

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