Skip to content

Stop using Stellar.default_network #87

@JakeUrban

Description

@JakeUrban

Users are currently required to set Stellar.default_network in order to submit transactions to mainnet. If users have clients for multiple different networks, they have to reset default_network before every submission.

This requirement is missed by many newcomers and can be confusing to even experienced users when they explicitly declare a client for mainnet but still have to set this attribute on the top-level module.

This design also differs from most of the SDKs (Go, Python, JavaScript, etc.). Instead, these SDK's accept the network passphrase as a parameter to the function that need it. See the JS library's TransactionBuilder, for example.

We should change the ruby implementation to accept these same parameters while maintaining backwards compatibility. This likely means the network will have to come in the form of a keyword argument. If omitted, the SDK can still use Stellar.default_network, but downstream errors due to not setting this attribute should be replaced with a suggestion to pass the network passphrase to the function or object constructor.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions