DApp原理
去中心化app的数据存储在中心化服务器上,DApp的数据存储在区块链上
DApp开发环境介绍
-
geth+js -
ganacha+js -
truffle
Geth私链环境搭建
$ sudo apt-get install software-properties-common
$ sudo apt-get-repository -y ppa:ethereum/ethereum
$ sudo apt-get update
$ sudo apt-get install ethereum
$ sudo apt install vim//如果买有安装vim需要安装后使用
$ vim genesis.json
{
"nonce": "0x0000000000000042",
"difficulty": "0x200",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2CD29C0",
"alloc": {},
"config": {
"chainId": 6500,
"homesteadBlock": 0
}
}//需要保存后退出,具体vim操作请自行移步查看https://blog.csdn.net/blood_Z/article/details/125064927
$ geth --datadir "chain" init genesis.json
操作完成后会显示如下图所示
?
$ geth --identity "myetherum" --rpc --rpccorsdomain "*" --datadir "clain" --port "30303" --rpcapi ? ? "db,eth,net,web,personal,miner" --networkid 6500 consloe 2>1.txt
未完待续...
|