proofservice

package
v1.0.3-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParseDuration

func MustParseDuration(s string) time.Duration

func TryEnqueue

func TryEnqueue(job *Job, jobChan chan *Job) bool

Types

type AxisClient

type AxisClient interface {
	CheckNils(nils []c_type.Uint256) bool
	CommitTx(tx *txtool.GTx) error
}

type Backend

type Backend interface {
	CommitTx(tx *txtool.GTx) error
	CheckNil(Nils []c_type.Uint256) (nilResps []light.NilValue, e error)
}

type Config

type Config struct {
	PKr            c_type.PKr
	MaxWorkNumber  int
	MaxQueueNumber int
	Fee            ServiceFee
}

type JSONRpcResp

type JSONRpcResp struct {
	Id     *json.RawMessage       `json:"id"`
	Result *json.RawMessage       `json:"result"`
	Error  map[string]interface{} `json:"error"`
}

type Job

type Job struct {
	TxHash    common.Hash
	Timestamp time.Time
	Error     error
	// contains filtered or unexported fields
}

type LocalClient

type LocalClient struct {
	// contains filtered or unexported fields
}

func NewLocalClient

func NewLocalClient(backend Backend) *LocalClient

func (*LocalClient) CheckNils

func (self *LocalClient) CheckNils(nils []c_type.Uint256) bool

func (*LocalClient) CommitTx

func (self *LocalClient) CommitTx(tx *txtool.GTx) error

type MapStorage

type MapStorage struct {
	// contains filtered or unexported fields
}

func (*MapStorage) Exists

func (storage *MapStorage) Exists(hash common.Hash) bool

func (*MapStorage) Get

func (storage *MapStorage) Get(hash common.Hash) *Job

func (*MapStorage) Save

func (storage *MapStorage) Save(job *Job)

type ProofService

type ProofService struct {
	// contains filtered or unexported fields
}

func Instance

func Instance() *ProofService

func NewProofService

func NewProofService(rpc string, backend Backend, config *Config) *ProofService

func (*ProofService) Fee

func (proof *ProofService) Fee() ServiceFee

func (*ProofService) FindTxHash

func (proof *ProofService) FindTxHash(hash common.Hash) common.Hash

func (*ProofService) SubmitWork

func (proof *ProofService) SubmitWork(tx *stx.T, param *txtool.GTxParam) error

type RemoteClient

type RemoteClient struct {
	// contains filtered or unexported fields
}

func NewRemoteClient

func NewRemoteClient(host string) *RemoteClient

func (*RemoteClient) CheckNils

func (self *RemoteClient) CheckNils(nils []c_type.Uint256) bool

func (*RemoteClient) CommitTx

func (self *RemoteClient) CommitTx(tx *txtool.GTx) error

type ServiceFee

type ServiceFee struct {
	ZinFee   *big.Int
	OinFee   *big.Int
	OutFee   *big.Int
	FixedFee *big.Int
}

type Storage

type Storage interface {
	Exists(common.Hash) bool
	Save(job *Job)
	Get(hash common.Hash) *Job
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL