The coinexplorer (webserver)¶
-
class
coinexplorer.CoinExplorer¶ Main webpage
-
block(n=None)¶ show info about a block (by n) EXPOSED
-
blockchain()¶ show whole blockchain EXPOSED
-
blockhash(h=None)¶ show info about a block (by hash)
-
blsubmit()¶ to submit a new block
-
erasepending(passwd)¶ For instructor use only (password protected)
Erase the list of pending transactions. Use only in case there are any problematic transactions in the list of transactions!
See
coinexplorer.check_password()for info on how to set the password
-
lastblock(obj=False)¶ get last block
-
pending(obj=False)¶ show pending transaction list
-
pubkey(N=None, e=None)¶ show info about a public key
-
readonly(passwd, enabled)¶ For instructor use only (password protected)
Allows to temporarily disable posting of any new transactions
See
coinexplorer.check_password()for info on how to set the password
-
setdifficulty(d, passwd)¶ For instructor use only (password protected)
Set the current difficulty.
See
coinexplorer.check_password()for info on how to set the password
-
tally()¶ show all public keys (with names if possible) and how many coins they have
-
transaction(h=None)¶ show info about a transaction (by hash)
-
txsubmit()¶ to submit a transaction
-
wallet(N=None, e=None, obj=False)¶ show wallet for public key
-
-
coinexplorer.blockpage(b, n, h)¶ page with info about a block (not exposed)
-
coinexplorer.check_password(passwd)¶ Basic authentication for accessing features that only the instructor should access (like erasing list of pending transactions or changing difficulty)
The hidden symbol _password in module
coinexploreris the md5 hash of the actual password. To change the password to something else, say for example KoalaBear you would:>>> import hashlib >>> hashlib.md5("KoalaBear").hexdigest() 'd445aa703dabaf0159ac02947793874f'
and set
_password = 'd445aa703dabaf0159ac02947793874f'in modulecoinexplorerNote that this is not a very secure way of doing things, as the password is sent in clear text and may just appear in the browsing history.
Return type: bool Returns: True if passwd matches the password
-
coinexplorer.html(o)¶ pretty print in html classes associated with a blockchain
-
coinexplorer.htmlpage(s)¶ an html page with body s