Documentation ¶
Index ¶
- Constants
- func BitcoinBlockCopy(msg *btcdwire.MsgBlock) *btcdwire.MsgBlock
- func Bits2Difficulty(bits uint32) (float *big.Float)
- func BtcBlockToBlockAux(btcBlock *btcdwire.MsgBlock) wire.BTCBlockAux
- func BtcTxToJaxTx(tx *btcdwire.MsgTx) wire.MsgTx
- func CalculateSteps(data [][]byte) [][]byte
- func Difficulty2Target(bigDiff *big.Float) *big.Int
- func ExtractOptionsFromPassword(password string) (map[string]float64, error)
- func GetMerkleHashes(steps [][]byte) []string
- func HashSortingLastBits(diff *big.Int, chainIDCount uint32) uint32
- func JaxCoinbaseScript(nextBlockHeight int64, chainID uint32, extraNonce uint64) ([]byte, error)
- func JaxTxToBtcTx(tx *wire.MsgTx) btcdwire.MsgTx
- func MerkleJoin(h1, h2 []byte) []byte
- func MerkleTreeBranch(merkles []*btcdchainhash.Hash) (path []*btcdchainhash.Hash)
- func MerkleTreeBranchString(merkles []string) (path []string)
- func PackInt32BE(n int32) []byte
- func PackInt32LE(n int32) []byte
- func PackUint16LE(n uint16) []byte
- func PackUint32BE(n uint32) []byte
- func PackUint32LE(n uint32) []byte
- func PackUint64LE(n uint64) []byte
- func RandHexUint64() string
- func RandUint32() uint32
- func RandUint64() uint64
- func Range(start, stop, step int) []int
- func ReverseByteOrder(b []byte) []byte
- func ReverseBytes(b []byte) []byte
- func SerializeNumber(n uint64) []byte
- func SerializeString(s string) []byte
- func SetStratumExtraNonce(block btcdwire.MsgBlock, coinbaseParts BitcoinBlockCoinbaseParts, ...) btcdwire.MsgBlock
- func Sha256(b []byte) []byte
- func Sha256d(b []byte) []byte
- func SplitCoinbase(block btcdwire.MsgBlock) ([]byte, []byte)
- func StringsIndexOf(data []string, element string) int
- func Target2Difficulty(target *big.Int) (float *big.Float)
- func Uint256BytesFromHash(h string) ([]byte, error)
- func UpdateBeaconExtraNonce(beaconBlock wire.MsgBlock, height int64, extraNonce uint64) (wire.MsgBlock, error)
- func UpdateBitcoinExtraNonce(block btcdwire.MsgBlock, height int64, extraNonce uint64, beaconHash []byte) (btcdwire.MsgBlock, error)
- func UpdateMerkleRoot(msgBlock *wire.MsgBlock)
- func UpdateShardsMerkleRoot(shardBlock wire.MsgBlock, height int64, shardID uint32, extraNonce uint64) (wire.MsgBlock, error)
- func VarIntBytes(n uint64) []byte
- type BitcoinBlockCoinbaseParts
- type StoppableMixin
Constants ¶
View Source
const ChainIDCount = 4096
ChainIDCount = 2^12
View Source
const CoinbaseFlags = "/P2SH/jaxnet/"
CoinbaseFlags is added to the coinbase script of a generated block and is used to monitor BIP16 support as well as blocks that are generated via btcd.
Variables ¶
This section is empty.
Functions ¶
func BitcoinBlockCopy ¶ added in v0.2.0
BitcoinBlockCopy creates a deep copy of a MsgBlock so that the original does not get modified when the copy is manipulated.
func Bits2Difficulty ¶ added in v0.2.0
TODO: unused function
func BtcBlockToBlockAux ¶ added in v0.2.0
func BtcBlockToBlockAux(btcBlock *btcdwire.MsgBlock) wire.BTCBlockAux
func CalculateSteps ¶ added in v0.2.0
func ExtractOptionsFromPassword ¶ added in v0.2.0
func GetMerkleHashes ¶ added in v0.2.0
func HashSortingLastBits ¶ added in v0.2.0
func JaxCoinbaseScript ¶ added in v0.2.0
JaxCoinbaseScript returns a standard script suitable for use as the signature script of the coinbase transaction of a new block. In particular, it starts with the block height that is required by version 2 blocks and adds the extra nonce as well as additional coinbase flags.
func MerkleJoin ¶ added in v0.2.0
func MerkleTreeBranch ¶ added in v0.2.0
func MerkleTreeBranch(merkles []*btcdchainhash.Hash) (path []*btcdchainhash.Hash)
func MerkleTreeBranchString ¶ added in v0.2.0
func PackInt32BE ¶ added in v0.2.0
func PackInt32LE ¶ added in v0.2.0
func PackUint16LE ¶ added in v0.2.0
func PackUint32BE ¶ added in v0.2.0
func PackUint32LE ¶ added in v0.2.0
func PackUint64LE ¶ added in v0.2.0
func RandHexUint64 ¶ added in v0.2.0
func RandHexUint64() string
func RandUint32 ¶ added in v0.2.0
func RandUint32() uint32
func RandUint64 ¶ added in v0.2.0
func RandUint64() uint64
func ReverseByteOrder ¶ added in v0.2.0
ReverseByteOrder converts bytes in Little endian from/to Big endian
func ReverseBytes ¶ added in v0.2.0
func SerializeNumber ¶ added in v0.2.0
func SerializeString ¶ added in v0.2.0
func SetStratumExtraNonce ¶ added in v0.2.0
func StringsIndexOf ¶ added in v0.2.0
func Uint256BytesFromHash ¶ added in v0.2.0
func UpdateBeaconExtraNonce ¶ added in v0.2.0
func UpdateBitcoinExtraNonce ¶ added in v0.2.0
func UpdateMerkleRoot ¶ added in v0.2.0
func UpdateShardsMerkleRoot ¶ added in v0.2.0
func VarIntBytes ¶ added in v0.2.0
Types ¶
type BitcoinBlockCoinbaseParts ¶ added in v0.2.0
type StoppableMixin ¶
type StoppableMixin struct { Ctx context.Context MustBeStopped bool IsStopped func() bool Done chan struct{} }
func Init ¶ added in v0.2.0
func Init(ctx context.Context) (sm StoppableMixin)
func (*StoppableMixin) Finish ¶ added in v0.2.0
func (sm *StoppableMixin) Finish()
func (*StoppableMixin) StopUsing ¶
func (sm *StoppableMixin) StopUsing(wg *sync.WaitGroup)
Click to show internal directories.
Click to hide internal directories.