@hokid/transcan
v0.1.0
Published
Scan transactions and save on server
Downloads
11
Readme
Install
$ npm install -g @hokid/transcan
Usage
- Make directory for
transcan
$ makedir transcan-example
$ cd transcan-example
- Create configuration file, for example,
.transcan.config.js
.
Put this in configuration file and replace placeholders.
module.exports = {
tasks: [
{ name: 'BTC', scheduleTime: <CRON_SCHEDULIGN_FORMAT> },
{ name: 'ETH', scheduleTime: <CRON_SCHEDULIGN_FORMAT> }
],
db: {
host: <POSTGRES_HOST>,
port: <POSTGRES_PORT>,
user: <POSTGRES_USER>,
password: <POSTGRES_PASSWORD>,
database: <POSTGRES_DATABASE>
},
apiBase: <API_URL>,
cacheFile: <NAME_FOR_CACHE_FILE>
}
- CRON_SCHEDULIGN_FORMAT - for scheduling task used https://github.com/node-schedule/node-schedule.
- POSTGRES_* - settings for connection to postgres server
- API_URL - base url for api to send transactions (https://example.com)
- NAME_FOR_CACHE_FILE - name for cache file (.cache.json)
- Run it:
$ transcan -c .transcan.config.js