Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Server ¶
func Server(path string, bc Blockchain, blockfile string)
Types ¶
type Block ¶
type Block struct {
Time int64 `json:"t"`
Nonce int64 `json:"nonce"`
Data []byte `json:"data"`
Prevhash []byte `json:"phash"`
}
func (Block) Prettify ¶
func (b Block) Prettify() PrettyBlock
type Blockchain ¶
type Blockchain []Block
func BlockchainFromFile ¶
func BlockchainFromFile(blockfile string) Blockchain
func LastBlocks ¶
func LastBlocks(blockfile string, n int) Blockchain
func NewBlockchain ¶
func NewBlockchain(blockfile string) Blockchain
func (Blockchain) Comb ¶
func (bc Blockchain) Comb() Blockchain
func (Blockchain) Prettify ¶
func (bc Blockchain) Prettify() PrettyChain
func (Blockchain) Tofile ¶
func (bc Blockchain) Tofile(blockfile string)
to-do: io.reader version for big chains
type PrettyBlock ¶
type PrettyChain ¶
type PrettyChain []PrettyBlock
Click to show internal directories.
Click to hide internal directories.