tiny

package
v0.0.0-...-77b6ffe Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

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

Network is the wrapper of physical p2p network layer

func NewNetwork

func NewNetwork(peer Peer) *Network

func (*Network) AddProtocol

func (p *Network) AddProtocol(proto common.Protocol) error

func (*Network) DelProtocol

func (p *Network) DelProtocol(proto common.Protocol)

func (*Network) ID

func (p *Network) ID() peer.ID

func (*Network) Peer

func (p *Network) Peer() Peer

func (*Network) Start

func (p *Network) Start()

func (*Network) Stop

func (p *Network) Stop()

type Peer

type Peer interface {
	Start()
	Stop()
	ID() peer.ID
	Send(peer.ID, string, []byte) error
	Multicast([]peer.ID, string, []byte)
	Broadcast(string, []byte)
	AddProtocol(common.Protocol) error
	DelProtocol(common.Protocol)
}

type Tiny

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

Tiny implements the tinychain full node service

func New

func New(config *common.Config) (*Tiny, error)

func (*Tiny) Chain

func (tiny *Tiny) Chain() chain.Blockchain

func (*Tiny) Close

func (tiny *Tiny) Close()

func (*Tiny) Config

func (tiny *Tiny) Config() *common.Config

func (*Tiny) DB

func (tiny *Tiny) DB() *db.TinyDB

func (*Tiny) Executor

func (tiny *Tiny) Executor() *executor.Executor

func (*Tiny) Network

func (tiny *Tiny) Network() *Network

func (*Tiny) RawDB

func (tiny *Tiny) RawDB() db.Database

func (*Tiny) Start

func (tiny *Tiny) Start() error

func (*Tiny) StateDB

func (tiny *Tiny) StateDB() *state.StateDB

Jump to

Keyboard shortcuts

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