Documentation
¶
Overview ¶
Package mobile is a wrapper for Babble that can be compiled with gomobile for use in Android and iOS.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPrivPublKeys ¶
func GetPrivPublKeys() string
GetPrivPublKeys generates a new public key pair and returns it in the following formatted string <public key hex>=!@#@!=<private key hex>.
Types ¶
type CommitHandler ¶
CommitHandler wraps an OnCommit callback. This method will be called by Babble to commit blocks. The blocks are serialized with JSON.
type ExceptionHandler ¶
type ExceptionHandler interface {
OnException(string)
}
ExceptionHandler wraps an OnException callback
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is the entry point for using Babble from Java or Objective-C. It is a wrapper around a normal Babble node that works around the limitations of gomobile concerning the exportable types.
func New ¶
func New( commitHandler CommitHandler, stateChangeHandler StateChangeHandler, exceptionHandler ExceptionHandler, configDir string, ) *Node
New creates a new mobile node from a set of handlers. The configDir parameter points to the directory where Babble configuration files reside.
func (*Node) GetGenesisPeers ¶ added in v0.6.0
GetGenesisPeers returns the genesis peers.
func (*Node) GetPubKey ¶ added in v0.8.1
GetPubKey returns the validator's public key in Hex format.
func (*Node) Leave ¶ added in v0.5.0
func (n *Node) Leave()
Leave instructs the node to leave politely (get removed from validator-set) before shutting down.
type StateChangeHandler ¶ added in v0.8.0
type StateChangeHandler interface {
OnStateChanged(state int32)
}
StateChangeHandler wraps an OnStateChanged callback