Documentation
¶
Index ¶
- func CreateGenesisBlock(privateKey *types.PrivateKey) *types.Block
- type BlockValidator
- type Blockchain
- func (bc *Blockchain) GiveReward(address common.Address) error
- func (bc *Blockchain) LinkBlock(b *types.Block) error
- func (bc *Blockchain) LinkBlockWithoutValidation(b *types.Block) error
- func (bc *Blockchain) ReadAccountByAddress(address common.Address) (*types.Account, error)
- func (bc *Blockchain) ReadAccountNonceByAddress(address common.Address) (*uint64, error)
- func (bc *Blockchain) ReadBalance(address common.Address) (*uint64, error)
- func (bc *Blockchain) ReadBlockByHash(hash common.Hash) (*types.Block, error)
- func (bc *Blockchain) ReadBlockByHeight(height int32) (*types.Block, error)
- func (bc *Blockchain) ReadBlocks(page int, size int) ([]*types.Block, error)
- func (bc *Blockchain) ReadBlocksByHash(hash common.Hash, size int) ([]*types.Block, error)
- func (bc *Blockchain) ReadHeaderByHash(hash common.Hash) (*types.Header, error)
- func (bc *Blockchain) ReadHeaderByHeight(height int32) (*types.Header, error)
- func (bc *Blockchain) ReadHeaders(page int, size int) ([]*types.Header, error)
- func (bc *Blockchain) ReadLastBlock() (*types.Block, error)
- func (bc *Blockchain) ReadLastBlockHeight() (*int32, error)
- func (bc *Blockchain) ReadLastHeader() (*types.Header, error)
- func (bc *Blockchain) ReadLastHeaderHeight() (*int32, error)
- func (bc *Blockchain) ReadLastTx() (*types.Transaction, error)
- func (bc *Blockchain) ReadLastTxNumber() (*uint32, error)
- func (bc *Blockchain) ReadTxByHash(hash common.Hash) (*types.Transaction, error)
- func (bc *Blockchain) ReadTxByNumber(number uint32) (*types.Transaction, error)
- func (bc *Blockchain) ReadTxs(page int, size int) ([]*types.Transaction, error)
- func (bc *Blockchain) RemoveLastBlock() error
- func (bc *Blockchain) SetValidator(v Validator)
- func (bc *Blockchain) WriteAccountWithAddress(address common.Address, account *types.Account) error
- func (bc *Blockchain) WriteBlockWithHash(hash common.Hash, block *types.Block) error
- func (bc *Blockchain) WriteBlockWithHeight(height int32, block *types.Block) error
- func (bc *Blockchain) WriteHeaderWithHash(hash common.Hash, header *types.Header) error
- func (bc *Blockchain) WriteHeaderWithHeight(height int32, header *types.Header) error
- func (bc *Blockchain) WriteLastBlock(block *types.Block) error
- func (bc *Blockchain) WriteLastHeader(header *types.Header) error
- func (bc *Blockchain) WriteLastTx(tx *types.Transaction) error
- func (bc *Blockchain) WriteLastTxNumber(number uint32) error
- func (bc *Blockchain) WriteTxWithHash(hash common.Hash, tx *types.Transaction) error
- func (bc *Blockchain) WriteTxWithNumber(number uint32, tx *types.Transaction) error
- type Validator
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) LinkBlockWithoutValidation ¶
func (bc *Blockchain) LinkBlockWithoutValidation(b *types.Block) error
func (*Blockchain) ReadAccountByAddress ¶
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 (*Blockchain) ReadBlockByHeight ¶
func (bc *Blockchain) ReadBlockByHeight(height int32) (*types.Block, error)
func (*Blockchain) ReadBlocks ¶
func (*Blockchain) ReadBlocksByHash ¶
사용시 수정 필요함.
func (*Blockchain) ReadHeaderByHash ¶
func (*Blockchain) ReadHeaderByHeight ¶
func (bc *Blockchain) ReadHeaderByHeight(height int32) (*types.Header, error)
func (*Blockchain) ReadHeaders ¶
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 (*Blockchain) WriteBlockWithHash ¶
func (*Blockchain) WriteBlockWithHeight ¶
func (bc *Blockchain) WriteBlockWithHeight(height int32, block *types.Block) error
func (*Blockchain) WriteHeaderWithHash ¶
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.