Git Product home page Git Product logo

alex-koin-go's Introduction

Alex Koin

A centralized non-crypto cryptocurrency. Also just a fun bot for slack.

Welcome

Alex Koin is being rewritten in golang. If you are interesteded in helping out, please read on!

Development

You'll need to copy the example .env.template to your own local .env.

$ cp .env.template .env
  1. make up
  2. ngrok http -subdomain=yourdomain 3000
  3. Configure Slack app's event endpoint to call https://yourdomain.ngrok.io/events
  4. Add slack settings to .env file (copy .env.template)

Database Setup

CREATE DATABASE akc;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

This should be run with your local psql command. The \copy function will pull from your local directory.

\COPY
	(SELECT ID,
			EMAIL,
			FIRST_NAME,
			LAST_NAME,
			SLACK_ID,
			INSERTED_AT AS CREATED_AT,
			UPDATED_AT
		FROM USERS) TO 'users.csv' WITH CSV HEADER;

\COPY
	(SELECT COINS.ID,
			COINS.HASH,
			COINS.ORIGIN,
			WALLETS.USER_ID AS USER_ID,
			COINS.MINED_BY_ID AS MINED_BY_USER_ID,
			COINS.CREATED_BY_USER_ID,
			COINS.INSERTED_AT AS CREATED_AT,
			COINS.UPDATED_AT
		FROM COINS
		LEFT JOIN WALLETS ON COINS.WALLET_ID = WALLETS.ID) TO 'coins.csv' WITH CSV HEADER

\COPY
  (SELECT 
    ID,
    AMOUNT,
    MEMO,
    FROM_ID AS FROM_USER_ID,
    TO_ID AS TO_USER_ID,
    COIN_ID,
    INSERTED_AT AS CREATED_AT,
    UPDATED_AT
    FROM TRANSACTIONS
    ) TO 'transactions.csv' WITH CSV HEADER
\COPY USERS (
 ID,
 EMAIL,
 FIRST_NAME,
 LAST_NAME,
 SLACK_ID,
 CREATED_AT,
 UPDATED_AT)
FROM 'users.csv' WITH CSV HEADER;

\COPY COINS (
 ID,
 HASH,
 ORIGIN,
 USER_ID,
 MINED_BY_USER_ID,
 CREATED_BY_USER_ID,
 CREATED_AT,
 UPDATED_AT)
FROM 'coins.csv' WITH CSV HEADER

\COPY TRANSACTIONS (
 ID,
 AMOUNT,
 MEMO,
 FROM_USER_ID,
 TO_USER_ID,
 COIN_ID,
 CREATED_AT,
 UPDATED_AT)
FROM 'transactions.csv' WITH CSV HEADER

Proxy outbound requests

Configure a proxy by setting the env var http_proxy, eg export http_proxy=http://127.0.0.1:9999. I use Charles proxy for this to see the calls to Slack.

alex-koin-go's People

Contributors

hex337 avatar finack avatar mikesoares avatar ziad-abdo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.