I am attempting to create a custom service that uses functionality from bitcore-lib. I am following the guide instructions as best I can. Most of the services examples do not include using bitcore-lib. I saw that Satoshi-Fire-Alarm did so I attempted to use the requires that I found in there:
var bitcore = require('bitcore-lib'); var Transaction = bitcore.Transaction;
It complains that it cannot find bitcore-lib. Looking at the project in github I see that it attempts to use relative paths to individual libraries which does not seem right. I tried it anyway and never had any luck loading bitcore-lib.
If I attempt to just use this:
var bitcore = require('bitcore');
it will complain that:
Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
I am not sure how I should go about requiring the core bitcore functionality in my service.
To be clear, when I remove the offending bitcore-lib specific code, my service gets loaded into bitcored. I only seem to be having an issue with require bitcore.
Also, I ran npm list -g and I only have email@example.com installed.
I created my project directory using “bitcore create projName” and symlinked my service into the resulting node_modules as per the instructions.
Any help would be appreciated.