Cryptoassets helper service¶
Service main¶
Cryptoassets helper service is a standalone process managing cryptoasset backend connections and transaction updates.
Manages asynchronous tasks for sending and receiving cryptocurrency over various APIs. This includes
- Broadcasting transactions to the cryptocurrency network asynchronously
- Handle incoming transactions and write them to the database, calls your application via event handlers
- Updates confirmation counts of open transactions
-
cryptoassets.core.service.main.
logger
= None¶ Must be instiated after the logging configure is passed in
-
class
cryptoassets.core.service.main.
Service
(config, subsystems=[<Subsystem.database: 1>, <Subsystem.backend: 3>], daemon=False, logging=True)[source]¶ Main cryptoassets helper service.
This class runs cryptoassets helper service process itself and various command line utilities (initialize-database, etc.)
We uses Advanced Python Scheduler to run timed jobs (broadcasts, confirmatino updates).
Status server (
cryptoassets.core.service.status
) can be started for inspecting our backend connections are running well.Parameters: - config – cryptoassets configuration dictionary
- subsystems – List of subsystems needed to initialize for this process
- daemon – Run as a service
-
status_server
= None¶ Status server instance
-
incoming_transaction_runnables
= None¶ coin name -> IncomingTransactionRunnable
-
broadcast_period
= None¶ How often we check out for outgoing transactions
-
config
(config, logging_)[source]¶ Load configuration from Python dict.
Initialize logging system if necessary.
-
start_status_server
()[source]¶ Start the status server on HTTP.
The server is previously set up by
configure
module.We need just to pass the status report generator of this service to it before starting it up.
-
poll_broadcast
()[source]¶ “A scheduled task to broadcast any new transactions to the bitcoin network.
Each wallet is broadcasted in its own transaction.
-
poll_network_transaction_confirmations
()[source]¶ Scan incoming open transactions.
Returns: Number of rescans attempted
-
scan_received
()[source]¶ Scan through all received transactions, see if we missed some through walletnotify.
-
start
()[source]¶ Start cryptoassets helper service.
Keep running until we get SIGTERM or CTRL+C.
Returns: Process exit code