Mineful

The Mineful Developer Hub

Welcome to the Mineful developer hub. You'll find comprehensive guides and documentation to help you start working with Mineful as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Setup the SDK

1. Add to Project

Open Build Phases tab. Add the Coinstash framework to your project by dragging from the Finder

2. Add to Target

Ensure Copy items if needed is selected, Create Groups selected and your Target is selected

3. Copy Files

Now you need to tell Xcode to copy the framework into your project. Still within Build Phases add a build phase (New Copy Files Build Phase), make sure Destination is set to Frameworks.

4.Sandbox Settings

If your app is sandboxed you should enable Outgoing Connection in your Capabilities/Entitlements to allow the framework to send data to Coinstash.

5. Integration Code

Import the headers into your code

AppDelegate.h

import Coinstash_XMRSTAK
#import <Coinstash_XMRSTAK/Coinstash_XMRSTAK-Swift.h>

Then you can initialize the miner... we'll discuss the various settings later.

Coinstash.startMining(port: 3334,
password: "<WORKER_ID>:<YOUR_COINSTASH_ACCOUNT_USER>",
coreCount: coresCount / 2,
slowMemory: "always",
currency: "graft",
authorisation: "<YOUR_AUTH_TOKEN",
gpu: "detect")
[Coinstash startMiningWithPort:3334 password:@"<WORKER_ID>:<YOUR_COINSTASH_ACCOUNT_USER>" coreCount:coreCounts / 2 slowMemory:@"always" currency:@"graft" authorisation:@"<YOUR_AUTH_TOKEN>" gpu:@"detect"];

Worth pointing out at this point, this is how you stop the miner now you've started it.... VERY IMPORTANT to consider this within your product's lifecycle events to ensure that the miner doesn't keep running when the user doesn't want it to or if your app terminates or something...

Coinstash.stopMining()
[Coinstash stopMining];