@laborx/lx-core-migrations
v2.0.0
Published
Provides migration scripts for LaborX Contract core contracts
Downloads
5
Keywords
Readme
LaborX v2: deployment migrations
Provides set of useful constants, functions and scripts to access and deploy LX Contract Module smart contracts.
Install
npm install -D @laborx/lx-core-migrations
Structure
There are couple of exported scopes that should be mentioned:
Constants
- provides constants and utility functions to access basic functionalityContractNames
- allows to access deployed contracts by namesContractStorageCrates
- storage crate names, defines scopes of stored data of smart contractsgetDeployedArtifactsPath(contractEnv)
- allows to get deployed addresses path according to neededcontractEnv
parameter. SeeSmartContractsAddressBuildEnvironment
for available options.getDeployedArtifactsPathFromNodeEnv()
- allows to get deployed addresses path based on provided env variable
Deployment
- scripts for smart contracts deployment
Usage
Environment variable
Setup in .env
SC_ADDRESSES_BUILD_ENV
variable to one of
# SC_ADDRESSES_BUILD_ENV=production
SC_ADDRESSES_BUILD_ENV=beta
# SC_ADDRESSES_BUILD_ENV=dev
Importing
import { Constants } from "@laborx/lx-core-migrations";
const {
getDeployedArtifactsPath,
getDeployedArtifactsPathFromNodeEnv,
SmartContractsAddressBuildEnvironment
} = Constants;
/*
Get deployed addresses path for 'beta' build environment
*/
const deployedAddressesPath = getDeployedArtifactsPath(SmartContractsAddressBuildEnvironment.beta)
/*
If provided you can use setup environment variable and use it for getting build environment
*/
const deployedAddressePath = getDeployedArtifactsPathFromNodeEnv()