Skip to content

Commit

Permalink
Added create, delete, and find privacy group endpoints (PegaSysEng#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadelineMurray authored and tmohay committed Jul 28, 2019
1 parent 67da403 commit 827809e
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions docs/Reference/Pantheon-API-Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -3771,6 +3771,113 @@ 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_createPrivacyGroup

Creates a privacy group containing the specified members. Members are specified by their Orion public key.

**Parameters**

`data` - Orion public key of privacy group creator

`string` - Privacy group name. Optional.

`string` - Privacy group description. Optional.

`array of data` - Array of members specified by Orion public keys

**Returns**

Privacy group ID

!!! example
```bash tab="curl HTTP request"
curl -X POST --data '{"jsonrpc":"2.0","method":"eea_createPrivacyGroup","params":["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "Group A", "Description Group A", ["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=","g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw="]],"id":1}' http://127.0.0.1:8545
```

```bash tab="wscat WS request"
{"jsonrpc":"2.0","method":"eea_createPrivacyGroup","params":["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "Group A", "Description Group A", ["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=","g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw="]],"id":1}
```

```json tab="JSON result"
{
"jsonrpc": "2.0",
"id": 1,
"result": "ewuTVoc5nlvWMwTFdRRK/wvV0dcyQo/Pauvx5bNEbTk="
}
```

### eea_deletePrivacyGroup

Deletes the specified privacy group.

**Parameters**

`data` - Orion public key of privacy group deleter

`data` - Privacy group ID

**Returns**

Privacy group ID

!!! example
```bash tab="curl HTTP request"
curl -X POST --data '{"jsonrpc":"2.0","method":"eea_deletePrivacyGroup","params":["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "ewuTVoc5nlvWMwTFdRRK/wvV0dcyQo/Pauvx5bNEbTk="],"id":1}' http://127.0.0.1:8545
```

```bash tab="wscat WS request"
{"jsonrpc":"2.0","method":"eea_deletePrivacyGroup","params":["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "ewuTVoc5nlvWMwTFdRRK/wvV0dcyQo/Pauvx5bNEbTk="],"id":1}
```

```json tab="JSON result"
{
"jsonrpc": "2.0",
"id": 53,
"result": "ewuTVoc5nlvWMwTFdRRK/wvV0dcyQo/Pauvx5bNEbTk="
}
```

### eea_findPrivacyGroup

Returns a list of privacy groups containing only the listed members. For example, if the listed members
are A and B, a privacy group containing A, B, and C is not returned.

**Parameters**

`array of data` - Members specified by Orion public keys

**Returns**

Privacy groups containing only the specified members.

!!! example
```bash tab="curl HTTP request"
curl -X POST --data '{"jsonrpc": "2.0","method": "eea_findPrivacyGroup","params": [["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw="]],"id": 1}' http://127.0.0.1:8545
```

```bash tab="wscat WS request"
{"jsonrpc": "2.0","method": "eea_findPrivacyGroup","params": [["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw="]],"id": 1}
```

```json tab="JSON result"
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"privacyGroupId": "GpK3ErNO0xF27T0sevgkJ3+4qk9Z+E3HtXYxcKIBKX8=",
"name": "Group B",
"description": "Description of Group B",
"type": "PANTHEON",
"members": [
"negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=",
"g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw="
]
}
]
}
```

### eea_sendRawTransaction

Creates a private transaction from a signed transaction, generates the transaction hash and submits it
Expand Down

0 comments on commit 827809e

Please sign in to comment.