Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kybernetwork/kyber-tracker
https://github.com/kybernetwork/kyber-tracker
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/kybernetwork/kyber-tracker
- Owner: KyberNetwork
- License: mit
- Created: 2018-03-17T19:45:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T00:55:05.000Z (almost 2 years ago)
- Last Synced: 2023-02-28T21:01:18.850Z (almost 2 years ago)
- Language: JavaScript
- Size: 13.2 MB
- Stars: 18
- Watchers: 3
- Forks: 73
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KyberTracker
## Setup environment and run the app
### Install system dependencies
- NodeJS v8+
- MariaDB v10+ (may use MySQL v5.7+ instead)### Install NodeJS global packages
```
$ npm install -g knex pm2
```### Checkout and install node packages from source code
```
$ git clone [email protected]:sotatek-dev/KyberTracker.git
$ cd KyberTracker
$ npm install
```### Create environment variables settings
```
$ cp .env.example .env // Then update the valid setting values in the .env file
```### Initialize the database schema and seeds data
```
$ npm run init-db
$ npm run seeds
```### Run the app
```
$ npm start
```## Code directory structure
### The `.env` file
- Store the environement variables
```
PORT=9009 // The port that app will run in
NODE_ENV=development // JS bundle files will be minified/compressed if the environment is production.
LOG_LEVEL=INFO // Available options: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATALMYSQL_DB_HOST=127.0.0.1 // MySQL host address
MYSQL_DBNAME=kyber_tracker // MySQL database name
MYSQL_USERNAME=root // MySQL username
MYSQL_PASSWORD=1 // MySQL user password
```### The `config` directory
- `config/routes/api.js`: View/add/update the API routes.
- `config/network/production`: Configuration that is related to on-chain data
- Almost don't need to touch other files.### The `app/controllers` directory
- The first request's handler layer.### The `app/crawlers` directory
- The process that crawls on-chain data to local database.### The `app/models` directory
- The interface that interacts with MySQL database.### The `app/services` directory
- The functions that will handle the main logic/business of the app## Maintenance
### Add new token
- Add data to `config/network/production.js` file.### Change the localization
- Update values in json files under folder `resources/lang`.