Documentation
¶
Index ¶
- type BitBoxBase
- func (base *BitBoxBase) BackupHSMSecret() error
- func (base *BitBoxBase) BackupSysconfig() error
- func (base *BitBoxBase) BaseInfo() (rpcmessages.GetBaseInfoResponse, error)
- func (base *BitBoxBase) ChannelHash() (string, bool)
- func (base *BitBoxBase) Close()
- func (base *BitBoxBase) ConnectElectrum() error
- func (base *BitBoxBase) ConnectRPCClient() error
- func (base *BitBoxBase) Deregister() error
- func (base *BitBoxBase) EnableClearnetIBD(toggleAction rpcmessages.ToggleSettingArgs) error
- func (base *BitBoxBase) EnableRootLogin(toggleAction rpcmessages.ToggleSettingArgs) error
- func (base *BitBoxBase) EnableTor(toggleAction rpcmessages.ToggleSettingArgs) error
- func (base *BitBoxBase) EnableTorElectrs(toggleAction rpcmessages.ToggleSettingArgs) error
- func (base *BitBoxBase) EnableTorMiddleware(toggleAction rpcmessages.ToggleSettingArgs) error
- func (base *BitBoxBase) EnableTorSSH(toggleAction rpcmessages.ToggleSettingArgs) 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) RebootBase() error
- func (base *BitBoxBase) ReindexBitcoin() error
- func (base *BitBoxBase) RestoreHSMSecret() error
- func (base *BitBoxBase) RestoreSysconfig() error
- func (base *BitBoxBase) ResyncBitcoin() error
- func (base *BitBoxBase) Self() *BitBoxBase
- func (base *BitBoxBase) ServiceInfo() (rpcmessages.GetServiceInfoResponse, error)
- func (base *BitBoxBase) SetHostname(hostname string) error
- func (base *BitBoxBase) SetRootPassword(password string) error
- func (base *BitBoxBase) ShutdownBase() error
- func (base *BitBoxBase) Status() bitboxbasestatus.Status
- func (base *BitBoxBase) UserAuthenticate(username string, password string) error
- func (base *BitBoxBase) UserChangePassword(username string, password, newPassword string) 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), socksProxy socksproxy.SocksProxy) (*BitBoxBase, error)
NewBitBoxBase creates a new bitboxBase instance
func (*BitBoxBase) BackupHSMSecret ¶
func (base *BitBoxBase) BackupHSMSecret() error
BackupHSMSecret backs up the lightning hsm_secret
func (*BitBoxBase) BackupSysconfig ¶
func (base *BitBoxBase) BackupSysconfig() error
BackupSysconfig backs up the system config to the flashdrive
func (*BitBoxBase) BaseInfo ¶
func (base *BitBoxBase) BaseInfo() (rpcmessages.GetBaseInfoResponse, error)
BaseInfo returns info about the Base contained in rpcmessages.GetBaseInfoResponse
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() 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) EnableClearnetIBD ¶
func (base *BitBoxBase) EnableClearnetIBD(toggleAction rpcmessages.ToggleSettingArgs) error
EnableClearnetIBD configures bitcoind to run over clearnet while in IBD with rpcmessages.ToggleSettingArgs Enable/Disable
func (*BitBoxBase) EnableRootLogin ¶
func (base *BitBoxBase) EnableRootLogin(toggleAction rpcmessages.ToggleSettingArgs) error
EnableRootLogin enables/disables login via the root user/password with rpcmessages.ToggleSettingArgs Enable/Disable
func (*BitBoxBase) EnableTor ¶
func (base *BitBoxBase) EnableTor(toggleAction rpcmessages.ToggleSettingArgs) error
EnableTor enables/disables Tor with rpcmessages.ToggleSettingArgs Enable/Disable
func (*BitBoxBase) EnableTorElectrs ¶
func (base *BitBoxBase) EnableTorElectrs(toggleAction rpcmessages.ToggleSettingArgs) error
EnableTorElectrs enables/disables Tor for electrs with rpcmessages.ToggleSettingArgs Enable/Disable
func (*BitBoxBase) EnableTorMiddleware ¶
func (base *BitBoxBase) EnableTorMiddleware(toggleAction rpcmessages.ToggleSettingArgs) error
EnableTorMiddleware enables/disables Tor for the middleware with rpcmessages.ToggleSettingArgs Enable/Disable
func (*BitBoxBase) EnableTorSSH ¶
func (base *BitBoxBase) EnableTorSSH(toggleAction rpcmessages.ToggleSettingArgs) error
EnableTorSSH enables/disables Tor for SSH with rpcmessages.ToggleSettingArgs Enable/Disable
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) RebootBase ¶
func (base *BitBoxBase) RebootBase() error
RebootBase initiates a `reboot` call via the bbb-cmd.sh script
func (*BitBoxBase) ReindexBitcoin ¶
func (base *BitBoxBase) ReindexBitcoin() error
ReindexBitcoin returns true if the chosen sync option was executed successfully
func (*BitBoxBase) RestoreHSMSecret ¶
func (base *BitBoxBase) RestoreHSMSecret() error
RestoreHSMSecret restores the lightning hsm_secret
func (*BitBoxBase) RestoreSysconfig ¶
func (base *BitBoxBase) RestoreSysconfig() error
RestoreSysconfig restores the system config from the flashdrive
func (*BitBoxBase) ResyncBitcoin ¶
func (base *BitBoxBase) ResyncBitcoin() error
ResyncBitcoin returns true if the chosen sync option was executed successfully
func (*BitBoxBase) Self ¶
func (base *BitBoxBase) Self() *BitBoxBase
Self returns the current bitbox base instance.
func (*BitBoxBase) ServiceInfo ¶
func (base *BitBoxBase) ServiceInfo() (rpcmessages.GetServiceInfoResponse, error)
ServiceInfo returns info about the Base contained in rpcmessages.GetServiceInfoResponse
func (*BitBoxBase) SetHostname ¶
func (base *BitBoxBase) SetHostname(hostname string) error
SetHostname sets the hostname of the bitboxbase
func (*BitBoxBase) SetRootPassword ¶
func (base *BitBoxBase) SetRootPassword(password string) error
SetRootPassword sets the systems root password
func (*BitBoxBase) ShutdownBase ¶
func (base *BitBoxBase) ShutdownBase() error
ShutdownBase initiates a `shutdown now` call via the bbb-cmd.sh script
func (*BitBoxBase) Status ¶
func (base *BitBoxBase) Status() bitboxbasestatus.Status
Status returns the current state of the bitboxbase.
func (*BitBoxBase) UserAuthenticate ¶
func (base *BitBoxBase) UserAuthenticate(username string, password string) error
UserAuthenticate returns if a given Username and Password are valid
func (*BitBoxBase) UserChangePassword ¶
func (base *BitBoxBase) UserChangePassword(username string, password, newPassword string) error
UserChangePassword returns if the password change for a username was successful
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() error
// ReindexBitcoin starts a bitcoin reindex on the base.
ReindexBitcoin() error
// ResyncBitcoin starts a bitcoin resync on the base.
ResyncBitcoin() error
// SetHostname sets the hostname of the BitBox Base
SetHostname(string) error
// UserChangePassword sets a new password for a given user
UserChangePassword(string, string, string) error
// UserAuthenticate returns is the authentication with a username and password was successful
UserAuthenticate(string, string) error
// BackupSysconfig backs up the system config to the flashdrive
BackupSysconfig() error
// BackupHSMSecret backs up the lightning hsm_secret
BackupHSMSecret() error
// RestoreSysconfig restores the system config from the flashdrive
RestoreSysconfig() error
// RestoreHSMSecret restores the lightning hsm_secret
RestoreHSMSecret() error
// EnableTor enables/disables Tor
EnableTor(rpcmessages.ToggleSettingArgs) error
// EnableTorMiddleware enables/disables Tor for the middleware
EnableTorMiddleware(rpcmessages.ToggleSettingArgs) error
// EnableTorElectrs enables/disables Tor for electrs
EnableTorElectrs(rpcmessages.ToggleSettingArgs) error
// EnableTorSSH enables/disables Tor for SSH
EnableTorSSH(rpcmessages.ToggleSettingArgs) error
// EnableClearnetIBD configures bitcoind to run over clearnet while in IBD
EnableClearnetIBD(rpcmessages.ToggleSettingArgs) error
// EnableRootLogin enables/disables login via the root user/password
EnableRootLogin(rpcmessages.ToggleSettingArgs) error
// SetRootPassword sets the systems root password
SetRootPassword(string) error
// ShutdownBase initiates a `shutdown now` call via the bbb-cmd.sh script
ShutdownBase() error
// RebootBase initiates a `reboot` call via the bbb-cmd.sh script
RebootBase() error
// BaseInfo returns information about the Base
BaseInfo() (rpcmessages.GetBaseInfoResponse, error)
// ServiceInfo returns information about the services running on the Base
// As for example the bitcoind, electrs and ligthningd block height
ServiceInfo() (rpcmessages.GetServiceInfoResponse, 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. |