node

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

README

node

GoDoc GoReport Travis License Chat Mentioned in Awesome Go

Package node provides ...

Overview

This package ...

Documentation

Index

Constants

View Source
const (
	// DefaultTimeProofInterval is the default interval for time proof message
	DefaultTimeProofInterval = 1 // 1 seconds

	// DefaultLocalPort is the default port of local serve
	DefaultLocalPort = 8341
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node is struct of node

func New

func New(udb db.UDB) (node *Node, err error)

New is used to create new node

func (*Node) AddPeer

func (n *Node) AddPeer(p *peer.Peer) error

AddPeer add peer to local node peers

func (*Node) EnableTP

func (n *Node) EnableTP(user *core.User, priKey *crypto.PrivateKey, val uint64) error

EnableTP set the time proof settings

func (*Node) Run

func (n *Node) Run(c <-chan os.Signal)

Run the node

func (*Node) SetLocalPort

func (n *Node) SetLocalPort(port uint64)

SetLocalPort set local listen port

func (*Node) SetNodes

func (n *Node) SetNodes(nodes string) error

SetNodes set the target nodes [userid@ip:port/nodeKey]

type Record

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

Record is the struct of wave request

Jump to

Keyboard shortcuts

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