Install dependencies:
nvm use # Should install node 10.16.0
npm install truffle
npm install
To compile contracts:
truffle compile
To run a console:
npx truffle console --network local
To deploy on goerli:
npx truffle deploy --network goerli
To run tests:
npx truffle test
Start by creating a session:
npx zos session --network
This creates a "connection" that will be used for every zos command. We define which network to connect, which account to use by default for all transaction and when it expires (3600 seconds after last used).
If no current session exists, or it its expired we need to create one.
When we create a new contract run:
npx zos add MyContract
To upgrade a current contract (change the code of it)
npx zos update MyContract
After any change we need to push the changes:
npx zos push
add
and update
only change the contract instance, but they don't actually release/create an instance of that contract.
To create an instance we do:
npz zos create MyContract --init initialize --args 42,hitchhiker