peerplays.instance module

class peerplays.instance.BlockchainInstance(*args, **kwargs)

Bases: object

This is a class that allows compatibility with previous naming conventions

chain

Short form for blockchain (for the lazy)

peerplays

Alias for the specific blockchain

class peerplays.instance.SharedInstance

Bases: object

This class merely offers a singelton for the Blockchain Instance

config = {}
instance = None
peerplays.instance.clear_cache()

Clear Caches

peerplays.instance.set_shared_blockchain_instance(peerplays_instance)

This method allows us to override default peerplays instance for all users of SharedInstance.instance.

Parameters:peerplays_instance (peerplays.Peerplays) – Peerplays instance
peerplays.instance.set_shared_config(config)

This allows to set a config that will be used when calling shared_peerplays_instance and allows to define the configuration without requiring to actually create an instance

peerplays.instance.set_shared_peerplays_instance(peerplays_instance)

This method allows us to override default peerplays instance for all users of SharedInstance.instance.

Parameters:peerplays_instance (peerplays.Peerplays) – Peerplays instance
peerplays.instance.shared_blockchain_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default peerplays instance that can be reused by multiple classes.

peerplays.instance.shared_peerplays_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default peerplays instance that can be reused by multiple classes.