miner

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.

The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE

Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.

The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is the private miner prefixed set of APIs in the Miner JSON-RPC spec.

func NewPrivateAPI

func NewPrivateAPI(
	ctx *server.Context,
	backend backend.EVMBackend,
) *API

NewPrivateAPI creates an instance of the Miner API.

func (*API) GetHashrate

func (api *API) GetHashrate() uint64

GetHashrate returns the current hashrate for local CPU miner and remote miner. Unsupported in Ethermint

func (*API) SetEtherbase

func (api *API) SetEtherbase(etherbase common.Address) bool

SetEtherbase sets the etherbase of the miner

func (*API) SetExtra

func (api *API) SetExtra(_ string) (bool, error)

SetExtra sets the extra data string that is included when this miner mines a block. Unsupported in Ethermint

func (*API) SetGasLimit

func (api *API) SetGasLimit(_ hexutil.Uint64) bool

SetGasLimit sets the gaslimit to target towards during mining. Unsupported in Ethermint

func (*API) SetGasPrice

func (api *API) SetGasPrice(gasPrice hexutil.Big) bool

SetGasPrice sets the minimum accepted gas price for the miner.

func (*API) Start

func (api *API) Start(_ *int) error

Start starts 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 and updates the minimum price required by the transaction pool. Unsupported in Ethermint

func (*API) Stop

func (api *API) Stop()

Stop terminates the miner, both at the consensus engine level as well as at the block creation level. Unsupported in Ethermint

Jump to

Keyboard shortcuts

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