mobile

package
v0.0.0-...-74075f7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 48 Imported by: 0

README

openbazaar-go for mobile

Purpose

This target allows a version of openbazaar-go to be compiled for use with Android or iOS. The primary changes are shorter timeouts around network requests and tighter resource management with a few details which allows a native frontend to speak with the server process.

Prepare

There are a few dependencies which must be installed and setup before a build can be completed.

iOS dependencies
  • go get golang.org/x/mobile/cmd/gomobile
  • gomobile init
  • Install xcode and accept EULA/T&Cs.
Android dependencies
  • go get -u golang.org/x/mobile/cmd/...
  • gomobile init -ndk ~/Library/Android/sdk/ndk-bundle/ (your Android NDK path may be different that this)

Build

iOS
  • Execute make ios_framework in your local openbazaar-go repo. This should produce a Mobile.framework file which may be included in your iOS project.
Android
  • Execute make android_framework in your local openbazaar-go repo. These must be executed from the root of the project and cannot be built inside a virtualized container or process.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	OpenBazaarNode *core.OpenBazaarNode
	// contains filtered or unexported fields
}

Node configuration structure

func NewNode

func NewNode(repoPath string, authenticationToken string, testnet bool, userAgent string, walletTrustedPeer string, password string, mnemonic string, profile bool) *Node

NewNode create the configuration file for a new node

func NewNodeWithConfig

func NewNodeWithConfig(config *NodeConfig, password string, mnemonic string) (*Node, error)

NewNodeWithConfig create a new node using the configuration file from NewNode()

func (*Node) PublishUnlocked

func (n *Node) PublishUnlocked() bool

PublishUnlocked return true if publish is unlocked

func (*Node) Restart

func (n *Node) Restart() error

func (*Node) Start

func (n *Node) Start() error

Start start openbazaard (OpenBazaar daemon)

func (*Node) Stop

func (n *Node) Stop() error

Stop stop openbazaard

type NodeConfig

type NodeConfig struct {

	// Path for the node's data directory
	RepoPath string

	// An API authentication. Authentication is turned on if not "".
	AuthenticationToken string

	// Use testnet
	Testnet bool

	// Add a custom user-agent
	UserAgent string

	// Add a trusted peer for the wallet
	WalletTrustedPeer string

	// Processes to disable
	DisableWallet        bool
	DisableExchangerates bool

	// Run the pprof profiler on port 6060
	Profile bool
}

NodeConfig struct of the config parameters to be passed when creating a new node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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