These OpenZeppelin instructions were a great help in getting started.
A brief overview of the install process that was used in building this repository:
- Install Node.js if needed
- node --version
- Create a project and package (package.json) and initialize
- npm init -y
- Install Truffle locally within your project to avoid upgrade problems (Hardhat is an alternative)
- npm install --save-dev truffle
- Add node_modules to .gitignore when prompted
- npx truffle init
- Only once!
- npm install --save-dev truffle
- Add source control (GitHub) with key information included in .gitignore (i.e. build)
- Install @openzeppelin/contracts
- npm install --save-dev @openzeppelin/contracts
- Create contract .sol file inheriting from Owner with the Box example
- Compile the example before making any changes just to make sure your environment is setup correctly
- npx truffle compile ./contracts/DSCSAOwner.sol > test.log
- Add build directory to .gitignore so private keys are not uploaded to GitHub
- Make changes to example file for DSCSA Blockchain and compile
- Setup local blockchain with ganache
- install GUI Ganache if needed
- Add Ganache network to truffle configuration file (truffle-config.js)
- Create migrations' file (2_deploy.js)
- npx truffle migrate --network development
- npm install --save ipfs-http-client
- Build Unit Tests: install environment, helpers, and Chai for javascript assertions
- npm install --save-dev @openzeppelin/test-environment
- npm install --save-dev @openzeppelin/test-helpers
- npm install --save-dev chai
- create one solidity or javascript test file per contract
- npx truffle test > test.log