Skip to content

v2.3.0 - Overhaul multi-network support + beem config

Latest
Compare
Choose a tag to compare
@Someguy123 Someguy123 released this 24 Nov 05:50
· 1 commit to master since this release

Overhauled multi-network support + more flexibility with configuring beem

from privex.steemengine import SteemEngineToken

# You may now specify RPC nodes in the constructor
# Just make sure you specify the correct network too, or various methods will raise the WrongNetwork exception.
st = SteemEngineToken(nodes=["https://hived.privex.io"], network="hive")

# You can also now use set_beem to replace the Beem instance with one that uses a different set of nodes
st.set_beem(["https://anyx.io", "https://hived.hive-engine.com"])

# Or you can specify your own instance by setting .steem
from beem.hive import Hive
st.steem = Hive("https://hived.privex.io")

# You can also change the network for an existing instance on-the-fly
# The Beem instance will be automatically switched to the Steem network instance
st.network = "steem"
  • Use of a Beem shared instance can now be enabled or disabled using SteemEngineToken.use_shared_instances

  • The default nodes used for each network when creating a Beem instance are now user configurable via SteemEngineToken.default_nodes

  • The SteemEngineToken.steem property now has a setter, allowing the user to override the Beem instance naturally, just by setting .steem

  • The constructor now accepts a nodes argument, allowing overriding the nodes used by Beem during construction

  • Added verify_network method, which raises WrongNetwork if the network of the current RPC node doesn't match the network set in the constructor or via .network

  • Added .set_beem method, for easier overriding of the Beem instances

  • Re-wrote custom_beem since ._steem is no longer used

  • Added return and parameter types to various beem-related methods

  • Refactored tests into tests/ folder for easier usage with PyTest

  • Adjustments to .travis.yml and pytest.ini

  • Probably some other small changes