Generate A Private Block Chain With Scripts, With Default Account Auto Generate And Configured.
- Node.JS 8.11+ (Or Lower Version But Without Test For Sure.)
- Bash Shell
- Geth
- Python 2.7.x+ (not Python 3.x)
- Supervisor, Install With
easy_install
,pip
Orsetup.py
After Instalallation, Make Sure To Put node
/npm
, geth
/swarm
,
python
/easy_install
/pip
/supervisord
/supervisorctl
Are In The PATH
.
Get A Private Single Node Geth To Run:
- Init Genesis Block, With 3 Default Account Generated
node init.js -n 3
It Will Generate 3 Accounts Start Wtth '0x' And Length Is 40 (Without '0x').
- Start The Server
sh start-geth.sh --mine --unlock 0
The start-geth.sh
Script Support All Geth Params, But Some Of Them Included In The Script By Default.
0xACCOUNT_GENERATED_IN_UPPER_STEP_01 Is The Account Generated In The First Step.
Success!! Everything Is Supposed To Be OK!
By Default,
-
account
Folder Is To Backup The Auto Generated Public Account -
account/private
Private Keys That Match The Public Keys Inaccount
-
datastore
Is The Main Ethereum Data Folder. -
datastore/geth
All Block Chain Data Stored Here. -
datastore/keystore
Auto Imported Keys, The Account Will Shown Viapersonal.listAccounts
-
datastore/logs
For Future Use To Store The Geth Log. -
private
Folder Is The Imported Private Key.
init.sh
Init Genesis Block
See Quick Start
You May Do This Several Times For Generate Multi Accounts.
start-geth.sh
Start A Private Block Chain
See Quick Start
import.sh
Import A Private Key Into The Keystore.
sh import.sh A_VERY_LONG_PRIVATE_KEY_STRING
Notice: The Imported Key's Password Need To Match That In File account.password
OR The Imported Account Will Not Show In The personal.listAccounts
In The start-geth.sh
, Add Support For eth-netstats
.
Download eth-netstats
From Github: https://github.com/cubedro/eth-netstats
Then Yarn/Npm Install The Dependencies, Generate css/js/html Code With grunt
(yarn global add grunt-cli).
Then Start The Project With WS_SECRET=thisisprivatekeyforgethstatus node app.js
.
The WS_SECRET Is The Password For Geth To Push Data Into eth-netstats
,
And Is Also Configured In The File start-geth.sh
.
In The start-geth.sh
, Add Support For explorer
.
Download explorer
From Github: https://github.com/carsenk/explorer
Then Yarn/Npm And Bower Install The Dependencies, Run Project With Simple npm start
.
The Server Run At Port 8000
By Default, And The Host:Port Is Configured In The start-geth.sh
File.
It Sure Can Be Change As You Want.
Use Supervisor To Make Sure That The Geth Press Alive~
sh start-supervisord.sh
By Default, It Use The supervisord.conf
If The Geth Process Printed, Then Start Success
sh stop-supervisord.sh
If Nothing Printed, Then Stop Success
supervisorctl -c supervisord.conf
Enter The Interaction Shell, Then Type help
For More Instructions.