From 417eb42905d0d1c322af23c4f90099a745a5c441 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 22 Apr 2018 13:14:20 +0200 Subject: [PATCH 1/3] Add README/documentation --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.js | 15 --------------- 2 files changed, 56 insertions(+), 15 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..059d2be --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# hubot-kredits + +This repository provides scripts for integrating Kosmos Kredits in +[Hubot](http://hubot.github.com/) chatbots. The bot will watch for +project-related things happening on the Internet and automatically create +proposals for issuing Kredits for project contributions. + +## Configuration + +As usual in Hubot, you can add all config as environment variables. + +| Key | Description | +| --- | --- | +| `KREDITS_WEBHOOK_TOKEN` | A string for building your secret webhook URLs | +| `KREDITS_ROOM` | The bot will talk to you in this room | +| `KREDITS_WALLET_PATH` | Path to an Etherum wallet JSON file | +| `KREDITS_WALLET_PASSWORD` | Wallet password | +| `KREDITS_PROVIDER_URL` | Ethereum JSON-RPC URL (default `http://localhost:7545`) | +| `KREDITS_NETWORK_ID` | The ethereum network ID to use (default 100 = local) | + +## Integrations + +### GitHub + +The GitHub integration will watch for closed issues and merged pull requests, +which carry a kredits label: `kredits-1`, `kredits-2`, `kredits-3` for small, +medium and large contributions. If there are multiple people assigned, it will +issue propsals for all of them. + +#### Setup + +Point a GitHub organization webhook to the following URL: + + https://your-hubot.example.com/incoming/kredits/github/{webhook_token} + +#### Config + +| Key | Description | +| --- | --- | +| `KREDITS_GITHUB_REPO_BLACKLIST` | Repos which you do not want to issue kredits for. Format: `orgname/reponame`, e.g. `67P/test-one-two` | + +### MediaWiki + +The MediaWiki integration will periodically check for wiki page creations and +edits. It will create kredits proposals based on amount of text added. + +#### Setup + +No setup needed, except for configuring the wiki URL. The bot will poll your +wiki's API on its own. + +#### Config + +| Key | Description | +| --- | --- | +| `KREDITS_MEDIAWIKI_URL` | Your wiki URL, e.g. `https://wiki.kosmos.org/` | diff --git a/index.js b/index.js index f3de2c8..b9f905a 100644 --- a/index.js +++ b/index.js @@ -1,18 +1,3 @@ -// Description: -// Kosmos Kredits chat integration -// -// Configuration: -// KREDITS_WEBHOOK_TOKEN: A string for building your secret webhook URL -// KREDITS_ROOM: Kredit Proposals are posted to this chatroom -// KREDITS_WALLET_PATH: Path to a etherum wallet JSON file -// KREDITS_WALLET_PASSWORD: Wallet password -// KREDITS_PROVIDER_URL: Ethereum JSON-RPC URL (default 'http://localhost:7545') -// KREDITS_NETWORK_ID: The ethereum network ID to use (default 100 = local) -// IPFS_API_HOST: Host/domain (default 'localhost') -// IPFS_API_PORT: Port number (default '5001') -// IPFS_API_PROTOCOL: Protocol, e.g. 'http' or 'https' (default 'http') -// - const fs = require('fs'); const util = require('util'); const fetch = require('node-fetch'); From bba5407c7d719ecf520c330ad57cc18bd40cb8ae Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 22 Apr 2018 13:39:29 +0200 Subject: [PATCH 2/3] Fix typo, link kredits wiki page --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 059d2be..87a5429 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # hubot-kredits -This repository provides scripts for integrating Kosmos Kredits in -[Hubot](http://hubot.github.com/) chatbots. The bot will watch for -project-related things happening on the Internet and automatically create -proposals for issuing Kredits for project contributions. +This repository provides scripts for integrating [Kosmos +Kredits](https://wiki.kosmos.org/Kredits) in [Hubot](http://hubot.github.com/) +chatbots. The bot will watch for project-related things happening on the +Internet and automatically create proposals for issuing kredits for project +contributions. ## Configuration @@ -25,7 +26,7 @@ As usual in Hubot, you can add all config as environment variables. The GitHub integration will watch for closed issues and merged pull requests, which carry a kredits label: `kredits-1`, `kredits-2`, `kredits-3` for small, medium and large contributions. If there are multiple people assigned, it will -issue propsals for all of them. +issue proposals for all of them. #### Setup From b4229c7879cfd47f9863ed7e3b3c454fea98a722 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 22 Apr 2018 13:47:32 +0200 Subject: [PATCH 3/3] Document wallet creation, rename npm script --- README.md | 11 ++++++++--- package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87a5429..1a44081 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,11 @@ chatbots. The bot will watch for project-related things happening on the Internet and automatically create proposals for issuing kredits for project contributions. +## Setup + +You will need an Ethereum wallet for your bot, so it can interact with the +Ethereum smart contracts. `npm run create-wallet` will do the job for you. + ## Configuration As usual in Hubot, you can add all config as environment variables. @@ -14,10 +19,10 @@ As usual in Hubot, you can add all config as environment variables. | --- | --- | | `KREDITS_WEBHOOK_TOKEN` | A string for building your secret webhook URLs | | `KREDITS_ROOM` | The bot will talk to you in this room | -| `KREDITS_WALLET_PATH` | Path to an Etherum wallet JSON file | +| `KREDITS_WALLET_PATH` | Path to an Etherum wallet JSON file (default: `./wallet.json`) | | `KREDITS_WALLET_PASSWORD` | Wallet password | -| `KREDITS_PROVIDER_URL` | Ethereum JSON-RPC URL (default `http://localhost:7545`) | -| `KREDITS_NETWORK_ID` | The ethereum network ID to use (default 100 = local) | +| `KREDITS_PROVIDER_URL` | Ethereum JSON-RPC URL (default: `http://localhost:7545`) | +| `KREDITS_NETWORK_ID` | The ethereum network ID to use (default: 100 = local) | ## Integrations diff --git a/package.json b/package.json index 43e3c10..c884887 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "bin": { - "kredits-wallet-create": "scripts/create-wallet.js" + "create-wallet": "scripts/create-wallet.js" }, "dependencies": { "ethers": "^3.0.15",