- Created a dapp for getting used to solidity.
- This dapp should be running in a private network.
- I've worked on this in Ubuntu, Linux.
$ wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.8.2-b8b9f7f4.tar.gz
$ tar -zxvf [file name]
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository -y ppa:ethereum/ethereum
$ sudo apt-get update
- Before running this, You should have sample.json
$ ./geth --datadir ./[any directory that you want to store extra data] init ./sample.json
- This is an example. Save it as sample.json in the directory.
{
"config": {
"chainId": 42,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000042",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x00",
"gasLimit": "0x4c4b40",
"difficulty": "0x0400",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
},
"number" : "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
$ ./geth --verbosity 6 --datadir ./enakee --nodiscover --syncmode 'full' --port 30411 --rpc --rpcaddr '0.0.0.0' --rpcport 6845 --rpccorsdomain "*" --rpcapi 'personal,db,eth,net,web3,txpool,miner' --networkid 37663 --gasprice '1'
$ ./geth attach ipc:./geth.ipc
admin.addPeer("peerData")
- You should set the peerData
admin.peers
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ cd /home/..
$ sudo npm install
- If there is an error which is related to "node-gyp",
$ sudo -s
$ sudo npm install -g node-gyp
$ sudo npm install scrypt
$ npm install supervisor -g
$ supervisor app.js
http://localhost:8081/
- As soon as you get into the localhost, It will unlock your first account. (Check the log)
- Deploy a contract and copy the contract address from the log.
- Paste the address to At section and click the "At" button so that It can make an js object through ABI.
- Create a new campaign
- You will get a campaign ID (you can see it from the log). You can check the status of the campaign by clicking "Check(call)", send the ether you have earned to your address that you put in Beneficiery when you were creating the campaign by clicking "Check(send)".