GithubHelp home page GithubHelp logo

quocviet339 / ledger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brave/ledger

0.0 1.0 0.0 2.08 MB

Deprecated, please see

Home Page: https://github.com/brave-intl/bat-ledger

License: Mozilla Public License 2.0

Smarty 1.02% JavaScript 98.26% Shell 0.21% Dockerfile 0.51%

ledger's Introduction

NOTE: This repo is deprecated, please see bat-ledger

Brave Ledger

The Brave Ledger is a BTC-based micropayments system for users and publishers.

Note that travis-ci is not yet operational for this repository.

Initialization

Take a look at the files in the config/ directory. When the server starts, it will look file a file called config/config.{PROFILE}.js where {PROFILE} is $NODE_ENV (defaulting to "development").

Authentication is achieved via a GitHub OAuth application. Create a developer application with an authorization callback of the form https://{DOMAIN:PORT}/v1/login and update the login.clientId and login.clientSecret properties.

Authorization is achieved by verifying that the user is a member of a GitHub organization, i.e., https://github.com/orgs/{ORGANIZATION}/teams. Set the login.organization property to the name of the organization.

Now start the server with npm start and https://{DOMAIN:PORT}/v1/login which will start the authentication/authorization process. On success, you will be redirected to https://{DOMAIN:PORT}/documentation.

When the server starts, it will create (if necessary) a persona and a wallet registrar. You will need to create a 'contribution' surveyor, go to https://{DOMAIN:PORT}/documentation#!/v1/postV1SurveyorSurveyortype, setsurveyorType to 'contribution', and enter a body like this:

{ "adFree": { "fee": { "USD": 5.00 }, "votes": 30 } }

Setup

Clone the repo: git clone [email protected]:brave/ledger.git

Install dependencies with npm install

Install MongoDB: brew update && brew install mongodb

Start MongoDB. There are a variety of ways to do this, one option on a mac: brew tap homebrew/services && brew services start mongodb

Install Redis: brew update && brew install redis

Start Redis. There are a variety of ways to do this, one option on a mac: brew tap homebrew/services && brew services start redis

StandardJS

For linting we use StandardJS. It's recommended that you install the necessary IDE plugin. Since this repo uses ES7 features, you'll need a global install of both the standard and babel-eslint packages.

Configuration

For staging or production environments configuration variables are stored as environment preferences. See config/config.production.js for a list of these variables.

For local development you can copy config/config.development.js.tpl to config/config.development.js and define the local config variables.

Running the server

Use gulp to run the server in development. This also sets up watchers and will restart the server on a file change.

Proximo

Proximo is currently used as a proxy so we can make outbound BitGo requests using a static IP. Please define process.env.BITGO_USE_PROXY as appropriate.

ledger's People

Contributors

mrose17 avatar evq avatar quocviet339 avatar

Watchers

James Cloos 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.