- Install
- Launch
- Tests
- Publish NPM package
- Docker Image
- Sequence diagrams
- Non ganache launches/deploys
These instructions are about the dev environment for contract development. For UI development see augmint-web repo
-
nodejs
NB: check supported node version in package.jsonInstalling nodejs with n node version manager:
npm install -g n n <node version, eg: 10.15.3>
-
Yarn:
npm install -g yarn@<version>
NB: check required yarn version in package.json -
git clone https://github.com/Augmint/augmint-contracts.git cd augmint-contracts yarn install
NB: windows install was not tested since a while, update on it is welcome
-
Git Bash (required for truffle & yarn start)
-
Git (if you haven't installed it as part of Git Bash in previous step)
-
Ethereum CLI - including development tools
-
nodejs
NB: check supported node version in package.jsonInstalling nodejs with Node Version Manager(NVM):
nvm install <node version number, eg: 10.15.3> nvm use 10.15.3
-
in Git bash:
git clone https://github.com/Augmint/augmint-contracts.git cd augmint-contracts yarn install
git pull
yarn install # if there were any node package changes in packages.json
yarn start
(runs truffle migrate
with --reset
flag)
or
yarn ganache:run
or./scripts/runganache.sh
- in separate console:
yarn migrate
or to overwrite existing migration:
yarn migrate --reset
NB: if you get this error from migration:
Error: Attempting to run transaction which calls a contract function, but recipient address 0xd217ac4354211cda27dd4027b5e223280f885ad3 is not a contract address
then you either need to do a yarn clean
before yarn migrate
or run migration as yarn migrate --reset
yarn start
yarn test
When the abiniser directory changed:
- bump the version property in the package.json
- release a new version as usual (staging -> master, git tag & github release)
npm publish
from master branch. test it with--dry-run
A docker image with an initial state of the contracts in ganache is published for development of dependent packages.
The image is published to augmint/contracts dockerhub repo.
NB: augmint-contracts
' own tests are also running on this container at Travis
yarn docker:start
yarnd docker:stop
localchaindb:builddocker
: deletes local chain data folder (./localchaindb
), launches ganache, migrates contracts and builds a docker image withlocaldockerimage
namedocker:run
: removes previousganache
container and runs a new from the docker image labeledlocaldockerimage
docker:start
&docker:stop
: start / stopganache
container
Travis set to generate a docker image for master and staging branch builds. See .travis.yml
Tags
yarn docker:tag:build
: every published image tagged withbuild-travisbuildnumber
andcommit-xxxxx
yarn docker:tag:staging
: on staging branch image tagged withstaging
yarn docker:tag:latest
: on master branch image tagged withlatest
yarn docker:tag:version
: on master branch image tagged withvx.x.x
tags (from git tag if it's in semver format)
Sequence diagrams in docs folder are created with plant UML. To edit them there are two Atom editor plugins: plantuml-preview and language-plantuml
cd privatechain
./createprivatechain.sh
cd ..
truffle migrate
cp ./build/contracts/\* ./src/contractsBuild
cd privatechain
./runprivatechain.sh
cd privatechain
rm -r chaindata/geth
./createprivatechain.sh
cd ..
truffle migrate --network privatechain
cp ./build/contracts/\* ./src/contractsBuild
For new deploys on rinkeby and main net see migration instructions
### Alternative ganache launches
If you use ganache UI then
- set the port to 8545
- For running UI tests set mnemonic:
hello build tongue rack parade express shine salute glare rate spice stock
NB: truffle runs local chain on localhost:9545
-
truffle develop
-
in truffle console:
migrate
or
migrate --reset
to overwrite existing migration -
cp ./build/contracts/* ./src/contractsBuild
TODO: use same mnemonic & port as
runganache.sh