Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge struct { // What function to be used to search for an answer CostFunction CostFunction // Starting number from where the search for the solution should start (inclusive) // Big-endian unsigned integer BlockStart []byte // End number where the search for the solution should stop (exclusive) // Big-endian unsigned integer BlockEnd []byte // Required number of zero bits in the beginning of CostFunction output Difficulty int // time in Unix seconds, when the challenge expires ExpireAt int64 }
type ChallengeRequest ¶
type ChallengeRequest struct { }
type ChallengeResponse ¶
type Client ¶
type Client interface { GetChallenge(ctx context.Context, rq *ChallengeRequest) (*ChallengeResponse, error) GetQuote(ctx context.Context, rq *QuoteRequest) (*QuoteResponse, error) }
func NewClient ¶
func NewClient(cfg *ClientConfig) Client
type ClientConfig ¶
type ClientConfig struct {
Address string
}
type QuoteRequest ¶
type QuoteRequest struct { ChallengeResponse // Solution of the challenge on the range starting from BlockStart to BlockEnd // CostFunction applied on the Solution should return the result, which has number of leading zero bytes equal to // Difficulty. // Big-endian unsigned integer Solution []byte }
type QuoteResponse ¶
type QuoteResponse struct {
Quote string
}
Click to show internal directories.
Click to hide internal directories.