polyswarmclient
¶
Submodules¶
polyswarmclient.abstractambassador
polyswarmclient.abstractarbiter
polyswarmclient.abstractmicroengine
polyswarmclient.abstractscanner
polyswarmclient.balanceclient
polyswarmclient.bloom
polyswarmclient.bountiesclient
polyswarmclient.config
polyswarmclient.corpus
polyswarmclient.events
polyswarmclient.log_formatter
polyswarmclient.offersclient
polyswarmclient.parameters
polyswarmclient.producer
polyswarmclient.relayclient
polyswarmclient.stakingclient
polyswarmclient.transaction
polyswarmclient.utils
polyswarmclient.verifiers
Package Contents¶
-
class
polyswarmclient.
OffersClient
(client)[source]¶ Bases:
object
OffersClient to handle offers. Presently stores a given client and parameters.
-
class
polyswarmclient.
NonceManager
(client, chain)[source]¶ Manages the nonce for some Ethereum chain
-
all_finished
(self)¶ Check that all tasks have finished
-
mark_update_nonce
(self)¶ Call this when the nonce is out of sync. This sets the update flag to true. The next acquire after being set will trigger an update
-
-
polyswarmclient.
check_response
(response)[source]¶ -
Check the status of responses from polyswarmd
- Parameters
response – Response dict parsed from JSON from polyswarmd
- Returns
True if successful else False
- Return type
(bool)
-
polyswarmclient.
is_valid_ipfs_uri
(ipfs_uri)[source]¶ -
Ensure that a given ipfs_uri is valid by checking length and base58 encoding.
- Parameters
ipfs_uri (str) – ipfs_uri to validate
- Returns
is this valid?
- Return type
bool
-
class
polyswarmclient.
Client
(polyswarmd_addr, keyfile, password, api_key=None, tx_error_fatal=False, insecure_transport=False)[source]¶ Bases:
object
Client to connected to a Ethereum wallet as well as a polyswarmd instance.
- Parameters
polyswarmd_addr (str) – URI of polyswarmd you are referring to.
keyfile (str) – Keyfile filename.
password (str) – Password associated with keyfile.
api_key (str) – Your PolySwarm API key.
tx_error_fatal (bool) – Transaction errors are fatal and exit the program
insecure_transport (bool) – Allow insecure transport such as HTTP?
-
run
(self, chains=None)[source]¶ Run the main event loop
- Parameters
chains (set(str)) – Set of chains to operate on. Defaults to {‘home’, ‘side’}
-
sign_transactions
(self, transactions)[source]¶ Sign a set of transactions
- Parameters
transactions (List[Transaction]) – The transactions to sign
- Returns
The signed transactions
- Return type
List[Transaction]