Local OJX Network
See also : https://github.com/ethereum/go-ethereum/wiki/Private-network
Setting up your OJX Node(s)
1. Prereq : Install Geth
Review the guide here
2. Prereq : create /projects
Create a /projects
symbolic link (Note: This step is simply so "/projects" can be used in all other commands, instead you could use full paths, or set an env var)
3. Create local_ethereum_blockchain folder
4. Create the genesis block config
Create this file : /projects/local_ethereum_blockchain/genesis.json
With the following contents :
5. Initialise an Ethereum node
6. Start that Ethereum node
7. Initialise another Ethereum node
8. Start the 2nd Ethereum node
9. Connect one node to the other
In one geth console :
In the other console :
Useful geth commands
Node info
Peers
Show peers
How many peers ?
Create an account
You need an account to do be able to do things like mining
And make sure your remember/save the password!
Unlock account
Neccessary before some actions
Start mining
The first block may take a while to mine, allow a few minutes
Stop mining
Current block number
Details of current block
Which node minded the last block
Account balance, in ether
Transfer ether between accounts
First get the account numbers by doing
> eth.accounts
Then unlock the account you are sending from
> personal.unlockAccount( <from account> )
eg.
> personal.unlockAccount(eth.accounts[0])
Finally transfer 1 ether
Exit
(This will also stop the node from running if it was started using $ geth console
(as opposed to $ geth attach
))
Connect to other nodes on your network
Get the IP of the node :
$ ifconfig|grep netmask|awk '{print $2}'
Get the enode of the node :
> admin.nodeInfo.enode
REPLACE
[::]
in the enode string with the[<ip address>]
On your console
> admin.addPeer(< the enode string with the ip address in it>)
Last updated