Documentation
¶
Index ¶
- Constants
- type OpenBazaarNode
- func (n *OpenBazaarNode) EncryptMessage(peerId peer.ID, message []byte) (ct []byte, rerr error)
- func (n *OpenBazaarNode) Follow(peerId string) error
- func (n *OpenBazaarNode) GetListingCount() int
- func (n *OpenBazaarNode) GetPeerStatus(peerId string) string
- func (n *OpenBazaarNode) GetProfile() (pb.Profile, error)
- func (n *OpenBazaarNode) Purchase(data *PurchaseData) error
- func (n *OpenBazaarNode) SeedNode() error
- func (n *OpenBazaarNode) SendOfflineAck(peerId string, pointerID peer.ID) error
- func (n *OpenBazaarNode) SendOfflineMessage(p peer.ID, m *pb.Message) error
- func (n *OpenBazaarNode) SetListingInventory(listing *pb.Listing) error
- func (n *OpenBazaarNode) SignListing(listing *pb.Listing) (*pb.RicardianContract, error)
- func (n *OpenBazaarNode) Unfollow(peerId string) error
- func (n *OpenBazaarNode) UpdateFollow() error
- func (n *OpenBazaarNode) UpdateListingIndex(contract *pb.RicardianContract) error
- func (n *OpenBazaarNode) UpdateProfile(profile *pb.Profile) error
- type PurchaseData
Constants ¶
View Source
const DescriptionMaxCharacters = 50000
View Source
const ListingVersion = 1
View Source
const MaxTags = 10
View Source
const SentanceMaxCharacters = 70
View Source
const TitleMaxCharacters = 140
View Source
const WordMaxCharacters = 40
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 publicly 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 // Used to resolve blockchainIDs to OpenBazaar IDs Resolver *bstk.BlockstackClient // A service that periodically fetches and caches the bitcoin exchange rates ExchangeRates bitcoin.ExchangeRates }
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) GetListingCount ¶
func (n *OpenBazaarNode) GetListingCount() int
func (*OpenBazaarNode) GetPeerStatus ¶
func (n *OpenBazaarNode) GetPeerStatus(peerId string) string
func (*OpenBazaarNode) GetProfile ¶
func (n *OpenBazaarNode) GetProfile() (pb.Profile, error)
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 (*OpenBazaarNode) SetListingInventory ¶
func (n *OpenBazaarNode) SetListingInventory(listing *pb.Listing) 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) UpdateFollow ¶
func (n *OpenBazaarNode) UpdateFollow() error
This function updates the follow and following lists in the node's root directory as well as adds the current follow, following, and listing counts to the profile. We only do this when a user updates his node to avoid needing to make network calls each time a new follower or unfollow request comes in.
func (*OpenBazaarNode) UpdateListingIndex ¶
func (n *OpenBazaarNode) UpdateListingIndex(contract *pb.RicardianContract) error
Update the index.json file in the listings directory
func (*OpenBazaarNode) UpdateProfile ¶
func (n *OpenBazaarNode) UpdateProfile(profile *pb.Profile) error
type PurchaseData ¶
type PurchaseData struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.