Send and receive transactions
Use the SDK to send transactions from JavaScript applications, or use the REST API.
Prerequisites:
- Orchestrate running
- Chain registered on the Chain Registry
- Smart contract registered on Contract Registry
- Sender account generated in Orchestrate.
Use the SDK
Prerequisites:
- Install the PegaSys Orchestrate JS client library.
Example code is available in the Orchestrate Node SDK repository examples directory.
Use the REST API
Send the transaction to the /transaction/send
endpoint on the Chain Registry service.
Send the transaction
Send transactions using a from
address, or increase anonymity by having Orchestrate generate one time keys for single use sender accounts.
Example
{
"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.