node

package
v0.6.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartLocalIPFS added in v0.6.0

func StartLocalIPFS() error

StartLocalIPFS initializes a local IPFS node.

Types

type Callback added in v0.3.1

type Callback = config.NodeCallback

Callback is an alias for a common.NodeCallback

type IPFS added in v0.3.1

type IPFS = config.IPFSNode

IPFS is an alias for a common.IPFSNode.

type IPFSStore

type IPFSStore interface {
	// Address returns the full address of the store.
	Address() string

	// All returns all the keys and values of the store.
	All() map[string][]byte

	// DBName returns the name of the store.
	DBName() string

	// Identity returns the identity of the store.
	Identity() string

	// PublicKey returns the base64 public key of the store.
	PublicKey() []byte

	// Type returns the type of the store.
	Type() string

	// Close closes the store.
	Close() error

	// Get returns the value of the given key.
	Get(key string) ([]byte, error)

	// Put adds a new value to the store.
	Put(key string, value []byte) error

	// Delete removes a value from the store.
	Delete(key string) error

	// Service returns the DID service of the store.
	Service() *types.Service
}

func NewIPFSStore

func NewIPFSStore(ctx context.Context, controllerAddr string) (IPFSStore, error)

NewIPFSKVStore creates a new IPFSKVStore. This requires a valid Sonr Account Public Key.

type Node

type Node interface {
	// Returning a Motor interface and an error.
	Host() P2P
	IPFS() IPFS
}

`Node` is an interface that has three methods: `Host`, `IPFS`, and `Type`.

The `Host` method returns a `Motor` interface and an error. The `IPFS` method returns a `Highway` interface and an error. The `Type` method returns a `Type` type.

The `Motor` interface has two methods: `Start` and `Stop`. The `Start` method returns an error. The `Stop` method returns an error.

The `Highway` interface has two methods: `Start` and @property Host - The motor that is hosting the node. @property IPFS - The IPFS node that the motor is connected to. @property {Type} Type - The type of node. This can be either a Motor or a Highway.

type P2P added in v0.3.1

type P2P = config.PeerNode

P2P is an alias for a common.P2PNode.

type ServiceOperation

type ServiceOperation string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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