Build Phases tab. Add the Coinstash framework to your project by dragging from the Finder
Copy items if needed is selected,
Create Groups selected and your Target is selected
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
If your app is sandboxed you should enable Outgoing Connection in your Capabilities/Entitlements to allow the framework to send data to Coinstash.
Import the headers into your code
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...