mobile

package
v0.13.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: MIT Imports: 51 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

View Source
const IpnsValidatorTag = "ipns"

IpnsValidatorTag required for constructClientDHTRouting()

Variables

View Source
var DHTClientOption ipfscore.RoutingOption = constructClientDHTRouting

DHTClientOption required for constructClientDHTRouting()

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) *Node

NewNode create the configuration file for a new node

func NewNodeWithConfig added in v0.13.0

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

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

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

	// The coin to use
	CoinType wallet.CoinType
}

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

Jump to

Keyboard shortcuts

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