Documentation ¶
Index ¶
- Constants
- Variables
- func CreateGenesisBlock(cs *hamt.CborIpldStore) (*types.Block, error)
- func CreateNewAddress() types.Address
- type HelloMessage
- type ToychainNode
- func (tch *ToychainNode) HelloPeer(p peer.ID)
- func (tch *ToychainNode) IsOurAddress(chk types.Address) bool
- func (tch *ToychainNode) SendNewBlock(b *types.Block) error
- func (tch *ToychainNode) SendNewTransaction(tx *types.Transaction) error
- func (tch *ToychainNode) SendNewTransactionAndWait(ctx context.Context, tx *types.Transaction) (*TxResult, error)
- type TxResult
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 ¶
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)
Click to show internal directories.
Click to hide internal directories.