zCloak-Network / zkID-service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zkID-service

QuickStart

The app is developed by Midway. For more configuration, please refer to Midway.

Database init

script location sql/init.sql

other component config

The configuration file is located in src/config/config.{current env}.ts

For example, the configuration file name is config.local.ts in development and config.prod.ts in deploy.

mongodb

export const mongoose = {
  client: {
    uri: 'mongodb uri',
    options: {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      user: 'mongodb user',
      pass: 'mongodb password',
    },
  },
};

mysql

export const orm = {
  type: 'mysql',
  host: 'localhost',
  port: 3306,
  username: 'mysql user',
  password: 'mysql password',
  database: 'mysql database',
  synchronize: false,
  logging: true, // print sql
};

application internal config

export const zCloak = {
  // worker
  worker: {
    // number of worker verify pass
    verifyPassNumber: 2,
  },
  // chain contract 
  scan: {
    // contract config
    contractConfigs: [
      {
        // chain to contract address mapping
        chainId: 1287,
        contract: {
   	      // contract address
          'ProofStorage': '',
          'SimpleAggregator': '',
          'ZcloakPoap': '',
        },
      },
    ],
  },
};

Development

$ npm i
$ npm run dev
$ open http://localhost:7001/

Deploy

$ npm start
$ curl https://zkid-service.zcloak.network/
$ npm stop

npm scripts

  • Use npm run lint to check code style.
  • Use npm test to run unit test.

About


Languages

Language:TypeScript 99.5%Language:JavaScript 0.5%