node

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNewDay

func IsNewDay(oldTime int64, nowT int64) bool

Types

type BlockDataProcessor

type BlockDataProcessor interface {
	ApplyDelta(t int64, oldBlock model.Block, updatedCid chan string, evidences chan model.Evidence, waitG *sync.WaitGroup)
}

type BlockSmith

type BlockSmith struct {
	Key crypto.Keypair

	CratosP CratosProcessingService

	Pools *TemporaryPool
	Chain *chain.BlockChainService
	// contains filtered or unexported fields
}

func NewBlockSmith

func NewBlockSmith(ch *chain.BlockChainService, pair crypto.Keypair, powCores int) *BlockSmith

func (BlockSmith) CalculatePow

func (smith BlockSmith) CalculatePow(block model.Block) model.Block

func (BlockSmith) CheckForkOrChain

func (smith BlockSmith) CheckForkOrChain(block model.Block) error

func (BlockSmith) GenerateBlock

func (smith BlockSmith) GenerateBlock(oldBlock model.Block) (model.Block, error)

func (BlockSmith) RunBlockSmith

func (smith BlockSmith) RunBlockSmith()

type CratosProcessingService

type CratosProcessingService struct {
	Pools *TemporaryPool
	// contains filtered or unexported fields
}

func (CratosProcessingService) ApplyAmendment

func (proc CratosProcessingService) ApplyAmendment(countAmendmentVote map[string]uint64, newCratos *model.Cratos, evidences chan model.Evidence)

func (CratosProcessingService) ApplyDelta

func (proc CratosProcessingService) ApplyDelta(t int64, oldBlock model.Block, updatedCratosCid chan string, evidences chan model.Evidence, waitG *sync.WaitGroup)

func (CratosProcessingService) ApplyVariableValueChange

func (proc CratosProcessingService) ApplyVariableValueChange(newCratos *model.Cratos, demos model.Demos, evidences chan model.Evidence)

func (CratosProcessingService) DeserializeFromCratos

func (proc CratosProcessingService) DeserializeFromCratos(block model.Cratos)

func (CratosProcessingService) IsAuthorized

func (proc CratosProcessingService) IsAuthorized(role string, perm string) bool

func (CratosProcessingService) SerializeForCratos

func (proc CratosProcessingService) SerializeForCratos() model.Roles

type CurrencyProcessorService

type CurrencyProcessorService struct {
	Pools *TemporaryPool
	// contains filtered or unexported fields
}

func (CurrencyProcessorService) ApplyDelta

func (ccy CurrencyProcessorService) ApplyDelta(t int64, oldBlock model.Block, updatedCid chan string, evidences chan model.Evidence, waitG *sync.WaitGroup)

type DemosProcessingService

type DemosProcessingService struct {
	Pools *TemporaryPool
	// contains filtered or unexported fields
}

func (DemosProcessingService) ApplyDelta

func (proc DemosProcessingService) ApplyDelta(t int64, oldBlock model.Block, updatedCid chan string, evidences chan model.Evidence, waitG *sync.WaitGroup)

func (DemosProcessingService) FindNewCitizens

func (proc DemosProcessingService) FindNewCitizens(demos *model.Demos, evidences chan model.Evidence)

type NotaryProcessorService

type NotaryProcessorService struct {
	Pools *TemporaryPool
	// contains filtered or unexported fields
}

func (NotaryProcessorService) ApplyDelta

func (proc NotaryProcessorService) ApplyDelta(t int64, oldBlock model.Block, updatedCid chan string, evidences chan model.Evidence, waitG *sync.WaitGroup)

type PolitikojjError

type PolitikojjError string

func (PolitikojjError) Error

func (e PolitikojjError) Error() string

type PowProcessorService

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

func (PowProcessorService) ApplyDelta

func (proc PowProcessorService) ApplyDelta(t int64, oldBlock model.Block, updatedCid chan string, evidences chan model.Evidence, waitG *sync.WaitGroup)

type TemporaryPool

type TemporaryPool struct {
	Claims         map[string]model.Claim
	ApprovedClaims map[string]model.ApprovedClaim
	Votes          map[string]model.OpenBallot
	Transactions   map[string]model.Transaction
	Amendments     map[string]model.Amendment
	sync.RWMutex
	// contains filtered or unexported fields
}

==================== Pools ====================

func NewPool

func NewPool() *TemporaryPool

func (*TemporaryPool) Add

func (pool *TemporaryPool) Add(cid string, data interface{})

func (*TemporaryPool) Attach

func (pool *TemporaryPool) Attach(docsChan chan model.Wrapper)

func (*TemporaryPool) CountVotes

func (pool *TemporaryPool) CountVotes() map[string]map[string]uint64

func (*TemporaryPool) Exists

func (pool *TemporaryPool) Exists(cid string) bool

func (*TemporaryPool) GetTxs

func (pool *TemporaryPool) GetTxs() map[string]model.Transaction

func (*TemporaryPool) GetVotes

func (pool *TemporaryPool) GetVotes() map[string]model.OpenBallot

func (*TemporaryPool) Remove

func (pool *TemporaryPool) Remove(cid string)

Jump to

Keyboard shortcuts

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