Wherever you have require('etherlime') you now need to change to require('etherlime-lib'). You can safely uninstall your project version of etherlime npm uninstall etherlime.
Note: Do reinstall the global CLI version of etherlime: npm uninstall -g etherlime, npm install -g etherlime
Installing v2.0
Installing the CLI:
npm i -g etherlime
This command in v2.0 will install only the etherlime CLI - (command line interface) library. You can use all the CLI commands.
Installing the LIB:
npm i etherlime-lib
This command will install only etherlime LIB . You can use LIB to deploy, instantiate or test smart contracts.
Deploying in v1.2
Deploying in v1.2 is as follows:
Example:
constetherlime=require('etherlime');// Path to your etherlime compiled contract json fileconstTestContract=require('../build/TestContract.json'); constdeploy=async (network, secret) => {constdeployer=newetherlime.EtherlimeGanacheDeployer();// Add params separated with ,constresult=awaitdeployer.deploy(TestContract, {}); }module.exports= { deploy }
Please note that here etherlime is required as etherlime.
Deploying in v2.0
Deploying in v2.0 is as follows using Etherlime LIB.
Example:
constetherlime=require('etherlime-lib');// Path to your etherlime compiled contract json fileconstTestContract=require('../build/TestContract.json'); constdeploy=async (network, secret) => {constdeployer=newetherlime.EtherlimeGanacheDeployer();// Add params separated with ,constresult=awaitdeployer.deploy(TestContract, {}); }module.exports= { deploy }
Please note that here etherlime is required as etherlime-lib.
Testing Smart Contracts v1.2
constetherlime=require('etherlime');constBillboard=require('../build/Billboard.json');describe('Example', () => {let owner = accounts[3];let deployer;beforeEach(async () => { deployer =newetherlime.EtherlimeGanacheDeployer(owner.secretKey); });it('should set correct owner',async () => {constBillboardContract=awaitdeployer.deploy(Billboard, {});let _owner =awaitBillboardContract.owner();assert.strictEqual(_owner,owner.signer.address,'Initial contract owner does not match'); }); });
Please note that here etherlime is required as etherlime.
Testing Smart Contracts v2.0
constetherlime=require('etherlime-lib');constBillboard=require('../build/Billboard.json');describe('Example', () => {let owner = accounts[3];let deployer;beforeEach(async () => { deployer =newetherlime.EtherlimeGanacheDeployer(owner.secretKey); });it('should set correct owner',async () => {constBillboardContract=awaitdeployer.deploy(Billboard, {});let _owner =awaitBillboardContract.owner();assert.strictEqual(_owner,owner.signer.address,'Initial contract owner does not match'); }); });
Please note that here etherlime is required as etherlime-lib.