Merge PR #2240: New broadcast command

Implement broadcast command/REST endpoint to submit transactions
generated offline with --generated-only and the sign command.
This commit is contained in:
Alessio Treglia
2018-09-08 17:26:20 +08:00
committed by Christopher Goes
parent 88a2ddeb25
commit 4448d175ad
10 changed files with 216 additions and 22 deletions
+41 -3
View File
@@ -226,12 +226,11 @@ Returns on success:
"sequence": 7
}
}
}
```
### POST /auth/accounts/sign
### POST /auth/tx/sign
- **URL**: `/auth/sign`
- **URL**: `/auth/tx/sign`
- **Functionality**: Sign a transaction without broadcasting it.
- Returns on success:
@@ -298,6 +297,45 @@ Returns on success:
}
```
### POST /auth/tx/broadcast
- **URL**: `/auth/broadcast`
- **Functionality**: Broadcast a transaction.
- Returns on success:
```json
{
"rest api": "1.0",
"code": 200,
"error": "",
"result":
{
"check_tx": {
"log": "Msg 0: ",
"gasWanted": "2742",
"gasUsed": "1002"
},
"deliver_tx": {
"log": "Msg 0: ",
"gasWanted": "2742",
"gasUsed": "2742",
"tags": [
{
"key": "c2VuZGVy",
"value": "Y29zbW9zMXdjNTl6ZXU3MmNjdnp5ZWR6ZGE1N3pzcXh2eXZ2Y3poaHBhdDI4"
},
{
"key": "cmVjaXBpZW50",
"value": "Y29zbW9zMTJ4OTNmY3V2azg3M3o1ejZnejRlNTl2dnlxcXp1eDdzdDcwNWd5"
}
]
},
"hash": "784314784503582AC885BD6FB0D2A5B79FF703A7",
"height": "5"
}
}
```
## ICS20 - TokenAPI
The TokenAPI exposes all functionality needed to query account balances and send transactions.
+6
View File
@@ -159,6 +159,12 @@ gaiacli sign \
unsignedSendTx.json > signedSendTx.json
```
You can broadcast the signed transaction to a node by providing the JSON file to the following command:
```
gaiacli broadcast --node=<node> signedSendTx.json
```
### Staking
#### Set up a Validator