Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flair purchase script #83

Merged
merged 11 commits into from
Aug 7, 2020
1 change: 1 addition & 0 deletions flair/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions flair/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:12-alpine

RUN apk update && apk add --no-cache python g++ make

WORKDIR /app

COPY . .

RUN npm install

ENTRYPOINT ["npm", "start"]
30 changes: 30 additions & 0 deletions flair/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Flair

job scheduler that updates user flair based on purchases they have made on the OMG Network

### Getting Started

To install dependencies run `npm install` in the root directory

To start the job run `npm run start` in the root directory

To test the application run `npm rest` in the root directory

### Environment Variables

The application supports the following environment variables, you may refer to env.template file for reference

```
BURN_ADDR=<address used to burn ERC20 token points for purchased assets>
CURRENCY=<ERC20 token points contract address>
WATCHER=<URL of the Watcher info>
USER_THREAD=<URL and path to the Reddit thread that contains a list of usernames>
USER_AGENT=<describes your node application name>
CLIENT_ID=<client ID of the Reddit application, obtained from Reddit developer portal>
CLIENT_SECRET=<client secret of the Reddit application, obtained from Reddit developer portal>
USERNAME=<Reddit username, must be listed as a moderator on the Reddit Sub with flair access>
PASSWORD=<Reddit password>
SUB=<Name of the sub>
SENTRY_DSN=<DSN to log the error to>

```
11 changes: 11 additions & 0 deletions flair/env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BURN_ADDR=0x000000000000000000000000000000000000dead
CURRENCY=0x79dac4c6aaff683328b9d000ffd5030c8b1e9df2
WATCHER=https://watcher-info.mainnet.v1.omg.network
USER_THREAD=https://www.reddit.com/r/OMGnetwork/comments/i0hn9r/ox/
USER_AGENT=node-js:v1
CLIENT_ID=id
CLIENT_SECRET=secret
USERNAME=foo
PASSWORD=bar
SUB=baz
SENTRY_DSN=dsn