Skip to content

Commit

Permalink
Started with peering and re-organized files.
Browse files Browse the repository at this point in the history
  • Loading branch information
chainhead committed Mar 21, 2018
1 parent 492b1b5 commit 8413134
Show file tree
Hide file tree
Showing 3 changed files with 424 additions and 411 deletions.
97 changes: 97 additions & 0 deletions contrib/aws-network-operation.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[[_anchor_operate_private_network]]
== Operating a private Ethereum network

[[_anchor_start_nodes]]
==== Start nodes

1. Log onto first machine and start Ethereum with the command below.

[[_code_start_node_nodiscover]]
[source,bash]
----
geth --datadir "/home/ubuntu/eth-priv" --networkid 15 --nodiscover --maxpeers 2 --port 30333 console
----

2. Log onto second machine and start Ethereum with the command below.

[[_code_start_node]]
[source,bash]
----
geth --datadir "/home/ubuntu/eth-priv" --networkid 15 --port 30333 console
----

3. Check for connected peer with the command below.

[[_code_node_list]]
[source,bash]
----
admin.peers
----

4. Exit with `Ctrl-D` on the third machine.

[[_anchor_account_setup]]
==== Set-up accounts

For now, we will set-up accounts only on the third machine. First, we launch the console as shown below.

[[_code_console_launch]]
[source,bash]
----
geth --datadir "/home/ubuntu/eth-priv" --networkid 15 console
----

Then, we add an account as below.

[[_code_add_account]]
[source,bash]
----
geth --datadir "/home/ubuntu/eth-priv" account new
----

Finally, we start the mining process so that ethers are credited to this account.

[[_code_start_mining]]
[source,bash]
----
geth --datadir "/home/ubuntu/eth-priv" --networkid 15 --mine
----

We can check the balance using the following command on the console.

[[_code_account_balance]]
[source,bash]
----
eth.getBalance(eth.accounts[0])
----

[[_anchor_RPC]]
==== Start RPC

On the third machine, open up the RPC port to allow for communication with a client.

[[_code_start_rpc]]
[source,bash]
----
geth --datadir eth-priv --networkid 15 --maxpeers 2 --port 30333 --rpc --rpcapi "web3,eth,personal" --rpcaddr "0.0.0.0" --rpccorsdomain "*"
----

**NOTE** that, the `--rpcaddr 0.0.0.0` value has been set for testing only. This value is **strongly discouraged**.

[[_anchor_mining]]
=== Mining

[[_code_start_mining_rpc]]
[source,bash]
----
geth --datadir eth-priv --networkid 15 --maxpeers 3 --port 30333 --rpc --rpcapi "web3,eth,personal" --rpcaddr "0.0.0.0" --rpccorsdomain "*" --mine
----

[[_anchor_RPC_end-point]]
=== RPC End-point

=== Contract deployment and execution

==== Deployment

==== Execution
Loading

0 comments on commit 8413134

Please sign in to comment.