Documentation
¶
Overview ¶
Copyright © 2021 Levi Noecker <levi.noecker@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2021 Levi Noecker <levi.noecker@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- Variables
- func BytesToString(bytes []byte) string
- func CreateLogPaymentsFile()
- func GetPoolStatus(opts *Opts)
- func JobFeeder(comms *Comms, jobComms *JobComms)
- func LogPaymentReq(poolIp string, wallet string, block int, amount string)
- func LogPaymentResp(paymentMsg []string, poolIp string)
- func Mine(opts *Opts)
- func Miner(workerNum string, comms *Comms, ready chan bool)
- func NewManagerComms() *managerComms
- func Parse(comms *Comms, poolIp string, wallet string, block int, resp string)
- func SolutionManager(solComms *SolutionComms, showPop bool)
- type Comms
- type Job
- type JobComms
- type MinerInfo
- type Opts
- type PoolStatus
- type Report
- type Solution
- type SolutionComms
- type TcpClient
Constants ¶
const ( JOINOK = "JOINOK" PASSFAILED = "PASSFAILED" PAYMENTOK = "PAYMENTOK" PONG = "PONG" POOLSTEPS = "POOLSTEPS" STATUS = "STATUS" STEPOK = "STEPOK" STEPFAIL = "STEPFAIL" )
const CSVHEADER = "Transaction Time,Pool IP Address,Wallet Address,Request Or Response,Block,Payment Amount,Order Id\n"
const (
HEADER = `` /* 229-byte string literal not displayed */
)
Variables ¶
var ( Commit = "0000000" Version = "v0.0.0" MinerName = fmt.Sprintf("ng%s", Version[1:]) )
Functions ¶
func BytesToString ¶
func CreateLogPaymentsFile ¶
func CreateLogPaymentsFile()
func GetPoolStatus ¶
func GetPoolStatus(opts *Opts)
func LogPaymentResp ¶
func NewManagerComms ¶
func NewManagerComms() *managerComms
func SolutionManager ¶
func SolutionManager(solComms *SolutionComms, showPop bool)
Types ¶
type Comms ¶
type Comms struct { PoolAddr chan string MinerSeed chan string TargetString chan string TargetChars chan int Block chan int Step chan int Diff chan int PoolDepth chan int Balance chan string PoolHashRate chan string BlocksTillPayment chan int StepSolved chan int StepFailed chan int HashRate chan int Jobs chan Job Reports chan Report Solutions chan Solution Joined chan struct{} Pong chan struct{} PoolStatus chan PoolStatus Disconnected chan struct{} }
type JobComms ¶
type JobComms struct { PoolAddr chan string MinerSeed chan string Block chan int Step chan int Diff chan int TargetChars chan int TargetString chan string PoolDepth chan int }
func NewJobComms ¶
func NewJobComms() *JobComms
type PoolStatus ¶
type PoolStatus struct { HashRateRaw string HashRate string FeeRaw int Fee string MinerCnt string Miners []MinerInfo }
func NewPoolStatus ¶
func NewPoolStatus(s []string) PoolStatus
s[] -> STATUS {hashrate} {fee} {share} {minerCount} [list of miners: {address}:{balance}:{blocks_until_paymet}]
func (*PoolStatus) PrettyPrint ¶
func (p *PoolStatus) PrettyPrint()
type SolutionComms ¶
type SolutionComms struct { Block chan int Step chan int Diff chan int Solution chan Solution SendChan chan string StepSent chan struct{} }
func NewSolutionComms ¶
func NewSolutionComms(sendChan chan string) *SolutionComms