json-rpc/docs/method_submit.md
Description
Submit a signed transaction to a full node.
| Name | Type | Description |
|---|---|---|
| data | string | Signed transaction data - hex-encoded bytes of BCS serialized Diem SignedTransaction type. |
Steps to create "data" parameters:
See more related at Crypto Spec
Null - on success
Note:
Errors during the transaction are indicated by different error codes:
| Code | Description |
|---|---|
| -32000 | Default server error |
| -32001 | VM validation error |
| -32002 | VM verification error |
| -32003 | VM invariant violation error |
| -32004 | VM deserialization error |
| -32005 | VM execution error |
| -32006 | VM unknown error |
| -32007 | Mempool error: invalid sequence number |
| -32008 | Mempool is full error |
| -32009 | Mempool error: account reached max capacity per account |
| -32010 | Mempool error: invalid update (only gas price increase is allowed) |
| -32011 | Mempool error: transaction did not pass VM validation |
| -32012 | Unknown error |
More information might be available in the “message” field, but this is not guaranteed. For VM and Mempool errors may include a "data" object contains more detail information.
// Request: submits a transaction whose hex-encoded BCS byte representation is in params
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"submit","params":["1668F6BE25668C1A17CD8CAF6B8D2F25370000000000000001E101A11CEB0B010000000701000202020403061004160205181D0735610896011000000001010000020001000003020301010004010300010501060C0108000506080005030A020A020005060C05030A020A020109000C4C696272614163636F756E741257697468647261774361706162696C6974791B657874726163745F77697468647261775F6361706162696C697479087061795F66726F6D1B726573746F72655F77697468647261775F6361706162696C69747900000000000000000000000000000001010104010C0B0011000C050E050A010A020B030B0438000B05110202010700000000000000000000000000000001034C4252034C4252000403262E691EC8C7E3E23470D8C3EE26E1A70140420F00000000000400040040420F00000000000000000000000000034C425200E8764817000000020020F549A91FB9989883FB4D38B463308F3EA82074FB39EA74DAE61F62E11BF55D25405CD26F114183C44874DD3F861E0AD24B8E5D8B8C1CAA1B79C7E641C664AE3FD645E4310237A0DC046046DEFBE27C4F15CAAB55A76BBAC15E92B444431232DE0C"],"id": 1}' https://testnet.diem.com/v1
// Response, for successful transaction submission
{
"id":1,
"jsonrpc":"2.0",
"diem_chain_id":2,
"diem_ledger_timestampusec":1596736351198722,
"diem_ledger_version":3475232,
"result":null
}