Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateWork(b Block) types.Work
- func HashBytes(inputs ...[]byte) types.BlockHash
- func HashChange(previous types.BlockHash, representative types.PubKey) types.BlockHash
- func HashOpen(source types.BlockHash, representative types.PubKey, account types.PubKey) types.BlockHash
- func HashReceive(previous types.BlockHash, source types.BlockHash) types.BlockHash
- func HashSend(previous types.BlockHash, destination types.PubKey, balance uint128.Uint128) types.BlockHash
- func HashUtx(account types.PubKey, prev types.BlockHash, repr types.PubKey, ...) types.BlockHash
- func SignMessage(prvStr string, message []byte) (types.Signature, error)
- func ValidateBlockWork(b Block) bool
- type Block
- type BlockStore
- type BlockType
- type ChangeBlock
- type CommonBlock
- type OpenBlock
- type RawBlock
- type ReceiveBlock
- type SendBlock
- type UtxBlock
Constants ¶
View Source
const ( Open BlockType = "open" Receive = "receive" Send = "send" Change = "change" Utx = "utx" )
View Source
const TestPrivateKey string = "34F0A37AAD20F4A260F0A5B3CB3D7FB50673212263E58A380BC10474BB039CE4"
Variables ¶
View Source
var GenesisAmount uint128.Uint128 = uint128.FromInts(0xffffffffffffffff, 0xffffffffffffffff)
View Source
var LiveGenesisBlock = liveGenesisBlock.(*OpenBlock)
View Source
var LiveGenesisBlockHash, _ = types.BlockHashFromString("991CF190094C00F0B68E2E5F75F6BEE95A2E0BD93CEAA4A6734DB9F19B728948")
View Source
var LiveGenesisSourceHash, _ = types.BlockHashFromString("E89208DD038FBB269987689621D52292AE9C35941A7484756ECCED92A65093BA")
View Source
var TestGenesisBlock = testGenesisBlock.(*OpenBlock)
Functions ¶
func GenerateWork ¶
func HashChange ¶
func HashReceive ¶
func ValidateBlockWork ¶
Types ¶
type Block ¶
type BlockStore ¶
type BlockStore struct {
// contains filtered or unexported fields
}
func NewBlockStore ¶
func NewBlockStore(store *store.Store) *BlockStore
func (*BlockStore) SetBlock ¶
func (s *BlockStore) SetBlock(b Block) error
type ChangeBlock ¶
type ChangeBlock struct {
Previous types.BlockHash
Representative types.PubKey
CommonBlock
}
func (*ChangeBlock) GetPrevious ¶
func (b *ChangeBlock) GetPrevious() types.BlockHash
func (*ChangeBlock) GetRoot ¶
func (b *ChangeBlock) GetRoot() types.BlockHash
func (*ChangeBlock) Hash ¶
func (b *ChangeBlock) Hash() types.BlockHash
func (*ChangeBlock) Type ¶
func (*ChangeBlock) Type() BlockType
type CommonBlock ¶
func (*CommonBlock) GetSignature ¶
func (b *CommonBlock) GetSignature() types.Signature
func (*CommonBlock) GetWork ¶
func (b *CommonBlock) GetWork() types.Work
type OpenBlock ¶
type OpenBlock struct {
Source types.BlockHash
Representative types.PubKey
Account types.PubKey
CommonBlock
}
var GenesisBlock *OpenBlock
func (*OpenBlock) GetPrevious ¶
func (*OpenBlock) VerifySignature ¶
type RawBlock ¶
type RawBlock struct {
Type BlockType
Source types.BlockHash
Representative types.PubKey
Account types.PubKey
Work types.Work
Signature types.Signature
Previous types.BlockHash
Balance uint128.Uint128
Destination types.PubKey
}
func (RawBlock) HashToString ¶
type ReceiveBlock ¶
type ReceiveBlock struct {
Previous types.BlockHash
Source types.BlockHash
CommonBlock
}
func (*ReceiveBlock) GetPrevious ¶
func (b *ReceiveBlock) GetPrevious() types.BlockHash
func (*ReceiveBlock) GetRoot ¶
func (b *ReceiveBlock) GetRoot() types.BlockHash
func (*ReceiveBlock) Hash ¶
func (b *ReceiveBlock) Hash() types.BlockHash
func (*ReceiveBlock) Type ¶
func (*ReceiveBlock) Type() BlockType
type SendBlock ¶
type SendBlock struct {
Previous types.BlockHash
Destination types.PubKey
Balance uint128.Uint128
CommonBlock
}
func (*SendBlock) GetPrevious ¶
Click to show internal directories.
Click to hide internal directories.