chain

package
v0.0.0-...-822dead Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAmendment

func MakeAmendment(name string, rules []model.Rule, key crypto.Keypair) model.Amendment

func MakeApprovedClaim

func MakeApprovedClaim(c model.Claim, key crypto.Keypair) model.ApprovedClaim

func MakeClaim

func MakeClaim(name string, role string, key crypto.Keypair) model.Claim

func MakeTransaction

func MakeTransaction(to string, amount int, key crypto.Keypair) model.Transaction

func MakeVote

func MakeVote(perm string, object string, value string, key crypto.Keypair) model.OpenBallot

func StampAndSign

func StampAndSign(obj model.Signable, key crypto.Keypair)

StampAndSign the object using the given private key

Types

type BlockChainService

type BlockChainService struct {
	Head  UnpackedBlock
	Store storage.Store
	// contains filtered or unexported fields
}

func NewChain

func NewChain(store storage.Store, network string) *BlockChainService

func (BlockChainService) BackwardWalk

func (cs BlockChainService) BackwardWalk(handler WalkHandler)

func (*BlockChainService) ByIndex

func (cs *BlockChainService) ByIndex(id uint32) model.Block

func (*BlockChainService) ChainBlock

func (cs *BlockChainService) ChainBlock(newBlock model.Block) (model.Block, string, error)

func (BlockChainService) Genesis

func (cs BlockChainService) Genesis(key crypto.Keypair, constitutionFile string) model.Block

build and publish the Genesis block using a keypair and a constitution file

returns its ipfs cid

func (*BlockChainService) GetHead

func (cs *BlockChainService) GetHead() UnpackedBlock

func (*BlockChainService) HeadBlock

func (cs *BlockChainService) HeadBlock() model.Block

func (BlockChainService) IsBlockDeltaValid

func (cs BlockChainService) IsBlockDeltaValid(new, old model.Block) bool

func (BlockChainService) IsBlockValid

func (cs BlockChainService) IsBlockValid(newBlock model.Block) bool

type UnpackedBlock

type UnpackedBlock struct {
	Cid      string
	Block    model.Block
	Cratos   model.Cratos
	Demos    model.Demos
	Currency model.Currency
	model.ObservableList
}

func (UnpackedBlock) Majority

func (c UnpackedBlock) Majority() uint64

type WalkHandler

type WalkHandler func(block model.Block, cid string)

Jump to

Keyboard shortcuts

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