/lettuce-wrap

JS wrapper around Ethminer. https://github.com/ethereum-mining/ethminer

Primary LanguageTypeScript

                    Python Dependencies GitHub Issues Contributions welcome License

Lettuce Wrap

Basic Overview

Lettuce Wrap is a Node.js wrapper around ethminer, allowing JavaScript and TypeScript developers to interface with an Ethereum mining solution that supports both OpenCL- and CUDA-compatible devices. Lettuce Wrap is currently being used in production by Salad.

Lettuce Wrap currently only supports Windows-based Node.js environments and will not work in a browser. Ethminer supports OSX and Linux, so additional platform support is planned for future Lettuce Wrap releases.

Installation

  • NPM: npm install lettuce-wrap
  • Yarn: yarn add lettuce-wrap

Since Lettuce Wrap is built with TypeScript, typings are included in the package.

Usage

You can either import individual Lettuce Wrap functions or the entire API.

import * as lettuceWrap from 'lettuce-wrap'

import { getAllDevices } from 'lettuce-wrap'

For a complete example, check out /example/example.ts.

Get Device List

Returns a list of all the detected OpenCL/CUDA devices.

import { getAllDevices } from 'lettuce-wrap'

getAllDevices().then(list => {
  console.log(list)
})

Start Mining

Start ethminer using all detected OpenCL and CUDA devices.

import { startMiner } from 'lettuce-wrap'

startMiner({
  poolUrl: `{pool url}`,
})

Contribute

All bug reports, pull requests and code reviews are very much welcome.