Documentation
¶
Index ¶
- func CreateTx(config *txConfig) (*wire.MsgTx, error)
- func GetBlock(cmd *cobra.Command, args []string) error
- func Send(cmd *cobra.Command, args []string) error
- func SignTx(privKey string, pkScript string, redeemTx *wire.MsgTx) error
- func Utxo(cmd *cobra.Command, args []string) error
- type Block
- type BlockHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTx ¶
CreateTx is based on examples provided at https://medium.com/swlh/create-raw-bitcoin-transaction-and-sign-it-with-golang-96b5e10c30aa
Types ¶
type Block ¶
type Block struct { Header *BlockHeader `json:"header,omitempty" yaml:"header,omitempty"` Transactions []string `json:"transactions,omitempty" yaml:"transactions,omitempty"` }
Block defines a custom view of actual block in the blockchain
type BlockHeader ¶
type BlockHeader struct { // Version of the block. This is not the same as the protocol version. Version int32 `json:"version,omitempty" yaml:"version,omitempty"` // Hash of the block Hash string `json:"hash,omitempty" yaml:"hash,omitempty"` // NumContiguousZerosInHash is the number of trailing zeros in the binary version of the hash NumContiguousZerosInHash int `json:"numContiguousZerosInHash,omitempty" yaml:"numContiguousZerosInHash,omitempty"` // PrevBlock is the hash of the previous block header in the blockchain PrevBlock string `json:"prevBlock,omitempty" yaml:"prevBlock,omitempty"` // Merkle tree reference to hash of all transactions for the block. MerkleRoot string `json:"merkleRoot,omitempty" yaml:"merkleRoot,omitempty"` // Time the block was created. This is, unfortunately, encoded as a // uint32 on the wire and therefore is limited to 2106. Timestamp time.Time `json:"timestamp,omitempty" yaml:"timestamp,omitempty"` // Difficulty target for the block. Bits uint32 `json:"bits,omitempty" yaml:"bits,omitempty"` // Nonce used to generate the block. Nonce uint32 `json:"nonce,omitempty" yaml:"nonce,omitempty"` }
BlockHeader defines information about a block
Click to show internal directories.
Click to hide internal directories.