Documentation ¶
Index ¶
- func DifficultyFromMultiplier(multiplier int) uint64
- func DifficultyToString(difficulty uint64) string
- func IsWorkValid(previous string, difficultyMultiplier int, w string) bool
- func MultiplierFromDifficulty(difficulty uint64) int
- func WorkCancelAPIRequest(url string, hash string)
- func WorkToString(w nanopow.Work) string
- func WriteChannelSafe(out chan *string, msg string) (err error)
- type PippinPow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DifficultyFromMultiplier ¶
This is a helper to convert work multiplier to difficulty string representation BoomPoW takes a multiplier while the node/other work servers take the string Our base is banano or nano's receive, which would be 1x Nano's send would be 64x
func DifficultyToString ¶
func WorkCancelAPIRequest ¶
Makes a work cancel request
func WorkToString ¶
func WriteChannelSafe ¶
Recovers from writing to close channel
Types ¶
type PippinPow ¶
type PippinPow struct { WorkPeers []string // contains filtered or unexported fields }
func NewPippinPow ¶
workPeers is an array of URLs to send work_generate requests to bpowKey and bpowUrl are optional, bpowUrl will default to boompow.banano.cc/graphql
func (*PippinPow) SetWorkPeersFailing ¶
func (*PippinPow) WorkGenerateMeta ¶
func (p *PippinPow) WorkGenerateMeta(hash string, difficultyMultiplier int, validate bool, blockAward bool, bpowKey string) (string, error)
The main entry point for Pippin WorkGenerate Invokes work_generate requests to every peer simultaneously including BoomPoW, depending on configuration Returns the first valid work response, sends cancel to everybody else If no peers or boompow configured, uses local PoW If all peers fail, will use local PoW until peers are responsive again