Verified Commit 88e86a91 authored by Adam Zerella's avatar Adam Zerella
Browse files

Making things a bit easier for others to dive into

parent 5cadc69a
WEBHOOK_PROXY_URL=https://smee.io/<secret>
APP_ID=<id>
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n private key \n-----END RSA PRIVATE KEY-----\n"
WEBHOOK_SECRET=<secret>
GITHUB_CLIENT_ID=<id>
GITHUB_CLIENT_SECRET=<secret>
ACCOUNT_SEED="twelve words seperated by spaces which seeds the account controlled by bot"
ALLOWED_USERS=["shawntabrizi", "and", "other", "github", "usernames", "in", "an", "array"]
\ No newline at end of file
node_modules
node_modules/
coverage/
lib/
dist/
npm-debug.log
*.pem
!mock-cert.pem
.env
coverage
lib
MIT License
Copyright (c) 2021 Shawn Tabrizi
Copyright (c) 2021 Parity Technologies
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -3,43 +3,60 @@
> A GitHub App built with [Probot](https://github.com/probot/probot) that can submit tips on behalf
> of a [Substrate](https://github.com/paritytech/substrate) based network.
## Setup
# Getting started 🌱
## Usage
This bot relies on GitHub pull request that opt in via a body text comment to specify what Substrate network and address to send tips to.
### Pull request body
```sh
# Install dependencies
npm install
{kusama|polkadot|localtest} address: <SS58 Address>
```
Followed by a _comment_ on said pull request
# Run the bot
npm start
### Pull request comment
```sh
/tip {small | medium | large}
```
### ENV File
To use this bot, you need to have a proper `.env` file created. Most of the options will
## Local development 🔧
To use this bot, you'll need to have an `.env` file. Most of the options will
automatically be generated by the GitHub application creation process, but you will also need to add
`ACCOUNT_SEED` and `ALLOWED_USERS`:
`ACCOUNT_SEED` and `ALLOWED_USERS`.
Example `.env` file:
A reference env file is placed at `.env.example` to copy over
```sh
$ cp .env.example .env
```
WEBHOOK_PROXY_URL=https://smee.io/<secret>
APP_ID=<id>
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n private key \n-----END RSA PRIVATE KEY-----\n"
WEBHOOK_SECRET=<secret>
GITHUB_CLIENT_ID=<id>
GITHUB_CLIENT_SECRET=<secret>
ACCOUNT_SEED="twelve words seperated by spaces which seeds the account controlled by bot"
ALLOWED_USERS=["shawntabrizi", "and", "other", "github", "usernames", "in", "an", "array"]
After registering and configuring the bot, we can run it like so
```sh
$ npm start
```
## Docker
### Docker
To run the bot via Docker, we need to build and then run it like so
```sh
# 1. Build container
docker build -t substrate-tip-bot .
$ docker build -t substrate-tip-bot .
```
# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> substrate-tip-bot
```sh
$ docker run \
-e APP_ID=<app-id> \
-e PRIVATE_KEY=<pem-value> \
substrate-tip-bot
```
## Contributing
......@@ -51,4 +68,4 @@ For more, check out the [Contributing Guide](CONTRIBUTING.md).
## License
[MIT](LICENSE) © 2021 Shawn Tabrizi <shawntabrizi@gmail.com>
[MIT](LICENSE) © 2021 Parity Technologies <admin@parity.io>
{
"name": "substrate-tip-bot",
"name": "@substrate/substrate-tip-bot",
"version": "1.0.0",
"private": true,
"description": "A GitHub bot to submit tips on behalf of the network.",
"author": "Shawn Tabrizi <shawntabrizi@gmail.com>",
"license": "ISC",
"homepage": "https://github.com/shawntabrizi/substrate-tip-bot",
"author": "Parity Technologies <admin@parity.io> (https://parity.io)",
"license": "MIT",
"homepage": "https://github.com/paritytech/substrate-tip-bot",
"keywords": [
"probot",
"github",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment