<ulclass="nav"><liclass="active"><ahref="#Overview">Overview</a></li><li><ahref="#Getting-Started">Getting Started</a><ulclass="nav"><li><ahref="#Installation">Installation</a></li><li><ahref="#Quickstart">Basic Quickstart</a></li><li><ahref="#Private-Network-Quickstart">Private Network Quickstart</a></li><li><ahref="#Starting-Pantheon">Starting Pantheon</a></li><li><ahref="#Run-Docker-Image">Running Pantheon from Docker Image</a></li></ul></li><li><span>Configuring Pantheon</span><ulclass="nav"><li><ahref="#Networking">Networking</a></li><li><ahref="#Logging">Logging</a></li><li><ahref="#Testing-Developing-Nodes">Testing and Developing Nodes</a></li><li><ahref="#Proof-of-Authority">Proof of Authority</a></li><li><ahref="#Passing-JVM-Options">Passing JVM Options</a></li></ul></li><li><span>Using Pantheon</span><ulclass="nav"><li><ahref="#Transactions">Creating and Sending Transactions</a></li><li><ahref="#Account-Management">Using Wallets for Account Management</a></li><li><ahref="#Mining">Mining</a></li><li><ahref="#RPC-PubSub">RPC Pub/Sub</a></li><li><ahref="#Debugging">Debugging Pantheon</a></li></ul></li><li><span>Reference</span><ulclass="nav"><li><ahref="#Pantheon-CLI-Syntax">Pantheon CLI Reference</a></li><li><ahref="#JSON-RPC-API">JSON-RPC API Reference</a></li></ul></li></ul>
<ulclass="nav"><liclass="active"><ahref="#Overview">Overview</a></li><li><ahref="#Getting-Started">Getting Started</a><ulclass="nav"><li><ahref="#Installation">Installation</a></li><li><ahref="#Quickstart">Basic Quickstart</a></li><li><ahref="#Private-Network-Quickstart">Private Network Quickstart</a></li><li><ahref="#Starting-Pantheon">Starting Pantheon</a></li><li><ahref="#Run-Docker-Image">Running Pantheon from Docker Image</a></li></ul></li><li><span>Configuring Pantheon</span><ulclass="nav"><li><ahref="#NetworkID-And-ChainID">Network ID and Chain ID</a></li><li><ahref="#Node-Keys">Node Keys</a></li><li><ahref="#Networking">Networking</a></li><li><ahref="#Accounts-for-Testing">Accounts for Testing</a></li><li><ahref="#Logging">Logging</a></li><li><ahref="#Testing-Developing-Nodes">Testing and Developing Nodes</a></li><li><ahref="#Proof-of-Authority">Proof of Authority</a></li><li><ahref="#Passing-JVM-Options">Passing JVM Options</a></li></ul></li><li><span>Using Pantheon</span><ulclass="nav"><li><ahref="#Transactions">Creating and Sending Transactions</a></li><li><ahref="#Account-Management">Using Wallets for Account Management</a></li><li><ahref="#Mining">Mining</a></li><li><ahref="#RPC-PubSub">RPC Pub/Sub</a></li><li><ahref="#Debugging">Debugging Pantheon</a></li></ul></li><li><span>Reference</span><ulclass="nav"><li><ahref="#Pantheon-CLI-Syntax">Pantheon CLI Reference</a></li><li><ahref="#JSON-RPC-API">JSON-RPC API Reference</a></li></ul></li></ul>
<li>Cloning our repository and <ahref="#Installation">building from source</a>. </li>
<li>Cloning the Pantheon repository and <ahref="#Installation">building from source</a>. </li>
<li>Cloning our repository and using the <ahref="#Private-Network-Quickstart">Private Network Quickstart</a>. </li>
<li>Cloning the Pantheon repository and using the <ahref="#Private-Network-Quickstart">Private Network Quickstart</a>. </li>
<li>Downloading the <ahref="https://bintray.com/consensys/pegasys-repo/pantheon/0.8.1#files">packaged binaries</a>. </li>
<li>Downloading the Pantheon <ahref="https://bintray.com/consensys/pegasys-repo/pantheon/0.8.1#files">packaged binaries</a>. </li>
<li>Running from the <ahref="#Run-Docker-Image">Pantheon docker image</a>. </li>
<li>Running from the <ahref="#Run-Docker-Image">Pantheon docker image</a>. </li>
</ol>
</ul>
<p>If you want to run a single node to connect the Ethereum mainnet or a public testnet, running from the <ahref="#Run-Docker-Image">docker image</a> or <ahref="https://bintray.com/consensys/pegasys-repo/pantheon/0.8.1#files">downloading the packaged binaries</a> is the fastest way to get started. </p>
<p>To run a single node to connect the Ethereum mainnet or a public testnet, running from the Pantheon<ahref="#Run-Docker-Image">docker image</a> or <ahref="https://bintray.com/consensys/pegasys-repo/pantheon/0.8.1#files">downloading the packaged binaries</a> is the fastest way to get started. </p>
<p>If you want a private network on which you can make JSON-RPC requests and send transactions, and use for testing or learning about Pantheon and Ethereum networks, the <ahref="#Private-Network-Quickstart">Private Network Quickstart</a> runs a private network of Pantheon nodes in a Docker container. </p>
<p>To run a private network on which you can make JSON-RPC requests and send transactions, or explore Pantheon and Ethereum networks, the <ahref="#Private-Network-Quickstart">Private Network Quickstart</a> runs a private network of Pantheon nodes in a Docker container. </p>
@ -900,10 +900,10 @@ running in a private network. To run the containers, go to the <code>pantheon</c
<p>On Windows, run the following docker-compose commands:</p>
<p>On Windows, run the following docker-compose commands:</p>
</blockquote>
</blockquote>
<preclass="hljs">// Run the Docker containers
<preclass="hljs">// Run the Docker containers
quickstart\docker-compose -f docker-compose.yml up -d --scale node=4
quickstart\docker-compose up -d --scale node=4
// List the endpoints
// List the endpoints
quickstart\docker-compose -f docker-compose.yml port explorer 80</pre><p>This script builds Pantheon, builds the images and runs the containers. It will also scale the regular node container to four containers to simulate a network with enough peers to synchronize.</p>
quickstart\docker-compose port explorer 80</pre><p>This script builds Pantheon, builds the images and runs the containers. It will also scale the regular node container to four containers to simulate a network with enough peers to synchronize.</p>
<p>When the process ends, it lists the running services:</p>
<p>When the process ends, it lists the running services:</p>
<p>On Windows, to display the list of endpoints again, run the following docker-compose command:</p>
<p>On Windows, to display the list of endpoints again, run the following docker-compose command:</p>
</blockquote>
</blockquote>
<preclass="hljs">quickstart\docker-compose -f docker-compose.yml port explorer 80</pre><h2id="block-explorer">Block Explorer</h2>
<preclass="hljs">quickstart\docker-compose port explorer 80</pre><h2id="block-explorer">Block Explorer</h2>
<p>This tutorial uses the <ahref="https://aleth.io/">Alethio light block explorer</a>.</p>
<p>This tutorial uses the <ahref="https://aleth.io/">Alethio light block explorer</a>.</p>
<h3id="run-the-block-explorer">Run the Block Explorer</h3>
<h3id="run-the-block-explorer">Run the Block Explorer</h3>
<p>Access the explorer by copying and pasting the <code>Web block explorer address</code> displayed when starting the private network to your browser.</p>
<p>Access the explorer by copying and pasting the <code>Web block explorer address</code> displayed when starting the private network to your browser.</p>
@ -1020,18 +1020,18 @@ created during the genesis of this test network.</p>
<li>In the <strong>New RPC URL</strong> field, enter the <code>JSON-RPC HTTP service endpoint</code> displayed when you started the private network.</li>
<li>In the <strong>New RPC URL</strong> field, enter the <code>JSON-RPC HTTP service endpoint</code> displayed when you started the private network.</li>
</ol>
</ol>
<p>Save the configuration and return to the MetaMask main screen. Your current network is now set to the private network RPC node.</p>
<p>Save the configuration and return to the MetaMask main screen. Your current network is now set to the private network RPC node.</p>
<p><ahref="https://consensys.zendesk.com/hc/en-us/articles/360004176551-Importing-an-Account-New-UI-">Import one of the existing accounts above into metamask</a>
<p><ahref="https://metamask.zendesk.com/hc/en-us/articles/360015489331-Importing-an-Account-New-UI-">Import one of the existing accounts above into metamask</a>
using the corresponding private key. </p>
using the corresponding private key. </p>
<p><strong>NOTE that here we don't really care about securing the keys as it's just a tutorial, but be sure
<p><strong>NOTE that here we don't really care about securing the keys as it's just a tutorial, but be sure
to secure your accounts when you run into a real usecase. This will be discussed in a more advanced
to secure your accounts when you run into a real usecase. This will be discussed in a more advanced
chapter.</strong></p>
chapter.</strong></p>
<p>Once this is done, try to <ahref="https://consensys.zendesk.com/hc/en-us/articles/360004774951-Creating-Additional-MetaMask-Wallets-New-UI-">create another account from scratch</a>
<p>Once this is done, try to <ahref="https://metamask.zendesk.com/hc/en-us/articles/360015289452-Creating-Additional-MetaMask-Wallets-New-UI-">create another account from scratch</a>
to send some ether to.</p>
to send some ether to.</p>
<p><em>Of course remember that here we are dealing with valueless ether as we are not
<p><em>Of course remember that here we are dealing with valueless ether as we are not
on the main network but on a local private network.</em></p>
on the main network but on a local private network.</em></p>
<p>In MetaMask, select the new account and copy the account address by clicking the <strong>...</strong> button and selecting <strong>Copy Address to clipboard</strong>.</p>
<p>In MetaMask, select the new account and copy the account address by clicking the <strong>...</strong> button and selecting <strong>Copy Address to clipboard</strong>.</p>
<p>In the block explorer, search for the new account by clicking on the magnifying glass and pasting the account address into the search box. The account is displayed with a zero balance. </p>
<p>In the block explorer, search for the new account by clicking on the magnifying glass and pasting the account address into the search box. The account is displayed with a zero balance. </p>
<p><ahref="https://consensys.zendesk.com/hc/en-us/articles/360005055472-Sending-Ether-New-UI-">Send some ether</a>
<p><ahref="https://metamask.zendesk.com/hc/en-us/articles/360015488991-Sending-Ether-New-UI-">Send some ether</a>
from the first account (containing some ether) to the new one (that have a zero balance).</p>
from the first account (containing some ether) to the new one (that have a zero balance).</p>
<p>Click refresh on the browser page displaying the new account. The updated balance is displayed and reflects the transaction completed using MetaMask. </p>
<p>Click refresh on the browser page displaying the new account. The updated balance is displayed and reflects the transaction completed using MetaMask. </p>
<h3id="playing-with-the-truffle-pet-shop-tutorial">Playing with the Truffle Pet Shop Tutorial</h3>
<h3id="playing-with-the-truffle-pet-shop-tutorial">Playing with the Truffle Pet Shop Tutorial</h3>
@ -1083,8 +1083,8 @@ So modify the file to look like the following :</p>
<p><strong>Note</strong>The quickstart creates a volume called <code>quickstart_public-keys</code>; you can remove this volume using <code>docker volume rm quickstart_public-keys</code>.</p>
<p><strong>Note</strong>On Windows, the quickstart creates a volume called <code>quickstart_public-keys</code>. Remove this volume using <code>docker volume rm quickstart_public-keys</code>.</p>
</blockquote>
</blockquote>
<h2id="stop-and-restart-the-private-network-without-removing-the-containers">Stop and restart the Private Network without Removing the Containers</h2>
<h2id="stop-and-restart-the-private-network-without-removing-the-containers">Stop and restart the Private Network without Removing the Containers</h2>
<p>To shut down the network without deleting the containers:</p>
<p>To shut down the network without deleting the containers:</p>
@ -1094,21 +1094,25 @@ So modify the file to look like the following :</p>
<p>Pantheon nodes can be used for varying purposes as described in the <ahref="#Overview">Overview</a>. Nodes can connect to the Ethereum mainnet, public testnets such as Ropsten, or private networks.</p>
<p>Pantheon nodes can be used for varying purposes as described in the <ahref="#Overview">Overview</a>. Nodes can connect to the Ethereum mainnet, public testnets such as Ropsten, or private networks.</p>
<h2id="local-block-data">Local Block Data</h2>
<h2id="local-block-data">Local Block Data</h2>
<p>When connecting to a network other than the network previously connected to, you must either delete the local block data or use the <code>--datadir</code> option to specify a different data directory. </p>
<p>When connecting to a network other than the network previously connected to, you must either delete the local block data or use the <code>--datadir</code> option to specify a different data directory. </p>
<p>To delete the local block data, delete the <code>database</code> directory in the <code>pantheon/build/distribution/pantheon-0.8.0-<version></code> directory.</p>
<p>To delete the local block data, delete the <code>database</code> directory in the <code>pantheon/build/distribution/pantheon-0.8.0-<version></code> directory.</p>
<p>The following genesis files are provided in the <code>/pantheon/ethereum/core/src/main/resources</code> directory:</p>
<p>Pantheon specifies the genesis configuration, and sets the network ID and bootnodes when connecting to <ahref="#run-a-node-on-ethereum--mainnet">mainnet</a>, <ahref="#run-a-node-on-rinkeby-testnet">Rinkeby</a>, and <ahref="#run-a-node-on-ropsten-testnet">Ropsten</a>. </p>
<ul>
<p>When <code>--dev-mode</code> is specified, Pantheon uses the development mode genesis configuration.</p>
<li><code>dev.json</code> - Default genesis file when <code>--dev-mode</code> specified. </li>
<p>The genesis files defining the genesis configurations are in the <ahref="https://github.com/PegaSysEng/pantheon/tree/master/config/src/main/resources">Pantheon source files</a>. </p>
<li><code>mainnet.json</code> - Default genesis file when <code>--dev-mode</code> not specified. </li>
<p>To define a genesis configuration, create a genesis file (for example, <code>genesis.json</code>) and specify the file using the <code>--genesis</code> option.</p>
<li><code>rinkeby.json</code> - Used to connect to Rinkeby testnet when <code>--rinkeby</code> specified. </li>
<li><code>ropsten.json</code> - Specify using <code>--genesis</code> option when connecting to Ropsten testnet. </li>
</ul>
<h2id="run-a-node-on-ethereum-mainnet">Run a Node on Ethereum Mainnet</h2>
<h2id="run-a-node-on-ethereum-mainnet">Run a Node on Ethereum Mainnet</h2>
<p>To run a node on the Ethereum mainnet: </p>
<p>To run a node on the Ethereum mainnet: </p>
<p><code>$ bin/pantheon</code></p>
<p><code>$ bin/pantheon</code></p>
@ -1116,7 +1120,7 @@ So modify the file to look like the following :</p>
<p><code>$ bin/pantheon --rpc-enabled</code></p>
<p><code>$ bin/pantheon --rpc-enabled</code></p>
<h2id="run-a-node-on-ropsten-testnet">Run a Node on Ropsten Testnet</h2>
<h2id="run-a-node-on-ropsten-testnet">Run a Node on Ropsten Testnet</h2>
<blockquote>
<blockquote>
<p><strong>Note</strong>If<ahref="#Installation">building from source</a>, you can use the <ahref="#Pantheon-CLI-Syntaxoptions"><code>--ropsten</code> option</a> instead of the following options. For v0.8.1, use the following options.</p>
<p><strong>Note</strong>From v0.8.2 or when<ahref="#Installation">building from source</a>, use the <ahref="#Pantheon-CLI-Syntaxoptions"><code>--ropsten</code> option</a> instead of the following options. For v0.8.1, use the following options.</p>
</blockquote>
</blockquote>
<p>Replace <code><path></code> with the path to the <code>/pantheon</code> directory. </p>
<p>Replace <code><path></code> with the path to the <code>/pantheon</code> directory. </p>
<p>To run a node on Ropsten: </p>
<p>To run a node on Ropsten: </p>
@ -1171,7 +1175,7 @@ So modify the file to look like the following :</p>
<p>To run a node on the Ethereum mainnet: </p>
<p>To run a node on the Ethereum mainnet: </p>
<preclass="hljs">docker run -p 30303:30303 --mount type=bind,source=/<myvolume/pantheon>,target=/var/lib/pantheon pegasyseng/pantheon:latest</pre><p>To run a node on mainnet with the HTTP JSON-RPC service enabled: </p>
<preclass="hljs">docker run -p 30303:30303 --mount type=bind,source=/<myvolume/pantheon>,target=/var/lib/pantheon pegasyseng/pantheon:latest</pre><p>To run a node on mainnet with the HTTP JSON-RPC service enabled: </p>
<preclass="hljs">docker run -p 8545:8545 -p 30303:30303 --mount type=bind,source=/<myvolume/pantheon>,target=/var/lib/pantheon pegasyseng/pantheon:latest --rpc-enabled</pre><h2id="run-a-node-on-ropsten-testnet">Run a Node on Ropsten Testnet</h2>
<preclass="hljs">docker run -p 8545:8545 -p 30303:30303 --mount type=bind,source=/<myvolume/pantheon>,target=/var/lib/pantheon pegasyseng/pantheon:latest --rpc-enabled</pre><h2id="run-a-node-on-ropsten-testnet">Run a Node on Ropsten Testnet</h2>
<p>Save a local copy of the <ahref="https://github.com/PegaSysEng/pantheon/blob/master/ethereum/core/src/main/resources/ropsten.json">Ropsten genesis file</a>. </p>
<p>Save a local copy of the <ahref="https://github.com/PegaSysEng/pantheon/blob/master/config/src/main/resources/ropsten.json">Ropsten genesis file</a>. </p>
<p>To run a node on Ropsten: </p>
<p>To run a node on Ropsten: </p>
<preclass="hljs">docker run -p 30303:30303 --mount type=bind,source=/<myvolume/pantheon/ropsten>,target=/var/lib/pantheon --mount type=bind,source=/<path>/ropsten.json,target=/etc/pantheon/genesis.json pegasyseng/pantheon:latest --network-id=3 --bootnodes=enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303,enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303</pre><h2id="run-a-node-on-rinkeby-testnet">Run a Node on Rinkeby Testnet</h2>
<preclass="hljs">docker run -p 30303:30303 --mount type=bind,source=/<myvolume/pantheon/ropsten>,target=/var/lib/pantheon --mount type=bind,source=/<path>/ropsten.json,target=/etc/pantheon/genesis.json pegasyseng/pantheon:latest --network-id=3 --bootnodes=enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303,enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303</pre><h2id="run-a-node-on-rinkeby-testnet">Run a Node on Rinkeby Testnet</h2>
<p>To run a node on Rinkeby: </p>
<p>To run a node on Rinkeby: </p>
@ -1182,7 +1186,30 @@ So modify the file to look like the following :</p>
<p>To stop a container:</p>
<p>To stop a container:</p>
<preclass="hljs">docker stop <container-name></pre><p>To delete a container:</p>
<preclass="hljs">docker stop <container-name></pre><p>To delete a container:</p>
<preclass="hljs">docker rm <container-name></pre><p>To delete a container volume (optional):</p>
<preclass="hljs">docker rm <container-name></pre><p>To delete a container volume (optional):</p>
<preclass="hljs">docker volume rm <volume-name></pre><pclass="page"id="NetworkID-And-ChainID"></p><h1>Network ID and Chain ID</h1>
<h1id="network-id-and-chain-id">Network ID and Chain ID</h1>
<p>Ethereum networks have a network ID and a chain ID. The network ID is specified using the <code>--network-id</code> option and the chain ID is specified in the genesis file.</p>
<p>For most networks including mainnet and the public testnets, the network ID and the chain ID are the same. </p>
<p>The network ID is defined by Pantheon when connecting to the Ethereum mainnet (<code>1</code>), Rinkeby (<code>4</code>), and Ropsten(<code>3</code>).</p>
<p>When using the <code>--dev-mode</code> or <code>--genesis</code> options, specify the network ID using the <code>--network-id</code> option. </p>
<p>Each node has a node key pair consisting of a node private key and node public key. </p>
<h2id="node-private-key">Node Private Key</h2>
<p>If a <code>key</code> file does not exist in the data directory and the <code>--node-private-key</code> option is not specified when Pantheon is started, a node private key is generated and written to the <code>key</code> file. If Pantheon is stopped and restarted without deleting the <code>key</code> file, the same private key is used when Pantheon is restarted.</p>
<p>If a <code>key</code> file exists in the data directory when Pantheon is started, the node is started with the private key in the <code>key</code> file. </p>
<blockquote>
<p><strong>Note</strong> The private key is not encrypted. </p>
</blockquote>
<h2id="node-public-key">Node Public Key</h2>
<p>The node public key is displayed in the log after starting Pantheon. Use the <ahref="#Pantheon-CLI-Syntaxcommands"><code>export-pub-key</code></a> subcommand to export the public key to a file. </p>
<p>The node public key is also referred to as the node ID. The node ID forms part of the <ahref="#Testing-Developing-Nodesprivate-networks">enode URL</a> for a node. </p>
<h2id="specifying-a-custom-node-private-key-file">Specifying a Custom Node Private Key File</h2>
<p>Use the <code>--node-private-key</code> option to specify a custom <code>key</code> file in any location. </p>
<p>If the <code>key</code> file exists, the node is started with the private key in the custom <code>key</code> file. If the custom <code>key</code> file does not exist, a node private key is generated and written to the custom <code>key</code> file.</p>
<p>For example, the following command either reads the node private key from the <code>privatekeyfile</code> or writes the generated private key to the <code>privatekeyfile</code>:</p>
<p>Pantheon uses the network to find and connect to peers. </p>
<p>Pantheon uses the network to find and connect to peers. </p>
<h2id="firewalls-and-incoming-connections">Firewalls and Incoming Connections</h2>
<h2id="firewalls-and-incoming-connections">Firewalls and Incoming Connections</h2>
@ -1199,9 +1226,40 @@ So modify the file to look like the following :</p>
<p>Trailing peers cannot be used to get new blocks and are more likely to be requesting blocks from you. Limiting trailing peers may reduce the time taken to catch up to the chain head when synchronizing. </p>
<p>Trailing peers cannot be used to get new blocks and are more likely to be requesting blocks from you. Limiting trailing peers may reduce the time taken to catch up to the chain head when synchronizing. </p>
<h2id="no-discovery">No Discovery</h2>
<h2id="no-discovery">No Discovery</h2>
<p>The <code>--no-discovery</code> command line option disables P2P peer discovery. Only use this option if you are running a test node or a test network with fixed nodes.</p>
<p>The <code>--no-discovery</code> command line option disables P2P peer discovery. Only use this option if you are running a test node or a test network with fixed nodes.</p>
<pclass="page"id="Accounts-for-Testing"></p><h1>Accounts for Testing</h1>
<h3id="accounts-for-testing">Accounts for Testing</h3>
<p>You can use existing accounts for testing by including them in the genesis file for a private network. Alternatively, Pantheon provides predefined accounts in development mode. </p>
<h4id="development-mode">Development Mode</h4>
<p> When you start Pantheon with the <ahref="#Pantheon-CLI-Syntax"><code>--dev-mode</code> command line option</a>, the <code>dev.json</code> genesis file is used by default. </p>
<p> The <code>dev.json</code> genesis file defines the accounts below that can be used for testing. </p>
<blockquote>
<p><strong>Warning</strong> Do not use the following accounts on mainnet or any public network except for testing. The private keys are displayed here so the accounts are not secure. </p>
<li><p>Initial balance : <code>0x90000000000000000000000</code> (2785365088392105618523029504 in decimal)</p>
<h4id="genesis-file">Genesis File</h4>
</li>
</ul>
<p>To use existing test accounts, specify the accounts and balances in a genesis file for your test network. For an example of defining accounts in the genesis file, refer to <ahref="https://github.com/PegaSysEng/pantheon/blob/master/config/src/main/resources/dev.json"><code>dev.json</code></a>.</p>
<p>Use the <ahref="https://github.com/PegaSysEng/pantheon/wiki/Pantheon-CLI-Syntax"><code>--genesis</code> command line option</a> to start Pantheon with the genesis file defining the existing accounts. </p>
<pclass="page"id="Logging"></p><h1>Logging</h1>
<pclass="page"id="Logging"></p><h1>Logging</h1>
<h1id="logging">Logging</h1>
<h1id="logging">Logging</h1>
<p>Pantheon uses Log4J for logging. There are two methods to configure logging behavior: </p>
<p>Pantheon uses Log4J2 for logging. There are two methods to configure logging behavior: </p>
<ul>
<ul>
<li>Basic - changes the log level. </li>
<li>Basic - changes the log level. </li>
<li>Advanced - configures the output and format of the logs. </li>
<li>Advanced - configures the output and format of the logs. </li>
@ -1212,7 +1270,7 @@ So modify the file to look like the following :</p>
<p>Use the <ahref="#Pantheon-CLI-Syntax"><code>--logging</code> command line option</a> to specify the logging verbosity. The <code>--logging</code> option changes the volume of events displayed in the log. </p>
<p>Use the <ahref="#Pantheon-CLI-Syntax"><code>--logging</code> command line option</a> to specify the logging verbosity. The <code>--logging</code> option changes the volume of events displayed in the log. </p>
<p>You can provide your own logging configuration using the standard Log4J configuration mechanisms. For example, the following Log4J2 configuration is the same as the <ahref="https://github.com/PegaSysEng/pantheon/blob/master/pantheon/src/main/resources/log4j2.xml">default configuration</a> except logging of stack traces for exceptions is excluded.</p>
<p>You can provide your own logging configuration using the standard Log4J2 configuration mechanisms. For example, the following Log4J2 configuration is the same as the <ahref="https://github.com/PegaSysEng/pantheon/blob/master/pantheon/src/main/resources/log4j2.xml">default configuration</a> except logging of stack traces for exceptions is excluded.</p>
@ -1267,6 +1325,17 @@ So modify the file to look like the following :</p>
<h2id="proof-of-authority">Proof of Authority</h2>
<h2id="proof-of-authority">Proof of Authority</h2>
<p>Pantheon implements the Clique Proof-of-Authority (PoA) consensus protocol. Clique is used by the Rinkeby testnet and can be used for private networks. </p>
<p>Pantheon implements the Clique Proof-of-Authority (PoA) consensus protocol. Clique is used by the Rinkeby testnet and can be used for private networks. </p>
<p>In PoA networks, transactions and blocks are validated by approved accounts, known as signers. Signers take turns to create the next block. Existing signers propose and vote to add or remove signers. </p>
<p>In PoA networks, transactions and blocks are validated by approved accounts, known as signers. Signers take turns to create the next block. Existing signers propose and vote to add or remove signers. </p>
<h3id="initial-signers">Initial Signers</h3>
<p>Before starting a private network using Clique, create at least one </p>
<p>Specify at least 1 but preferably </p>
<ul>
<li>Must create 1 or more (preferably at least 3) private keys (Pantheon doesn't do account management so probably externally or start nodes with different data directories to get private key)</li>
<li>32 bytes/64 characters of vanity data</li>
<li>signers nX40 characters for each one - left pad with zeros</li>
<li>followed by 65 bytes/130 - usually this is the signature for the block but because this is the genesis block it's unsigned </li>
</ul>
<p>Then need to start network with the nodes specified as initial signers - refer to Node Keys topic. </p>
<p>Process as per Slack DM. Trent getting back to me. </p>
<h2id="genesis-file">Genesis File</h2>
<h2id="genesis-file">Genesis File</h2>
<p>To use Clique in a private network, Pantheon requires a PoA genesis file. When connecting to Rinkeby, Pantheon uses the <ahref="https://github.com/PegaSysEng/pantheon/blob/master/ethereum/core/src/main/resources/rinkeby.json"><code>rinkeby.json</code></a> genesis file in the <code>/pantheon/ethereum/core/src/main/resources</code> directory.</p>
<p>To use Clique in a private network, Pantheon requires a PoA genesis file. When connecting to Rinkeby, Pantheon uses the <ahref="https://github.com/PegaSysEng/pantheon/blob/master/ethereum/core/src/main/resources/rinkeby.json"><code>rinkeby.json</code></a> genesis file in the <code>/pantheon/ethereum/core/src/main/resources</code> directory.</p>
<p>A PoA genesis file defines properties specific to Clique:</p>
<p>A PoA genesis file defines properties specific to Clique:</p>
@ -1285,7 +1354,7 @@ So modify the file to look like the following :</p>
<ul>
<ul>
<li><code>period</code> - Block time in seconds. </li>
<li><code>period</code> - Block time in seconds. </li>
<li><code>epoch</code> - Number of blocks after which to reset all votes.</li>
<li><code>epoch</code> - Number of blocks after which to reset all votes.</li>
<li><code>extraData</code> - Initial signers are specified after the 32 bytes reserved for vanity data. </li>
<p>To connect to the Rinkeby testnet, start Pantheon with the <code>--rinkeby</code> option. To start a node on a PoA private network, use the <code>--network-id</code> and <code>--genesis</code> options. </p>
<p>To connect to the Rinkeby testnet, start Pantheon with the <code>--rinkeby</code> option. To start a node on a PoA private network, use the <code>--network-id</code> and <code>--genesis</code> options. </p>
<h3id="adding-and-removing-signers">Adding and Removing Signers</h3>
<h3id="adding-and-removing-signers">Adding and Removing Signers</h3>
<p>In Pantheon, you can use the JSON-RPC methods:</p>
<p>In Pantheon, you can use the JSON-RPC methods:</p>
<ul>
<ul>
<li><ahref="#JSON-RPC-APIeth_getbalance">eth_getBalance</a> to obtain the account balance</li>
<li><ahref="#JSON-RPC-APIeth_getbalance">eth_getBalance</a> to obtain the account balance</li>
<li><p><ahref="#JSON-RPC-APIeth_sendrawtransaction">eth_sendRawTransaction</a> to transfer ether or create and interact with contracts (for more information, refer to <ahref="#Transactionstransactions">Transactions</a>). </p>
<li><ahref="#JSON-RPC-APIeth_sendrawtransaction">eth_sendRawTransaction</a> to transfer ether or create and interact with contracts (for more information, refer to <ahref="#Transactionstransactions">Transactions</a>). </li>
<h3id="accounts-for-testing">Accounts for Testing</h3>
</li>
</ul>
</ul>
<p>You can use existing accounts for testing by including them in the genesis file for a private network. Alternatively, Pantheon provides predefined accounts in development mode. </p>
<h4id="development-mode">Development Mode</h4>
<p> When you start Pantheon with the <ahref="#Pantheon-CLI-Syntax"><code>--dev-mode</code> command line option</a>, the <code>dev.json</code> genesis file is used by default. </p>
<p> The <code>dev.json</code> genesis file defines the following accounts that can be used for testing. </p>
<li><p>Initial balance : <code>0x90000000000000000000000</code> (2785365088392105618523029504 in decimal)</p>
<h4id="genesis-file">Genesis File</h4>
</li>
</ul>
<p>To use existing test accounts, specify the accounts and balances in a genesis file for your test network. For an example of defining accounts in the genesis file, refer to <ahref="https://github.com/PegaSysEng/pantheon/blob/master/ethereum/core/src/main/resources/dev.json"><code>dev.json</code></a>.</p>
<p>Use the <ahref="https://github.com/PegaSysEng/pantheon/wiki/Pantheon-CLI-Syntax"><code>--genesis</code> command line option</a> to start Pantheon with the genesis file defining the existing accounts. </p>
<pclass="page"id="Mining"></p><h1>Mining</h1>
<pclass="page"id="Mining"></p><h1>Mining</h1>
<h1id="mining">Mining</h1>
<h1id="mining">Mining</h1>
<p>Start Pantheon with the following options to enable mining: </p>
<p>Start Pantheon with the following options to enable mining: </p>
<dd>List of node IDs to ban from the P2P network. </dd>
<dd>List of node IDs to ban from the P2P network. The node ID is the public key of the node. The banned node IDs can be specified with or without the <code>0x</code> prefix.</dd>
<br>
><strong>Note</strong> This option is only available from v0.8.2 or when <ahref="#Installation">building from source</a>.
Set this option to <code>true</code> to run nodes in development mode which means you can run nodes in private or test networks. This is useful, for example, to do CPU mining more easily. In development mode, you use a custom genesis file that specifies a particular chain ID. When you set this option, you should also set the <code>--network-id</code> option to the specific network you use for development. The default is <code>false</code>.
Set this option to <code>true</code> to run in development mode. For example, specify this option to perform CPU mining more easily in a private test network. In development mode, a custom genesis configuration specifies the chain ID. When using this option, also set the <code>--network-id</code> option to the network you use for development. Default is <code>false</code>.
</dd>
</dd>
<br>
><strong>Note:</strong> The <code>--dev-mode</code> option overrides the <code>--genesis</code> option. If both are specified, the development mode configuration is used.<br><br>
<dt><code>--genesis=<PATH></code></dt>
<dt><code>--genesis=<PATH></code></dt>
<dd>The path to the genesis file. The default is the embedded genesis file in the Pantheon mainnet.</dd>
<dd>The path to the genesis file. The default is the embedded genesis file for the Ethereum mainnet. When using this option, it is recommended to also set the <code>--network-id</code> option.</dd>
><strong>Note:</strong> This option is not used when running Pantheon from the <ahref="#Run-Docker-Imagecustom-genesis-file">Docker image</a>.
><strong>Note:</strong> This option is not used when running Pantheon from the <ahref="#Run-Docker-Imagecustom-genesis-file">Docker image</a>.
><strong>Note:</strong> The <code>--genesis</code> option is overriden by the <code>--dev-mode</code> option. If both are specified, the specified genesis file is ignored and the development mode configuration used.
<br>
<br>
<dt><code>--max-peers=<INTEGER></code></dt>
<dt><code>--max-peers=<INTEGER></code></dt>
<dd>Specifies the maximum P2P peer connections that can be established. The default is 25.</dd>
<dd>Specifies the maximum P2P peer connections that can be established. The default is 25.</dd>
<dd>Path to the private key file of the node. The default is the key file in the data directory. If no key file exists, is it created; otherwise, the existing key file specifies the node private key.
<dd><code><PATH></code> is thepath of the private key file of the node. The default is the key file in the data directory. If no key file exists, a key file containing the generated private key is created; otherwise, the existing key file specifies the node private key.
</dd>
</dd>
><strong>Note</strong> The private key is not encrypted.
><strong>Note</strong> The private key is not encrypted.
><strong>Note</strong> This option is only available from v0.8.2 or when <ahref="#Installation">building from source</a>.
<br>
<br>
<dt><code>--ottoman</code></dt>
<dt><code>--ottoman</code></dt>
<dd>Synchronize against the Ottoman test network. This is only useful if you are using an IBFT genesis file. The default is <code>false</code>.</dd>
<dd>Synchronize against the Ottoman test network. This is only useful if you are using an IBFT genesis file. The default is <code>false</code>.</dd>
@ -1873,6 +1921,7 @@ To activate JSON-RPC using http or WebSocket, see <a href="https://github.com/Pe
<h4id="eth-methods">eth Methods</h4>
<h4id="eth-methods">eth Methods</h4>
<ul>
<ul>
<li><ahref="#eth_syncing">eth_syncing</a></li>
<li><ahref="#eth_syncing">eth_syncing</a></li>
<li><ahref="#eth_chainId">eth_chainId</a></li>
<li><ahref="#eth_coinbase">eth_coinbase</a></li>
<li><ahref="#eth_coinbase">eth_coinbase</a></li>
<li><ahref="#eth_mining">eth_mining</a></li>
<li><ahref="#eth_mining">eth_mining</a></li>
<li><ahref="#eth_gasprice">eth_gasPrice</a></li>
<li><ahref="#eth_gasprice">eth_gasPrice</a></li>
@ -2026,6 +2075,22 @@ To activate JSON-RPC using http or WebSocket, see <a href="https://github.com/Pe
<p>To set a coinbase address, call the pantheon CLI with the <code>--miner-coinbase</code> option set to a valid Ethereum account address. You can get the Ethereum account address from a client such as MetaMask or Etherscan. For example:</p>
<p>To set a coinbase address, call the pantheon CLI with the <code>--miner-coinbase</code> option set to a valid Ethereum account address. You can get the Ethereum account address from a client such as MetaMask or Etherscan. For example:</p>