Configuration

The pypeerplays library comes with its own local configuration database that stores information like

  • API node URL
  • default account name
  • the encrypted master password

and potentially more.

You can access those variables like a regular dictionary by using

from peerplays import PeerPlays
peerplays = PeerPlays()
print(peerplays.config.items())

Keys can be added and changed like they are for regular dictionaries.

If you don’t want to load the peerplays.PeerPlays class, you can load the configuration directly by using:

from peerplays.storage import configStorage as config

API

class peerplays.storage.Configuration

This is the configuration storage that stores key/value pairs in the config table of the SQLite3 database.

checkBackup()

Backup the SQL database every 7 days

config_defaults = {'rpcuser': '', 'node': 'wss://peerplays-dev.blocktrades.info/ws', 'rpcpassword': ''}

Default configuration

create_table()

Create the new table in the SQLite database

delete(key)

Delete a key from the configuration store

exists_table()

Check if the database table exists

get(key, default=None)

Return the key if exists or a default value