An iteration of the Colony Dapp sporting both a fully decentralized operating mode, as well as a mode enhanced by a metadata caching layer.
node
v16.16.x
(Best use nvm)npm
v8.11.x
(At least. The newer, the better)docker
v19.03.0+
(See install instructions)
First, clone this repository :)
Pick the right node version (as seen in .nvmrc
):
nvm use
Install all dependencies:
npm install
Note: at the end of the install there's a post-install script that will recursively install dependencies for all the currently declared lambda functions
npm run dev
This will build your local docker images, then attempt to start them _(the local dev environment runs inside a couple of docker containers).
On the next start, assuming no key cache files changed, it will skip the image building step (as it will just used the cached version), and go straight to starting your environment.
Once the above dev environment is up and running, you need to start your dev web server, running through webpack:
npm run webpack
You can access it at http://localhost:9091
(notice the different port, as to not cause a local storage and cache conflict with the Dapp)
You can access the Amplify / Mock Appsync GraphQL api playground at http://localhost:20002
In order for reputation to function within your dev environment, you will need to toggle it on first.
Access the following URL to toggle the reputation monitor auto-mining on or off: http://127.0.0.1:3001/reputation/monitor/toggle
You can also view the status of the reputation monitor using the following URL: http://127.0.0.1:3001/reputation/monitor/status
If needed, the truffle console is available to you via:
npm run truffle console
NOTE: This only works while the environment is running
If you want to build the bundle locally for inspection, you can do it via:
npm run webpack:build
Note: It's a straight-up dev build. Just bundled, no code optimizations whatsoever.
Linting your code via eslint
can be done as such:
npm run lint
To lint the project's style sheets you run:
npm run stylelint
Type checking using TypeScript can be accessed using this npm script:
npm run typecheck
# Or, with file watching (or any other `tsc optional arguments`)
npm run typecheck --watch
To run unit tests you have the following npm script:
npm run test
When upgrading colony-js
package, you usually want to do it for not just CDapp but also all the lambdas that depend on it. There's an upgrade-colony-js
script that does it for you:
npm run upgrade-colony-js <version>
Twemoji graphics made by Twitter and other contributors, licensed under CC-BY 4.0: https://creativecommons.org/licenses/by/4.0/