Documentation ¶
Index ¶
- type PowRepo
- func (p *PowRepo) GetName() string
- func (p *PowRepo) GetTicketOutput() string
- func (p *PowRepo) GetWorkOutput() map[string]interface{}
- func (p *PowRepo) GetWorkProofOutput() map[string]interface{}
- func (p *PowRepo) MarshalJSON() (data []byte, err error)
- func (p *PowRepo) ValidateWork(data []byte) bool
- func (p *PowRepo) Work()
- type PowResultType
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PowRepo ¶
type PowRepo struct {
W proofofwork.ProofOfWork
}
PowRepo is the repository for proof of work
func (*PowRepo) GetTicketOutput ¶
GetTicketOutput will return the output that is stored inside a ticket
func (*PowRepo) GetWorkOutput ¶
GetWorkOutput will return a list of data that will be returned in the ticket
func (*PowRepo) GetWorkProofOutput ¶
GetWorkProofOutput will return the proof / work done that will be send back to the server
func (*PowRepo) MarshalJSON ¶
MarshalJSON will return a marshalled version of the pow repository
func (*PowRepo) ValidateWork ¶
ValidateWork will validate the work data
type PowResultType ¶
type PowResultType struct {
Proof uint64
}
PowResultType is the result that gets returned when done the work
type Repository ¶
type Repository interface { GetName() string GetWorkOutput() map[string]interface{} GetWorkProofOutput() map[string]interface{} ValidateWork(data []byte) bool Work() }
Repository is the main interface for work types
func GetPreferredWork ¶
func GetPreferredWork(preferences []string) (Repository, error)
GetPreferredWork will fetch work by taken the preference into account
func NewPow ¶
func NewPow() (Repository, error)
NewPow will return a new proof-of-work repository filled
func NewPowFromString ¶
func NewPowFromString(s string) (Repository, error)
NewPowFromString will return a new pow structure taken from a string representation