Documentation
¶
Index ¶
- type BitBoxBase
- func (base *BitBoxBase) ChannelHash() (string, bool)
- func (base *BitBoxBase) Close()
- func (base *BitBoxBase) ConnectElectrum() error
- func (base *BitBoxBase) ConnectRPCClient() error
- func (base *BitBoxBase) Deregister() (bool, error)
- func (base *BitBoxBase) GetRegisterTime() time.Time
- func (base *BitBoxBase) Identifier() string
- func (base *BitBoxBase) MiddlewareInfo() (rpcmessages.SampleInfoResponse, error)
- func (base *BitBoxBase) Ping() (bool, error)
- func (base *BitBoxBase) RPCClient() *rpcclient.RPCClient
- func (base *BitBoxBase) Self() *BitBoxBase
- func (base *BitBoxBase) Status() bitboxbasestatus.Status
- func (base *BitBoxBase) SyncWithOption(option SyncOption) (bool, error)
- func (base *BitBoxBase) VerificationProgress() (rpcmessages.VerificationProgressResponse, error)
- type Interface
- type SyncOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitBoxBase ¶
type BitBoxBase struct {
observable.Implementation
// contains filtered or unexported fields
}
BitBoxBase provides the dictated bitboxbase api to communicate with the base
func NewBitBoxBase ¶
func NewBitBoxBase(address string, id string, config *config.Config, bitboxBaseConfigDir string, onUnregister func(string)) (*BitBoxBase, error)
NewBitBoxBase creates a new bitboxBase instance
func (*BitBoxBase) ChannelHash ¶
func (base *BitBoxBase) ChannelHash() (string, bool)
ChannelHash returns the bitboxbase's rpcClient noise channel hash
func (*BitBoxBase) Close ¶
func (base *BitBoxBase) Close()
Close implements a method to unset the bitboxBase
func (*BitBoxBase) ConnectElectrum ¶
func (base *BitBoxBase) ConnectElectrum() error
ConnectElectrum connects to the electrs server on the base and configures the backend accordingly
func (*BitBoxBase) ConnectRPCClient ¶
func (base *BitBoxBase) ConnectRPCClient() error
ConnectRPCClient starts the connection with the remote bitbox base middleware
func (*BitBoxBase) Deregister ¶
func (base *BitBoxBase) Deregister() (bool, error)
Deregister calls the backend's BitBoxBaseDeregister callback and sends a notification to the frontend, if bitboxbase is active. If bitboxbase is not active, an error is returned.
func (*BitBoxBase) GetRegisterTime ¶
func (base *BitBoxBase) GetRegisterTime() time.Time
GetRegisterTime implements a getter for the timestamp of when the bitbox base was registered
func (*BitBoxBase) Identifier ¶
func (base *BitBoxBase) Identifier() string
Identifier implements a getter for the bitboxBase ID
func (*BitBoxBase) MiddlewareInfo ¶
func (base *BitBoxBase) MiddlewareInfo() (rpcmessages.SampleInfoResponse, error)
MiddlewareInfo returns the received MiddlewareInfo packet from the rpcClient
func (*BitBoxBase) Ping ¶
func (base *BitBoxBase) Ping() (bool, error)
Ping sends a get requset to the bitbox base middleware root handler and returns true if successful
func (*BitBoxBase) RPCClient ¶
func (base *BitBoxBase) RPCClient() *rpcclient.RPCClient
RPCClient returns ths current instance of the rpcClient
func (*BitBoxBase) Self ¶
func (base *BitBoxBase) Self() *BitBoxBase
Self returns the current bitbox base instance.
func (*BitBoxBase) Status ¶
func (base *BitBoxBase) Status() bitboxbasestatus.Status
Status returns the current state of the bitboxbase.
func (*BitBoxBase) SyncWithOption ¶
func (base *BitBoxBase) SyncWithOption(option SyncOption) (bool, error)
SyncWithOption returns true if the chosen sync option was executed successfully
func (*BitBoxBase) VerificationProgress ¶
func (base *BitBoxBase) VerificationProgress() (rpcmessages.VerificationProgressResponse, error)
VerificationProgress returns the received VerificationProgress packet from the rpcClient
type Interface ¶
type Interface interface {
// Identifier returns the bitboxBaseID.
Identifier() string
// GetRPCClient returns the rpcClient so we can listen to its events.
RPCClient() *rpcclient.RPCClient
// Close tells the bitboxbase to close all connections.
Close()
// GetRegisterTime implements a getter for the timestamp of when the bitboxBase was registered
GetRegisterTime() time.Time
// MiddlewareInfo returns some blockchain information.
MiddlewareInfo() (rpcmessages.SampleInfoResponse, error)
// VerificationProgress returns the bitcoind verification progress.
VerificationProgress() (rpcmessages.VerificationProgressResponse, error)
// ConnectElectrum connects to the electrs server on the base and configures the backend accordingly
ConnectElectrum() error
// Ping sends a get requset to the bitbox base middleware root handler and returns true if successful
Ping() (bool, error)
// Self returns an instance of the base
Self() *BitBoxBase
// Status returns the current status of the base
Status() bitboxbasestatus.Status
// ChannelHash returns the hash of the noise channel
ChannelHash() (string, bool)
// Deregister calls the backend's BitBoxBase Deregister callback and sends a notification to the frontend, if bitboxbase is active.
// If bitboxbase is not active, an error is returned.
Deregister() (bool, error)
// SyncOption returns true if the bitcoin resync rpc call executed successfully
SyncWithOption(SyncOption) (bool, error)
}
Interface represents bitbox base.
type SyncOption ¶
type SyncOption string
SyncOption is a user provided blockchain sync option during BBB initialization
const ( SyncOptionPresynced SyncOption = "preSynced" SyncOptionReindex SyncOption = "reindex" SyncOptionInitialBlockDownload SyncOption = "initialBlockDownload" )
SyncOption iota has three options: Accept pre-synchronized blockchain; delete the chainstate and reindex; resync bitcon from scratch with an IBD
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mdns manages and/or registers new bitbox bases.
|
Package mdns manages and/or registers new bitbox bases. |
|
Package rpcclient contains the API to the physical device.
|
Package rpcclient contains the API to the physical device. |