mobile

package
v0.0.0-...-50e3d47 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: MIT Imports: 15 Imported by: 0

README

Build from source

Dependencies

Java JDK, Android NDK, Go mobile tools

$ go get golang.org/x/mobile/cmd/gomobile
$ gomobile init -ndk ~/PATH/TO/ANDROID/NDK

Building android library

To compile Go package as android library execute

$ gomobile bind -v -target=android -tags=mobile github.com/abassian/huron/src/mobile

Import the Huron Module

Follow Oliver's answer:
https://stackoverflow.com/questions/16682847/how-to-manually-include-external-aar-package-using-new-gradle-android-build-syst

Sometimes, Android Studio says “cannot resolve symbol” even if the project compiles. In this case, do the following:

"File" -> "Invalidate Caches..." -> "Invalidate and Restart"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrivPublKeys

func GetPrivPublKeys() string

GetPrivPublKeys ...

Types

type CommitHandler

type CommitHandler interface {
	OnCommit([]byte) (stateHash []byte)
}

CommitHandler ...

type ExceptionHandler

type ExceptionHandler interface {
	OnException(string)
}

ExceptionHandler ...

type MobileConfig

type MobileConfig struct {
	Heartbeat      int    //heartbeat timeout in milliseconds
	TCPTimeout     int    //TCP timeout in milliseconds
	MaxPool        int    //Max number of pooled connections
	CacheSize      int    //Number of items in LRU cache
	SyncLimit      int    //Max Events per sync
	EnableFastSync bool   //Enable fast sync
	Store          bool   //Use badger store
	LogLevel       string //debug, info, warn, error, fatal, panic
	Moniker        string //optional name
}

MobileConfig ...

func DefaultMobileConfig

func DefaultMobileConfig() *MobileConfig

DefaultMobileConfig ...

func NewMobileConfig

func NewMobileConfig(heartbeat int,
	tcpTimeout int,
	maxPool int,
	cacheSize int,
	syncLimit int,
	enableFastSync bool,
	store bool,
	logLevel string,
	moniker string) *MobileConfig

NewMobileConfig ...

type Node

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

Node ...

func New

func New(privKey string,
	nodeAddr string,
	jsonPeers string,
	commitHandler CommitHandler,
	exceptionHandler ExceptionHandler,
	config *MobileConfig) *Node

New initializes Node struct

func (*Node) GetPeers

func (n *Node) GetPeers() string

GetPeers ...

func (*Node) GetStats

func (n *Node) GetStats() string

GetStats ...

func (*Node) Leave

func (n *Node) Leave()

Leave ...

func (*Node) Run

func (n *Node) Run(async bool)

Run ...

func (*Node) Shutdown

func (n *Node) Shutdown()

Shutdown ...

func (*Node) SubmitTx

func (n *Node) SubmitTx(tx []byte)

SubmitTx ...

Jump to

Keyboard shortcuts

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