breez

package module
v0.0.0-...-ddb1edc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 52 Imported by: 0

README

breez

In order to build breez you will need to install gomobile and go 1.19.x. If you install go from homebrew, you will have to ensure the GOPATH environment variable is set yourself.

Prepare your environment

git clone https://github.com/breez/breez.git
go install golang.org/x/mobile/cmd/gomobile
go install golang.org/x/mobile/cmd/gobind
export PATH=$PATH:$GOPATH/bin
gomobile init

Building breez for Android

You need to install the ndk as part of your sdk Tools. If you have a separate ndk installed then make sure to set the ANDROID_NDK_HOME environment variable to your ndk install location.

export ANDROID_HOME=<your android sdk directory>

Or in case you want to use a direct ndk path

export ANDROID_NDK_HOME=<your android ndk directory>

If you are using NDK 24+, install NDK r19 and point ANDROID_NDK_HOME to it's folder due to gomobile incompatibility. Alternatively, you can add -androidapi 19 to gomobile command in build script.

If the library will be run on an emulator target, add -ldflags=-extldflags=-Wl,-soname,libgojni.so to gomobile command in build script.

Then you are ready to run the build:

./build.sh

The file breez.aar will be built in build/android/

Building breez for iOS

./build-ios.sh

The bindings.framework will be built in build/ios/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {

	//exposed sub services
	AccountService *account.Service
	BackupManager  *backup.Manager
	SwapService    *swapfunds.Service
	ServicesClient *services.Client
	// contains filtered or unexported fields
}

App represents the breez application

func NewApp

func NewApp(workingDir string, applicationServices AppServices, startBeforeSync bool) (*App, error)

NewApp create a new application

func (*App) BackupFiles

func (a *App) BackupFiles() (string, error)

func (*App) CheckVersion

func (a *App) CheckVersion() error

func (*App) ClosedChannels

func (a *App) ClosedChannels() (int, error)

func (*App) DaemonReady

func (a *App) DaemonReady() bool

DaemonReady return the status of the lightningLib daemon

func (*App) DeleteGraph

func (a *App) DeleteGraph() error

func (*App) GetLogPath

func (a *App) GetLogPath() string

GetLogPath returns the log file path.

func (*App) GetPeers

func (a *App) GetPeers() (peers []string, isDefault bool, err error)

func (*App) GetTorActive

func (a *App) GetTorActive() bool

func (*App) GetTxSpentURL

func (a *App) GetTxSpentURL() (txSpentURL string, isDefault bool, err error)

func (*App) GetWorkingDir

func (a *App) GetWorkingDir() string

GetWorkingDir returns the working dir.

func (*App) GraphUrl

func (a *App) GraphUrl() (string, error)

func (*App) LastSyncedHeaderTimestamp

func (a *App) LastSyncedHeaderTimestamp() (int64, error)

func (*App) LatestBackupTime

func (a *App) LatestBackupTime() (time.Time, error)

func (*App) NotificationChan

func (a *App) NotificationChan() chan data.NotificationEvent

NotificationChan returns a channel that receives notification events

func (*App) OnResume

func (a *App) OnResume()

OnResume recalculate things we might missed when we were idle.

func (*App) PopulateChannelPolicy

func (a *App) PopulateChannelPolicy()

func (*App) RequestBackup

func (a *App) RequestBackup()

func (*App) RestartDaemon

func (a *App) RestartDaemon() error

func (*App) Restore

func (a *App) Restore(nodeID string, key []byte) error

Restore is the breez API for restoring a specific nodeID using the configured backup backend provider.

func (*App) SendCommand

func (a *App) SendCommand(command string) (string, error)

func (*App) SetPeers

func (a *App) SetPeers(peers []string) error

func (*App) SetTorActive

func (a *App) SetTorActive(enable bool) error

func (*App) SetTxSpentURL

func (a *App) SetTxSpentURL(txSpentURL string) error

func (*App) Start

func (a *App) Start(torConfig *data.TorConfig) error

Start is responsible for starting the lightning client and some go routines to track and notify for account changes

func (*App) Stop

func (a *App) Stop() error

Stop is responsible for stopping the ligtning daemon.

func (*App) TestPeer

func (a *App) TestPeer(peer string) error

type AppServices

type AppServices interface {
	BackupProviderName() string
	BackupProviderSignIn() (string, error)
}

AppServices defined the interface needed in Breez library in order to functional right.

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

AuthService is a Specific implementation for backup.Manager

func (*AuthService) SignIn

func (a *AuthService) SignIn() (string, error)

SignIn is the interface function implementation needed for backup.Manager

type Service

type Service interface {
	Start() error
	Stop() error
}

Service is the interface to be implemeted by all breez services

Directories

Path Synopsis
cmd module
TODO(nochiel) Add useful commands to manage Tor to the developer panel.
TODO(nochiel) Add useful commands to manage Tor to the developer panel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL