Miner

Last updated 4 months ago

miner_start

Start the CPU miner.

Private: Requires authentication.

Parameters: None

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start", "id":21}'

Console Example

> miner.start()

Returns:

Boolean

Output:

{
"id": 21,
"jsonrpc": "2.0",
"result": true
}

miner_stop

Stop the CPU miner.

Private: Requires authentication.

Parameters: None

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"miner_stop", "id":21}'

Console Example

> miner.stop()

Returns:

Boolean

Output:

{
"id": 21,
"jsonrpc": "2.0",
"result": true
}

miner_stop

Stop the CPU miner.

Parameters: None

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"miner_stop", "id":21}'

Console Example

> miner.stop()

Returns:

Boolean

Output:

{
"id": 21,
"jsonrpc": "2.0",
"result": true
}

miner_isMining

Checks whether the CPU miner is running.

Parameters: None

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"miner_isMining", "id":21}'

Console Example

> miner.isMining()

Returns:

Boolean

Output:

{
"id": 21,
"jsonrpc": "2.0",
"result": true
}

miner_setThreads

Set the number of miner threads. By default, it is set to the number of available CPUs on the machine.

Private: Requires authentication.

Parameters: None

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setThreads", "id":21}'

Console Example

> miner.setThreads(3)

Returns:

Boolean

Output:

{
"id": 21,
"jsonrpc": "2.0",
"result": true
}

miner_getHashrate

Get the hashrate.

Parameters: None

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"miner_getHashrate", "id":21}'

Console Example

> miner.getHashrate()

Returns:

Integer

Output:

{
"id": 21,
"jsonrpc": "2.0",
"result": 1000
}

‚Äč