Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBlockchain ¶
func InitBlockchain(Coins uint64) (Blockchain, Account, error)
Types ¶
type Account ¶
type Block ¶
type Block struct { BlockId hash.Hash PrevHash hash.Hash Transactions []Transaction }
func CreateBlock ¶
func CreateBlock(prevHash hash.Hash, transactions []Transaction) (Block, error)
type Blockchain ¶
func (*Blockchain) AddBlock ¶
func (bch *Blockchain) AddBlock(b Block) error
func (Blockchain) CreateTransaction ¶
func (bch Blockchain) CreateTransaction(SetOfOperations []Operation) (Transaction, error)
func (*Blockchain) NewAccount ¶
func (bch *Blockchain) NewAccount(pair keypair.KeyPair) Account
func (Blockchain) String ¶
func (bch Blockchain) String() string
func (Blockchain) Verify ¶
func (bch Blockchain) Verify(op Operation) bool
type Depository ¶
type Depository struct { Identifier ed25519.PublicKey Balance uint64 DepositDatabase map[[32]byte]uint64 // contains filtered or unexported fields }
func NewDepository ¶
func NewDepository(pair keypair.KeyPair, faucetCoins uint64) Depository
func (Depository) SendInterests ¶
type Operation ¶
type Operation struct { Sender ed25519.PublicKey Receiver ed25519.PublicKey Amount uint64 SignedMessage signature.SignedMessage }
type PaymentMessages ¶
type PaymentMessages struct { Sender ed25519.PublicKey Receiver ed25519.PublicKey MoneyAmount uint64 }
func (*PaymentMessages) Decode ¶
func (message *PaymentMessages) Decode(input []byte)
func (PaymentMessages) Encode ¶
func (message PaymentMessages) Encode() []byte
type Transaction ¶
func (Transaction) String ¶
func (tx Transaction) String() string
func (Transaction) ToByte ¶
func (tx Transaction) ToByte() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.