Context API
ContextOptions
Bases: KernelOpaquePtr
Options for creating a new kernel context.
Once a kernel context has been created from this options object, it may be destroyed. Changes made to the options after the kernel context has been created will not be reflected on the kernel context.
Source code in pbk/context.py
__init__
set_chainparams
Sets the chain parameters for the context options.
| PARAMETER | DESCRIPTION |
|---|---|
chain_parameters
|
Chain parameters to set.
TYPE:
|
set_notifications
Sets the kernel notifications for the context options.
| PARAMETER | DESCRIPTION |
|---|---|
notifications
|
Notification callbacks to set.
TYPE:
|
Source code in pbk/context.py
set_validation_interface
Sets the validation interface callbacks for the context options.
| PARAMETER | DESCRIPTION |
|---|---|
interface_callbacks
|
Validation callbacks to set. |
Source code in pbk/context.py
Context
Bases: KernelOpaquePtr
The kernel context is used to initialize internal state and hold the chain parameters and callbacks for handling error and validation events.
Source code in pbk/context.py
__init__
__repr__
interrupt
Interrupt long-running validation functions. Useful for operations like reindexing, importing or processing blocks.
| RETURNS | DESCRIPTION |
|---|---|
int
|
0 if interrupt was successful, non-zero otherwise |