## Private Ethereum Network
### Setup Node Zero
Create a new account for private net
```javascript
$Â geth --datadir "~/bether" account new
```
Create a private chain with the custom genesis block
```javascript
$ geth --datadir "~/bether" init genesis.json
```
Launch node zero, a mining full node in cloud
```javascript
$ geth --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "~/bether" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --identity "zero" --networkid 666 --mine --minerthreads 1 console
```
To run in background with ```nohup```
```javascript
$ nohup geth --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "~/bether" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --identity "zero" --networkid 666 --mine --minerthreads 1 > /dev/null &
```
To run in background with ```screen``` (CTRL+A then D for detaching), check ```geth.sh``` script
```javascript
$ screen -dmS geth /usr/local/bin/geth --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "~/bether" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --identity "zero" --networkid 666 --mine --minerthreads 1
$ screen -x geth
```
For attaching geth console
```javascript
$ geth --datadir "/root/bether" attach ipc:/root/bether/geth.ipc console
```
Run ```eth.getBalance(eth.coinbase)``` command to check the (pre-allocated) account balance
Run ```admin.nodeInfo``` to get enode url (```enode://xxxxx```) and add ip address of the interface ```[::]``` to construct the complete enode address to share with other peers
```javascript
"enode://6ad5934db83a0266c4c6d5048d02f86b3e69251d45ad411387cde9cc5a86030f2bee4bcbe200d4238d91b01c94444e562986058c9c4acca2a92cb81eb012acfc@192.168.2.41:30303?discport=0"
```
### Setup Node One
Setup and launch node one: a non-mining full node
```javascript
$Â geth --datadir "~/bether" account new
$ geth --datadir "~/bether" init genesis.json
$ geth --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "~/bether" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --identity "one" --networkid 666 console
```
Run ```admin.addPeer``` to connect node zero
```javascript
> admin.addPeer("enode://6ad5934db83a0266c4c6d5048d02f86b3e69251d45ad411387cde9cc5a86030f2bee4bcbe200d4238d91b01c94444e562986058c9c4acca2a92cb81eb012acfc@192.168.2.41:30303")
```
Or create a ```