Documentation
¶
Overview ¶
Package miner is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterMinerManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMinerManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MinerManagerClient) error
- func RegisterMinerManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMinerManagerServer(s *grpc.Server, srv MinerManagerServer)
- type Extra
- func (*Extra) Descriptor() ([]byte, []int)
- func (m *Extra) GetExtra() string
- func (*Extra) ProtoMessage()
- func (m *Extra) Reset()
- func (m *Extra) String() string
- func (m *Extra) XXX_DiscardUnknown()
- func (m *Extra) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Extra) XXX_Merge(src proto.Message)
- func (m *Extra) XXX_Size() int
- func (m *Extra) XXX_Unmarshal(b []byte) error
- type MinerManagerClient
- type MinerManagerServer
- type Threads
- func (*Threads) Descriptor() ([]byte, []int)
- func (m *Threads) GetThreads() int32
- func (*Threads) ProtoMessage()
- func (m *Threads) Reset()
- func (m *Threads) String() string
- func (m *Threads) XXX_DiscardUnknown()
- func (m *Threads) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Threads) XXX_Merge(src proto.Message)
- func (m *Threads) XXX_Size() int
- func (m *Threads) XXX_Unmarshal(b []byte) error
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) ProtoMessage ¶
func (*Extra) ProtoMessage()
func (*Extra) XXX_DiscardUnknown ¶
func (m *Extra) XXX_DiscardUnknown()
func (*Extra) XXX_Marshal ¶
func (*Extra) XXX_Unmarshal ¶
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) GetThreads ¶
func (*Threads) ProtoMessage ¶
func (*Threads) ProtoMessage()
func (*Threads) XXX_DiscardUnknown ¶
func (m *Threads) XXX_DiscardUnknown()