node

package
v0.3.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIPFS

func NewIPFS(ctx context.Context, opts ...config.Option) (common.IPFSNode, error)

NewIPFS creates a new IPFS node

Types

type Node

type Node interface {
	// Returning a Motor interface and an error.
	Host() common.P2PNode
	IPFS() common.IPFSNode
	Type() common.PeerType
}

`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.

func New

func New(ctx context.Context, opts ...config.Option) (Node, error)

It creates a new host, and then creates a new node with that host

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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