Documentation ¶
Index ¶
- Variables
- func BigDiffToLittle(diff *big.Int) float64
- func CalculateTarget(bits uint64) big.Int
- func DiffToHash(diff float64) float64
- func DiffToTarget(diff float64) *big.Int
- func GenerateJobHeader(headerData []byte) []uint64
- func GenerateLargeJobParams(headerData []byte, timestamp uint64) string
- func ListenAndServe(cfg BridgeConfig) error
- func MiningStateGenerator() any
- func SerializeBlockHeader(template *appmessage.RPCBlock) ([]byte, error)
- type AuthDbQuery
- type BridgeConfig
- type ErrorJob
- type ErrorShortCodeT
- type KaspaApi
- type MiningState
- type OraBackend
- type OraJob
- type SubmitBlockDbQuery
- type SubmitShareDbQuery
Constants ¶
This section is empty.
Variables ¶
View Source
var ()
Functions ¶
func BigDiffToLittle ¶
func CalculateTarget ¶
func DiffToHash ¶
func DiffToTarget ¶
func GenerateJobHeader ¶
func GenerateLargeJobParams ¶
func ListenAndServe ¶
func ListenAndServe(cfg BridgeConfig) error
func MiningStateGenerator ¶
func MiningStateGenerator() any
func SerializeBlockHeader ¶
func SerializeBlockHeader(template *appmessage.RPCBlock) ([]byte, error)
Types ¶
type AuthDbQuery ¶
type BridgeConfig ¶
type BridgeConfig struct { StratumPort string `yaml:"stratum_port"` RPCServer string `yaml:"kaspad_address"` UseLogFile bool `yaml:"log_to_file"` BlockWaitTime time.Duration `yaml:"block_wait_time"` ExtranonceSize uint `yaml:"extranonce_size"` PoolWallet string `yaml:"pool_wallet"` OraConnStr string `yaml:"ora_connstr"` }
type ErrorShortCodeT ¶
type ErrorShortCodeT string
const ( ErrNoMinerAddress ErrorShortCodeT = "err_no_miner_address" ErrFailedBlockFetch ErrorShortCodeT = "err_failed_block_fetch" ErrInvalidAddressFmt ErrorShortCodeT = "err_malformed_wallet_address" ErrMissingJob ErrorShortCodeT = "err_missing_job" ErrBadDataFromMiner ErrorShortCodeT = "err_bad_data_from_miner" ErrFailedSendWork ErrorShortCodeT = "err_failed_sending_work" ErrFailedSetDiff ErrorShortCodeT = "err_diff_set_failed" ErrDisconnected ErrorShortCodeT = "err_worker_disconnected" )
type KaspaApi ¶
type KaspaApi struct { PoolWallet string // contains filtered or unexported fields }
func NewKaspaAPI ¶
func (*KaspaApi) GetBlockTemplate ¶
func (ks *KaspaApi) GetBlockTemplate( client *gostratum.StratumContext) (*appmessage.GetBlockTemplateResponseMessage, error)
type MiningState ¶
type MiningState struct { Jobs map[int]*appmessage.RPCBlock JobLock sync.Mutex // contains filtered or unexported fields }
func GetMiningState ¶
func GetMiningState(ctx *gostratum.StratumContext) *MiningState
func (*MiningState) AddJob ¶
func (ms *MiningState) AddJob(job *appmessage.RPCBlock) int
func (*MiningState) GetJob ¶
func (ms *MiningState) GetJob(id int) (*appmessage.RPCBlock, bool)
type OraBackend ¶
type OraBackend struct { Jobs map[uint32]OraJob JobLock sync.RWMutex FileLock sync.RWMutex JobCounter uint32 JobDeleted uint32 Coin string Db *sql.DB // contains filtered or unexported fields }
func NewOraBackend ¶
func NewOraBackend(coin string, logger *zap.SugaredLogger, connstr string) (*OraBackend, error)
func (*OraBackend) AddJob ¶
func (ob *OraBackend) AddJob(jobType string, jobText string)
func (*OraBackend) AddObj ¶
func (ob *OraBackend) AddObj(jobType string, jobObj any)
type SubmitBlockDbQuery ¶
type SubmitShareDbQuery ¶
type SubmitShareDbQuery struct {}
Click to show internal directories.
Click to hide internal directories.