node

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 44 Imported by: 0

README

node

Node that connects to the C3 peer-to-peer network

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(n *Service, cfg *nodetypes.Config) error

Start ... note: start is called from cobra

Types

type DiscoveryNotifee

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

DiscoveryNotifee ...

func (*DiscoveryNotifee) HandlePeerFound

func (n *DiscoveryNotifee) HandlePeerFound(pi peerstore.PeerInfo)

HandlePeerFound ...

type Interface

type Interface interface {
}

Interface ... TODO: finish...

type Keys

type Keys struct {
	Priv *ecdsa.PrivateKey
	Pub  *ecdsa.PublicKey
}

Keys ... note: any concern keeping these in memory? Maybe only fetch when needed?

type Props

type Props struct {
	// Note: it's preferable to not use abbreviations if it means uppercasing all the letters. Acronyms are OK.
	Context             context.Context
	SubscriberChannel   chan interface{}
	CancelMinersChannel chan struct{}
	Host                host.Host
	Store               nodestore.Interface // store is used to temporarily store blocks and txs for mining and verification
	Pubsub              *floodsub.PubSub    // note: how to make this into an interface?
	P2P                 p2p.Interface
	Keys                Keys
	Protobyff           protobuff.Interface
	BlockDifficulty     int
}

Props ...

type Service

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

Service ...

func New

func New(props *Props) (*Service, error)

New ...

func (*Service) BroadcastMinedBlock

func (s *Service) BroadcastMinedBlock(minedBlock *miner.MinedBlock) error

BroadcastMinedBlock ... note: only mainchain blocks get broadcast

func (*Service) BroadcastTransaction

func (s *Service) BroadcastTransaction(tx *statechain.Transaction) (*nodetypes.SendTxResponse, error)

BroadcastTransaction ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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