Giter Site home page Giter Site logo

ausprinzip / koinos-miner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from koinos/koinos-miner

0.0 0.0 0.0 269 KB

The Koinos Miner (CLI) provides a functional command line interface that allows users to mine the KOIN ERC-20 which will be used to deliver an equitable initial token distribution on the Koinos blockchain.

Home Page: https://koinos.io

License: GNU General Public License v3.0

CMake 2.21% C 49.26% JavaScript 48.53%

koinos-miner's Introduction

Koinos Miner

GitHub Issues GitHub License

Environmental Variables

Just create an .env file in your root directory and add the following variables:

  • ADDRESS
  • ENDPOINT
  • TIP
  • KEYFILE
  • PASS
  • PROOFPERIOD
  • GASMULTIPLIER
  • GASPRICELIMIT

NOTE: Please make sure to ignore this ".env" file in your .gitgnore.

Table of Contents

Dependencies

Prior to installation, you'll need to install the necessary dependencies.

Linux (Debian based)

sudo apt-get install git cmake build-essential libssl-dev

macOS

On macOS, installing gcc is required to support OpenMP parallelization. Using the brew package manager, install OpenSSL and gcc.

brew install openssl gcc cmake

Windows

On Windows, ensure that you are using the MingW compiler and you have installed CMake. Using the cholocately package manager, install OpenSSL.

choco install openssl

Installation

For both Windows and Linux, you should be able to simply invoke the standard npm installer.

npm install

For macOS, you will need to specify the C compiler as gcc.

CC=gcc-10 npm install

Getting started

You can view the CLI miner arguments by using npm like so:

npm start -- --help

And get the following output:

❯ npm start -- --help

> [email protected] start /path/to/koinos-miner
> node app.js "--help"

Usage: app [OPTIONS]...

Options:
  -v, --version                      output the version number
  -a, --addr <addr>                  An ethereum address
  -e, --endpoint <endpoint>          An ethereum endpoint (default: "wss://ropsten-rpc.linkpool.io/ws")
  -t, --tip <percent>                The percentage of mined coins to tip the developers (default: "5")
  -p, --proof-period <seconds>       How often you want to submit a proof on average (default: "86400")
  -k, --key-file <file>              AES encrypted file containing private key
  -m, --gas-multiplier <multiplier>  The multiplier to apply to the recommended gas price (default: "1")
  -l, --gas-price-limit <limit>      The maximum amount of gas to be spent on a proof submission (default: "1000000000000")
  --import                           Import a private key
  --export                           Export a private key
  -h, --help                         display help for command

Recipient Address: The --addr argument specifies the recipient address, this is where KOIN will be rewarded.

Ethereum Endpoint: The --endpoint argument specifies the Ethereum node to be used when querying contract information and submitting proofs.

Developer Tip: The --tip argument specifies the percentage of rewarded KOIN to donate to the development team, thank you!

Proof Period: The --proof-period argument specifies the number of seconds on average the miner will attempt to mine and submit proofs.

Gas Multiplier: The --gas-multiplier argument specifies a multiplier to apply to the calculated gas price. This can be used to get your proofs submitted when the Ethereum network gas fees are spiking or are unpredictable.

Gas Price Limit: The --gas-price-limit argument specifies a cap in the acceptable gas price for a proof submission.

A more detailed explanation of the different miner configurations can be found in the Koinos GUI Miner README.md.

Key Management

The CLI miner provides the arguments --import, --export, and --key-file. These are used in handling the private key of the funding address. The user may import a private key and optionally store it in a key file in which case exporting the key is now possible.

Example Run

A simple example of running the miner:

❯ npm start -- --endpoint http://167.172.118.40:8545 --addr 0x98047645bf61644caa0c24daabd118cc1d640f62 --import

> [email protected] start /path/to/koinos-miner
> node app.js "--endpoint" "http://167.172.118.40:8545" "--addr" "0x98047645bf61644caa0c24daabd118cc1d640f62" "--import"

 _  __     _                   __  __ _
| |/ /    (_)                 |  \/  (_)
| ' / ___  _ _ __   ___  ___  | \  / |_ _ __   ___ _ __
|  < / _ \| | '_ \ / _ \/ __| | |\/| | | '_ \ / _ \ '__|
| . \ (_) | | | | | (_) \__ \ | |  | | | | | |  __/ |
|_|\_\___/|_|_| |_|\___/|___/ |_|  |_|_|_| |_|\___|_|

[JS](app.js) Mining with the following arguments:
[JS](app.js) Ethereum Address: 0x98047645bf61644caa0c24daabd118cc1d640f62
[JS](app.js) Ethereum Endpoint: http://167.172.118.40:8545
[JS](app.js) Developer Tip: 5%
[JS](app.js) Proof Period: 86400

Enter private key:
Reinput a same one to confirm it:
Do you want to store your private key encrypted on disk? [y/n]: n
Imported Ethereum address: 0x98047645BF61644CAA0c24dAABD118cC1D640F62
[JS] Starting miner

License

Copyright 2020 Open Orchard, Inc.

Koinos Miner is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Koinos Miner is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Koinos Miner. If not, see https://www.gnu.org/licenses/.

koinos-miner's People

Contributors

mvandeberg avatar sgerbino avatar theoreticalbts avatar youkaicountry avatar ausprinzip avatar brklyn8900 avatar

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.