Send transactions
Use the SDK to send transactions from JavaScript applications, or use the REST API.
Tip
Use the transaction retry policy to retry pending transactions based on the gas price.
Prerequisites:
- Orchestrate running
- A registered chain
- A registered smart contract
- Sender account generated in Orchestrate.
Use the SDK
Prerequisites:
- Install the Orchestrate JS client library.
Example code is available in the Orchestrate Node SDK repository examples directory.
Use the REST API
Use the REST API to send:
-
Transactions
Send the transaction to the
/transaction/send
endpoint on the Orchestrate Gateway API. -
Raw transactions
Send the signed raw transaction to the
/transactions/send-raw
endpoint on the Orchestrate Gateway API.
Send the transaction
Send transactions using a from
address, or increase anonymity by having Orchestrate generate one time keys for single use sender accounts.
Transaction
{
"chain": "besu",
"params": {
"to": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"methodSignature": "increment(int256)",
"args": [2],
"from": "0x7e654d251da770a068413677967f6d3ea2fea9e4"
}
}
{
"uuid": "dffb0079-c21f-454f-b39f-e6c35e674e97",
"idempotencyKey": "lfzL7LnFvdI2ZvPy",
"chain": "besu",
"params": {
"from": "0x7e654d251da770a068413677967f6d3ea2fea9e4",
"to": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"methodSignature": "increment(int256)",
"args": [2]
},
"schedule": {
"uuid": "fd562eef-11cc-4339-b00c-f00c9e13c066",
"tenantID": "_",
"jobs": [
{
"uuid": "299fe6a6-cbbd-4a7f-b534-8d916a6416f3",
"chainUUID": "97b75b22-f0a1-43d0-a53e-25e5a7425538",
"scheduleUUID": "fd562eef-11cc-4339-b00c-f00c9e13c066",
"transaction": {
"from": "0x7e654d251da770a068413677967f6d3ea2fea9e4",
"to": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"data": "0xc03c30030000000000000000000000000000000000000000000000000000000000000002",
"createdAt": "2020-08-07T00:21:28.239229Z",
"updatedAt": "2020-08-07T00:21:28.239229Z"
},
"logs": [
{
"status": "CREATED",
"at": "2020-08-07T00:21:28.239229Z"
},
{
"status": "STARTED",
"at": "2020-08-07T00:21:28.249527Z"
}
],
"annotations": {
"chainID": "2020"
},
"status": "STARTED",
"type": "eth://ethereum/transaction",
"createdAt": "2020-08-07T00:21:28.239229Z"
}
],
"createdAt": "2020-08-07T00:21:28.239229Z"
},
"createdAt": "2020-08-07T00:21:28.239229Z"
}
In the JSON result, idempotencyKey
is a unique ID for the user transaction. Use the idempotencyKey
to retrieve the transaction details.
Raw transaction
{
"chain": "besu",
"params": {
"raw": "0xf86580808253189493f7274c...7ecbc53c0f57442ccf3d5960baa17"
}
}
{
"uuid": "00931dae-a047-4ec1-91bc-7104877370f8",
"idempotencyKey": "nqRX3ljo0i71QFJq",
"chain": "besu",
"params": {
"raw": "0xf86580808253189493f7274c9059e601be4512f656b57b830e019e23808490fa17bb820fe8a0ae9a7c01956f7c16f3e8858dddd117e8581c0b7a030130547893bbfcd89d5a1ea04fa1f39b76cfaf7ef6768469563f6ccdcaf7ecbc53c0f57442ccf3d5960baa17"
},
"schedule": {
"uuid": "5b684827-656f-401b-8465-84c69f8c50b2",
"tenantID": "_",
"jobs": [
{
"uuid": "a9a6bedd-3405-40e7-833f-fe44bd7fe90c",
"chainUUID": "4760abd2-d1b6-407b-99fe-11c8d71aeea8",
"scheduleUUID": "5b684827-656f-401b-8465-84c69f8c50b2",
"transaction": {
"raw": "0xf86580808253189493f7274c9059e601be4512f656b57b830e019e23808490fa17bb820fe8a0ae9a7c01956f7c16f3e8858dddd117e8581c0b7a030130547893bbfcd89d5a1ea04fa1f39b76cfaf7ef6768469563f6ccdcaf7ecbc53c0f57442ccf3d5960baa17",
"createdAt": "2020-08-12T09:00:58.532112Z",
"updatedAt": "2020-08-12T09:00:58.532112Z"
},
"logs": [
{
"status": "CREATED",
"at": "2020-08-12T09:00:58.532112Z"
},
{
"status": "STARTED",
"at": "2020-08-12T09:00:58.541245Z"
}
],
"annotations": {
"chainID": "2018"
},
"status": "STARTED",
"type": "eth://ethereum/rawTransaction",
"createdAt": "2020-08-12T09:00:58.532112Z"
}
],
"createdAt": "2020-08-12T09:00:58.532112Z"
},
"createdAt": "2020-08-12T09:00:58.532112Z"
}