From f6f30da05ab7199dcb3f1a617973dbc083538d72 Mon Sep 17 00:00:00 2001 From: bgravenorst <50852695+bgravenorst@users.noreply.github.com> Date: Fri, 10 Dec 2021 06:04:50 +1000 Subject: [PATCH] Add content for #172. (#173) * Add content for #172. Signed-off-by: bgravenorst * Update docs/tutorials/contracts/deploying-contracts.md Co-authored-by: Alexandra Tran <12214231+alexandratran@users.noreply.github.com> Co-authored-by: Alexandra Tran <12214231+alexandratran@users.noreply.github.com> --- docs/concepts/architecture.md | 2 +- docs/concepts/free-gas-network.md | 34 +++++++++++++++++++ docs/reference/api-methods.md | 4 +-- .../contracts/account-funds-transfers.md | 4 +-- .../contracts/calling-contract-functions.md | 2 +- .../contracts/deploying-contracts.md | 12 +++---- .../quorum-dev-quickstart/getting-started.md | 6 ++-- mkdocs.navigation.yml | 1 + 8 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 docs/concepts/free-gas-network.md diff --git a/docs/concepts/architecture.md b/docs/concepts/architecture.md index 91f68d18..4cdb93b2 100644 --- a/docs/concepts/architecture.md +++ b/docs/concepts/architecture.md @@ -25,6 +25,6 @@ GoQuorum includes the following changes to geth: * Block validation logic is changed to handle [private transactions](privacy/private-and-public.md#private-transactions). * Transaction creation is changed to allow for replacing transaction data with encrypted hashes to preserve private data where required. -* The pricing of gas is removed. Gas itself remains. +* [The pricing of gas is removed](free-gas-network.md). Gas itself remains. For more information about the GoQuorum architecture and its differences from geth, contact us on [GoQuorum Discord](https://discord.gg/5U9Jwp7). diff --git a/docs/concepts/free-gas-network.md b/docs/concepts/free-gas-network.md new file mode 100644 index 00000000..6800e934 --- /dev/null +++ b/docs/concepts/free-gas-network.md @@ -0,0 +1,34 @@ +--- +description: Free gas networks +--- + +# Free gas networks + +GoQuorum is a free gas network, which means there's no gas price. + +Transactions use computational resources, so they have associated costs. +*Gas* is the cost unit and *gas price* is the price per gas unit. +The transaction cost is the gas used multiplied by the gas price. + +In public Ethereum networks, the account submitting the transaction pays the transaction cost, in Ether. +The miner (or validator, in proof of authority networks) that includes the transaction in a block receives the +transaction cost. + +In many private networks, including GoQuorum, network participants run the validators and don't require gas as an incentive. +Networks that don't require gas as an incentive usually remove gas price or configure the gas price to be zero (that is, +free gas). +Some private networks might allocate Ether and use a non-zero gas price to limit resource use. + +In free gas networks, the gas price is zero but transactions still use gas, so the transaction cost (gas used multiplied +by the gas price) is zero. + +In GoQuorum, gas price is completely removed. +Gas price is not included as a transaction object parameter in [GoQuorum privacy API methods](../reference/api-methods.md#privacy-methods). +When using standard Ethereum JSON-RPC methods such as +[`sendSignedTransaction`](https://web3js.readthedocs.io/en/v1.3.4/web3-eth.html#sendsignedtransaction), you must set +`gasPrice` to 0. + +!!! tip + + We use the term *free gas network* to refer to a network with a gas price of zero. + A network with a gas price of zero is also known as a *zero gas network* or *no gas network*. diff --git a/docs/reference/api-methods.md b/docs/reference/api-methods.md index 2d915fc9..2cf0f150 100644 --- a/docs/reference/api-methods.md +++ b/docs/reference/api-methods.md @@ -2471,8 +2471,8 @@ The following API methods provide functionality for GoQuorum [privacy](../concep !!! note - Gas price is removed from GoQuorum networks, so is not included as a transaction object parameter in GoQuorum - privacy methods. + [Gas price is removed from GoQuorum networks](../concepts/free-gas-network.md), so is not included + as a transaction object parameter in GoQuorum privacy methods. When using standard Ethereum JSON-RPC methods such as [`sendSignedTransaction`](https://web3js.readthedocs.io/en/v1.3.4/web3-eth.html#sendsignedtransaction), set `gasPrice` to 0. diff --git a/docs/tutorials/contracts/account-funds-transfers.md b/docs/tutorials/contracts/account-funds-transfers.md index 437741e7..f3efe403 100644 --- a/docs/tutorials/contracts/account-funds-transfers.md +++ b/docs/tutorials/contracts/account-funds-transfers.md @@ -51,7 +51,7 @@ Before making the transaction, the script checks the balances of both accounts t from: accountA.address, to: accountB.address, value: "0x100", // Amount of ETH to transfer - gasPrice: "0x0", // ETH per unit of gas + gasPrice: "0x0", // Set to 0 in GoQuorum networks gasLimit: "0x24A22" // Max number of gas units the tx is allowed to use }; console.log("Creating transaction..."); @@ -100,7 +100,7 @@ Create a new file `eth_tx.js` (or run the following commands in a JavaScript con from: accountA.address, to: accountB.address, value: "0x100", // Amount of ETH to transfer - gasPrice: "0x0", // ETH per unit of gas + gasPrice: "0x0", // Set to 0 in GoQuorum networks gasLimit: "0x24A22" // Max number of gas units the tx is allowed to use }; console.log("Creating transaction..."); diff --git a/docs/tutorials/contracts/calling-contract-functions.md b/docs/tutorials/contracts/calling-contract-functions.md index 3ff2209c..6c1b66cf 100644 --- a/docs/tutorials/contracts/calling-contract-functions.md +++ b/docs/tutorials/contracts/calling-contract-functions.md @@ -71,7 +71,7 @@ Make the `set` call passing in your account address, `value` as the updated valu you are willing to spend for the transaction: ```js -// You need to use the accountAddress details provided to Quorum to send/interact with contracts +// You need to use the accountAddress details provided to GoQuorum to send/interact with contracts async function setValueAtAddress(host, accountAddress, value, deployedContractAbi, deployedContractAddress){ const web3 = new Web3(host); const contractInstance = new web3.eth.Contract(deployedContractAbi, deployedContractAddress); diff --git a/docs/tutorials/contracts/deploying-contracts.md b/docs/tutorials/contracts/deploying-contracts.md index b1a1669b..13800b30 100644 --- a/docs/tutorials/contracts/deploying-contracts.md +++ b/docs/tutorials/contracts/deploying-contracts.md @@ -87,7 +87,7 @@ Call [`eth_sendTransaction`](https://eth.wiki/json-rpc/API) with the following p * `from` - Address of the sender's account. * `to` - Address of the receiver. To deploy a contract, set to `null`. * `gas` - Amount of gas provided by the sender for the transaction. -* `gasPrice` - Price for each unit of gas the sender is willing to pay. +* `gasPrice` - Price for each unit of gas the sender is willing to pay. [Set to zero](../../concepts/free-gas-network.md) in GoQuorum networks. * `data` - One of the following: * For contract deployments (this use case), the [compiled binary of the contract](#compile-the-contract). * For contract interactions, the hash of the invoked method signature and encoded parameters @@ -195,7 +195,7 @@ Create a new file `public_tx.js`(or run the following commands in a JavaScript c to: null, // public tx value: "0x00", data: '0x'+contractBin+contractInit, // contract binary appended with initialization value - gasPrice: "0x0", // ETH per unit of gas + gasPrice: "0x0", // Set to 0 in GoQuorum networks gasLimit: "0x24A22" // max number of gas units the tx is allowed to use }; console.log("Creating transaction..."); @@ -215,7 +215,7 @@ Create a new file `public_tx.js`(or run the following commands in a JavaScript c * `from` - Address of the EthSigner account. * `to` - Address of the receiver. To deploy a contract, set to `null`. * `gas` - Amount of gas provided by the sender for the transaction. -* `gasPrice` - Price for each unit of gas the sender is willing to pay. +* `gasPrice` - Price for each unit of gas. [Set to zero](../../concepts/free-gas-network.md) in GoQuorum networks. * `data` - Binary of the contract (in this example there's also a constructor initialization value appended to the binary value). * `value` - Amount of ETH in Wei transferred from the sender to the recipient. @@ -234,7 +234,7 @@ Call [`eth_sendTransaction`](https://eth.wiki/json-rpc/API) with the following p * `from` - Address of the sender's account. * `to` - Address of the receiver. To deploy a contract, set to `null`. * `gas` - Amount of gas provided by the sender for the transaction. -* `gasPrice` - Price for each unit of gas the sender is willing to pay. +* `gasPrice` - Price for each unit of gas. [Set to zero](../../concepts/free-gas-network.md) in GoQuorum networks. * `privateFrom` - The sender's base-64-encoded public key. * `privateFor` - Array of the recipient's base-64-encoded public keys. * `privacyFlag` - 0 for standard private, 1 for [counter party protection](../../concepts/privacy/privacy-enhancements.md#counter-party-protection). @@ -341,7 +341,7 @@ Create a new file `private_tx_web3js_quorum.js`(or run the following commands in const txOptions = { nonce: txCount, - gasPrice: 0, //ETH per unit of gas + gasPrice: 0, //Set to 0 in GoQuorum networks gasLimit: 0x24A22, //max number of gas units the tx is allowed to use value: 0, data: '0x'+contractBin+contractConstructorInit, @@ -362,7 +362,7 @@ Create a new file `private_tx_web3js_quorum.js`(or run the following commands in * `nonce` - Number of transactions sent from this address. * `from` - Address of the EthSigner account. * `gasLimit` - Amount of gas provided by the sender for the transaction. -* `gasPrice` - Price for each unit of gas the sender is willing to pay. +* `gasPrice` - Price for each unit of gas. [Set to zero](../../concepts/free-gas-network.md) in GoQuorum networks. * `isPrivate` - Indicates that this is a private transaction. * `privateKey` - The sender's GoQuorum node private key. * `privateFrom` - The sender's base-64-encoded public key. diff --git a/docs/tutorials/quorum-dev-quickstart/getting-started.md b/docs/tutorials/quorum-dev-quickstart/getting-started.md index ec594d6a..ffc21434 100644 --- a/docs/tutorials/quorum-dev-quickstart/getting-started.md +++ b/docs/tutorials/quorum-dev-quickstart/getting-started.md @@ -107,10 +107,8 @@ You can use: Quorum Dev Quickstart is open source, and we invite you to contribute enhancements. You will be required to complete a Contributor License Agreement (CLA) before we are able to merge. -If you have any questions about the contribution process, you can get them answered by the [GoQuorum Slack community]. +If you have any questions about the contribution process, you can get them answered on the [GoQuorum Discord](https://discord.gg/5U9Jwp7). ## Getting help -Stuck on a step? Please join our [GoQuorum Slack community] for support. - -[GoQuorum Slack community]: https://www.goquorum.com/slack-inviter +Stuck on a step? Please join the [GoQuorum Discord](https://discord.gg/5U9Jwp7) for support. diff --git a/mkdocs.navigation.yml b/mkdocs.navigation.yml index 75139cb5..48e28482 100644 --- a/mkdocs.navigation.yml +++ b/mkdocs.navigation.yml @@ -78,6 +78,7 @@ nav: - Overview: concepts/consensus/overview.md - Comparing PoA consensus protocols: concepts/consensus/comparing-poa.md - Account management: concepts/account-management.md + - Free gas network: concepts/free-gas-network.md - Privacy: - Overview: concepts/privacy/privacy.md - Public and private transactions: concepts/privacy/private-and-public.md