mirror of
https://github.com/vacp2p/status-linea-besu.git
synced 2026-01-09 13:58:02 -05:00
Moved priv methods into priv section (#1770)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This commit is contained in:
@@ -3772,6 +3772,97 @@ None
|
||||
The `EEA` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
|
||||
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `EEA` API methods.
|
||||
|
||||
### eea_sendRawTransaction
|
||||
|
||||
Creates a [private transaction](../Privacy/Explanation/Privacy-Overview.md) from a signed transaction, generates the transaction hash
|
||||
and submits it to the transaction pool, and returns the transaction hash of the Privacy Marker Transaction.
|
||||
|
||||
The signed transaction passed as an input parameter includes the `privateFrom`, `privateFor`, and `restriction` fields.
|
||||
|
||||
To avoid exposing your private key, create signed transactions offline and send the signed transaction
|
||||
data using `eea_sendRawTransaction`.
|
||||
|
||||
!!! important
|
||||
For production systems requiring private transactions, we recommend using a network
|
||||
with a consensus mechanism supporting transaction finality. For example, [IBFT 2.0](../Consensus-Protocols/IBFT.md).
|
||||
|
||||
Pantheon does not implement [`eea_sendTransaction`](../Using-Pantheon/Account-Management.md).
|
||||
|
||||
[EthSigner](https://docs.ethsigner.pegasys.tech/en/latest/) provides transaction signing and implements [`eea_sendTransaction`](https://docs.ethsigner.pegasys.tech/en/latest/Using-EthSigner/Using-EthSigner/#eea_sendtransaction).
|
||||
|
||||
**Parameters**
|
||||
|
||||
`data` - Signed RLP-encoded private transaction. For example:
|
||||
|
||||
`params: ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"]`
|
||||
|
||||
**Returns**
|
||||
|
||||
`result` : `data` - 32-byte transaction hash
|
||||
|
||||
!!! tip
|
||||
If creating a contract, use [eea_getTransactionReceipt](#eea_gettransactionreceipt) to retrieve the contract
|
||||
address after the transaction is finalized.
|
||||
|
||||
!!! example
|
||||
```bash tab="curl HTTP request"
|
||||
curl -X POST --data '{"jsonrpc":"2.0","method":"eea_sendRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1}' http://127.0.0.1:8545
|
||||
```
|
||||
|
||||
```bash tab="wscat WS request"
|
||||
{"jsonrpc":"2.0","method":"eea_sendRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1}
|
||||
```
|
||||
|
||||
```json tab="JSON result"
|
||||
{
|
||||
"id":1,
|
||||
"jsonrpc": "2.0",
|
||||
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
|
||||
}
|
||||
```
|
||||
|
||||
### eea_getTransactionReceipt
|
||||
|
||||
Returns information about the private transaction after the transaction was mined. Receipts for pending transactions
|
||||
are not available.
|
||||
|
||||
**Parameters**
|
||||
|
||||
`data` - 32-byte hash of a transaction.
|
||||
|
||||
**Returns**
|
||||
|
||||
`Object` - [Private Transaction receipt object](Pantheon-API-Objects.md#private-transaction-receipt-object), or `null` if no receipt found.
|
||||
|
||||
!!! example
|
||||
```bash tab="curl HTTP request"
|
||||
curl -X POST --data '{"jsonrpc":"2.0","method":"eea_getTransactionReceipt","params":["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"],"id":1}' http://127.0.0.1:8545
|
||||
```
|
||||
|
||||
```bash tab="wscat WS request"
|
||||
{"jsonrpc":"2.0","method":"eea_getTransactionReceipt","params":["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"],"id":1}
|
||||
```
|
||||
|
||||
```json tab="JSON result"
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"contractAddress": "0xf4464be696b6531b87edbfb8c21dd178c34eb89e",
|
||||
"from": "0x372a70ace72b02cc7f1757183f98c620254f9c8d",
|
||||
"to": null,
|
||||
"output": "0x6080604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fa4f245811461005b5780636057361d1461008257806367e404ce146100ae575b600080fd5b34801561006757600080fd5b506100706100ec565b60408051918252519081900360200190f35b34801561008e57600080fd5b506100ac600480360360208110156100a557600080fd5b50356100f2565b005b3480156100ba57600080fd5b506100c3610151565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60025490565b604080513381526020810183905281517fc9db20adedc6cf2b5d25252b101ab03e124902a73fcb12b753f3d1aaa2d8f9f5929181900390910190a16002556001805473ffffffffffffffffffffffffffffffffffffffff191633179055565b60015473ffffffffffffffffffffffffffffffffffffffff169056fea165627a7a72305820c7f729cb24e05c221f5aa913700793994656f233fe2ce3b9fd9a505ea17e8d8a0029",
|
||||
"logs": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Priv Methods
|
||||
|
||||
!!! note
|
||||
The `PRIV` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
|
||||
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `PRIV` API methods.
|
||||
|
||||
|
||||
### priv_getPrivateTransaction
|
||||
|
||||
@@ -3957,91 +4048,6 @@ Returns the private transaction count for specified account and privacy group.
|
||||
"result": "0x1"
|
||||
}
|
||||
```
|
||||
|
||||
### eea_sendRawTransaction
|
||||
|
||||
Creates a private transaction from a signed transaction, generates the transaction hash and submits it
|
||||
to the transaction pool, and returns the transaction hash of the Privacy Marker Transaction.
|
||||
|
||||
The signed transaction passed as an input parameter includes the `privateFrom`, `privateFor`, and `restriction` fields.
|
||||
|
||||
To avoid exposing your private key, create signed transactions offline and send the signed transaction
|
||||
data using `eea_sendRawTransaction`.
|
||||
|
||||
!!! important
|
||||
For production systems requiring private transactions, we recommend using a network
|
||||
with a consensus mechanism supporting transaction finality. For example, [IBFT 2.0](../Consensus-Protocols/IBFT.md).
|
||||
|
||||
Pantheon does not implement [`eea_sendTransaction`](../Using-Pantheon/Account-Management.md).
|
||||
|
||||
[EthSigner](https://docs.ethsigner.pegasys.tech/en/latest/) provides transaction signing and implements [`eea_sendTransaction`](https://docs.ethsigner.pegasys.tech/en/latest/Using-EthSigner/Using-EthSigner/#eea_sendtransaction).
|
||||
|
||||
**Parameters**
|
||||
|
||||
`data` - Signed RLP-encoded private transaction. For example:
|
||||
|
||||
`params: ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"]`
|
||||
|
||||
**Returns**
|
||||
|
||||
`result` : `data` - 32-byte transaction hash
|
||||
|
||||
!!! tip
|
||||
If creating a contract, use [eea_getTransactionReceipt](#eea_gettransactionreceipt) to retrieve the contract
|
||||
address after the transaction is finalized.
|
||||
|
||||
!!! example
|
||||
```bash tab="curl HTTP request"
|
||||
curl -X POST --data '{"jsonrpc":"2.0","method":"eea_sendRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1}' http://127.0.0.1:8545
|
||||
```
|
||||
|
||||
```bash tab="wscat WS request"
|
||||
{"jsonrpc":"2.0","method":"eea_sendRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1}
|
||||
```
|
||||
|
||||
```json tab="JSON result"
|
||||
{
|
||||
"id":1,
|
||||
"jsonrpc": "2.0",
|
||||
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
|
||||
}
|
||||
```
|
||||
|
||||
### eea_getTransactionReceipt
|
||||
|
||||
Returns information about the private transaction after the transaction was mined. Receipts for pending transactions
|
||||
are not available.
|
||||
|
||||
**Parameters**
|
||||
|
||||
`data` - 32-byte hash of a transaction.
|
||||
|
||||
**Returns**
|
||||
|
||||
`Object` - [Private Transaction receipt object](Pantheon-API-Objects.md#private-transaction-receipt-object), or `null` if no receipt found.
|
||||
|
||||
!!! example
|
||||
```bash tab="curl HTTP request"
|
||||
curl -X POST --data '{"jsonrpc":"2.0","method":"eea_getTransactionReceipt","params":["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"],"id":1}' http://127.0.0.1:8545
|
||||
```
|
||||
|
||||
```bash tab="wscat WS request"
|
||||
{"jsonrpc":"2.0","method":"eea_getTransactionReceipt","params":["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"],"id":1}
|
||||
```
|
||||
|
||||
```json tab="JSON result"
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"contractAddress": "0xf4464be696b6531b87edbfb8c21dd178c34eb89e",
|
||||
"from": "0x372a70ace72b02cc7f1757183f98c620254f9c8d",
|
||||
"to": null,
|
||||
"output": "0x6080604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fa4f245811461005b5780636057361d1461008257806367e404ce146100ae575b600080fd5b34801561006757600080fd5b506100706100ec565b60408051918252519081900360200190f35b34801561008e57600080fd5b506100ac600480360360208110156100a557600080fd5b50356100f2565b005b3480156100ba57600080fd5b506100c3610151565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60025490565b604080513381526020810183905281517fc9db20adedc6cf2b5d25252b101ab03e124902a73fcb12b753f3d1aaa2d8f9f5929181900390910190a16002556001805473ffffffffffffffffffffffffffffffffffffffff191633179055565b60015473ffffffffffffffffffffffffffffffffffffffff169056fea165627a7a72305820c7f729cb24e05c221f5aa913700793994656f233fe2ce3b9fd9a505ea17e8d8a0029",
|
||||
"logs": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Miscellaneous Methods
|
||||
|
||||
|
||||
Reference in New Issue
Block a user