p2p

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: 20 Imported by: 0

README

p2p

C3 peer-to-peer package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchMainchainBlock

func FetchMainchainBlock(bs bserv.BlockService, c *cid.Cid) (*mainchain.Block, error)

FetchMainchainBlock ...

func FetchMerkleTree

func FetchMerkleTree(bs bserv.BlockService, c *cid.Cid) (*merkle.Tree, error)

FetchMerkleTree ...

func FetchStateChainBlock

func FetchStateChainBlock(bs bserv.BlockService, c *cid.Cid) (*statechain.Block, error)

FetchStateChainBlock ...

func FetchStateChainDiff

func FetchStateChainDiff(bs bserv.BlockService, c *cid.Cid) (*statechain.Diff, error)

FetchStateChainDiff ...

func FetchStateChainTransaction

func FetchStateChainTransaction(bs bserv.BlockService, c *cid.Cid) (*statechain.Transaction, error)

FetchStateChainTransaction ...

func GetCID

func GetCID(v interface{}) (*cid.Cid, error)

GetCID ...

func GetCIDByHash

func GetCIDByHash(hash string) (*cid.Cid, error)

GetCIDByHash ...

func GetMainchainBlockCID

func GetMainchainBlockCID(block *mainchain.Block) (*cid.Cid, error)

GetMainchainBlockCID ...

func GetMerkleTreeCID

func GetMerkleTreeCID(tree *merkle.Tree) (*cid.Cid, error)

GetMerkleTreeCID ...

func GetStatechainBlockCID

func GetStatechainBlockCID(block *statechain.Block) (*cid.Cid, error)

GetStatechainBlockCID ...

func GetStatechainDiffCID

func GetStatechainDiffCID(d *statechain.Diff) (*cid.Cid, error)

GetStatechainDiffCID ...

func GetStatechainTransactionCID

func GetStatechainTransactionCID(tx *statechain.Transaction) (*cid.Cid, error)

GetStatechainTransactionCID ...

func Put

func Put(bs bserv.BlockService, v interface{}) (*cid.Cid, error)

Put ...

func PutMainchainBlock

func PutMainchainBlock(bs bserv.BlockService, block *mainchain.Block) (*cid.Cid, error)

PutMainchainBlock ...

func PutMerkleTree

func PutMerkleTree(bs bserv.BlockService, tree *merkle.Tree) (*cid.Cid, error)

PutMerkleTree ...

func PutStatechainBlock

func PutStatechainBlock(bs bserv.BlockService, block *statechain.Block) (*cid.Cid, error)

PutStatechainBlock ...

func PutStatechainDiff

func PutStatechainDiff(bs bserv.BlockService, d *statechain.Diff) (*cid.Cid, error)

PutStatechainDiff ...

func PutStatechainTransaction

func PutStatechainTransaction(bs bserv.BlockService, tx *statechain.Transaction) (*cid.Cid, error)

PutStatechainTransaction ...

Types

type Interface

type Interface interface {
	Props() Props
	Set(v interface{}) (*cid.Cid, error)
	SetMainchainBlock(block *mainchain.Block) (*cid.Cid, error)
	SetStatechainBlock(block *statechain.Block) (*cid.Cid, error)
	SetStatechainTransaction(tx *statechain.Transaction) (*cid.Cid, error)
	SetStatechainDiff(d *statechain.Diff) (*cid.Cid, error)
	SetMerkleTree(tree *merkle.Tree) (*cid.Cid, error)
	//SaveLocal(v interface{}) (*cid.Cid, error)
	//SaveLocalMainchainBlock(block *mainchain.Block) (*cid.Cid, error)
	//SaveLocalStatechainBlock(block *statechain.Block) (*cid.Cid, error)
	//SaveLocalStatechainTransaction(tx *statechain.Transaction) (*cid.Cid, error)
	//SaveLocalStatechainDiff(d *statechain.Diff) (*cid.Cid, error)
	//Get(c *cid.Cid) (interface{}, error)
	GetMainchainBlock(c *cid.Cid) (*mainchain.Block, error)
	GetStatechainBlock(c *cid.Cid) (*statechain.Block, error)
	GetStatechainTransaction(c *cid.Cid) (*statechain.Transaction, error)
	GetStatechainDiff(c *cid.Cid) (*statechain.Diff, error)
	GetMerkleTree(c *cid.Cid) (*merkle.Tree, error)
	FetchMostRecentStateBlock(imageHash string, block *mainchain.Block) (*statechain.Block, error)
}

Interface ...

type Props

Props ...

type Service

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

Service ...

func New

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

New ...

func (Service) FetchMostRecentStateBlock

func (s Service) FetchMostRecentStateBlock(imageHash string, block *mainchain.Block) (*statechain.Block, error)

FetchMostRecentStateBlock ...

func (Service) GetMainchainBlock

func (s Service) GetMainchainBlock(c *cid.Cid) (*mainchain.Block, error)

GetMainchainBlock ...

func (Service) GetMerkleTree

func (s Service) GetMerkleTree(c *cid.Cid) (*merkle.Tree, error)

GetMerkleTree ...

func (Service) GetStatechainBlock

func (s Service) GetStatechainBlock(c *cid.Cid) (*statechain.Block, error)

GetStatechainBlock ...

func (Service) GetStatechainDiff

func (s Service) GetStatechainDiff(c *cid.Cid) (*statechain.Diff, error)

GetStatechainDiff ...

func (Service) GetStatechainTransaction

func (s Service) GetStatechainTransaction(c *cid.Cid) (*statechain.Transaction, error)

GetStatechainTransaction ...

func (Service) Props

func (s Service) Props() Props

Props ...

func (Service) Set

func (s Service) Set(v interface{}) (*cid.Cid, error)

Set ...

func (Service) SetMainchainBlock

func (s Service) SetMainchainBlock(block *mainchain.Block) (*cid.Cid, error)

SetMainchainBlock ... note: this function does not do any validation!

func (Service) SetMerkleTree

func (s Service) SetMerkleTree(tree *merkle.Tree) (*cid.Cid, error)

SetMerkleTree ..

func (Service) SetStatechainBlock

func (s Service) SetStatechainBlock(block *statechain.Block) (*cid.Cid, error)

SetStatechainBlock ...

func (Service) SetStatechainDiff

func (s Service) SetStatechainDiff(d *statechain.Diff) (*cid.Cid, error)

SetStatechainDiff ...

func (Service) SetStatechainTransaction

func (s Service) SetStatechainTransaction(tx *statechain.Transaction) (*cid.Cid, error)

SetStatechainTransaction ...

Directories

Path Synopsis
Package mock_p2p is a generated GoMock package.
Package mock_p2p is a generated GoMock package.
pb
Package protocols_p2p is a generated protocol buffer package.
Package protocols_p2p is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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