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.
- NPM:
npm install lettuce-wrap
- Yarn:
yarn add lettuce-wrap
Since Lettuce Wrap is built with TypeScript, typings are included in the package.
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
.
Returns a list of all the detected OpenCL/CUDA devices.
import { getAllDevices } from 'lettuce-wrap'
getAllDevices().then(list => {
console.log(list)
})
Start ethminer using all detected OpenCL and CUDA devices.
import { startMiner } from 'lettuce-wrap'
startMiner({
poolUrl: `{pool url}`,
})
All bug reports, pull requests and code reviews are very much welcome.