bhive.witness module¶
-
class
bhive.witness.
GetWitnesses
(name_list, batch_limit=100, lazy=False, full=True, hive_instance=None)¶ Bases:
bhive.witness.WitnessesObject
Obtain a list of witnesses
- Parameters
name_list (list) – list of witneses to fetch
batch_limit (int) – (optional) maximum number of witnesses to fetch per call, defaults to 100
hive_instance (Hive) – Hive() instance to use when accessing a RPCcreator = Witness(creator, hive_instance=self)
from bhive.witness import GetWitnesses w = GetWitnesses(["gtg", "jesta"]) print(w[0].json()) print(w[1].json())
-
class
bhive.witness.
ListWitnesses
(from_account='', limit=100, lazy=False, full=False, hive_instance=None)¶ Bases:
bhive.witness.WitnessesObject
List witnesses ranked by name
- Parameters
from_account (str) – Witness name from which the lists starts (default = “”)
limit (int) – Limits the number of shown witnesses (default = 100)
hive_instance (Hive) – Hive instance to use when accesing a RPC
>>> from bhive.witness import ListWitnesses >>> ListWitnesses(from_account="gtg", limit=100) <ListWitnesses gtg>
-
class
bhive.witness.
Witness
(owner, full=False, lazy=False, hive_instance=None)¶ Bases:
bhive.blockchainobject.BlockchainObject
Read data about a witness in the chain
- Parameters
account_name (str) – Name of the witness
hive_instance (Hive) – Hive instance to use when accesing a RPC
>>> from bhive.witness import Witness >>> Witness("gtg") <Witness gtg>
-
property
account
¶
-
feed_publish
(base, quote=None, account=None)¶ Publish a feed price as a witness.
- Parameters
base (float) – USD Price of HIVE in HBD (implied price)
quote (float) – (optional) Quote Price. Should be 1.000 (default), unless we are adjusting the feed to support the peg.
account (str) – (optional) the source account for the transfer if not self[“owner”]
-
property
is_active
¶
-
json
()¶
-
refresh
()¶
-
type_id
= 3¶
-
update
(signing_key, url, props, account=None)¶ Update witness
- Parameters
signing_key (str) – Signing key
url (str) – URL
props (dict) – Properties
account (str) – (optional) witness account name
Properties::
{ "account_creation_fee": x, "maximum_block_size": x, "hbd_interest_rate": x, }
-
class
bhive.witness.
Witnesses
(lazy=False, full=True, hive_instance=None)¶ Bases:
bhive.witness.WitnessesObject
Obtain a list of active witnesses and the current schedule
- Parameters
hive_instance (Hive) – Hive instance to use when accesing a RPC
>>> from bhive.witness import Witnesses >>> Witnesses() <Witnesses >
-
refresh
()¶
-
class
bhive.witness.
WitnessesObject
¶ Bases:
list
-
get_votes_sum
()¶
-
printAsTable
(sort_key='votes', reverse=True, return_str=False, **kwargs)¶
-
-
class
bhive.witness.
WitnessesRankedByVote
(from_account='', limit=100, lazy=False, full=False, hive_instance=None)¶ Bases:
bhive.witness.WitnessesObject
Obtain a list of witnesses ranked by Vote
- Parameters
from_account (str) – Witness name from which the lists starts (default = “”)
limit (int) – Limits the number of shown witnesses (default = 100)
hive_instance (Hive) – Hive instance to use when accesing a RPC
>>> from bhive.witness import WitnessesRankedByVote >>> WitnessesRankedByVote(limit=100) <WitnessesRankedByVote >
-
class
bhive.witness.
WitnessesVotedByAccount
(account, lazy=False, full=True, hive_instance=None)¶ Bases:
bhive.witness.WitnessesObject
Obtain a list of witnesses which have been voted by an account
- Parameters
account (str) – Account name
hive_instance (Hive) – Hive instance to use when accesing a RPC
>>> from bhive.witness import WitnessesVotedByAccount >>> WitnessesVotedByAccount("gtg") <WitnessesVotedByAccount gtg>