Giter Club home page Giter Club logo

smartpool-client's Introduction

Smartpool - The first decentralized mining pool based on smart contract (alpha)

Gitter

Ropsten testnet

Smartpool is live on Ropsten testnet. This repository consists of the client software. The smart contract repository is here.

Requirements

OS

The client is currently tested only on Mac OS and Ubuntu.

Golang compiler

Golang compiler version 1.7 or higher.

Parity client

Ethereum Parity client version 1.5.9 or higher.

Geth client

Ethereum Geth client needs to be compiled from source.

Ethminer

We support CPU and GPU mining with ethminer version 1.2.9 or higher. Current versions do not do CPU mining so an older version is necessary to CPU mine on testnet.

ETH balance

To run smartpool you must have a Ropsten testnet account with least 0.5 Ether. You can get testnet Ethers from metamask faucets or ping us on our gitter channel.

Note: To get Ether from metamask faucet, you need to install metamask browser add-on.

Installation

  1. git clone https://github.com/SmartPool/smartpool-client.git
  2. cd smartpool-client
  3. ./compile.sh

Note: If you are on MacOS, there is a issue with Go and XCode 8.3 that might make you see killed ./smartpool error. To fix this issue, please run build/env.sh go build -o smartpool -ldflags -s cmd/ropsten/ropsten.go instead of ./compile.sh.

Running

  1. Run Geth on Ropsten testnet: geth --testnet --fast --rpc --rpcapi "db,eth,net,web3,miner" or Parity: parity --chain ropsten --jsonrpc-apis "web3,eth,net,parity,traces,rpc,parity_set"
  2. Run smartpool client ./smartpool --keystore keystore_path --miner account. Where
  • keystore_path is a path to a directory that contains your account key. E.g., $HOME/.local/share/io.parity.ethereum/keys/kovan/.
  • account is the address of your account. E.g., 0x2ba80fe2811f8e0ea5eabf8e07697f7e9f5ae56c.
  • E.g., ./smartpool --keystore ~/Library/Ethereum/testnet/keystore --miner 0xe034afdcc2ba0441ff215ee9ba0da3e86450108d.
  1. Enter your key passphrase.
  2. Run ethminer -F localhost:1633 or ethminer -G -F localhost:1633 if you mine with your GPU.

Kovan testnet

Smartpool was live on Kovan testnet altough since Kovan is PoA rather than PoW mining had to be faked. Smartpool no longer runs on Kovan, Ropsten must be used instead.

Support

Contact us at gitter for support.

smartpool-client's People

Contributors

andrewsource avatar jcvernaleo avatar loiluu avatar tranvictor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smartpool-client's Issues

--keystore doesn't accept \ as opposed to /

If I copied from the folder page on windows, I will be given

"C:\Users\DATA\AppData\Roaming\Ethereum\keystore"

but smartpool will reject and ask for valid keypath.
I had to manually change them to

"C:/Users/DATA/AppData/Roaming/Ethereum/keystore"

sometime tx takes too long to verify

some discussed strategies:

  • For testnet only, we can just drop the claim if a tx is not verified in time (hardcoded 10 mins)
  • Rebroadcast the tx with gas price increased by 25% so it can replace the old tx (we are using this strategy now).
  • Query last counter from contract side and put all shares of the claim back to active share pool so they can be included in next claim. This is applicable only if tx that is submitting the claim is stuck.
  • In mainnet, we might retransmit the tx from some chosen stable public nodes.

Support multiple rigs

  • Give same pow work to rigs
  • Accept shares from specific rig id
  • Provide stats for each rig id

Your SmartPool client is too old

Your SmartPool client is too old. Please update to new version by going to https://github.com/SmartPool/smartpool-client.

usr@ethereum:~/smartpool-client$ ./kovan_compile.sh
Install dependencies...
github.com/bmizerany/pat (download)
github.com/bmizerany/pat
Compiling SmartPool client...
Done. You can run SmartPool by ./kovan --help
usr@ethereum:~/smartpool-client$ ./kovan --keystore $HOME/.local/share/io.parity.ethereum/keys/kovan/ --miner 0x00724713c75f4Ee23b3e154f013C49616Eb00a44 --spcontract 0x0398ae5a974FE8179B6B0ab9baF4d5f366E932Bf
SmartPool is in Hot-Stop mode: It will exit immediately if the contract returns errors.
Using miner address: 0x00724713c75f4ee23b3e154f013c49616eb00a44
Connected to Ethereum node: Parity//v1.7.0-beta-5f2cabd-20170727/x86_64-linux-gnu/rustc1.18.0
Using miner address: 0x00724713c75f4ee23b3e154f013c49616eb00a44
Please enter passphrase:
Unlocking account...Done.
Stat persister is running...
Couldn't load counter from storage. Initialize it to 0.
The address is already registered to the pool. Good to go.
Trying to set etherbase to SmartPool contract address: 0x0398ae5a974fe8179b6b0ab9baf4d5f366e932bf...Done.
Trying to set extradata to SmartPool extradata convention: SmartPool-WPc6TmiHwc429c40000000...Done.
peerCount: 18
The network is ready for mining.
Share collector is running...
Share persister and stat persister are running...
RPC Server is running...
You can start mining now by running ethminer using following command:
--------------------------
ethminer -F localhost:1633/:worker_name/
Change :worker_name to whichever name you want.
--------------------------
Saving stats to disk...Done.
Your SmartPool client is too old. Please update to new version by going to https://github.com/SmartPool/smartpool-client.
Persisting current state to disk...
Saving stats to disk...Done.
Gracefully stopped SmartPool.
usr@ethereum:~/smartpool-client$

Sometime it fails to persist data to disk

  • When persisting open claims and active claims, "Can't move file because it's being used by other process" in Windows
  • Saving active claims to disk...Failed. (rename /Users/victor/.smartpool/active_shares.temp /Users/victor/.smartpool/active_shares: no such file or directory)

Dead branches in repo

This is mostly a housekeeping issue, but figured it is worth it anyway.

The following branches have been fully merged into master already and should really be deleted:

persist_shares
hotfix_issue19_compiling
issue18_check_coinbase
minimerkle_tree
gateway_param
duplicate_share
persist_timestamp
hotfix_submitter_hang

The following branches have already been merged into the develop branch and can therefore probably also be removed:

rigs_support
gas_price_param
persist_work
fix_concurrent_workpool
fix_issue_26
spps
mix_digest
tx_retry_with_higher_price
rig_ip
fix_40
log
tx_retry_on_public_node
web_interface

The only branches that are needed still are produce_test_input, develop, and of course master.

Of course if there is a good reason to keep them, then feel free to close this issue but I think it is easiest to keep track of what is still being worked on this way (and any branch that was merged as a PR is still available in the write-only origin/pr/# namespace).

Payment info in stat page

  • payment per day
  • payment last 24 hours, last week, last 30 days
  • tx fee stats (last 24 hours, last week, last 30 days)

Contract error messages presentation can be improved

IMO

Error code: 2214592512 - Error info: 783075685025659740
Got error verifing claim: Contract returned error code 0x84000000(contract balance is too low to pay). Function(verifyClaim)-Name(payment)-Value(0xade0b2fc6333b5c)

Should be replaced with:

Error code: hex value - Error info: hex value
Contract returned error code 0x84000000.
verifyClaim: contract balance is too low to pay. payment is 0xade0b2fc6333b5c

In general case:
Function: error msg. Name is Value.

Share's counter is lower than max counter

Share's counter (0x58cf45dbe6c74219ceea165d) is lower than last claim max counter (0x58cf45dbfcd915ad9850cc62)
Share's counter (0x58cf45dbec790aae372d5cca) is lower than last claim max counter (0x58cf45dbfcd915ad9850cc62)
Share's counter (0x58cf45dbfae8bc7328877e83) is lower than last claim max counter (0x58cf45dbfcd915ad9850cc62)
Verification index of 1 has been requested. Submitting verification for the claim.
Share's counter (0x58cf45dbc94d948e1c48fdda) is lower than last claim max counter (0x58cf45dbfcd915ad9850cc62)
Share's counter (0x58cf45db636ca5cbf13d7d5a) is lower than last claim max counter (0x58cf45dbfcd915ad9850cc62)
Verified the claim.
Set Latest Counter to 27485258410282482037689470050.
Share's counter (0x58cf45db498a1f6faa684dbd) is lower than last claim max counter (0x58cf45dbfcd915ad9850cc62)

Miner address could not be found

I am running this command line:
./smartpool --keystore . --threshold 100 --miner 0x2ba80fe2811f8e0ea5eabf8e07697f7e9f5ae56c --spcontract 0xa03aC6971bEEc9D053707AB05C66Db0ED591ae27

I am getting this strange error msg:

Your keystore: .
Your miner address: 0x2ba80fe2811f8e0ea5eabf8e07697f7e9f5ae56c
We couldn't find your miner address private key in the keystore path you specified. We found following addresses:
1. 0x2ba80fe2811f8e0ea5eabf8e07697f7e9f5ae56c
Please make sure you entered correct miner address.

This is the content of my private key:

{"id":"77df3923-0592-01ad-582d-cb8a09622e99","version":3,"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"c351646093aff65ecb0c5b449b6021af"},"ciphertext":"76495e8b030308e415295c035406abe67105f1ab24051985c1c56958283b4beb","kdf":"pbkdf2","kdfparams":{"c":10240,"dklen":32,"prf":"hmac-sha256","salt":"55daeec502cb20a3600862fe9a985319c87b9524d444a32a15f70bfdf58c1671"},"mac":"e99c9fed64701370ebc6d33aaa22eed75ac563ff9412e8a43e4d39d4d76c0a8b"},"address":"2ba80fe2811f8e0ea5eabf8e07697f7e9f5ae56c","name":"","meta":"{}"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.