network_broadcast_api.broadcast_transaction
Purpose
用于广播一笔交易(transaction)。
Parameters
PARAMETERS
json
{
"trx": {
"ref_block_num": 0,
"ref_block_prefix": 0,
"expiration": "1970-01-01T00:00:00",
"operations": [],
"extensions": [],
"signatures": []
},
"max_block_age": -1
}Example
Example 1
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "network_broadcast_api.broadcast_transaction",
"params": {
"trx": {
"ref_block_num": 1097,
"ref_block_prefix": 2181793527,
"expiration": "2016-03-24T18:00:21",
"operations": [
{
"type": "vote_operation",
"value": {
"voter": "steemit",
"author": "alice",
"permlink": "a-post-by-alice",
"weight": 10000
}
}
],
"extensions": [],
"signatures": []
},
"max_block_age": 50
},
"id": 1
}'Example 2
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "network_broadcast_api.broadcast_transaction",
"params": {
"trx": {
"ref_block_num": 1097,
"ref_block_prefix": 2181793527,
"expiration": "2016-03-24T18:00:21",
"operations": [
{
"type": "pow_operation",
"value": {
"worker_account": "cloop3",
"block_id": "00000449f7860b82b4fbe2f317c670e9f01d6d9a",
"nonce": 3899,
"work": {
"worker": "STM7P5TDnA87Pj9T4mf6YHrhzjC1KbPZpNxLWCcVcHxNYXakpoT4F",
"input": "ae8e7c677119d22385f8c48026fee7aad7bba693bf788d7f27047f40b47738c0",
"signature": "1f38fe9a3f9989f84bd94aa5bbc88beaf09b67f825aa4450cf5105d111149ba6db560b582c7dbb026c7fc9c2eb5051815a72b17f6896ed59d3851d9a0f9883ca7a",
"work": "000e7b209d58f2e64b36e9bf12b999c6c7af168cc3fc41eb7f8a4bf796c174c3"
},
"props": {
"account_creation_fee": {
"amount": "100000",
"precision": 3,
"nai": "@@000000021"
},
"maximum_block_size": 131072,
"sbd_interest_rate": 1000
}
}
}
],
"extensions": [],
"signatures": []
},
"max_block_age": 50
},
"id": 1
}'Response
RESPONSE
json
{}Expected curl responses
EXPECTED RESPONSES
text
Internal Errortext
Internal Error