proofservice

package
v1.0.1-dev Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: GPL-3.0 Imports: 18 Imported by: 3

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 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
	RedisConfig    RedisConfig
}

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 RedisClient

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

func NewRedisClient

func NewRedisClient(cfg *RedisConfig, prefix string) *RedisClient

func (*RedisClient) BgSave

func (r *RedisClient) BgSave() (string, error)

func (*RedisClient) Check

func (r *RedisClient) Check() (string, error)

func (*RedisClient) Client

func (r *RedisClient) Client() *redis.Client

func (*RedisClient) Exists

func (r *RedisClient) Exists(txHash common.Hash) bool

func (*RedisClient) Get

func (r *RedisClient) Get(txHash common.Hash) *Job

func (*RedisClient) Save

func (r *RedisClient) Save(job *Job)

type RedisConfig

type RedisConfig struct {
	Endpoint string `json:"endpoint"`
	Password string `json:"password"`
	Database int64  `json:"database"`
	PoolSize int    `json:"poolSize"`
}

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 SeroClient

type SeroClient interface {
	CheckNils(nils []c_type.Uint256) bool
	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