Skip to content

Commit 70c234b

Browse files
authored
minimum notification level for web-hook (#39)
* implementation * documentation
1 parent ab3e68f commit 70c234b

File tree

8 files changed

+51
-15
lines changed

8 files changed

+51
-15
lines changed

CONFIGURATION.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ See [osseus-config](https://github.com/colucom/osseus-config) for detailed expla
66

77
#### non-osseus config variables
88

9-
| Key | Mandatory | Type | Description | Default |
10-
|:---------------------------: |:---------: |:-------: |:-------------------------------------------------------------------: |:-------: |
11-
| `DEBUG` | x | Boolean | Activate specific debug logs | false |
12-
| `WEB3_PROVIDER` | v | String | URL through which the app "talks" to the blockchain | |
13-
| `SECRET` | v | String | Part of the password to encrypt community mnemonic | |
14-
| `BLOCKS_TO_CONFIRM_BCTX` | v | Number | Blocks to be mined until a transaction is considered as "CONFIRMED" | |
15-
| `NOTIFICATIONS_WEBHOOK_URL` | x | String | URL to receive notifications on | |
16-
| `CURRENCIES_BATCH_SIZE` | x | Number | Currencies to process in parallel on transmit & events listener | 10 |
17-
| `NO_LISTENERS` | x | Boolean | Deactivate events listeners | false |
18-
| `PAST_EVENTS_INTERVAL` | x | Number | Milliseconds interval to get past events | 60000 |
19-
| `PAST_EVENTS_BLOCK_LIMIT` | x | Number | Blocks to get past events at once | 1000 |
9+
| Key | Mandatory | Type | Description | Default |
10+
|:---------------------------------: |:---------: |:-------: |:------------------------------------------------------------------------------------------------------------------------------------: |:-------: |
11+
| `DEBUG` | x | Boolean | Activate specific debug logs | false |
12+
| `WEB3_PROVIDER` | v | String | URL through which the app "talks" to the blockchain | |
13+
| `SECRET` | v | String | Part of the password to encrypt community mnemonic | |
14+
| `BLOCKS_TO_CONFIRM_BCTX` | v | Number | Blocks to be mined until a transaction is considered as "CONFIRMED" | |
15+
| `NOTIFICATIONS_WEBHOOK_URL` | x | String | URL to receive notifications on | |
16+
| `NOTIFICATIONS_WEBHOOK_MIN_LEVEL` | x | String | Minimum [notification level](https://github.com/ColuLocalNetwork/inventory-manager/blob/master/NOTIFICATIONS.md#levels) for web-hook | |
17+
| `CURRENCIES_BATCH_SIZE` | x | Number | Currencies to process in parallel on transmit & events listener | 10 |
18+
| `NO_LISTENERS` | x | Boolean | Deactivate events listeners | false |
19+
| `PAST_EVENTS_INTERVAL` | x | Number | Milliseconds interval to get past events | 60000 |
20+
| `PAST_EVENTS_BLOCK_LIMIT` | x | Number | Blocks to get past events at once | 1000 |

config/LOCAL.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ module.exports = {
1818
WEB3_PROVIDER: 'https://ropsten.infura.io',
1919
SECRET: 'e4365c30-ec9f-459a-8a8e-55d3818c6134kNJYzFQ1jB97WXAn',
2020
BLOCKS_TO_CONFIRM_BCTX: 20,
21-
NOTIFICATIONS_WEBHOOK_URL: 'https://postman-echo.com/post'
21+
NOTIFICATIONS_WEBHOOK_URL: 'https://postman-echo.com/post',
22+
NOTIFICATIONS_WEBHOOK_MIN_LEVEL: 'INFO'
2223
}

docs/api_project.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api_project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "title": "Inventory Manager API", "header": { "title": "README", "content": "<p><a href=\"https://github.com/standard/standard\"><img src=\"https://cdn.rawgit.com/standard/standard/master/badge.svg\" alt=\"JavaScript Style Guide\"></a></p>\n<h1>Inventory Manager</h1>\n<p>The inventory manager is an <a href=\"https://github.com/colucom/osseus\">osseus</a> based server implementation for community currency issuers.</p>\n<p>It provides blockchain reflection of offchain activities on community currencies issued against the <a href=\"https://cln.network/\">CLN</a>.</p>\n<h2>Dependencies</h2>\n<p>To make sure that the following instructions work, please install the following dependencies\non you machine:</p>\n<ul>\n<li>Node.js (comes with a bundled npm)</li>\n<li>Git</li>\n<li>MongoDB</li>\n</ul>\n<h2>Installation</h2>\n<p>To get the source of <code>inventory-manager</code>, clone the git repository via:</p>\n<pre><code>$ git clone https://github.com/ColuLocalNetwork/inventory-manager\n</code></pre>\n<p>This will clone the complete source to your local machine.</p>\n<p>Navigate to the project folder and install all needed dependencies via <strong>npm</strong>:</p>\n<pre><code>$ npm install\n</code></pre>\n<p>This commands installs everything which is required for building and testing the project.</p>\n<h2>Developing</h2>\n<h3>Run locally: <code>npm run dev</code></h3>\n<p>This task will run the application and start listening on port <code>8080</code>.</p>\n<p>Under the hood, we use a complete <a href=\"https://github.com/colucom/osseus\">osseus</a> stack.</p>\n<p>You will find the local configuration at <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/config/LOCAL.js\">LOCAL.js</a>.</p>\n<h2>Configuration</h2>\n<p>See <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/CONFIGURATION.md\">tutorial</a>.</p>\n<h2>Getting Started</h2>\n<p>See <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/GETTING-STARTED.md\">tutorial</a>.</p>\n<h2>Notifications</h2>\n<p>See <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/NOTIFICATIONS.md\">tutorial</a>.</p>\n<h2>Testing</h2>\n<h3>Source linting</h3>\n<p><code>npm run lint</code> performs a lint for all source code using <a href=\"https://standardjs.com/\">standard js</a>.</p>\n<h3>Unit testing</h3>\n<p><code>npm test</code> executes (as you might think) the unit tests, which are located\nin <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/test\"><code>test</code></a>.</p>\n<h4>Enable a lot of transactions test</h4>\n<p>Before running <code>npm test</code> you should:</p>\n<pre><code>$ export A_LOT_OF_TXS={n}\n</code></pre>\n<p><em><strong>Notes</strong></em></p>\n<ul>\n<li><code>{n}</code> is number of transactions to test</li>\n<li>There's a 1 second delay between each blockchain transaction so be patient :)</li>\n</ul>\n<p>The task uses <a href=\"https://truffleframework.com/\">truffle framework</a>.</p>\n<h2>Contributing</h2>\n<p>Please see <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/.github/CONTRIBUTING.md\">contributing guidelines</a>.</p>\n<h2>License</h2>\n<p>Code released under the <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/LICENSE\">MIT License</a>.</p>\n" }, "name": "inventory-manager", "version": "1.0.0", "description": "The inventory manager is a server implementation for community currency issuers", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2018-12-11T11:25:27.626Z", "url": "http://apidocjs.com", "version": "0.17.6" }}
1+
{ "title": "Inventory Manager API", "header": { "title": "README", "content": "<p><a href=\"https://github.com/standard/standard\"><img src=\"https://cdn.rawgit.com/standard/standard/master/badge.svg\" alt=\"JavaScript Style Guide\"></a></p>\n<h1>Inventory Manager</h1>\n<p>The inventory manager is an <a href=\"https://github.com/colucom/osseus\">osseus</a> based server implementation for community currency issuers.</p>\n<p>It provides blockchain reflection of offchain activities on community currencies issued against the <a href=\"https://cln.network/\">CLN</a>.</p>\n<h2>Dependencies</h2>\n<p>To make sure that the following instructions work, please install the following dependencies\non you machine:</p>\n<ul>\n<li>Node.js (comes with a bundled npm)</li>\n<li>Git</li>\n<li>MongoDB</li>\n</ul>\n<h2>Installation</h2>\n<p>To get the source of <code>inventory-manager</code>, clone the git repository via:</p>\n<pre><code>$ git clone https://github.com/ColuLocalNetwork/inventory-manager\n</code></pre>\n<p>This will clone the complete source to your local machine.</p>\n<p>Navigate to the project folder and install all needed dependencies via <strong>npm</strong>:</p>\n<pre><code>$ npm install\n</code></pre>\n<p>This commands installs everything which is required for building and testing the project.</p>\n<h2>Developing</h2>\n<h3>Run locally: <code>npm run dev</code></h3>\n<p>This task will run the application and start listening on port <code>8080</code>.</p>\n<p>Under the hood, we use a complete <a href=\"https://github.com/colucom/osseus\">osseus</a> stack.</p>\n<p>You will find the local configuration at <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/config/LOCAL.js\">LOCAL.js</a>.</p>\n<h2>Configuration</h2>\n<p>See <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/CONFIGURATION.md\">tutorial</a>.</p>\n<h2>Getting Started</h2>\n<p>See <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/GETTING-STARTED.md\">tutorial</a>.</p>\n<h2>Notifications</h2>\n<p>See <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/NOTIFICATIONS.md\">tutorial</a>.</p>\n<h2>Testing</h2>\n<h3>Source linting</h3>\n<p><code>npm run lint</code> performs a lint for all source code using <a href=\"https://standardjs.com/\">standard js</a>.</p>\n<h3>Unit testing</h3>\n<p><code>npm test</code> executes (as you might think) the unit tests, which are located\nin <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/test\"><code>test</code></a>.</p>\n<h4>Enable a lot of transactions test</h4>\n<p>Before running <code>npm test</code> you should:</p>\n<pre><code>$ export A_LOT_OF_TXS={n}\n</code></pre>\n<p><em><strong>Notes</strong></em></p>\n<ul>\n<li><code>{n}</code> is number of transactions to test</li>\n<li>There's a 1 second delay between each blockchain transaction so be patient :)</li>\n</ul>\n<p>The task uses <a href=\"https://truffleframework.com/\">truffle framework</a>.</p>\n<h2>Contributing</h2>\n<p>Please see <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/.github/CONTRIBUTING.md\">contributing guidelines</a>.</p>\n<h2>License</h2>\n<p>Code released under the <a href=\"https://github.com/ColuLocalNetwork/inventory-manager/blob/master/LICENSE\">MIT License</a>.</p>\n" }, "name": "inventory-manager", "version": "1.0.0", "description": "The inventory manager is a server implementation for community currency issuers", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2018-12-12T13:40:22.392Z", "url": "http://apidocjs.com", "version": "0.17.7" }}

0 commit comments

Comments
 (0)