Skip to content

Commit

Permalink
Add content for #172. (#173)
Browse files Browse the repository at this point in the history
* Add content for #172.

Signed-off-by: bgravenorst <[email protected]>

* Update docs/tutorials/contracts/deploying-contracts.md

Co-authored-by: Alexandra Tran <[email protected]>

Co-authored-by: Alexandra Tran <[email protected]>
  • Loading branch information
bgravenorst and alexandratran authored Dec 9, 2021
1 parent d2c50b8 commit f6f30da
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/concepts/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
34 changes: 34 additions & 0 deletions docs/concepts/free-gas-network.md
Original file line number Diff line number Diff line change
@@ -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*.
4 changes: 2 additions & 2 deletions docs/reference/api-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/contracts/account-funds-transfers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand Down Expand Up @@ -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...");
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/contracts/calling-contract-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/contracts/deploying-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...");
Expand All @@ -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.

Expand All @@ -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).
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions docs/tutorials/quorum-dev-quickstart/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions mkdocs.navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6f30da

Please sign in to comment.