xrpl-py icon indicating copy to clipboard operation
xrpl-py copied to clipboard

Use Network ID to determine the correct faucet to use

Open mvadari opened this issue 1 year ago • 2 comments

Code reference: https://github.com/XRPLF/xrpl-py/blob/main/xrpl/asyncio/wallet/wallet_generation.py

Currently, the faucet generation code guesses the correct faucet to use based on substrings in the URL. This isn't a very robust system. It would be better (and more robust) to use the Network ID.

mvadari avatar May 30 '24 17:05 mvadari

If a transaction includes the NetworkID field, then it fails on mainnet, testnet, devnet (any network whose network_id < 1025). Docs: https://xrpl.org/docs/references/protocol/transactions/common-fields/#networkid-field image

How can we disambiguate between these networks with the network_id field?

ckeshava avatar Jun 11 '24 22:06 ckeshava

If a transaction includes the NetworkID field, then it fails on mainnet, testnet, devnet (any network whose network_id < 1025). How can we disambiguate between these networks with the network_id field?

All networks have a network ID, that's how you determine whether or not the NetworkID field needs to be included in the transaction. It's available in server_info.

mvadari avatar Jun 12 '24 05:06 mvadari