Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeVariableLengthInteger ¶
Get the Tx count, decode the variable length integer https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer
func GetShaString ¶
func HashString ¶
Types ¶
type Block ¶
type Block struct {
Raw []byte `json:"-"`
Hash string `json:"hash"`
Height uint `json:"height"`
Txs []*Tx `json:"tx,omitempty"`
Version uint32 `json:"ver"`
MerkleRoot string `json:"mrkl_root"`
BlockTime uint32 `json:"time"`
Bits uint32 `json:"bits"`
Nonce uint32 `json:"nonce"`
Size uint32 `json:"size"`
TxCnt uint32 `json:"n_tx"`
TotalBTC uint64 `json:"total_out"`
BlockReward float64 `json:"-"`
Parent string `json:"prev_block"`
Next string `json:"next_block"`
}
type Blockchain ¶
func NewBlockchain ¶
func NewBlockchain(path string, magic [4]byte) (blockchain *Blockchain, err error)
func (*Blockchain) FetchNextBlock ¶
func (blockchain *Blockchain) FetchNextBlock() (rawblock []byte, err error)
func (*Blockchain) NextBlock ¶
func (blockchain *Blockchain) NextBlock() (block *Block, err error)
func (*Blockchain) SkipBlock ¶
func (blockchain *Blockchain) SkipBlock() (err error)
type Tx ¶
Click to show internal directories.
Click to hide internal directories.