Developer Resources
Block ExplorerGitHubRun a NodeMigration GuideETN Testnet Faucet
  • Overview
  • Foundational topics
    • Intro to the Electroneum Smart Chain
    • Intro to ETN
    • Intro to dapps
    • Web2 vs Web3
    • Accounts
    • Transactions
    • Blocks
    • Electroneum Virtual Machine (EVM)
      • Opcodes
    • Gas and Fees
    • Nodes and clients
    • Networks
    • Consensus mechanisms
      • IBFT
  • Electroneum Stack
    • Intro to the stack
    • Smart contracts
    • Development networks
    • Development frameworks
    • Electroneum client APIs
      • JavaScript APIs
      • JSON-RPC
    • Storage
    • Integrated Development Environments (IDEs)
    • Metamask
  • Advanced
    • Bridges
    • Standards
      • Token standards
        • ERC-20 Fungible Tokens
        • ERC-721 NFTs
    • Oracles
    • Networking layer
      • Network addresses
    • Data structures and encoding
      • Patricia Merkle Trie
      • Recursive-length prefix (RLP)
      • Web3 secret storage definition
  • Design fundamentals
    • Intro to design and UX
  • ETN-SC Client
    • Getting started
      • Introduction
      • Hardware requirements
      • Instaling ETN-SC
    • Fundamentals
      • Command-line options
      • Security
      • Sync-modes
      • Account management
      • Databases
      • Backup & restore
      • Logs
      • Connecting to peers
      • Pruning
      • Private networks
      • Config files
      • Light client
    • Interacting with ETN-SC
      • JSON-RPC Server
        • Batch requests
        • Real-time events
      • JSON-RPC Namespaces
        • admin
        • clique
        • debug
        • eth
        • istanbul
        • les
        • miner
        • net
        • personal
        • txpool
      • JS Console
      • JS Console 2: Contracts
      • GraphQL Server
    • Developers
      • Introduction
      • Dapp developers
        • Dev mode
        • Go API
        • Go Account Management
        • Go Contract Bindings
      • EVM tracing
        • Introduction
        • Basic traces
        • Built-in tracers
        • Custom EVM tracer
        • Tutorial for JavaScript tracing
      • ETN-SC developer
        • Developer guide
        • Disclosures
        • DNS discovery setup guide
        • Code review guidelines
      • Contributing
    • Monitoring
      • Creating Dashboards
      • Understanding Dashboards
      • Ethstats
      • Metrics
    • Tools
      • Clef
        • Introduction
        • APIs
        • Rules
        • Setup
        • Datatypes
        • Tutorial
        • Clique-signing
      • abigen
      • devp2p
    • FAQs
  • Migration to Smart Chain
    • Overview
    • How to Migrate
      • ETN Online Wallets
      • Paper Wallets
      • CLI Wallet Users
      • Exchange Holders
      • Exchanges
    • Bridge Smart Contract
  • Misc. Guides
    • Set up Ledger + Metamask
  • MY.ELECTRONEUM.COM
    • Vendor API
Powered by GitBook
On this page
  • miner_getHashrate
  • miner_setExtra
  • miner_setGasPrice
  • miner_setRecommitInterval
  • miner_start
  • miner_stop
  • miner_setEtherbase
  • miner_setGasLimit

Was this helpful?

  1. ETN-SC Client
  2. Interacting with ETN-SC
  3. JSON-RPC Namespaces

miner

The miner API is responsible to provide remote control the node's mining operation and set various mining specific settings.

miner_getHashrate

Get hashrate in H/s (Hash operations per second).

CLIENT
METHOD INVOCATION

Console

miner.getHashrate()

RPC

{"method": "miner_getHashrate", "params": []}

miner_setExtra

Sets the extra data a miner can include when miner blocks. This is capped at 32 bytes.

CLIENT
METHOD INVOCATION

Go

miner.setExtra(extra string) (bool, error)

Console

miner.setExtra(string)

RPC

{"method": "miner_setExtra", "params": [string]}

miner_setGasPrice

Sets the minimal accepted gas price when mining transactions. Any transactions that are below this limit are excluded from the mining process.

CLIENT
METHOD INVOCATION

Go

miner.setGasPrice(number *rpc.HexNumber) bool

Console

miner.setGasPrice(number)

RPC

{"method": "miner_setGasPrice", "params": [number]}

miner_setRecommitInterval

Updates the interval for recomitting the miner sealing work.

CLIENT
METHOD INVOCATION

Console

miner.setRecommitInterval(interval int)

RPC

{"method": "miner_setRecommitInterval", "params": [number]}

miner_start

Start the CPU mining process.

CLIENT
METHOD INVOCATION

Go

miner.Start() error

Console

miner.start()

RPC

{"method": "miner_start", "params": []}

miner_stop

Stop the CPU mining operation.

CLIENT
METHOD INVOCATION

Go

miner.Stop() bool

Console

miner.stop()

RPC

{"method": "miner_stop", "params": []}

miner_setEtherbase

Sets the etherbase, where mining rewards will go.

CLIENT
METHOD INVOCATION

Go

miner.SetEtherbase(common.Address) bool

Console

miner.setEtherbase(address)

RPC

{"method": "miner_setEtherbase", "params": [address]}

miner_setGasLimit

Sets the gas limit the miner will target when mining. Note: on networks where EIP-1559 is activated, this should be set to twice the gas target (i.e. the effective gas used on average per block) to be.

CLIENT
METHOD INVOCATION

Go

miner.SetGasLimit(number *rpc.HexNumber) bool

Console

miner.SetGasLimit(number)

RPC

{"method": "miner_setGasLimit", "params": [number]}

PreviouslesNextnet

Last updated 1 year ago

Was this helpful?