Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Added privacy group methods for web3.js-eea #1761

Merged
merged 32 commits into from
Jul 27, 2019
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0ed474b
WIP
MadelineMurray Jun 13, 2019
0cd240a
WIP
MadelineMurray Jun 15, 2019
0bb7329
WIP:
MadelineMurray Jun 16, 2019
8e1cc0e
WIP
MadelineMurray Jun 29, 2019
3329412
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
MadelineMurray Jun 29, 2019
d9d7716
Ready for review
MadelineMurray Jun 29, 2019
4edbf16
WIP
MadelineMurray Jul 12, 2019
3bd6f8d
WIP
MadelineMurray Jul 13, 2019
236afe8
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
MadelineMurray Jul 15, 2019
7f58702
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
MadelineMurray Jul 21, 2019
0787fe8
Added overview of privacy methods
MadelineMurray Jul 21, 2019
e99111d
Added method overviews
MadelineMurray Jul 21, 2019
c46761a
Reorganised privacy section
MadelineMurray Jul 21, 2019
e261569
Moved files
MadelineMurray Jul 22, 2019
12c3568
Rework
MadelineMurray Jul 22, 2019
a5ffe15
Merge branch 'privacyReorg' of https://github.com/MadelineMurray/pant…
MadelineMurray Jul 22, 2019
9834dde
Merge branch 'MadelineMurray-privacyReorg'
MadelineMurray Jul 22, 2019
f55ff08
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
MadelineMurray Jul 22, 2019
da054a5
Merge branch 'MadelineMurray-privacyReorg'
MadelineMurray Jul 22, 2019
1ca598f
Merge branch 'managingPrivateTransactions' of https://github.com/Made…
MadelineMurray Jul 22, 2019
7e1f705
rework
MadelineMurray Jul 22, 2019
4acf168
Merge branch 'MadelineMurray-managingPrivateTransactions'
MadelineMurray Jul 22, 2019
2058cbd
Merge branch 'master' of https://github.com/PegaSysEng/pantheon
MadelineMurray Jul 23, 2019
1a86c07
Merge branch 'eeajsMethods' of https://github.com/MadelineMurray/pant…
MadelineMurray Jul 24, 2019
9319b04
Merge branch 'MadelineMurray-eeajsMethods'
MadelineMurray Jul 24, 2019
fcd5f38
fix conflict
MadelineMurray Jul 24, 2019
6d4f152
Merge branch 'master' of https://github.com/PegaSysEng/pantheon
MadelineMurray Jul 25, 2019
7c80061
Added priv group methods
MadelineMurray Jul 25, 2019
c7d3d2a
Merge branch 'master' into privGroupweb3jsEEA
MadelineMurray Jul 25, 2019
af90e99
Merge branch 'master' into privGroupweb3jsEEA
MadelineMurray Jul 26, 2019
2a90cd1
Merge branch 'master' into privGroupweb3jsEEA
MadelineMurray Jul 27, 2019
fd30c56
Merge branch 'master' into privGroupweb3jsEEA
MadelineMurray Jul 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 80 additions & 7 deletions docs/Reference/web3js-eea-Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ private transactions](../Privacy/How-To/Creating-Sending-Private-Transactions.md

## Options Parameter

The Options parameter is used by:

* [`generatePrivacyGroup`](#generateprivacygroup)
* [`getTransactionCount`](#gettransactioncount)
* [`sendRawParameter`](#sendrawtransaction)

The Options parameter has the following properties:

* `privateKey`: Ethereum private key with which to sign the transaction
Expand All @@ -23,9 +17,88 @@ The Options parameter has the following properties:
* `to` : Optional. Contract address to send the transaction to. Do not specify for contract deployment transactions
* `data` : Transaction data

## createPrivacyGroup

Creates privacy group for Pantheon privacy.

**Parameters**

[Transaction options](#options-parameter)

**Returns**

`string` : Privacy group ID

!!! example
```bash
const createPrivacyGroup = () => {
const contractOptions = {
addresses: [orion.node1.publicKey, orion.node2.publicKey],
privateFrom: orion.node1.publicKey,
name: "Privacy Group A",
description: "Members of Group A"
};
return web3.eea.createPrivacyGroup(contractOptions).then(result => {
console.log(`The privacy group created is:`, result);
return result;
});
};
```

## deletePrivacyGroup

Deletes privacy group.

**Parameters**

[Transaction options](#options-parameter)

**Returns**

`string` : Privacy group ID

!!! example
```bash
const deletePrivacyGroup = givenPrivacyGroupId => {
const contractOptions = {
privacyGroupId: givenPrivacyGroupId,
privateFrom: orion.node1.publicKey
};
return web3.eea.deletePrivacyGroup(contractOptions).then(result => {
console.log(`The privacy group deleted is:`, result);
return result;
});
};
```

## findPrivacyGroup

Finds privacy groups containing only the specified members.

**Parameters**

[Transaction options](#options-parameter)

**Returns**

`array of objects` : Privacy groups containing only the specified members.

!!! example
```bash
const findPrivacyGroup = () => {
const contractOptions = {
addresses: [orion.node1.publicKey, orion.node2.publicKey]
};
return web3.eea.findPrivacyGroup(contractOptions).then(result => {
console.log(`The privacy groups found are:`, result);
return result;
});
};
```

## generatePrivacyGroup

Generates the privacy group ID. The privacy group ID is the RLP-encoded `privateFor` and `privateFrom` keys.
Generates the privacy group ID for EEA privacy. The privacy group ID is the RLP-encoded `privateFor` and `privateFrom` keys.

**Parameters**

Expand Down