core

package
v0.0.0-...-c820c6a Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const HelloProtocol = "/toychain/hello/0.0.1"

Variables

View Source
var BlocksTopic = "/tch/blks"
View Source
var InitialNetworkTokens = big.NewInt(2000000000)
View Source
var ProtocolID = protocol.ID("/tch/0.0.0")
View Source
var TxsTopic = "/tch/tx"

Functions

func CreateGenesisBlock

func CreateGenesisBlock(cs *hamt.CborIpldStore) (*types.Block, error)

func CreateNewAddress

func CreateNewAddress() types.Address

Types

type HelloMessage

type HelloMessage struct {
	// Could just put the full block header here
	Head        *cid.Cid
	BlockHeight uint64
}

type ToychainNode

type ToychainNode struct {
	Host host.Host

	Addresses []types.Address

	Lookup *lookup.LookupEngine

	DAG     ipld.DAGService
	Bitswap *bitswap.Bitswap

	StateMgr *state.StateManager
	// contains filtered or unexported fields
}

func NewToychainNode

func NewToychainNode(h host.Host, fs *floodsub.PubSub, dag ipld.DAGService, bs bserv.BlockService, bswap *bitswap.Bitswap) (*ToychainNode, error)

func (*ToychainNode) HelloPeer

func (tch *ToychainNode) HelloPeer(p peer.ID)

func (*ToychainNode) IsOurAddress

func (tch *ToychainNode) IsOurAddress(chk types.Address) bool

func (*ToychainNode) SendNewBlock

func (tch *ToychainNode) SendNewBlock(b *types.Block) error

func (*ToychainNode) SendNewTransaction

func (tch *ToychainNode) SendNewTransaction(tx *types.Transaction) error

func (*ToychainNode) SendNewTransactionAndWait

func (tch *ToychainNode) SendNewTransactionAndWait(ctx context.Context, tx *types.Transaction) (*TxResult, error)

type TxResult

type TxResult struct {
	Block   *types.Block
	Receipt *types.Receipt
}

Jump to

Keyboard shortcuts

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