Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ participants are offline when the private transaction is submitted, the transact
!!! note
Private transactions either deploy contracts or call contract functions.
Ether transfer transactions cannot be private.

!!! tip
For private contracts, [`priv_call`](../../Reference/API-Methods.md#priv_call) is the equivalent
of [`eth_call`](../../Reference/API-Methods.md#eth_call).

## eea_sendRawTransaction

Expand Down Expand Up @@ -145,5 +149,4 @@ a contract are displayed below.

<!-- links ---->

[privacy marker transaction]: ../../Concepts/Privacy/Private-Transaction-Processing.md

[privacy marker transaction]: ../../Concepts/Privacy/Private-Transaction-Processing.md
6 changes: 2 additions & 4 deletions docs/HowTo/Send-Transactions/Transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ and create a smart contract.
Libraries such as [web3j](https://github.com/web3j/web3j) or [ethereumj](https://github.com/ethereum/ethereumj)
and tools such as [MyCrypto](https://mycrypto.com/) can also be used to create signed transactions.



## eth_call vs eth_sendRawTransaction

You can interact with contracts using [eth_call](../../Reference/API-Methods.md#eth_call)
or [eth_sendRawTransaction](../../Reference/API-Methods.md#eth_sendrawtransaction).
You can interact with contracts using [`eth_call`](../../Reference/API-Methods.md#eth_call)
or [`eth_sendRawTransaction`](../../Reference/API-Methods.md#eth_sendrawtransaction).
The table below compares the characteristics of both calls.

| eth_call | eth_sendRawTransaction |
Expand Down
4 changes: 1 addition & 3 deletions docs/HowTo/Use-Privacy/Create-Manage-Privacy-Groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ Hyperledger Besu-extended privacy provides JSON-RPC API methods for creating and
!!! tip
[EEA-compliant privacy groups](../../Concepts/Privacy/Privacy-Groups.md) can be found and deleted using
[`priv_findPrivacyGroup`](../../Reference/API-Methods.md#priv_findprivacygroup)
and [`priv_deletePrivacyGroup`](../../Reference/API-Methods.md#priv_deleteprivacygroup) but
future functionality to update group membership will only be available for privacy groups
created using [`priv_createPrivacyGroup`](../../Reference/API-Methods.md#priv_createprivacygroup).
and [`priv_deletePrivacyGroup`](../../Reference/API-Methods.md#priv_deleteprivacygroup).
68 changes: 67 additions & 1 deletion docs/Reference/API-Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ To avoid exposing your private key, create signed transactions offline and send

Invokes a contract function locally and does not change the state of the blockchain.

You can interact with contracts using [eth_sendRawTransaction or eth_call](../HowTo/Send-Transactions/Transactions.md#eth_call-or-eth_sendrawtransaction).
You can interact with contracts using [eth_sendRawTransaction or eth_call](../HowTo/Send-Transactions/Transactions.md#eth_call-vs-eth_sendrawtransaction).

**Parameters**

Expand Down Expand Up @@ -4208,6 +4208,72 @@ data using `eea_sendRawTransaction`.
The `PRIV` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](CLI/CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](CLI/CLI-Syntax.md#rpc-ws-api) options to enable the `PRIV` API methods.

### priv_call

Invokes a private contract function locally and does not change the privacy group state.

For private contracts, `priv_call` is the equivalent to [`eth_call`](#eth_call).

**Parameters**

`data` - 32-byte [privacy Group ID](../Concepts/Privacy/Privacy-Groups.md).

`object` - [Transaction call object](API-Objects.md#transaction-call-object).

`quantity|tag` - Integer representing a block number or one of the string tags `latest`, `earliest`,
or `pending`, as described in [Block Parameter](../HowTo/Interact/APIs/Using-JSON-RPC-API.md#block-parameter).

**Returns**

`result` : `data` - Return value of the executed contract.

!!! example
```bash tab="curl HTTP"
curl -X POST --data '{"jsonrpc":"2.0","method":"priv_call","params":["tb8NVyQqZnHNegf/3mYsyB+HEud4SPWn90rz3GoskRw=", {"to":"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13","data": "0x3fa4f245"}, "latest"],"id":1}' http://127.0.0.1:8545
```

```bash tab="wscat WS"
{"jsonrpc":"2.0","method":"priv_call","params":["tb8NVyQqZnHNegf/3mYsyB+HEud4SPWn90rz3GoskRw=", {"to":"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13","data": "0x3fa4f245"}, "latest"],"id":1}
```

```json tab="JSON result"
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
```

```bash tab="curl GraphQL"
curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block {number call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13\", data :\"0x12a7b914\"}){data status}}}"}' http://localhost:8547/graphql
```

```bash tab="GraphQL"
{
block {
number
call(data: {from: "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", to: "0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13", data: "0x12a7b914"}) {
data
status
}
}
}
```

```json tab="GraphQL result"
{
"data" : {
"block" : {
"number" : 17449,
"call" : {
"data" : "0x",
"status" : 1
}
}
}
}
```

### priv_distributeRawTransaction

Distributes a signed, RLP encoded [private transaction](../HowTo/Send-Transactions/Creating-Sending-Private-Transactions.md).
Expand Down