I want to use an external library. I guess it is good to load the library in production from a CDN because this requires less space and should be faster.
import "github.com/Arachnid/solidity-stringutils/strings.sol";
But in dev this library cannot be found:
Cannot find import strings.sol from Challenge.sol. If it's a relative path, ensure it starts with ./
or ../
.
I read in this post: How should we set a import path in solidity?
And in this tutorial: http://solidity.readthedocs.io/en/latest/layout-of-source-files.html
When the compiler is invoked, it is not only possible to specify how to discover the first element of a path, but it is possible to specify path prefix remappings so that e.g. github.com/ethereum/dapp-bin/library is remapped to /usr/local/dapp-bin/library and the compiler will read the files from there.
So I created the folders
/usr/local/dapp-bin/library/solidity-stringutils/
and downloaded the github repo to that folder.
I also tried to put it directly into
/usr/local/solidity-stringutils/
But I' still getting:
Cannot find import strings.sol from Challenge.sol. If it's a relative path, ensure it starts with ./
or ../
.
Can I configure truffle that it takes libraries from a default folder. Good would be github.com/*/lib-name
=> ./vendor/lib-name