Skip to content

Modules: ethash

ethash_getHashrate

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

Params (0)

None

Result

uint64

  • Required: ✓ Yes

=== "Schema"

``` Schema

- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string


```

=== "Raw"

``` Raw
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}
```

Client Method Invocation Examples

=== "Shell HTTP"

``` shell
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "ethash_getHashrate", "params": []}'
```

=== "Shell WebSocket"

``` shell
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "ethash_getHashrate", "params": []}'
```

=== "Javascript Console"

``` js
ethash.getHashrate();
```

ethash_submitHashrate

SubmitHashrate can be used for remote miners to submit their hash rate.
This enables the node to report the combined hash rate of all miners
which submit work through this node.

It accepts the miner hash rate and an identifier which must be unique
between nodes.

Params (2)

Parameters must be given by position.

1:
rate hexutil.Uint64

  • Required: ✓ Yes

=== "Schema"

``` Schema

- description: `Hex representation of a uint64`
- pattern: `^0x([a-fA-F\d])+$`
- title: `uint64`
- type: string


```

=== "Raw"

``` Raw
{
    "description": "Hex representation of a uint64",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "uint64",
    "type": [
        "string"
    ]
}
```

2:
id common.Hash

  • Required: ✓ Yes

=== "Schema"

``` Schema

- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string


```

=== "Raw"

``` Raw
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}
```

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

=== "Shell HTTP"

``` shell
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "ethash_submitHashrate", "params": [<rate>, <id>]}'
```

=== "Shell WebSocket"

``` shell
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "ethash_submitHashrate", "params": [<rate>, <id>]}'
```

=== "Javascript Console"

``` js
ethash.submitHashrate(rate,id);
```