Documentation ¶
Overview ¶
github is a Go library for accessing the Github API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockHash ¶
func GetTransactionHash ¶
func GetTransactionHash(tx Transaction) ([]byte, error)
Get the transaction hashcode that is calculated from the payload
Types ¶
type Block ¶
type Block struct { Index uint64 Timestamp string Transaction *Transaction Hash []byte PreviousHash []byte }
Type Block represents a transactions
func NewGenesisBlock ¶
func NewGenesisBlock() *Block
type Blockchain ¶
type Blockchain struct {
// contains filtered or unexported fields
}
Type Blockchain represents a Blockchain
func NewBlockchain ¶
func NewBlockchain(initialBlock *Block) *Blockchain
func (*Blockchain) AddBlock ¶
func (bc *Blockchain) AddBlock(t Transaction) error
AddBlock adds a new Block to the back of the Blockchain with a specific transaction
func (*Blockchain) GetCurrentBlock ¶
func (bc *Blockchain) GetCurrentBlock() *Block
GetCurrentBlock returns the tip Block
type Transaction ¶
func NewTransaction ¶
func NewTransaction(payload []byte) *Transaction
func (*Transaction) MarshalBinary ¶
func (tx *Transaction) MarshalBinary() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.