core

package
v0.0.0-...-e85cc61 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGenesisBlock

func CreateGenesisBlock(privateKey *types.PrivateKey) *types.Block

Types

type BlockValidator

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

func NewBlockValidator

func NewBlockValidator(bc *Blockchain) *BlockValidator

func (*BlockValidator) ValidateBlock

func (v *BlockValidator) ValidateBlock(b *types.Block) error

type Blockchain

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

func NewBlockchain

func NewBlockchain(l log.Logger, privateKey *types.PrivateKey) (*Blockchain, error)

func (*Blockchain) GiveReward

func (bc *Blockchain) GiveReward(address common.Address) error

func (*Blockchain) LinkBlock

func (bc *Blockchain) LinkBlock(b *types.Block) error

func (*Blockchain) LinkBlockWithoutValidation

func (bc *Blockchain) LinkBlockWithoutValidation(b *types.Block) error

func (*Blockchain) ReadAccountByAddress

func (bc *Blockchain) ReadAccountByAddress(address common.Address) (*types.Account, error)

func (*Blockchain) ReadAccountNonceByAddress

func (bc *Blockchain) ReadAccountNonceByAddress(address common.Address) (*uint64, error)

func (*Blockchain) ReadBalance

func (bc *Blockchain) ReadBalance(address common.Address) (*uint64, error)

func (*Blockchain) ReadBlockByHash

func (bc *Blockchain) ReadBlockByHash(hash common.Hash) (*types.Block, error)

func (*Blockchain) ReadBlockByHeight

func (bc *Blockchain) ReadBlockByHeight(height int32) (*types.Block, error)

func (*Blockchain) ReadBlocks

func (bc *Blockchain) ReadBlocks(page int, size int) ([]*types.Block, error)

func (*Blockchain) ReadBlocksByHash

func (bc *Blockchain) ReadBlocksByHash(hash common.Hash, size int) ([]*types.Block, error)

사용시 수정 필요함.

func (*Blockchain) ReadHeaderByHash

func (bc *Blockchain) ReadHeaderByHash(hash common.Hash) (*types.Header, error)

func (*Blockchain) ReadHeaderByHeight

func (bc *Blockchain) ReadHeaderByHeight(height int32) (*types.Header, error)

func (*Blockchain) ReadHeaders

func (bc *Blockchain) ReadHeaders(page int, size int) ([]*types.Header, error)

func (*Blockchain) ReadLastBlock

func (bc *Blockchain) ReadLastBlock() (*types.Block, error)

func (*Blockchain) ReadLastBlockHeight

func (bc *Blockchain) ReadLastBlockHeight() (*int32, error)

func (*Blockchain) ReadLastHeader

func (bc *Blockchain) ReadLastHeader() (*types.Header, error)

func (*Blockchain) ReadLastHeaderHeight

func (bc *Blockchain) ReadLastHeaderHeight() (*int32, error)

func (*Blockchain) ReadLastTx

func (bc *Blockchain) ReadLastTx() (*types.Transaction, error)

func (*Blockchain) ReadLastTxNumber

func (bc *Blockchain) ReadLastTxNumber() (*uint32, error)

func (*Blockchain) ReadTxByHash

func (bc *Blockchain) ReadTxByHash(hash common.Hash) (*types.Transaction, error)

func (*Blockchain) ReadTxByNumber

func (bc *Blockchain) ReadTxByNumber(number uint32) (*types.Transaction, error)

func (*Blockchain) ReadTxs

func (bc *Blockchain) ReadTxs(page int, size int) ([]*types.Transaction, error)

func (*Blockchain) RemoveLastBlock

func (bc *Blockchain) RemoveLastBlock() error

func (*Blockchain) SetValidator

func (bc *Blockchain) SetValidator(v Validator)

func (*Blockchain) WriteAccountWithAddress

func (bc *Blockchain) WriteAccountWithAddress(address common.Address, account *types.Account) error

func (*Blockchain) WriteBlockWithHash

func (bc *Blockchain) WriteBlockWithHash(hash common.Hash, block *types.Block) error

func (*Blockchain) WriteBlockWithHeight

func (bc *Blockchain) WriteBlockWithHeight(height int32, block *types.Block) error

func (*Blockchain) WriteHeaderWithHash

func (bc *Blockchain) WriteHeaderWithHash(hash common.Hash, header *types.Header) error

func (*Blockchain) WriteHeaderWithHeight

func (bc *Blockchain) WriteHeaderWithHeight(height int32, header *types.Header) error

func (*Blockchain) WriteLastBlock

func (bc *Blockchain) WriteLastBlock(block *types.Block) error

func (*Blockchain) WriteLastHeader

func (bc *Blockchain) WriteLastHeader(header *types.Header) error

func (*Blockchain) WriteLastTx

func (bc *Blockchain) WriteLastTx(tx *types.Transaction) error

func (*Blockchain) WriteLastTxNumber

func (bc *Blockchain) WriteLastTxNumber(number uint32) error

func (*Blockchain) WriteTxWithHash

func (bc *Blockchain) WriteTxWithHash(hash common.Hash, tx *types.Transaction) error

func (*Blockchain) WriteTxWithNumber

func (bc *Blockchain) WriteTxWithNumber(number uint32, tx *types.Transaction) error

type Validator

type Validator interface {
	ValidateBlock(*types.Block) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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