From 0ed474b1867414ff6e502b44fa739d00384fd6cc Mon Sep 17 00:00:00 2001 From: Madeline Date: Thu, 13 Jun 2019 12:53:55 +1000 Subject: [PATCH 01/14] WIP --- docs/Reference/web3js-eea-Methods.md | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/Reference/web3js-eea-Methods.md diff --git a/docs/Reference/web3js-eea-Methods.md b/docs/Reference/web3js-eea-Methods.md new file mode 100644 index 0000000000..bd45c470e0 --- /dev/null +++ b/docs/Reference/web3js-eea-Methods.md @@ -0,0 +1,34 @@ +web3.eea.getMakerTransaction + +web3.eea.generatePrivacyGroup + +web3.eea.sendRawTransaction + +web3.eea.getTransactionCount + +web3.eea.getTransactionReceipt + + + +### eea.getMakerTransaction + +Gets the [privacy marker transaction](../Privacy/Private-Transaction-Processing.md) transaction receipt. + +**Parameters** + +`txHash` - `string` : Transaction hash of the private transaction +`retries` - `int` : Number of attempts to make to get the private marker transaction receipts +`delay` - `int` : Delay between retries (in seconds?) + +**Returns** + +`result` : Privacy marker transaction receipt + +!!! example + ```bash tab="JS request" + eea.getMakerTransaction("tx hash -add", 5, 2) + ``` + + ```bash tab="Result" + Add this + ``` \ No newline at end of file From 0cd240a43c57e84f5164f6e5f9f46b0d5ef1e7ea Mon Sep 17 00:00:00 2001 From: Madeline Date: Sat, 15 Jun 2019 14:53:02 +1000 Subject: [PATCH 02/14] WIP --- docs/Reference/web3js-eea-Methods.md | 114 +++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 8 deletions(-) diff --git a/docs/Reference/web3js-eea-Methods.md b/docs/Reference/web3js-eea-Methods.md index bd45c470e0..190f04fe30 100644 --- a/docs/Reference/web3js-eea-Methods.md +++ b/docs/Reference/web3js-eea-Methods.md @@ -1,16 +1,27 @@ -web3.eea.getMakerTransaction +description: web3.js-eea methods reference + -web3.eea.generatePrivacyGroup +M -web3.eea.sendRawTransaction +## Options Parameter -web3.eea.getTransactionCount +The Options parameter is used by: -web3.eea.getTransactionReceipt +* [`generatePrivacyGroup`](#generateprivacygroup) +* [`sendRawParameter`](#sendrawtransaction) +* [`getTransactionCount`](#gettransactioncount) +The Options parameter has the following properties: +* `privateKey`: Ethereum private key with which to sign the transaction +* `privateFrom` : Orion public key +* `privateFor` : Orion public keys of recipients +* `nonce` : Optional. If not provided, is calculated using `eea_getTransctionCount`. +* `to` : Optional. Contract address to which to send the transaction. If not provided, the transaction +is a contract deployment transaction +* `data` : Transaction data -### eea.getMakerTransaction +## getMakerTransaction Gets the [privacy marker transaction](../Privacy/Private-Transaction-Processing.md) transaction receipt. @@ -22,7 +33,7 @@ Gets the [privacy marker transaction](../Privacy/Private-Transaction-Processing. **Returns** -`result` : Privacy marker transaction receipt +`result` : Privacy marker transaction receipt (promise?) !!! example ```bash tab="JS request" @@ -31,4 +42,91 @@ Gets the [privacy marker transaction](../Privacy/Private-Transaction-Processing. ```bash tab="Result" Add this - ``` \ No newline at end of file + ``` + +## generatePrivacyGroup + +Generates the privacy group ID. The privacy group ID is the RLP-encoded `privateFor` and `privateFrom` keys. + +**Parameters** + +[Transaction options](#options-parameter) + +**Returns** + +`string` : Privacy marker transaction receipt + + !!! example + ```bash tab="JS request" + add + ``` + + ```bash tab="Result" + add + ``` + +## sendRawTransaction + +Signs and sends a RLP-encoded private transaction to Pantheon using `eea_sendRawTransaction`. + +**Parameters** + +[Transaction options](#options-parameter) + +**Returns** + +`string` : Transaction hash of the [`privacy marker transaction`](../Privacy/Private-Transaction-Processing.md) + + !!! example + ```bash tab="JS request" + add + ``` + + ```bash tab="Result" + add + ``` + +## getTransactionCount + +Returns the number of transactions sent from the specified address for the privacy group (add link to privacy group content). + +**Parameters** + +[Transaction options](#options-parameter) + +**Returns** + +`int` : Transaction count that address and privacy group + + !!! example + ```bash tab="JS request" + add + ``` + + ```bash tab="Result" + add + ``` + +## getTransactionReceipt + +Gets the private transaction receipt. + +**Parameters** + +`txHash` - `string` : Transaction hash of the private transaction +`enclavePublicKey` - `string` : Orion public key (same as privateFrom? what about privateFor?) +`retries` - `int` : Number of attempts to make to get the private marker transaction receipts +`delay` - `int` : Delay between retries (in seconds?) + +**Returns** + +Private transaction receipt + + !!! example + ```bash tab="JS request" + add + ``` + + ```bash tab="Result" + add + ``` \ No newline at end of file From 0bb7329b29448b85440fd6ccabd1b2c2449110a9 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 17 Jun 2019 05:45:42 +1000 Subject: [PATCH 03/14] WIP: --- docs/Reference/web3js-eea-Methods.md | 138 ++++++++++++++------------- 1 file changed, 72 insertions(+), 66 deletions(-) diff --git a/docs/Reference/web3js-eea-Methods.md b/docs/Reference/web3js-eea-Methods.md index 190f04fe30..62c5781704 100644 --- a/docs/Reference/web3js-eea-Methods.md +++ b/docs/Reference/web3js-eea-Methods.md @@ -1,15 +1,18 @@ -description: web3.js-eea methods reference +description: web3js-eea methods reference -M +For more examples, refer to the following in the [webjs-eea repository](https://github.com/PegaSysEng/web3js-eea): + +* [`deployContract.js`](https://github.com/PegaSysEng/web3js-eea/blob/master/example/multiNodeExample/deployContract.js) +* [`storeValueFromNode1.js`](https://github.com/PegaSysEng/web3js-eea/blob/master/example/multiNodeExample/storeValueFromNode1.js) ## Options Parameter The Options parameter is used by: * [`generatePrivacyGroup`](#generateprivacygroup) -* [`sendRawParameter`](#sendrawtransaction) * [`getTransactionCount`](#gettransactioncount) +* [`sendRawParameter`](#sendrawtransaction) The Options parameter has the following properties: @@ -17,33 +20,9 @@ The Options parameter has the following properties: * `privateFrom` : Orion public key * `privateFor` : Orion public keys of recipients * `nonce` : Optional. If not provided, is calculated using `eea_getTransctionCount`. -* `to` : Optional. Contract address to which to send the transaction. If not provided, the transaction -is a contract deployment transaction +* `to` : Optional. Contract address to which to send the transaction. Do not specify for contract deployment transactions * `data` : Transaction data -## getMakerTransaction - -Gets the [privacy marker transaction](../Privacy/Private-Transaction-Processing.md) transaction receipt. - -**Parameters** - -`txHash` - `string` : Transaction hash of the private transaction -`retries` - `int` : Number of attempts to make to get the private marker transaction receipts -`delay` - `int` : Delay between retries (in seconds?) - -**Returns** - -`result` : Privacy marker transaction receipt (promise?) - -!!! example - ```bash tab="JS request" - eea.getMakerTransaction("tx hash -add", 5, 2) - ``` - - ```bash tab="Result" - Add this - ``` - ## generatePrivacyGroup Generates the privacy group ID. The privacy group ID is the RLP-encoded `privateFor` and `privateFrom` keys. @@ -54,41 +33,38 @@ Generates the privacy group ID. The privacy group ID is the RLP-encoded `private **Returns** -`string` : Privacy marker transaction receipt - - !!! example - ```bash tab="JS request" - add - ``` - - ```bash tab="Result" - add - ``` - -## sendRawTransaction +`string` : Privacy group ID -Signs and sends a RLP-encoded private transaction to Pantheon using `eea_sendRawTransaction`. +!!! example + ```bash" + const privacyGroupId = web3.eea.generatePrivacyGroup({ + privateFrom: "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=", + privateFor: ["Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs="] + }); + ``` + +## getMarkerTransaction + +Gets the [privacy marker transaction](../Privacy/Private-Transaction-Processing.md) transaction receipt. **Parameters** -[Transaction options](#options-parameter) +`txHash` - `string` : Transaction hash of the private transaction +`retries` - `int` : Number of attempts to make to get the private marker transaction receipts +`delay` - `int` : Delay between retries in milliseconds **Returns** -`string` : Transaction hash of the [`privacy marker transaction`](../Privacy/Private-Transaction-Processing.md) - - !!! example - ```bash tab="JS request" - add - ``` - - ```bash tab="Result" - add - ``` +`result` : Privacy marker transaction receipt +!!! example + ```bash + const privateMarkerTransacion = web3.eea.getMarkerTransaction("0x9c41b3d44ed73511c82a9e2b1ef581eb797475c82f318ca2802358d3ba4a8274", 5, 100); + ``` + ## getTransactionCount -Returns the number of transactions sent from the specified address for the privacy group (add link to privacy group content). +Returns the number of transactions sent from the specified address for the privacy group. **Parameters** @@ -96,37 +72,67 @@ Returns the number of transactions sent from the specified address for the priva **Returns** -`int` : Transaction count that address and privacy group +`int` : Transaction count for that account (`privateKey`) and privacy group !!! example ```bash tab="JS request" add ``` - ```bash tab="Result" - add - ``` - ## getTransactionReceipt -Gets the private transaction receipt. +Gets the private transaction receipt using `eea_getTransactionReceipt`. **Parameters** `txHash` - `string` : Transaction hash of the private transaction -`enclavePublicKey` - `string` : Orion public key (same as privateFrom? what about privateFor?) +`enclavePublicKey` - `string` : `privateFrom` key for the transaction `retries` - `int` : Number of attempts to make to get the private marker transaction receipts -`delay` - `int` : Delay between retries (in seconds?) +`delay` - `int` : Delay between retries in milliseconds **Returns** Private transaction receipt !!! example - ```bash tab="JS request" - add + ```bash + const privateTxReceipt = web3.eea.getTransactionReceipt("0x9c41b3d44ed73511c82a9e2b1ef581eb797475c82f318ca2802358d3ba4a8274", "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="); ``` + - ```bash tab="Result" - add - ``` \ No newline at end of file +## sendRawTransaction + +Signs and sends a RLP-encoded private transaction to Pantheon using `eea_sendRawTransaction`. + +**Parameters** + +[Transaction options](#options-parameter) + +**Returns** + +`string` : Transaction hash of the [`privacy marker transaction`](../Privacy/Private-Transaction-Processing.md) + + !!! example + ```bash tab="Contract Deployment Transaction" + const createPrivateEmitterContract = () => { + const contractOptions = { + data: `0x${binary}`, + privateFrom: orion.node1.publicKey, + privateFor: [orion.node2.publicKey], + privateKey: pantheon.node1.privateKey + }; + return web3.eea.sendRawTransaction(contractOptions); + }; + ``` + + ```bash tab="Contract Invocation Transaction" + const functionCall = { + to: address, + data: functionAbi.signature + functionArgs, + privateFrom: orion.node1.publicKey, + privateFor: [orion.node2.publicKey], + privateKey: pantheon.node1.privateKey + }; + return web3.eea.sendRawTransaction(functionCall); + ``` + \ No newline at end of file From 8e1cc0e2ba9170ebc8fd074f77167965826e7d71 Mon Sep 17 00:00:00 2001 From: Madeline Date: Sat, 29 Jun 2019 11:10:12 +1000 Subject: [PATCH 04/14] WIP --- docs/Reference/web3js-eea-Methods.md | 14 +++++++++----- mkdocs.yml | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/Reference/web3js-eea-Methods.md b/docs/Reference/web3js-eea-Methods.md index 62c5781704..2ae18d10e3 100644 --- a/docs/Reference/web3js-eea-Methods.md +++ b/docs/Reference/web3js-eea-Methods.md @@ -76,7 +76,12 @@ Returns the number of transactions sent from the specified address for the priva !!! example ```bash tab="JS request" - add + return web3.eea + .getTransactionCount({ + privateKey: pantheon.node1.privateKey, + privateFrom: orion.node1.publicKey, + privateFor: [orion.node2.publicKey], + }) ``` ## getTransactionReceipt @@ -87,8 +92,8 @@ Gets the private transaction receipt using `eea_getTransactionReceipt`. `txHash` - `string` : Transaction hash of the private transaction `enclavePublicKey` - `string` : `privateFrom` key for the transaction -`retries` - `int` : Number of attempts to make to get the private marker transaction receipts -`delay` - `int` : Delay between retries in milliseconds +`retries` - `int` : Optional. Number of attempts to make to get the private marker transaction receipts. Default is `300`. +`delay` - `int` : Optional. Delay between retries in milliseconds. Optional. Default is `1000`. **Returns** @@ -96,10 +101,9 @@ Private transaction receipt !!! example ```bash - const privateTxReceipt = web3.eea.getTransactionReceipt("0x9c41b3d44ed73511c82a9e2b1ef581eb797475c82f318ca2802358d3ba4a8274", "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="); + const privateTxReceipt = web3.eea.getTransactionReceipt("0x9c41b3d44ed73511c82a9e2b1ef581eb797475c82f318ca2802358d3ba4a8274", "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="); ``` - ## sendRawTransaction Signs and sends a RLP-encoded private transaction to Pantheon using `eea_sendRawTransaction`. diff --git a/mkdocs.yml b/mkdocs.yml index f5e72a1cde..b306c018fe 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -129,6 +129,7 @@ nav: - Pantheon Command Line: Reference/Pantheon-CLI-Syntax.md - Pantheon API Methods: Reference/Pantheon-API-Methods.md - Pantheon API Objects: Reference/Pantheon-API-Objects.md + - web3.js-eaa Methods: Reference/web3js-eea-Methods.md - Resources: - Blog Posts and Webinars: Resources/Resources.md From d9d7716954d444befc9e4dcdedf716f077d54d1a Mon Sep 17 00:00:00 2001 From: Madeline Date: Sat, 29 Jun 2019 11:41:30 +1000 Subject: [PATCH 05/14] Ready for review --- docs/Privacy/Private-Transactions/eeajs.md | 4 + docs/Reference/web3js-eea-Methods.md | 100 +++++++++++---------- 2 files changed, 55 insertions(+), 49 deletions(-) diff --git a/docs/Privacy/Private-Transactions/eeajs.md b/docs/Privacy/Private-Transactions/eeajs.md index 68b7967f61..5b122864ea 100644 --- a/docs/Privacy/Private-Transactions/eeajs.md +++ b/docs/Privacy/Private-Transactions/eeajs.md @@ -57,3 +57,7 @@ to get the contract binary. ``` The transaction hash is returned. To get the private transaction receipt, use `web3.eea.getTransactionReceipt(txHash)`. + +## web3.js-eea Methods + +Refer to the [web3.js-eea reference documentation](../../Reference/web3js-eea-Methods.md). \ No newline at end of file diff --git a/docs/Reference/web3js-eea-Methods.md b/docs/Reference/web3js-eea-Methods.md index 2ae18d10e3..27193b9d81 100644 --- a/docs/Reference/web3js-eea-Methods.md +++ b/docs/Reference/web3js-eea-Methods.md @@ -1,10 +1,8 @@ description: web3js-eea methods reference -For more examples, refer to the following in the [webjs-eea repository](https://github.com/PegaSysEng/web3js-eea): - -* [`deployContract.js`](https://github.com/PegaSysEng/web3js-eea/blob/master/example/multiNodeExample/deployContract.js) -* [`storeValueFromNode1.js`](https://github.com/PegaSysEng/web3js-eea/blob/master/example/multiNodeExample/storeValueFromNode1.js) +Use the [web3.js-eea library](https://github.com/PegaSysEng/eeajs) to [create and send +private transactions](../Privacy/Private-Transactions/eeajs.md). ## Options Parameter @@ -19,7 +17,7 @@ The Options parameter has the following properties: * `privateKey`: Ethereum private key with which to sign the transaction * `privateFrom` : Orion public key * `privateFor` : Orion public keys of recipients -* `nonce` : Optional. If not provided, is calculated using `eea_getTransctionCount`. +* `nonce` : Optional. If not provided, calculated using [`eea_getTransctionCount`](../Reference/Pantheon-API-Methods.md). * `to` : Optional. Contract address to which to send the transaction. Do not specify for contract deployment transactions * `data` : Transaction data @@ -36,7 +34,7 @@ Generates the privacy group ID. The privacy group ID is the RLP-encoded `private `string` : Privacy group ID !!! example - ```bash" + ```bash const privacyGroupId = web3.eea.generatePrivacyGroup({ privateFrom: "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=", privateFor: ["Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs="] @@ -50,12 +48,14 @@ Gets the [privacy marker transaction](../Privacy/Private-Transaction-Processing. **Parameters** `txHash` - `string` : Transaction hash of the private transaction -`retries` - `int` : Number of attempts to make to get the private marker transaction receipts + +`retries` - `int` : Number of attempts to make to get the private marker transaction receipt + `delay` - `int` : Delay between retries in milliseconds **Returns** -`result` : Privacy marker transaction receipt +Privacy marker transaction receipt !!! example ```bash @@ -74,39 +74,42 @@ Returns the number of transactions sent from the specified address for the priva `int` : Transaction count for that account (`privateKey`) and privacy group - !!! example - ```bash tab="JS request" - return web3.eea - .getTransactionCount({ - privateKey: pantheon.node1.privateKey, - privateFrom: orion.node1.publicKey, - privateFor: [orion.node2.publicKey], - }) - ``` +!!! example + ```bash + return web3.eea + .getTransactionCount({ + privateKey: pantheon.node1.privateKey, + privateFrom: orion.node1.publicKey, + privateFor: [orion.node2.publicKey], + }) + ``` ## getTransactionReceipt -Gets the private transaction receipt using `eea_getTransactionReceipt`. +Gets the private transaction receipt using [`eea_getTransactionReceipt`](../Reference/Pantheon-API-Methods.md#eea_gettransactionreceipt). **Parameters** `txHash` - `string` : Transaction hash of the private transaction -`enclavePublicKey` - `string` : `privateFrom` key for the transaction -`retries` - `int` : Optional. Number of attempts to make to get the private marker transaction receipts. Default is `300`. + +`enclavePublicKey` - `string` : [`privateFrom` key for the transaction](#options-parameter) + +`retries` - `int` : Optional. Number of attempts to make to get the private marker transaction receipt. Default is `300`. + `delay` - `int` : Optional. Delay between retries in milliseconds. Optional. Default is `1000`. **Returns** Private transaction receipt - !!! example - ```bash - const privateTxReceipt = web3.eea.getTransactionReceipt("0x9c41b3d44ed73511c82a9e2b1ef581eb797475c82f318ca2802358d3ba4a8274", "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="); - ``` +!!! example + ```bash + const privateTxReceipt = web3.eea.getTransactionReceipt("0x9c41b3d44ed73511c82a9e2b1ef581eb797475c82f318ca2802358d3ba4a8274", "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="); + ``` ## sendRawTransaction -Signs and sends a RLP-encoded private transaction to Pantheon using `eea_sendRawTransaction`. +Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRawTransaction`](Pantheon-API-Methods.md#eea_sendrawtransaction). **Parameters** @@ -115,28 +118,27 @@ Signs and sends a RLP-encoded private transaction to Pantheon using `eea_sendRaw **Returns** `string` : Transaction hash of the [`privacy marker transaction`](../Privacy/Private-Transaction-Processing.md) - - !!! example - ```bash tab="Contract Deployment Transaction" - const createPrivateEmitterContract = () => { - const contractOptions = { - data: `0x${binary}`, - privateFrom: orion.node1.publicKey, - privateFor: [orion.node2.publicKey], - privateKey: pantheon.node1.privateKey - }; - return web3.eea.sendRawTransaction(contractOptions); - }; - ``` - ```bash tab="Contract Invocation Transaction" - const functionCall = { - to: address, - data: functionAbi.signature + functionArgs, - privateFrom: orion.node1.publicKey, - privateFor: [orion.node2.publicKey], - privateKey: pantheon.node1.privateKey - }; - return web3.eea.sendRawTransaction(functionCall); - ``` - \ No newline at end of file +!!! example + ```bash tab="Contract Deployment" + const createPrivateEmitterContract = () => { + const contractOptions = { + data: `0x${binary}`, + privateFrom: orion.node1.publicKey, + privateFor: [orion.node2.publicKey], + privateKey: pantheon.node1.privateKey + }; + return web3.eea.sendRawTransaction(contractOptions); + }; + ``` + + ```bash tab="Contract Invocation" + const functionCall = { + to: address, + data: functionAbi.signature + functionArgs, + privateFrom: orion.node1.publicKey, + privateFor: [orion.node2.publicKey], + privateKey: pantheon.node1.privateKey + }; + return web3.eea.sendRawTransaction(functionCall); + ``` \ No newline at end of file From 4edbf16186082c0e66c944127c57b44bd60bceed Mon Sep 17 00:00:00 2001 From: Madeline Date: Sat, 13 Jul 2019 05:45:09 +1000 Subject: [PATCH 06/14] WIP --- .../Creating-Sending-Private-Transactions.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md index e13c557852..936cf44c1c 100644 --- a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md +++ b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md @@ -10,4 +10,9 @@ To create and send private transactions use one of: !!! note Private transactions either deploy contracts or call contract functions. - Ether transfer transactions cannot be private. \ No newline at end of file + Ether transfer transactions cannot be private. + +## Accessing Private Transactions using JSON-RPC + +A private transaction creates a Privacy Marker Transaction (PMT) that is included in a block and +propagated using devP2P in the same way as a public Ethereum transaction. \ No newline at end of file From 3bd6f8d98e055796aa37d144cd021a40f1eb56d2 Mon Sep 17 00:00:00 2001 From: Madeline Date: Sun, 14 Jul 2019 08:18:17 +1000 Subject: [PATCH 07/14] WIP --- .../Creating-Sending-Private-Transactions.md | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md index 936cf44c1c..5d85b80168 100644 --- a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md +++ b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md @@ -5,8 +5,9 @@ description: Creating and sending private transactions To create and send private transactions use one of: -* [web3.js-eea client library](eeajs.md) +* [web3.js-eea client library](eeajs.md) or [web3j client library](https://github.com/web3j/web3j) * [`eea_sendTransaction` with EthSigner](https://docs.ethsigner.pegasys.tech/en/latest/Using-EthSigner/Using-EthSigner/) +* [`eea_sendRawTransaction`](../../Reference/Pantheon-API-Methods.md#eea_sendrawtransaction) !!! note Private transactions either deploy contracts or call contract functions. @@ -15,4 +16,36 @@ To create and send private transactions use one of: ## Accessing Private Transactions using JSON-RPC A private transaction creates a Privacy Marker Transaction (PMT) that is included in a block and -propagated using devP2P in the same way as a public Ethereum transaction. \ No newline at end of file +propagated using devP2P in the same way as a public Ethereum transaction. JSON-RPC API methods are +provided to access private transaction receipts and counts: + +* [`eea_getTransactionCount`] +* [`eea_getTransactionReceipt`] +* [`eea_getPrivateTransaction`] +* [`eth_getTransactionReceipt`] + +!!! note + If sending a large number of private transactions, the nonce for the account and privacy group must + be maintained outside the client. Unlike [`eth_getTransaction Count`], [`eea_getTransactionCount`] does + not include the block parameter to specify the pending block to obtain the account nonce. + + +## Methods for Privacy Groups + +* [`eea_createPrivacyGroup`] +* [`eea_deletePrivacyGroup`] +* [`eea_findPrivacyGroup`] +* [`eea_sendRawTransaction`] specifying a privacy group ID +* [`eea_sendTransaction`] specifying a privacy group + +## Example + +Create Privacy Group containing A & B + +Send transaction using eea_sendTransaction specifying privacy group A + +eth_getTransactionReceipt (one example privy and one not) + +eea_getPrivateTransaction (one example privy and one not) + +eea_getTransaction Count \ No newline at end of file From 0787fe8d5e53c6dfe225faf6184561373da4b047 Mon Sep 17 00:00:00 2001 From: Madeline Date: Sun, 21 Jul 2019 15:26:15 +1000 Subject: [PATCH 08/14] Added overview of privacy methods --- .../Creating-Sending-Private-Transactions.md | 50 +++++++------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md index 5d85b80168..5981b2a12e 100644 --- a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md +++ b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md @@ -3,7 +3,7 @@ description: Creating and sending private transactions # Creating and Sending Private Transactions -To create and send private transactions use one of: +To create and send private transactions using: * [web3.js-eea client library](eeajs.md) or [web3j client library](https://github.com/web3j/web3j) * [`eea_sendTransaction` with EthSigner](https://docs.ethsigner.pegasys.tech/en/latest/Using-EthSigner/Using-EthSigner/) @@ -13,39 +13,23 @@ To create and send private transactions use one of: Private transactions either deploy contracts or call contract functions. Ether transfer transactions cannot be private. -## Accessing Private Transactions using JSON-RPC +## Methods for Private Transactions -A private transaction creates a Privacy Marker Transaction (PMT) that is included in a block and -propagated using devP2P in the same way as a public Ethereum transaction. JSON-RPC API methods are -provided to access private transaction receipts and counts: +A private transaction creates a Privacy Marker Transaction (PMT) as well the private transaction itself. +Use [`eth_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionreceipt) to +get the transaction receipt for the Privacy Maker Transaction and [`eea_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eea_gettransactionreceipt) +to get the transaction receipt for the private transaction. -* [`eea_getTransactionCount`] -* [`eea_getTransactionReceipt`] -* [`eea_getPrivateTransaction`] -* [`eth_getTransactionReceipt`] +Use [`eth_getTransactionByHash`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionbyhash) to +get the Privacy Marker Transaction using the transaction hash returned when submitting the private transaction. +Use [`eea_getPrivateTransacton`] to get the private transaction using the `input` value from Privacy Marker Transaction. -!!! note - If sending a large number of private transactions, the nonce for the account and privacy group must - be maintained outside the client. Unlike [`eth_getTransaction Count`], [`eea_getTransactionCount`] does - not include the block parameter to specify the pending block to obtain the account nonce. - - -## Methods for Privacy Groups - -* [`eea_createPrivacyGroup`] -* [`eea_deletePrivacyGroup`] -* [`eea_findPrivacyGroup`] -* [`eea_sendRawTransaction`] specifying a privacy group ID -* [`eea_sendTransaction`] specifying a privacy group - -## Example +Separate private states are maintained for each [privacy group](../Privacy-Overview.md#privacy-groups) so +the account nonce for an account is specific to the privacy group. That is, the nonce for account A for +privacy group ABC is different to the account nonce for account A for privacy group AB. Use +[`eea_getTransactionCount`](../../Reference/Pantheon-API-Methods.md#eea_gettransactioncount) to get +the account nonce for an account for the specified privacy group. -Create Privacy Group containing A & B - -Send transaction using eea_sendTransaction specifying privacy group A - -eth_getTransactionReceipt (one example privy and one not) - -eea_getPrivateTransaction (one example privy and one not) - -eea_getTransaction Count \ No newline at end of file +!!! note + If sending a large number of private transactions, you may need to calculate the nonce for the account + and privacy group outside the client. \ No newline at end of file From e99111db3715611a20f32e502419ca164393c42d Mon Sep 17 00:00:00 2001 From: Madeline Date: Sun, 21 Jul 2019 15:34:23 +1000 Subject: [PATCH 09/14] Added method overviews --- .../Creating-Sending-Private-Transactions.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md index 5981b2a12e..471eba18a2 100644 --- a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md +++ b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md @@ -3,7 +3,7 @@ description: Creating and sending private transactions # Creating and Sending Private Transactions -To create and send private transactions using: +Create and send private transactions using: * [web3.js-eea client library](eeajs.md) or [web3j client library](https://github.com/web3j/web3j) * [`eea_sendTransaction` with EthSigner](https://docs.ethsigner.pegasys.tech/en/latest/Using-EthSigner/Using-EthSigner/) @@ -15,14 +15,15 @@ To create and send private transactions using: ## Methods for Private Transactions -A private transaction creates a Privacy Marker Transaction (PMT) as well the private transaction itself. +A private transaction creates a [Privacy Marker Transaction](../Private-Transaction-Processing.md) as well the private transaction itself. Use [`eth_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionreceipt) to get the transaction receipt for the Privacy Maker Transaction and [`eea_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eea_gettransactionreceipt) to get the transaction receipt for the private transaction. Use [`eth_getTransactionByHash`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionbyhash) to -get the Privacy Marker Transaction using the transaction hash returned when submitting the private transaction. -Use [`eea_getPrivateTransacton`] to get the private transaction using the `input` value from Privacy Marker Transaction. +get the Privacy Marker Transaction with the transaction hash returned when submitting the private transaction. +Use [`eea_getPrivateTransacton`](../../Reference/Pantheon-API-Methods.md#eea_getprivatetransaction) +to get the private transaction with the `input` value from the Privacy Marker Transaction. Separate private states are maintained for each [privacy group](../Privacy-Overview.md#privacy-groups) so the account nonce for an account is specific to the privacy group. That is, the nonce for account A for From c46761a6ab3fbf20f9efd2567e60dbaceced4bf1 Mon Sep 17 00:00:00 2001 From: Madeline Date: Sun, 21 Jul 2019 20:38:14 +1000 Subject: [PATCH 10/14] Reorganised privacy section --- mkdocs.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 2c10d5ee9b..49d15bac7e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,6 +65,7 @@ nav: - Running Pantheon from Docker Image: Getting-Started/Run-Docker-Image.md - Tutorials: - Private Network Quickstart: Tutorials/Private-Network-Quickstart.md + - Private Network Quickstart for Private Transactions: Privacy/Privacy-Quickstart.md - Private Network Quickstart On Azure: Tutorials/Azure/Azure-Private-Network-Quickstart.md - Create a Private Network using Ethash (Pow): Tutorials/Create-Private-Network.md - Create a Private Network using Clique (PoA): Tutorials/Create-Private-Clique-Network.md @@ -98,15 +99,16 @@ nav: - IBFT 2.0: Consensus-Protocols/IBFT.md - Quorum IBFT 1.0: Consensus-Protocols/QuorumIBFT.md - Privacy: - - Overview: Privacy/Privacy-Overview.md - - Processing Private Transactions: Privacy/Private-Transaction-Processing.md - - Configuring a Privacy-Enabled Network: Privacy/Configuring-Privacy.md - - Creating and Sending Private Transactions: - - Overview: Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md - - web3.js-eea Client Library: Privacy/Private-Transactions/eeajs.md - - web3.js-eea Multinode Example: Privacy/Private-Transactions/eeajs-Multinode-example.md - - Quickstart for Private Transactions: Privacy/Privacy-Quickstart.md - - Permissions: + - Tutorials: + - Configuring a Privacy-Enabled Network: Privacy/Configuring-Privacy.md + - Using web3.js-eea Multinode Example: Privacy/Private-Transactions/eeajs-Multinode-example.md + - How To: + - Create and Send Private Transactions: Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md + - Use the web3.js-eea Client Library: Privacy/Private-Transactions/eeajs.md + - Explanation: + - Privacy Overview: Privacy/Privacy-Overview.md + - Processing Private Transactions: Privacy/Private-Transaction-Processing.md + - Perrmissions: - Overview: Permissions/Permissioning-Overview.md - Local Permissions: Permissions/Local-Permissioning.md - Onchain Permissions: Permissions/Onchain-Permissioning.md From e261569d3ed956628fbd5ac2591957e2193b1543 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 22 Jul 2019 10:43:16 +1000 Subject: [PATCH 11/14] Moved files --- docs/Deploying-Pantheon/High-Availability.md | 2 +- docs/Permissions/Permissioning-Overview.md | 2 +- .../{ => Explanation}/Privacy-Overview.md | 8 +++---- .../Private-Transaction-Processing.md | 8 +++---- .../Creating-Sending-Private-Transactions.md | 0 .../{Private-Transactions => How-To}/eeajs.md | 0 .../{ => Tutorials}/Configuring-Privacy.md | 24 +++++++++---------- .../eeajs-Multinode-example.md | 2 +- docs/Reference/Pantheon-CLI-Syntax.md | 8 +++---- .../Privacy-Quickstart.md | 6 ++--- mkdocs.yml | 16 ++++++------- 11 files changed, 38 insertions(+), 38 deletions(-) rename docs/Privacy/{ => Explanation}/Privacy-Overview.md (94%) rename docs/Privacy/{ => Explanation}/Private-Transaction-Processing.md (91%) rename docs/Privacy/{Private-Transactions => How-To}/Creating-Sending-Private-Transactions.md (100%) rename docs/Privacy/{Private-Transactions => How-To}/eeajs.md (100%) rename docs/Privacy/{ => Tutorials}/Configuring-Privacy.md (81%) rename docs/Privacy/{Private-Transactions => Tutorials}/eeajs-Multinode-example.md (99%) rename docs/{Privacy => Tutorials}/Privacy-Quickstart.md (96%) diff --git a/docs/Deploying-Pantheon/High-Availability.md b/docs/Deploying-Pantheon/High-Availability.md index 99c69a36e7..7f4cacddb0 100644 --- a/docs/Deploying-Pantheon/High-Availability.md +++ b/docs/Deploying-Pantheon/High-Availability.md @@ -29,7 +29,7 @@ are sent to multiple nodes, the [`eth_getTransactionCount`](../Reference/Pantheo results can be incorrect. !!! note - If using [private transactions](../Privacy/Privacy-Overview.md), `eea_getTransactionCount` is used to obtain + If using [private transactions](../Privacy/Explanation/Privacy-Overview.md), `eea_getTransactionCount` is used to obtain the account nonce and [`eea_sendRawTransaction`](../Reference/Pantheon-API-Methods.md#eea_sendrawtransaction) to send private transactions. diff --git a/docs/Permissions/Permissioning-Overview.md b/docs/Permissions/Permissioning-Overview.md index b2bbf6edc4..436abade97 100644 --- a/docs/Permissions/Permissioning-Overview.md +++ b/docs/Permissions/Permissioning-Overview.md @@ -13,7 +13,7 @@ account permissioning on the network. follow the rules. A single bad actor can decide not to follow the rules. Nodes can take action to prevent the bad actor adding to the chain but they cannot prevent the bad actor from allowing access to the chain. - Pantheon also implements [privacy](../Privacy/Privacy-Overview.md). + Pantheon also implements [privacy](../Privacy/Explanation/Privacy-Overview.md). ## Node Permissioning diff --git a/docs/Privacy/Privacy-Overview.md b/docs/Privacy/Explanation/Privacy-Overview.md similarity index 94% rename from docs/Privacy/Privacy-Overview.md rename to docs/Privacy/Explanation/Privacy-Overview.md index 01aa841124..5cdc299aee 100644 --- a/docs/Privacy/Privacy-Overview.md +++ b/docs/Privacy/Explanation/Privacy-Overview.md @@ -8,14 +8,14 @@ Other parties cannot access the transaction content, sending party, or list of p !!! 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). + with a consensus mechanism supporting transaction finality. For example, [IBFT 2.0](../../Consensus-Protocols/IBFT.md). ## Private Transaction Manager Pantheon uses a Private Transaction Manager to implement privacy. For example, [Orion](http://docs.orion.pegasys.tech). Each Pantheon node that sends or receives private transactions requires an associated Orion node. -![Orion Nodes](../images/OrionNodes.png) +![Orion Nodes](../../images/OrionNodes.png) Private transactions are passed from the Pantheon node to the associated Orion node. The Orion node encrypts and directly distributes (that is, point to point) the private transaction to Orion nodes @@ -48,7 +48,7 @@ Private transactions have additional attributes to public Ethereum transactions: Pantheon and Orion nodes both have public/private key pairs identifying them. The private transaction submitted from the Pantheon node to the Orion node is signed with the Pantheon node private key. The `privateFrom` and `privateFor` attributes specified in the RLP-encoded transaction string for -[`eea_sendRawTransaction`](../Reference/Pantheon-API-Methods.md#eea_sendrawtransaction) are the public keys +[`eea_sendRawTransaction`](../../Reference/Pantheon-API-Methods.md#eea_sendrawtransaction) are the public keys of the Orion nodes sending and receiving the transaction. !!! important @@ -64,7 +64,7 @@ The Pantheon nodes maintain the public world state for the blockchain and a priv The private states contain data that is not shared in the globally replicated world state. Private transactions read and write to the private world state for the privacy group, and read from the public world state. -![Privacy Groups](../images/PrivacyGroups.png) +![Privacy Groups](../../images/PrivacyGroups.png) !!! note The Orion nodes are not shown above for clarity only. To send private transactions, diff --git a/docs/Privacy/Private-Transaction-Processing.md b/docs/Privacy/Explanation/Private-Transaction-Processing.md similarity index 91% rename from docs/Privacy/Private-Transaction-Processing.md rename to docs/Privacy/Explanation/Private-Transaction-Processing.md index ebda2a0bf0..9aa175d82c 100644 --- a/docs/Privacy/Private-Transaction-Processing.md +++ b/docs/Privacy/Explanation/Private-Transaction-Processing.md @@ -10,13 +10,13 @@ Ethereum node for later execution. - **Privacy Marker Transaction**: Public Ethereum transaction with a payload of the transaction hash of the private transaction. The `to` attribute of the Privacy Marker Transaction is the address of the privacy precompile contract. -The Privacy Marker Transaction is signed with the [Ethereum node private key](../Configuring-Pantheon/Node-Keys.md#node-private-key). +The Privacy Marker Transaction is signed with the [Ethereum node private key](../../Configuring-Pantheon/Node-Keys.md#node-private-key). Private transactions are processed as illustrated and described below. -![Processing Private Transctions](../images/PrivateTransactionProcessing.png) +![Processing Private Transctions](../../images/PrivateTransactionProcessing.png) -1. A private transaction is submitted using [eea_sendRawTransaction](../Reference/Pantheon-API-Methods.md#eea_sendrawtransaction). +1. A private transaction is submitted using [eea_sendRawTransaction](../../Reference/Pantheon-API-Methods.md#eea_sendrawtransaction). The signed transaction includes transaction attributes that are specific to private transactions: * `privateFor` specifies the list of recipients @@ -57,4 +57,4 @@ the private world state, and read from the public world state. !!! 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). + with a consensus mechanism supporting transaction finality. For example, [IBFT 2.0](../../Consensus-Protocols/IBFT.md). diff --git a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md b/docs/Privacy/How-To/Creating-Sending-Private-Transactions.md similarity index 100% rename from docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md rename to docs/Privacy/How-To/Creating-Sending-Private-Transactions.md diff --git a/docs/Privacy/Private-Transactions/eeajs.md b/docs/Privacy/How-To/eeajs.md similarity index 100% rename from docs/Privacy/Private-Transactions/eeajs.md rename to docs/Privacy/How-To/eeajs.md diff --git a/docs/Privacy/Configuring-Privacy.md b/docs/Privacy/Tutorials/Configuring-Privacy.md similarity index 81% rename from docs/Privacy/Configuring-Privacy.md rename to docs/Privacy/Tutorials/Configuring-Privacy.md index 8c6648560a..09566d718a 100644 --- a/docs/Privacy/Configuring-Privacy.md +++ b/docs/Privacy/Tutorials/Configuring-Privacy.md @@ -7,8 +7,8 @@ Configuring a network that supports private transactions requires starting an Or Pantheon node. Pantheon command line options associate the Pantheon node with the Orion node. This tutorial assumes you have completed setting up an IBFT 2.0 network to the point where you have -[created the genesis file](../Tutorials/Create-IBFT-Network.md#5-create-genesis-file). If not, complete -steps 1 to 5 of the [Create an IBFT 2.0](../Tutorials/Create-IBFT-Network.md) tutorial before continuing. +[created the genesis file](../../Tutorials/Create-IBFT-Network.md#5-create-genesis-file). If not, complete +steps 1 to 5 of the [Create an IBFT 2.0](../../Tutorials/Create-IBFT-Network.md) tutorial before continuing. In this tutorial we start Orion nodes for the three Pantheon nodes and configure each Pantheon node to be associated with an Orion node. @@ -116,18 +116,18 @@ pantheon --data-path=data --genesis-file=..\ibftGenesis.json --rpc-http-enabled The command line specifies privacy options: -* [`--privacy-enabled`](../Reference/Pantheon-CLI-Syntax.md#privacy-enabled) enables privacy -* [`--privacy-url`](../Reference/Pantheon-CLI-Syntax.md#privacy-url) specifies the Orion node URL (`clienturl` in `orion.conf`) -* [`--privacy-public-key-file`](../Reference/Pantheon-CLI-Syntax.md#privacy-public-key-file) specifies the file containing +* [`--privacy-enabled`](../../Reference/Pantheon-CLI-Syntax.md#privacy-enabled) enables privacy +* [`--privacy-url`](../../Reference/Pantheon-CLI-Syntax.md#privacy-url) specifies the Orion node URL (`clienturl` in `orion.conf`) +* [`--privacy-public-key-file`](../../Reference/Pantheon-CLI-Syntax.md#privacy-public-key-file) specifies the file containing Orion node public key (created in [3. Generate Orion Keys](#3-generate-orion-keys)) -* [`--rpc-http-api`](../Reference/Pantheon-CLI-Syntax.md#rpc-http-api) includes `EEA` in the list of +* [`--rpc-http-api`](../../Reference/Pantheon-CLI-Syntax.md#rpc-http-api) includes `EEA` in the list of JSON-RPC APIs to enable privacy JSON-RPC API methods. -* [`--min-gas-price`](../Reference/Pantheon-CLI-Syntax.md#min-gas-price) set to 0 for a [free gas network](../Configuring-Pantheon/FreeGas.md). +* [`--min-gas-price`](../../Reference/Pantheon-CLI-Syntax.md#min-gas-price) set to 0 for a [free gas network](../../Configuring-Pantheon/FreeGas.md). -When the node starts, the [enode URL](../Configuring-Pantheon/Node-Keys.md#enode-url) is displayed. +When the node starts, the [enode URL](../../Configuring-Pantheon/Node-Keys.md#enode-url) is displayed. Copy the enode URL to specify Node-1 as the bootnode in the following steps. -![Node 1 Enode URL](../images/EnodeStartup.png) +![Node 1 Enode URL](../../images/EnodeStartup.png) ### 7. Start Pantheon Node-2 @@ -142,10 +142,10 @@ pantheon --data-path=data --genesis-file=..\ibftGenesis.json --bootnodes= ``` -Address to which the [privacy pre-compiled contract](../Privacy/Private-Transaction-Processing.md) is mapped. +Address to which the [privacy pre-compiled contract](../Privacy/Explanation/Private-Transaction-Processing.md) is mapped. The default is 126. ### privacy-public-key-file @@ -962,7 +962,7 @@ PANTHEON_PRIVACY_PUBLIC_KEY_FILE=Orion/nodeKey.pub privacy-public-key-file="Orion/nodeKey.pub" ``` -Path to the [public key of the Orion node](../Privacy/Privacy-Overview.md#pantheon-and-orion-keys). +Path to the [public key of the Orion node](../Privacy/Explanation/Privacy-Overview.md#pantheon-and-orion-keys). ### privacy-url @@ -982,7 +982,7 @@ PANTHEON_PRIVACY_URL=http://127.0.0.1:8888 privacy-url="http://127.0.0.1:8888" ``` -URL on which the [Orion node](../Privacy/Configuring-Privacy.md#4-create-orion-configuration-files) is running. +URL on which the [Orion node](../Privacy/Tutorials/Configuring-Privacy.md#4-create-orion-configuration-files) is running. ### revert-reason-enabled diff --git a/docs/Privacy/Privacy-Quickstart.md b/docs/Tutorials/Privacy-Quickstart.md similarity index 96% rename from docs/Privacy/Privacy-Quickstart.md rename to docs/Tutorials/Privacy-Quickstart.md index 8594efc0cc..b17028dca4 100644 --- a/docs/Privacy/Privacy-Quickstart.md +++ b/docs/Tutorials/Privacy-Quickstart.md @@ -4,12 +4,12 @@ description: Pantheon private network with privacy enabled quickstart tutorial # Private Network with Privacy Enabled Quickstart Tutorial The Private Network with Privacy Enabled Quickstart runs a private network of Pantheon and Orion nodes managed by Docker Compose. -It is an expanded version of the [Private Network Quickstart](../Tutorials/Private-Network-Quickstart.md). +It is an expanded version of the [Private Network Quickstart](Private-Network-Quickstart.md). You can use the [Block Explorer](../Tutorials/Private-Network-Quickstart.md#block-explorer), make [JSON-RPC requests](../Tutorials/Private-Network-Quickstart.md#run-json-rpc-requests), and create [transactions using Metamask](../Tutorials/Private-Network-Quickstart.md#creating-a-transaction-using-metamask) -as described in the [Private Network Quickstart tutorial](../Tutorials/Private-Network-Quickstart.md). +as described in the [Private Network Quickstart tutorial](Private-Network-Quickstart.md). This tutorial describes how to use the examples provided in the EEAJS library to [create and send private transactions](#send-private-transactions-and-read-values). !!! important @@ -143,7 +143,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","para curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xe0776de9a9d4e30be0025c1308eed8bc45502cba9fe22c504a56e2fd95343e6f"],"id":1}' http://localhost:32771/jsonrpc ``` -The transaction receipt for the [privacy marker transaction](Private-Transaction-Processing.md) is displayed with a `contractAddress` of `null`. +The transaction receipt for the [privacy marker transaction](../Privacy/Explanation/Private-Transaction-Processing.md) is displayed with a `contractAddress` of `null`. ```json { diff --git a/mkdocs.yml b/mkdocs.yml index 49d15bac7e..09f1e9fb5f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,7 +65,7 @@ nav: - Running Pantheon from Docker Image: Getting-Started/Run-Docker-Image.md - Tutorials: - Private Network Quickstart: Tutorials/Private-Network-Quickstart.md - - Private Network Quickstart for Private Transactions: Privacy/Privacy-Quickstart.md + - Private Network Quickstart for Private Transactions: Tutorials/Privacy-Quickstart.md - Private Network Quickstart On Azure: Tutorials/Azure/Azure-Private-Network-Quickstart.md - Create a Private Network using Ethash (Pow): Tutorials/Create-Private-Network.md - Create a Private Network using Clique (PoA): Tutorials/Create-Private-Clique-Network.md @@ -100,15 +100,15 @@ nav: - Quorum IBFT 1.0: Consensus-Protocols/QuorumIBFT.md - Privacy: - Tutorials: - - Configuring a Privacy-Enabled Network: Privacy/Configuring-Privacy.md - - Using web3.js-eea Multinode Example: Privacy/Private-Transactions/eeajs-Multinode-example.md + - Configuring a Privacy-Enabled Network: Privacy/Tutorials/Configuring-Privacy.md + - Using web3.js-eea Multinode Example: Privacy/Tutorials/eeajs-Multinode-example.md - How To: - - Create and Send Private Transactions: Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md - - Use the web3.js-eea Client Library: Privacy/Private-Transactions/eeajs.md + - Create and Send Private Transactions: Privacy/How-To/Creating-Sending-Private-Transactions.md + - Use the web3.js-eea Client Library: Privacy/How-To/eeajs.md - Explanation: - - Privacy Overview: Privacy/Privacy-Overview.md - - Processing Private Transactions: Privacy/Private-Transaction-Processing.md - - Perrmissions: + - Privacy Overview: Privacy/Explanation/Privacy-Overview.md + - Processing Private Transactions: Privacy/Explanation/Private-Transaction-Processing.md + - Permissions: - Overview: Permissions/Permissioning-Overview.md - Local Permissions: Permissions/Local-Permissioning.md - Onchain Permissions: Permissions/Onchain-Permissioning.md From 12c356805411a22313ec9aa6025f003cf6c008e8 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 22 Jul 2019 10:51:06 +1000 Subject: [PATCH 12/14] Rework --- .../Creating-Sending-Private-Transactions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md index 471eba18a2..7388ffae48 100644 --- a/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md +++ b/docs/Privacy/Private-Transactions/Creating-Sending-Private-Transactions.md @@ -15,7 +15,7 @@ Create and send private transactions using: ## Methods for Private Transactions -A private transaction creates a [Privacy Marker Transaction](../Private-Transaction-Processing.md) as well the private transaction itself. +A private transaction creates a [Privacy Marker Transaction](../Private-Transaction-Processing.md) in addition to the private transaction itself. Use [`eth_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionreceipt) to get the transaction receipt for the Privacy Maker Transaction and [`eea_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eea_gettransactionreceipt) to get the transaction receipt for the private transaction. From e86cbd4e6e0896286c2c7cf063195a67b3a03dc2 Mon Sep 17 00:00:00 2001 From: Madeline Date: Sat, 27 Jul 2019 09:54:47 +1000 Subject: [PATCH 13/14] Added privacy group ID for web3.js-eea --- docs/Reference/web3js-eea-Methods.md | 34 ++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/docs/Reference/web3js-eea-Methods.md b/docs/Reference/web3js-eea-Methods.md index 04093d59d3..d2121d69e6 100644 --- a/docs/Reference/web3js-eea-Methods.md +++ b/docs/Reference/web3js-eea-Methods.md @@ -18,7 +18,7 @@ The Options parameter has the following properties: * `privateKey`: Ethereum private key with which to sign the transaction * `privateFrom` : Orion public key of the sender -* `privateFor` : Orion public keys of recipients +* [`privateFor` : Orion public keys of recipients or `privacyGroupId`: Privacy group to receive the transaction](../Privacy/Explanation/Privacy-Groups.md) * `nonce` : Optional. If not provided, calculated using [`eea_getTransctionCount`](../Reference/Pantheon-API-Methods.md). * `to` : Optional. Contract address to send the transaction to. Do not specify for contract deployment transactions * `data` : Transaction data @@ -113,6 +113,8 @@ Private transaction receipt Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRawTransaction`](Pantheon-API-Methods.md#eea_sendrawtransaction). +`sendRawTransaction` support [EEA-compliant privacy](../Privacy/How-To/EEA-Compliant.md) using `privateFor` or [Pantheon-extended privacy](../Privacy/How-To/Pantheon-Privacy.md) using `privacyGroupId`. + **Parameters** [Transaction options](#options-parameter) @@ -121,8 +123,32 @@ Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRa `string` : Transaction hash of the [`privacy marker transaction`](../Privacy/Explanation/Private-Transaction-Processing.md) -!!! example - ```bash tab="Contract Deployment" +!!! example "Pantheon-extended Privacy" + ```bash tab="Contract Deployment with privacyGroupId" + const createPrivateEmitterContract = privacyGroupId => { + const contractOptions = { + data: `0x${binary}`, + privateFrom: orion.node1.publicKey, + privacyGroupId, + privateKey: pantheon.node1.privateKey + }; + return web3.eea.sendRawTransaction(contractOptions); + }; + ``` + + ```bash tab="Contract Invocation with privacyGroupId " + const functionCall = { + to: address, + data: functionAbi.signature, + privateFrom, + privacyGroupId, + privateKey + }; + return web3.eea.sendRawTransaction(functionCall); + ``` + +!!! example "EEA-compliant Privacy" + ```bash tab="Contract Deployment with privateFor" const createPrivateEmitterContract = () => { const contractOptions = { data: `0x${binary}`, @@ -134,7 +160,7 @@ Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRa }; ``` - ```bash tab="Contract Invocation" + ```bash tab="Contract Invocation with privateFor" const functionCall = { to: address, data: functionAbi.signature + functionArgs, From c48b35cf1e92c3846baf924716778f1ab9dc897d Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 29 Jul 2019 15:55:10 +1000 Subject: [PATCH 14/14] Rework --- docs/Reference/web3js-eea-Methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Reference/web3js-eea-Methods.md b/docs/Reference/web3js-eea-Methods.md index d2121d69e6..dedb476fc9 100644 --- a/docs/Reference/web3js-eea-Methods.md +++ b/docs/Reference/web3js-eea-Methods.md @@ -113,7 +113,7 @@ Private transaction receipt Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRawTransaction`](Pantheon-API-Methods.md#eea_sendrawtransaction). -`sendRawTransaction` support [EEA-compliant privacy](../Privacy/How-To/EEA-Compliant.md) using `privateFor` or [Pantheon-extended privacy](../Privacy/How-To/Pantheon-Privacy.md) using `privacyGroupId`. +`sendRawTransaction` supports [EEA-compliant privacy](../Privacy/How-To/EEA-Compliant.md) using `privateFor`, or [Pantheon-extended privacy](../Privacy/How-To/Pantheon-Privacy.md) using `privacyGroupId`. **Parameters**