beem.storage¶
-
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
= {'client_id': '', 'hot_sign_redirect_uri': None, 'node': ['wss://steemd.pevo.science', 'wss://rpc.buildteam.io', 'wss://steemd.privex.io', 'wss://rpc.steemviz.com', 'https://rpc.buildteam.io', 'wss://steemd.minnowsupportproject.org', 'https://api.steemit.com', 'https://api.steem.house', 'https://steemd.minnowsupportproject.org', 'https://rpc.steemviz.com', 'https://gtg.steem.house:8090', 'wss://gtg.steem.house:8090', 'https://steemd.privex.io', 'https://rpc.curiesteem.com', 'https://steemd.pevo.science', 'wss://appbasetest.timcliff.com', 'wss://rpc.steemliberator.com', 'https://appbasetest.timcliff.com', 'https://rpc.steemliberator.com', 'wss://steemd.steemgigs.org', 'https://steemd.steemgigs.org', 'wss://seed.bitcoiner.me', 'https://seed.bitcoiner.me'], 'oauth_base_url': 'https://v2.steemconnect.com/oauth2/', 'order-expiration': 604800, 'password_storage': 'environment', 'rpcpassword': '', 'rpcuser': '', 'sc2_api_url': 'https://v2.steemconnect.com/api/'}¶
-
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
()¶
-
nodelist
= [{'owner': 'steemit', 'type': 'appbase', 'url': 'https://api.steemit.com', 'version': '0.19.4', 'score': 100}, {'owner': 'timcliff', 'type': 'appbase', 'url': 'wss://appbasetest.timcliff.com', 'version': '0.19.4', 'score': 20}, {'owner': 'timcliff', 'type': 'appbase', 'url': 'https://appbasetest.timcliff.com', 'version': '0.19.4', 'score': 10}, {'owner': 'gtg', 'type': 'appbase', 'url': 'https://api.steem.house', 'version': '0.19.4', 'score': 90}, {'owner': 'steemit', 'type': 'appbase-dev', 'url': 'https://api.steemitdev.com', 'version': '0.19.4', 'score': 100}, {'owner': 'steemit', 'type': 'appbase-dev', 'url': 'https://api.steemitstage.com', 'version': '0.19.4', 'score': 110}, {'owner': 'ausbitbank', 'type': 'normal', 'url': 'wss://rpc.steemviz.com', 'version': '0.19.3', 'score': 125}, {'owner': 'ausbitbank', 'type': 'normal', 'url': 'https://rpc.steemviz.com', 'version': '0.19.3', 'score': 80}, {'owner': 'privex', 'type': 'normal', 'url': 'wss://steemd.privex.io', 'version': '0.19.3', 'score': 150}, {'owner': 'privex', 'type': 'normal', 'url': 'https://steemd.privex.io', 'version': '0.19.3', 'score': 50}, {'owner': 'themarkymark', 'type': 'normal', 'url': 'wss://rpc.buildteam.io', 'version': '0.19.3', 'score': 165}, {'owner': 'themarkymark', 'type': 'normal', 'url': 'https://rpc.buildteam.io', 'version': '0.19.3', 'score': 120}, {'owner': 'gtg', 'type': 'normal', 'url': 'wss://gtg.steem.house:8090', 'version': '0.19.3', 'score': 75}, {'owner': 'gtg', 'type': 'normal', 'url': 'https://gtg.steem.house:8090', 'version': '0.19.3', 'score': 80}, {'owner': 'pharesim', 'type': 'normal', 'url': 'wss://steemd.pevo.science', 'version': '0.19.3', 'score': 170}, {'owner': 'pharesim', 'type': 'normal', 'url': 'https://steemd.pevo.science', 'version': '0.19.3', 'score': 30}, {'owner': 'netuoso', 'type': 'normal', 'url': 'wss://rpc.steemliberator.com', 'version': '0.19.3', 'score': 20}, {'owner': 'netuoso', 'type': 'normal', 'url': 'https://rpc.steemliberator.com', 'version': '0.19.3', 'score': 10}, {'owner': 'bitcoiner', 'type': 'normal', 'url': 'wss://seed.bitcoiner.me', 'version': '0.19.3', 'score': 1}, {'owner': 'bitcoiner', 'type': 'normal', 'url': 'https://seed.bitcoiner.me', 'version': '0.19.3', 'score': 1}, {'owner': 'steemgigs', 'type': 'normal', 'url': 'wss://steemd.steemgigs.org', 'version': '0.19.3', 'score': 10}, {'owner': 'steemgigs', 'type': 'normal', 'url': 'https://steemd.steemgigs.org', 'version': '0.19.3', 'score': 10}, {'owner': 'followbtcnews', 'type': 'normal', 'url': 'wss://steemd.minnowsupportproject.org', 'version': '0.19.3', 'score': 120}, {'owner': 'followbtcnews', 'type': 'normal', 'url': 'https://steemd.minnowsupportproject.org', 'version': '0.19.3', 'score': 90}, {'owner': 'curie', 'type': 'normal', 'url': 'https://rpc.curiesteem.com', 'version': '0.19.3', 'score': 50}, {'owner': 'almost-digital', 'type': 'testnet', 'url': 'wss://testnet.steem.vc', 'version': '0.19.2', 'score': 20}, {'owner': 'almost-digital', 'type': 'testnet', 'url': 'ws://testnet.steem.vc', 'version': '0.19.2', 'score': 5}, {'owner': 'almost-digital', 'type': 'testnet', 'url': 'https://testnet.steem.vc', 'version': '0.19.2', 'score': 10}, {'owner': 'almost-digital', 'type': 'testnet', 'url': 'http://testnet.steem.vc', 'version': '0.19.2', 'score': 5}]¶ Default configuration
-
nodes
= ['wss://steemd.pevo.science', 'wss://rpc.buildteam.io', 'wss://steemd.privex.io', 'wss://rpc.steemviz.com', 'https://rpc.buildteam.io', 'wss://steemd.minnowsupportproject.org', 'https://api.steemit.com', 'https://api.steem.house', 'https://steemd.minnowsupportproject.org', 'https://rpc.steemviz.com', 'https://gtg.steem.house:8090', 'wss://gtg.steem.house:8090', 'https://steemd.privex.io', 'https://rpc.curiesteem.com', 'https://steemd.pevo.science', 'wss://appbasetest.timcliff.com', 'wss://rpc.steemliberator.com', 'https://appbasetest.timcliff.com', 'https://rpc.steemliberator.com', 'wss://steemd.steemgigs.org', 'https://steemd.steemgigs.org', 'wss://seed.bitcoiner.me', 'https://seed.bitcoiner.me']¶
-
-
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
-
recover_with_latest_backup
(backupdir='backups')¶ Replace database with latest backup
-
refreshBackup
()¶ Make a new backup
-
sqlDataBaseFile
= '/home/docs/.local/share/beem/beem.sqlite'¶
-
sqlite3_backup
(backupdir)¶ Create timestamped database copy
-
sqlite3_copy
(src, dst)¶ Copy sql file from src to dst
-
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
-
wipe
(sure=False)¶ Purge the entire wallet. No keys will survive this!
-
-
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
= ''¶
-
saveEncrytpedMaster
()¶ Store the encrypted master password in the configuration store
-
static
wipe
(sure=False)¶ Remove all keys from configStorage
-
-
class
beem.storage.
Token
¶ Bases:
beem.storage.DataDir
This is the token storage that stores the public username and the (possibly encrypted) token in the token table in the SQLite3 database.
-
add
(name, token)¶ - Add a new public/private token pair (correspondence has to be
- checked elsewhere!)
Parameters: - name (str) – Public name
- token (str) – Private token
-
create_table
()¶ Create the new table in the SQLite database
-
delete
(name)¶ Delete the key identified as name
Parameters: name (str) – Public name
-
exists_table
()¶ Check if the database table exists
-
getPublicNames
()¶ Returns the public names stored in the database
-
getTokenForPublicName
(name)¶ - Returns the (possibly encrypted) private token that
- corresponds to a public name
Parameters: pub (str) – Public name The encryption scheme is BIP38
-
updateToken
(name, token)¶ Change the token to a name
Parameters: - name (str) – Public name
- token (str) – Private token
-
wipe
(sure=False)¶ Purge the entire wallet. No keys will survive this!
-