miner

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2018 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package miner is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMinerManagerHandler

func RegisterMinerManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMinerManagerHandler registers the http handlers for service MinerManager to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMinerManagerHandlerClient

func RegisterMinerManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MinerManagerClient) error

RegisterMinerManagerHandlerClient registers the http handlers for service MinerManager to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MinerManagerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MinerManagerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MinerManagerClient" to call the correct interceptors.

func RegisterMinerManagerHandlerFromEndpoint

func RegisterMinerManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMinerManagerHandlerFromEndpoint is same as RegisterMinerManagerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMinerManagerServer

func RegisterMinerManagerServer(s *grpc.Server, srv MinerManagerServer)

Types

type Extra

type Extra struct {
	Extra                string   `protobuf:"bytes,1,opt,name=extra,proto3" json:"extra,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ExTra the extra data string that is included when this miner mines a block.

func (*Extra) Descriptor

func (*Extra) Descriptor() ([]byte, []int)

func (*Extra) GetExtra

func (m *Extra) GetExtra() string

func (*Extra) ProtoMessage

func (*Extra) ProtoMessage()

func (*Extra) Reset

func (m *Extra) Reset()

func (*Extra) String

func (m *Extra) String() string

func (*Extra) XXX_DiscardUnknown

func (m *Extra) XXX_DiscardUnknown()

func (*Extra) XXX_Marshal

func (m *Extra) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Extra) XXX_Merge

func (m *Extra) XXX_Merge(src proto.Message)

func (*Extra) XXX_Size

func (m *Extra) XXX_Size() int

func (*Extra) XXX_Unmarshal

func (m *Extra) XXX_Unmarshal(b []byte) error

type MinerManagerClient

type MinerManagerClient interface {
	// Start the miner with the given number of threads. If threads is nil the number
	// of workers started is equal to the number of logical CPUs that are usable by
	// this process. If mining is already running, this method adjust the number of
	// threads allowed to use.
	Start(ctx context.Context, in *Threads, opts ...grpc.CallOption) (*empty.Empty, error)
	//    Stop the miner
	Stop(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*common.IsOk, error)
	// SetExtra sets the extra data string that is included when this miner mines a block.
	SetExtra(ctx context.Context, in *Extra, opts ...grpc.CallOption) (*common.IsOk, error)
	// SetGasPrice sets the minimum accepted gas price for the miner.
	SetGasPrice(ctx context.Context, in *common.GasPrice, opts ...grpc.CallOption) (*common.IsOk, error)
	// SetCoinbase sets the coinbase of the miner
	SetCoinbase(ctx context.Context, in *common.Address, opts ...grpc.CallOption) (*common.IsOk, error)
}

MinerManagerClient is the client API for MinerManager service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMinerManagerClient

func NewMinerManagerClient(cc *grpc.ClientConn) MinerManagerClient

type MinerManagerServer

type MinerManagerServer interface {
	// Start the miner with the given number of threads. If threads is nil the number
	// of workers started is equal to the number of logical CPUs that are usable by
	// this process. If mining is already running, this method adjust the number of
	// threads allowed to use.
	Start(context.Context, *Threads) (*empty.Empty, error)
	//    Stop the miner
	Stop(context.Context, *empty.Empty) (*common.IsOk, error)
	// SetExtra sets the extra data string that is included when this miner mines a block.
	SetExtra(context.Context, *Extra) (*common.IsOk, error)
	// SetGasPrice sets the minimum accepted gas price for the miner.
	SetGasPrice(context.Context, *common.GasPrice) (*common.IsOk, error)
	// SetCoinbase sets the coinbase of the miner
	SetCoinbase(context.Context, *common.Address) (*common.IsOk, error)
}

MinerManagerServer is the server API for MinerManager service.

type Threads

type Threads struct {
	Threads              int32    `protobuf:"varint,1,opt,name=threads,proto3" json:"threads,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Threads represents the number of threads opened.

func (*Threads) Descriptor

func (*Threads) Descriptor() ([]byte, []int)

func (*Threads) GetThreads

func (m *Threads) GetThreads() int32

func (*Threads) ProtoMessage

func (*Threads) ProtoMessage()

func (*Threads) Reset

func (m *Threads) Reset()

func (*Threads) String

func (m *Threads) String() string

func (*Threads) XXX_DiscardUnknown

func (m *Threads) XXX_DiscardUnknown()

func (*Threads) XXX_Marshal

func (m *Threads) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Threads) XXX_Merge

func (m *Threads) XXX_Merge(src proto.Message)

func (*Threads) XXX_Size

func (m *Threads) XXX_Size() int

func (*Threads) XXX_Unmarshal

func (m *Threads) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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