Shreyc711 / colonyCDapp

A interation of the Colony Dapp sporting both a fully decentralized operating mode, as well as a mode enhanced by a metadata caching layer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Colony CDapp

An iteration of the Colony Dapp sporting both a fully decentralized operating mode, as well as a mode enhanced by a metadata caching layer.

Prerequisites

  • node v16.16.x (Best use nvm)
  • npm v8.11.x (At least. The newer, the better)
  • docker v19.03.0+ (See install instructions)

Installation

First, clone this repository :)

Install packages

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

Running the dev environment

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.

Running the dev web server

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)

Additional services

Amplify

You can access the Amplify / Mock Appsync GraphQL api playground at http://localhost:20002

Reputation Monitor

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

Truffle

If needed, the truffle console is available to you via:

npm run truffle console

NOTE: This only works while the environment is running

Building the bundle locally

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

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

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

Testing

To run unit tests you have the following npm script:

npm run test

Upgrading colony-js

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/

About

A interation of the Colony Dapp sporting both a fully decentralized operating mode, as well as a mode enhanced by a metadata caching layer


Languages

Language:TypeScript 89.0%Language:CSS 5.3%Language:JavaScript 5.1%Language:HTML 0.3%Language:Shell 0.2%Language:Velocity Template Language 0.1%Language:Dockerfile 0.1%