polyswarmclient
¶
Subpackages¶
polyswarmclient.ethereum
polyswarmclient.fast
polyswarmclient.filters
polyswarmclient.liveness
polyswarmclient.producer
polyswarmclient.ratelimit
Submodules¶
polyswarmclient.abstractambassador
polyswarmclient.abstractarbiter
polyswarmclient.abstractmicroengine
polyswarmclient.abstractscanner
polyswarmclient.backoff_wrapper
polyswarmclient.bidstrategy
polyswarmclient.config
polyswarmclient.corpus
polyswarmclient.events
polyswarmclient.exceptions
polyswarmclient.log_formatter
polyswarmclient.parameters
polyswarmclient.request_rate_limit
polyswarmclient.utils
Package Contents¶
-
class
polyswarmclient.
NonceManager
(client, chain)¶ Manages the nonce for some Ethereum chain
-
static
find_gaps
(nonces)¶ Finds any gaps between base nonce and the last nonce in the given nonces list.
- Parameters
nonces (list[int]) – list of nonces being checked
- Returns
(list[int]): Any missing nonces between base_nonce and the last given nonce
-
static
-
exception
polyswarmclient.
RateLimitedError
[source]¶ Bases:
polyswarmclient.exceptions.PolyswarmClientException
Hit the rate limit from polyswarmd
-
class
polyswarmclient.
LocalLivenessRecorder
[source]¶ Bases:
polyswarmclient.liveness.liveness.LivenessRecorder
Record liveness data in a tempfile
-
write_sync
(self, content)¶ Write the given content to the file at the given path.
- Parameters
content – content to write into the file
-
-
class
polyswarmclient.
BackoffWrapper
(func, **kwargs)[source]¶ Uses a generator to create backoff times
This is for use in functions that don’t return. In our use case, listen_for_events is not supposed to return, but exists as a long running Task. Using the decorator, the backoff time grows forever, because the function is only called one time. So each error causes a longer and longer timeout.
This adds an ability to reset the backoff, so your long running function can reduce the timeout after success
-
reset
(self)¶
-
-
class
polyswarmclient.
Client
(polyswarmd_addr, keyfile, password, api_key=None, tx_error_fatal=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?