core

package
v0.0.0-...-7bc409f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenBazaarNode

type OpenBazaarNode struct {
	// Context for issuing IPFS commands
	Context commands.Context

	// IPFS node object
	IpfsNode *core.IpfsNode

	// The roothash of the node directory inside the openbazaar repo.
	// This directory hash is published on IPNS at our peer ID making
	// the directory publically viewable on the network.
	RootHash string

	// The path to the openbazaar repo in the file system.
	RepoPath string

	// The OpenBazaar network service for direct communication between peers
	Service net.NetworkService

	// Database for storing node specific data
	Datastore repo.Datastore

	// Websocket channel used for pushing data to the UI.
	Broadcast chan []byte

	// Bitcoin wallet implementation
	Wallet bitcoin.BitcoinWallet

	// Storage for our outgoing messages
	MessageStorage sto.OfflineMessagingStorage

	// A service that periodically checks the dht for outstanding messages
	MessageRetriever *net.MessageRetriever

	// A service that periodically republishes active pointers
	PointerRepublisher *net.PointerRepublisher
}
var Node *OpenBazaarNode

func (*OpenBazaarNode) EncryptMessage

func (n *OpenBazaarNode) EncryptMessage(peerId peer.ID, message []byte) (ct []byte, rerr error)

This is a placeholder until the libsignal is operational For now we will just encrypt outgoing offline messages with the long lived identity key.

func (*OpenBazaarNode) Follow

func (n *OpenBazaarNode) Follow(peerId string) error

func (*OpenBazaarNode) GetPeerStatus

func (n *OpenBazaarNode) GetPeerStatus(peerId string) string

func (*OpenBazaarNode) Purchase

func (n *OpenBazaarNode) Purchase(data *PurchaseData) error

func (*OpenBazaarNode) SeedNode

func (n *OpenBazaarNode) SeedNode() error

Unpin the current node repo, re-add it, then publish to ipns

func (*OpenBazaarNode) SendOfflineAck

func (n *OpenBazaarNode) SendOfflineAck(peerId string, pointerID peer.ID) error

func (*OpenBazaarNode) SendOfflineMessage

func (n *OpenBazaarNode) SendOfflineMessage(p peer.ID, m *pb.Message) error

func (*OpenBazaarNode) SignListing

func (n *OpenBazaarNode) SignListing(listing *pb.Listing) (*pb.RicardianContract, error)

Add our identity to the listings and sign it

func (*OpenBazaarNode) Unfollow

func (n *OpenBazaarNode) Unfollow(peerId string) error

func (*OpenBazaarNode) UpdateListingIndex

func (n *OpenBazaarNode) UpdateListingIndex(contract *pb.RicardianContract) error

Update the index.json file in the listings directory

type PurchaseData

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

Jump to

Keyboard shortcuts

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