Documentation ¶
Index ¶
- Constants
- func CheckForDuplicatesAndEmptyStrings(input []string) error
- func GetBaseBTCHeaderHeight() uint64
- func GetBaseBTCHeaderHex() string
- func GetMaxDifficulty() big.Int
- func MustGetGasSettings(configPath string, v *viper.Viper) (string, float64)
- func ParseKeyNameFromConfig(opts servertypes.AppOptions) string
- func Reverse(s interface{})
- func ValidateBTCHeader(header *wire.BlockHeader, powLimit *big.Int) error
- type BTCHeaderBytes
- func (m *BTCHeaderBytes) Bits() uint32
- func (m *BTCHeaderBytes) Difficulty() *big.Int
- func (m *BTCHeaderBytes) Eq(other *BTCHeaderBytes) bool
- func (m *BTCHeaderBytes) FromBlockHeader(header *wire.BlockHeader)
- func (m *BTCHeaderBytes) HasParent(header *BTCHeaderBytes) bool
- func (m *BTCHeaderBytes) Hash() *BTCHeaderHashBytes
- func (m BTCHeaderBytes) Marshal() ([]byte, error)
- func (m BTCHeaderBytes) MarshalHex() string
- func (m BTCHeaderBytes) MarshalJSON() ([]byte, error)
- func (m BTCHeaderBytes) MarshalTo(data []byte) (int, error)
- func (m BTCHeaderBytes) MustMarshal() []byte
- func (m *BTCHeaderBytes) ParentHash() *BTCHeaderHashBytes
- func (m *BTCHeaderBytes) Size() int
- func (m *BTCHeaderBytes) Time() time.Time
- func (m BTCHeaderBytes) ToBlockHeader() *wire.BlockHeader
- func (m *BTCHeaderBytes) Unmarshal(data []byte) error
- func (m *BTCHeaderBytes) UnmarshalHex(header string) error
- func (m *BTCHeaderBytes) UnmarshalJSON(bz []byte) error
- type BTCHeaderHashBytes
- func (m *BTCHeaderHashBytes) Eq(hash *BTCHeaderHashBytes) bool
- func (m *BTCHeaderHashBytes) FromChainhash(hash *chainhash.Hash)
- func (m BTCHeaderHashBytes) Marshal() ([]byte, error)
- func (m *BTCHeaderHashBytes) MarshalHex() string
- func (m BTCHeaderHashBytes) MarshalJSON() ([]byte, error)
- func (m BTCHeaderHashBytes) MarshalTo(data []byte) (int, error)
- func (m BTCHeaderHashBytes) MustMarshal() []byte
- func (m *BTCHeaderHashBytes) Size() int
- func (m *BTCHeaderHashBytes) String() string
- func (m BTCHeaderHashBytes) ToChainhash() *chainhash.Hash
- func (m *BTCHeaderHashBytes) Unmarshal(bz []byte) error
- func (m *BTCHeaderHashBytes) UnmarshalHex(hash string) error
- func (m *BTCHeaderHashBytes) UnmarshalJSON(bz []byte) error
- type BtcConfig
- type SupportedBtcNetwork
Constants ¶
View Source
const BTCHeaderHashLen = 32
View Source
const BTCHeaderLen = 80
Variables ¶
This section is empty.
Functions ¶
func CheckForDuplicatesAndEmptyStrings ¶ added in v0.6.0
func GetBaseBTCHeaderHeight ¶
func GetBaseBTCHeaderHeight() uint64
func GetBaseBTCHeaderHex ¶
func GetBaseBTCHeaderHex() string
func GetMaxDifficulty ¶
func MustGetGasSettings ¶ added in v0.6.0
MustGetGasSettings reads GasPrice and GasAdjustment from app.toml file
func ParseKeyNameFromConfig ¶
func ParseKeyNameFromConfig(opts servertypes.AppOptions) string
func ValidateBTCHeader ¶
func ValidateBTCHeader(header *wire.BlockHeader, powLimit *big.Int) error
ValidateBTCHeader Perform the checks that [checkBlockHeaderSanity](https://github.com/btcsuite/btcd/blob/master/blockchain/validate.go#L430) of btcd does
We skip the "timestamp should not be 2 hours into the future" check since this might introduce undeterministic behavior
Types ¶
type BTCHeaderBytes ¶
type BTCHeaderBytes []byte
func GetBaseBTCHeaderBytes ¶
func GetBaseBTCHeaderBytes() BTCHeaderBytes
func NewBTCHeaderBytesFromBlockHeader ¶
func NewBTCHeaderBytesFromBlockHeader(header *wire.BlockHeader) BTCHeaderBytes
func NewBTCHeaderBytesFromBytes ¶
func NewBTCHeaderBytesFromBytes(header []byte) (BTCHeaderBytes, error)
func NewBTCHeaderBytesFromHex ¶
func NewBTCHeaderBytesFromHex(hex string) (BTCHeaderBytes, error)
func (*BTCHeaderBytes) Bits ¶
func (m *BTCHeaderBytes) Bits() uint32
func (*BTCHeaderBytes) Difficulty ¶
func (m *BTCHeaderBytes) Difficulty() *big.Int
func (*BTCHeaderBytes) Eq ¶
func (m *BTCHeaderBytes) Eq(other *BTCHeaderBytes) bool
func (*BTCHeaderBytes) FromBlockHeader ¶
func (m *BTCHeaderBytes) FromBlockHeader(header *wire.BlockHeader)
func (*BTCHeaderBytes) HasParent ¶
func (m *BTCHeaderBytes) HasParent(header *BTCHeaderBytes) bool
func (*BTCHeaderBytes) Hash ¶
func (m *BTCHeaderBytes) Hash() *BTCHeaderHashBytes
func (BTCHeaderBytes) Marshal ¶
func (m BTCHeaderBytes) Marshal() ([]byte, error)
func (BTCHeaderBytes) MarshalHex ¶
func (m BTCHeaderBytes) MarshalHex() string
func (BTCHeaderBytes) MarshalJSON ¶
func (m BTCHeaderBytes) MarshalJSON() ([]byte, error)
func (BTCHeaderBytes) MustMarshal ¶
func (m BTCHeaderBytes) MustMarshal() []byte
func (*BTCHeaderBytes) ParentHash ¶
func (m *BTCHeaderBytes) ParentHash() *BTCHeaderHashBytes
func (*BTCHeaderBytes) Size ¶
func (m *BTCHeaderBytes) Size() int
func (*BTCHeaderBytes) Time ¶
func (m *BTCHeaderBytes) Time() time.Time
func (BTCHeaderBytes) ToBlockHeader ¶
func (m BTCHeaderBytes) ToBlockHeader() *wire.BlockHeader
func (*BTCHeaderBytes) Unmarshal ¶
func (m *BTCHeaderBytes) Unmarshal(data []byte) error
func (*BTCHeaderBytes) UnmarshalHex ¶
func (m *BTCHeaderBytes) UnmarshalHex(header string) error
func (*BTCHeaderBytes) UnmarshalJSON ¶
func (m *BTCHeaderBytes) UnmarshalJSON(bz []byte) error
type BTCHeaderHashBytes ¶
type BTCHeaderHashBytes []byte
func NewBTCHeaderHashBytesFromBytes ¶
func NewBTCHeaderHashBytesFromBytes(hash []byte) (BTCHeaderHashBytes, error)
func NewBTCHeaderHashBytesFromChainhash ¶
func NewBTCHeaderHashBytesFromChainhash(chHash *chainhash.Hash) BTCHeaderHashBytes
func NewBTCHeaderHashBytesFromHex ¶
func NewBTCHeaderHashBytesFromHex(hex string) (BTCHeaderHashBytes, error)
func (*BTCHeaderHashBytes) Eq ¶
func (m *BTCHeaderHashBytes) Eq(hash *BTCHeaderHashBytes) bool
func (*BTCHeaderHashBytes) FromChainhash ¶
func (m *BTCHeaderHashBytes) FromChainhash(hash *chainhash.Hash)
func (BTCHeaderHashBytes) Marshal ¶
func (m BTCHeaderHashBytes) Marshal() ([]byte, error)
func (*BTCHeaderHashBytes) MarshalHex ¶
func (m *BTCHeaderHashBytes) MarshalHex() string
func (BTCHeaderHashBytes) MarshalJSON ¶
func (m BTCHeaderHashBytes) MarshalJSON() ([]byte, error)
func (BTCHeaderHashBytes) MarshalTo ¶
func (m BTCHeaderHashBytes) MarshalTo(data []byte) (int, error)
func (BTCHeaderHashBytes) MustMarshal ¶
func (m BTCHeaderHashBytes) MustMarshal() []byte
func (*BTCHeaderHashBytes) Size ¶
func (m *BTCHeaderHashBytes) Size() int
func (*BTCHeaderHashBytes) String ¶
func (m *BTCHeaderHashBytes) String() string
func (BTCHeaderHashBytes) ToChainhash ¶
func (m BTCHeaderHashBytes) ToChainhash() *chainhash.Hash
func (*BTCHeaderHashBytes) Unmarshal ¶
func (m *BTCHeaderHashBytes) Unmarshal(bz []byte) error
func (*BTCHeaderHashBytes) UnmarshalHex ¶
func (m *BTCHeaderHashBytes) UnmarshalHex(hash string) error
func (*BTCHeaderHashBytes) UnmarshalJSON ¶
func (m *BTCHeaderHashBytes) UnmarshalJSON(bz []byte) error
type BtcConfig ¶
type BtcConfig struct {
// contains filtered or unexported fields
}
func ParseBtcOptionsFromConfig ¶
func ParseBtcOptionsFromConfig(opts servertypes.AppOptions) BtcConfig
func (*BtcConfig) ReduceMinDifficulty ¶
func (*BtcConfig) RetargetAdjustmentFactor ¶
type SupportedBtcNetwork ¶
type SupportedBtcNetwork string
const ( BtcMainnet SupportedBtcNetwork = "mainnet" BtcTestnet SupportedBtcNetwork = "testnet" BtcSimnet SupportedBtcNetwork = "simnet" BtcRegtest SupportedBtcNetwork = "regtest" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.