GithubHelp home page GithubHelp logo

xojala / cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 3for/cli

0.0 1.0 0.0 22 KB

Point Token Command Line Interface (CLI) For Administering Rewards

License: Eclipse Public License 2.0

JavaScript 100.00%

cli's Introduction

Point Token Command Line Interface (CLI)

This repo contains a Node-based command line interface for interacting with the POINT Token System. The POINT Token System is a multi-tenant, decentralized loyalty and rewards system that runs on the Ethereum Blockchain.

To learn more about the POINT Token System, go to http://www.pointtoken.io. The website has a white paper which thoroughly outlines how the system works.

Installation

Clone the repo. Install the dependencies as follows:

npm install

Configuration

All configuration properties can be found and set in config.js. This includes which Ethereum network you are connecting to and what address you are sending transactions as. If you want to use the CLI to write to the Ethereum blockchain, you will need to specify an address and a private key. Write-able transactions do require gas. If you only want to query the blockchain, you don't have to provide an address or private key.

Usage

All commands can be called as follows:

node index.js [command] [arguments]

The following commands are supported:

addAward <awardId>

If you have been provisioned as an AWARDER, you can use this command to add an AWARD to the system. AWARDS are unsigned integers. Once you have claimed that integer, it is owned by the address that claimed it forever.

Returns a transaction ID. Requires gas.

getAward <awardId>

You can use this command to determine the address that owns an AWARD. Useful when adding awards so that you don't burn gas trying to claim an AWARD id that is already in use.

Returns the address that owns the AWARD. Does not require gas.

isAwarder <address>

Pass an Ethereum address. Returns a boolean indicating if that address has the privilege to issue AWARDS in the system. Does not require gas.

getAchievements <address>

Pass an Ethereum address to determine which AWARDS an address has earned. Returns the AWARD ID of each achievement earned. Does not require gas.

balanceOf <address>

Pass an Ethereum address to determine the number of POINT tokens earned by this address. Does not require gas.

awardAchievement <address> <awardId> <amount> <checkIfEarned>

Use this command to award an achievement. This can only be issued by an address that has been provisioned as an AWARDER. If the AWARDER also wants to issue POINT tokens, they can be issued by passing the parameter. If you want to issue an AWARD without issuing any POINTS, pass zero. If you want the command to fail if the person has already earned the achievement, pass true for the command. Returns a transaction ID. Requires gas.

cli's People

Contributors

pointtoken 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.