core

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Timestamp     int64
	Transactions  []*Transaction
	PrevBlockHash []byte
	Hash          []byte
	Nonce         int64
}

func DeserializeBlock

func DeserializeBlock(d []byte) *Block

func NewBlock

func NewBlock(transactions []*Transaction, prevBlockHash []byte) *Block

func (*Block) HashTransaction

func (b *Block) HashTransaction() []byte

func (*Block) Serialize

func (b *Block) Serialize() []byte

type Transaction

type Transaction struct {
	ID     []byte
	Input  []TxInput
	Output []TxOutput
}

func CoinbaseTx

func CoinbaseTx(to string, data string) *Transaction

type TxInput

type TxInput struct {
	TxId      []byte
	Value     int
	Signature string
}

type TxOutput

type TxOutput struct {
	Value     int
	PublicKey string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL