Skip to content

DAppKitProvider with custom nodeUrl does not detect genesis id #235

@ifavo

Description

@ifavo

When setting up a DAppKitProvider with react using only the nodeUrl, it will switch VeWorld to MainNet.

Example:

<DAppKitProvider
    // the network & node to connect to
    nodeUrl="https://testnet.vechain.org"
    // remember last connected address on page reload
    usePersistence={true}
>
    {children}
</DAppKitProvider>
  • Creating a transaction request within the providers context using the thor client from useConnex() will automatically switch to MainNet.
  • When the genesis is explicitly defined genesis="test", it will switch to TestNet.

My personal expected behavior is that it will automatically detect the network/genesis and use it, according to the nodeUrl.

If this is correct behavior, may I suggest to either detect the genesis id automatically using the given nodeUrl or make the genesis mandatory, to prevent confusion during setup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions