Перейти к основному содержимому

Мемпул узла и публикация транзакций

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

get_pool_size

Read only

Number of transactions in the mempool.

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

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_pool_size",
  "params": []
}
Response1 lines
0

Number of transactions in the Dandelion stempool.

Surface
/v2/foreign on port 3413
Parameters
none
Declared in
api/src/foreign_rpc.rs:661
  • Stem transactions are held before broadcast as a privacy measure, so a transaction can be in the stempool and invisible to peers.

This method takes no parameters.

6 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_stempool_size",
  "params": []
}
Response1 lines
0

The full contents of the mempool, not just its size.

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

This method takes no parameters.

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

push_transaction

Can move funds

Broadcast a finished transaction.

Irreversible once accepted. There is no unbroadcast, and no way to replace a transaction by fee.

Surface
/v2/foreign on port 3413
Parameters
2 positional
Declared in
api/src/foreign_rpc.rs:799
  • A wallet normally does this for you through post_tx on the Owner API. Reach for this only when you are driving the whole transaction yourself.
Parameters

A complete signed transaction object.

Skip the Dandelion stem phase and broadcast immediately.

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

Далее