Generating

Try mining with the node.

Not recommended for production, please refer to the mining guide if you are mining on the mainnet

You can use mvc-cli help command to view the usage of specific commands. The JsonRpc call method is in the example.

Commands

== Generating ==
generate nblocks ( maxtries )
generatetoaddress nblocks address (maxtries)

generate

Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.

Param๏ผš

  • nblocks (numeric, required)

  • maxtries (numeric, optional)

generate nblocks ( maxtries )

Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.

Arguments:
1. nblocks      (numeric, required) How many blocks are generated immediately.
2. maxtries     (numeric, optional) How many iterations to try (default = 1000000).

Result:
[ blockhashes ]     (array) hashes of blocks generated

Examples:

Generate 11 blocks
> mvc-cli generate 11
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "generate", "params": [11] }' -H 'content-type: text/plain;' http://127.0.0.1:9882/

generatetoaddress

Mine blocks immediately to a specified address (before the RPC call returns)

Param๏ผš

  • nblocks (numeric, required) ่ฆ็”Ÿๆˆ็š„ๅŒบๅ—ๆ•ฐ้‡ใ€‚

  • address (string, required) ๅฅ–ๅŠฑๅ‘้€ๅˆฐ็š„ๅœฐๅ€ใ€‚

  • maxtries (numeric, optional) ๆœ€ๅคงๅฐ่ฏ•ๆฌกๆ•ฐ๏ผˆ้ป˜่ฎคไธบ1000000๏ผ‰ใ€‚