internals

package
v0.0.0-...-fee3720 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EchoService         = "EchoRPCAPI"
	EchoServiceFuncEcho = "Echo"
)

Variables

This section is empty.

Functions

func CopyEnvelopesToIfaces

func CopyEnvelopesToIfaces(in []*Envelope) []interface{}

func CreateGenesis

func CreateGenesis()

func Ctxts

func Ctxts(n int) []context.Context

func Discover

func Discover(ctx context.Context, h host.Host, dht *dht.IpfsDHT, rendezvous string)

func NewBlockchain

func NewBlockchain()

func NewKDHT

func NewKDHT(ctx context.Context, host host.Host, bootstrapPeers []multiaddr.Multiaddr) (*disc.RoutingDiscovery, error)

Types

type EchoRPCAPI

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

func (*EchoRPCAPI) Echo

func (e *EchoRPCAPI) Echo(ctx context.Context, in Envelope, out *Envelope) error

type Envelope

type Envelope struct {
	Message string
}

type Genesis

type Genesis struct {
	ChainID            *big.Int
	VersionID          *big.Int
	OriginatingHost    string
	OriginalValidators map[string]common.Address
	CoinbaseAddress    string
	Coin               string
	StakingCoin        string
	GenesisValidators  map[string]string
	BlockRoot          string
	GenesisTime        int64
	NextBlockHash      string
	Signature          string
	Proof              string
	// contains filtered or unexported fields
}

type LamaBlockchain

type LamaBlockchain struct {
	Genesis *Genesis
	Blocks  []*primitives.Block
	// contains filtered or unexported fields
}

func (*LamaBlockchain) GetChainID

func (L *LamaBlockchain) GetChainID() *big.Int

func (*LamaBlockchain) LoadGenesis

func (L *LamaBlockchain) LoadGenesis()

type NewTx

type NewTx struct {
	TransactionID *big.Int        // transaction ID
	Transaction   *tx.Transaction // new transaction
	Source        string          // who sent it
}

type Node

type Node struct {
	Addr multiaddr.Multiaddr
	Host host.Host
	// contains filtered or unexported fields
}

func (*Node) NewHost

func (p *Node) NewHost(ctx context.Context, seed int64, port int) host.Host

type Processor

type Processor struct {
	GenesisID     *big.Int
	BlockRouterID *big.Int
	OracleID      *big.Int
	BlockStorage  storage.LocalStorage

	LamaChain LamaBlockchain
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(genesisID *big.Int, blockStore storage.LocalStorage, txQueue []tx.Transaction, chain LamaBlockchain) *Processor

type Service

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

func NewService

func NewService(host host.Host, protocol protocol.ID) *Service

func (*Service) Echo

func (s *Service) Echo(message string)

func (*Service) ReceiveEcho

func (s *Service) ReceiveEcho(envelope Envelope) Envelope

func (*Service) SetupRPC

func (s *Service) SetupRPC() error

func (*Service) StartMessaging

func (s *Service) StartMessaging(ctx context.Context)

type TipChange

type TipChange struct {
	BlockID *big.Int          // block ID of the main chain tip block
	Block   *primitives.Block // full block
	Source  string            // who sent the block that caused this change
	Connect bool              // true if the tip has been connected. false for disconnected
	More    bool              // true if the tip has been connected and more connections are expected
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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