跳到主要内容

节点区块模板

Endpoint
http://127.0.0.1:3413/v2/foreign
Credential
No credential by default. Optional, see foreign_api_secret_path
Methods here
3
Documented against
node 4.0.3, wallet 4.0.0

A candidate block to work on.

Surface
/v2/foreign on port 3413
Parameters
none
Declared in
api/src/foreign_rpc.rs:801

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_block_template",
  "params": []
}
Response
N/A

Attach a solution to a template.

Surface
/v2/foreign on port 3413
Parameters
2 positional
Declared in
api/src/foreign_rpc.rs:803
Parameters

The template you were given.

Externally tagged by algorithm, for example {"RandomX": "<decimal string>"}.

9 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "finalize_block_template",
  "params": [
    {},
    {}
  ]
}
Response
N/A

submit_block

Read only

Submit a finalised block to the chain.

Surface
/v2/foreign on port 3413
Parameters
1 positional
Declared in
api/src/foreign_rpc.rs:802
Parameters

The finalised block.

8 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "submit_block",
  "params": [
    {}
  ]
}
Response
N/A

下一页