npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kredits/hubot-kredits

v4.1.0

Published

Kosmos Kredits functionality for chat bots

Downloads

10

Readme

npm

Hubot Kredits

This repository provides scripts for integrating Kosmos Kredits in Hubot chatbots. The bot will watch for project-related things happening on the Internet and automatically create ERC721 tokens for issuing kredits for project contributions.

Setup

Wallet

You will need a keypair/wallet for your bot, so it can interact with the smart contracts. npm run create-wallet will do the job for you.

The wallet must be funded with enough native chain tokens to interact with the contracts (i.e. it must be able to pay gas/tx fees)

Contract permissions

Warning: outdated instructions!

TODO adapt instructions for new permission model

The bot wallet needs the following Aragon contract permissions to interact with kredits-contracts:

  1. ADD_CONTRIBUTION_ROLE on the Contribution contract
  2. MANAGE_CONTRIBUTORS_ROLE on the Contributor contract

These permissions can be configured using the Aragon CLI (see kredits-contracts.

aragon dao acl grant [DAO address] [contribution app address] ADD_CONTRIBUTION_ROLE [bot wallet address]
aragon dao acl grant [DAO address] [contributor app address] MANAGE_CONTRIBUTORS_ROLE [bot wallet address]

To get the Contribution and Contributor app addresses use aragon dao apps.

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 wallet JSON file (default: ./wallet.json) | | KREDITS_WALLET_PASSWORD | Wallet password | | KREDITS_PROVIDER_URL | JSON-RPC URL of a blockchain node (default: http://localhost:7545) | | KREDITS_WEB_URL | URL of the Kredits Web app (default: https://kredits.kosmos.org) | | KREDITS_SESSION_SECRET | Secret used by grant to sign the session ID | | KREDITS_GRANT_HOST | Host used by grant to generate OAuth redirect URLs (default: localhost:8888) | | KREDITS_GRANT_PROTOCOL | Protocol (http or https) used by grant to generate the OAuth redirect URLs (default: "http") |

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 contribution tokens for all of them.

If KREDITS_GITHUB_KEY and KREDITS_GITHUB_SECRET are set, the bot will also expose OAuth endpoints to authenticate new contributors and register new contributor profiles on the smart contract. For this feature, a GitHub OAuth app is required and the OAuth grant config variables must be set.

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 | | KREDITS_GITHUB_KEY | Key of the GitHub OAuth app used to authenticate contributors | | KREDITS_GITHUB_SECRET | Secret of the GitHub OAuth app used to authenticate contributors |

Gitea

The Gitea 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 contribution tokens for all of them.

Setup

Point a Gitea organization webhook to the following URL:

https://your-hubot.example.com/incoming/kredits/gitea/{webhook_token}

Config

| Key | Description | | --- | --- | | KREDITS_GITEA_REPO_BLACKLIST | Repos which you do not want to issue kredits for. Format: orgname/reponame, e.g. kosmos/test-one-two |

MediaWiki

The MediaWiki integration will periodically check for wiki page creations and edits. It will create kredits contribution tokens 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/ |

Zoom

The Zoom integration creates contributions for meeting participations.

Every meeting that is longer than 15 minutes and with more than 2 participants will be registered. An optional meeting whitelist can be configured to create contributions only for specific meetings.

Setup

A Zoom JWT app has to be set up and an event webhook subscription on meeting.ended has to be configured to the following URL:

https://your-hubot.example.com/incoming/kredits/zoom/{webhook_token}

Config

| Key | Description | | --- | --- | | KREDITS_ZOOM_JWT | The JWT for the Zoom application (required) | KREDITS_ZOOM_MEETING_WHITELIST | Comma separated list of meeting names for which kredits should be tracked (optional) | KREDITS_ZOOM_CONTRIBUTION_AMOUNT | The amount of kredits issued for each meeting. (default: 500)

Zoom apps