Documentation ¶
Overview ¶
blockchain.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAddress ¶
Types ¶
type Block ¶
type Block struct { Index int PrevHash string Hash string TimeStamp string Data string Transactions []*Transaction }
func CreateGenesisBlock ¶
func CreateGenesisBlock() *Block
type Blockchain ¶
type Blockchain struct {
Blocks []*Block
}
func NewBlockchain ¶
func NewBlockchain() *Blockchain
func NewBlockchainWithGenesis ¶
func NewBlockchainWithGenesis(genesis *Block) *Blockchain
func (*Blockchain) AddBlock ¶
func (bc *Blockchain) AddBlock(data string, sender *Wallet, receiver *Wallet, amount int)
func (*Blockchain) PrintBlockchain ¶
func (bc *Blockchain) PrintBlockchain()
type Wallet ¶
type Wallet struct { PrivateKey *ecdsa.PrivateKey PublicKey *ecdsa.PublicKey }
func CreateWallet ¶
Click to show internal directories.
Click to hide internal directories.