Skip to content

Instantly share code, notes, and snippets.

@zhaojun-sh
Last active January 2, 2019 13:05
Show Gist options
  • Select an option

  • Save zhaojun-sh/8205f4416969901e3c6eca9c731b0dc1 to your computer and use it in GitHub Desktop.

Select an option

Save zhaojun-sh/8205f4416969901e3c6eca9c731b0dc1 to your computer and use it in GitHub Desktop.
Efsn pos mining guide for linux
Efsn pos mining guide for linux
1. Build the efsn from source code.
Make sure golang installed first.
$ git clone https://github.com/zhaojun-sh/efsn.git
$ cd ./efsn/
$ make efsn
$ ./build/bin/efsn --datadir ./data1/
2. Run the efsn client.
Make sure copy you keystore file to ./efsn/data1/keystore/ and create a passwdfile in ./efsn/ with your keystore password.
DO NOT SHARE YOUR KEYSTORE AND PASSWD TO ANYONE.
Run the efsn console:
$ ./build/bin/efsn --datadir ./data1/ --port 48888 --unlock 0x0520e8e5E08169c4dbc1580Dc9bF56638532773A --password passwdfile --mine console
> web3.fromWei(eth.getBalance(eth.coinbase),"ether")
> fsnbt.buyTicket({from:eth.coinbase},"keystorePasswd")
> fsnbt.allTicketsByAddress(eth.coinbase)
> eth.blocknumber
If you see "Successfully sealed new block number=****", then new block mined by your node, but need to confirmed by network.
3. Start efsn pos mining.
Run efsn background:
$ nohup ./build/bin/efsn --datadir ./data1/ --port 48888 --unlock 0x0520e8e5E08169c4dbc1580Dc9bF56638532773A --password passwdfile --mine &
Auto buy the ticket with shellscript autobuytk.sh:
#!/bin/sh
while [ true ]; do
/bin/sleep 15
/bin/date >>/tmp/autobuytk-20190101.txt
/home/user/efsn/build/bin/efsn --exec 'fsnbt.buyTicket({from:eth.coinbase},"keystorePasswd")' attach /home/user/efsn/data1/efsn.ipc >> /tmp/autobuytk-20190101.txt
done
Run autobuytx:
$ chmod +x autobuytk.sh
$ nohup ./autobuytk.sh &
Check your miner result with blockchain explorer, good luck!
@ada4profit

Copy link
Copy Markdown

Hi ZhaoJun,

When i use your script on Ubuntu 18.04 i get a util.go:45: exit status 2 error. I figure this has something to do with compilation of the Geth client. Any idea how i could resolve this error? Would be thankful for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment