beem.storage module¶
-
class
beem.storage.
Configuration
¶ Bases:
beem.storage.DataDir
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
= {'node': ['wss://steemd.pevo.science', 'wss://gtg.steem.house:8090', 'wss://rpc.steemliberator.com', 'wss://rpc.buildteam.io', 'wss://rpc.steemviz.com', 'wss://seed.bitcoiner.me', 'wss://steemd.steemgigs.org', 'wss://steemd.minnowsupportproject.org'], 'order-expiration': 604800, 'rpcpassword': '', 'rpcuser': ''}¶
-
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
-
items
()¶
-
nodes
= ['wss://steemd.pevo.science', 'wss://gtg.steem.house:8090', 'wss://rpc.steemliberator.com', 'wss://rpc.buildteam.io', 'wss://rpc.steemviz.com', 'wss://seed.bitcoiner.me', 'wss://steemd.steemgigs.org', 'wss://steemd.minnowsupportproject.org']¶ Default configuration
-
-
class
beem.storage.
DataDir
¶ Bases:
object
This class ensures that the user’s data is stored in its OS preotected user directory:
OSX:
- ~/Library/Application Support/<AppName>
Windows:
- C:Documents and Settings<User>Application DataLocal Settings<AppAuthor><AppName>
- C:Documents and Settings<User>Application Data<AppAuthor><AppName>
Linux:
- ~/.local/share/<AppName>
Furthermore, it offers an interface to generated backups in the backups/ directory every now and then.
-
appname
= 'beem'¶
-
clean_data
()¶ Delete files older than 70 days
-
data_dir
= '/home/docs/.local/share/beem'¶
-
mkdir_p
()¶ Ensure that the directory in which the data is stored exists
-
refreshBackup
()¶ Make a new backup
-
sqlDataBaseFile
= '/home/docs/.local/share/beem/beem.sqlite'¶
-
sqlite3_backup
(dbfile, backupdir)¶ Create timestamped database copy
-
storageDatabase
= 'beem.sqlite'¶
-
class
beem.storage.
Key
¶ Bases:
beem.storage.DataDir
This is the key storage that stores the public key and the (possibly encrypted) private key in the keys table in the SQLite3 database.
-
add
(wif, pub)¶ - Add a new public/private key pair (correspondence has to be
- checked elsewhere!)
Parameters: - pub (str) – Public key
- wif (str) – Private key
-
create_table
()¶ Create the new table in the SQLite database
-
delete
(pub)¶ Delete the key identified as pub
Parameters: pub (str) – Public key
-
exists_table
()¶ Check if the database table exists
-
getPrivateKeyForPublicKey
(pub)¶ - Returns the (possibly encrypted) private key that
- corresponds to a public key
Parameters: pub (str) – Public key The encryption scheme is BIP38
-
getPublicKeys
()¶ Returns the public keys stored in the database
-
updateWif
(pub, wif)¶ Change the wif to a pubkey
Parameters: - pub (str) – Public key
- wif (str) – Private key
-
-
class
beem.storage.
MasterPassword
(password)¶ Bases:
object
The keys are encrypted with a Masterpassword that is stored in the configurationStore. It has a checksum to verify correctness of the password
-
changePassword
(newpassword)¶ Change the password
-
config_key
= 'encrypted_master_password'¶ This key identifies the encrypted master password stored in the confiration
-
decryptEncryptedMaster
()¶ Decrypt the encrypted masterpassword
-
decrypted_master
= ''¶
-
deriveChecksum
(s)¶ Derive the checksum
-
getEncryptedMaster
()¶ Obtain the encrypted masterkey
-
newMaster
()¶ Generate a new random masterpassword
-
password
= ''¶
-
purge
()¶ Remove the masterpassword from the configuration store
-
saveEncrytpedMaster
()¶ Store the encrypted master password in the configuration store
-