Public | Automated Build

Last pushed: 2 years ago
Short Description
We're building a tokenized reputation protocol using http://getbitwrap.com
Full Description

Karmanom.com

We're building a reputation protocol using http://getbitwrap.com

View the cucumber specs here: https://github.com/bitwrap/bitwrap-dsl/tree/master/features.

Jruby depricated

This project has been ported to Node.js and moved: https://github.com/karmanom/karmanom-ui

Though the bitwrap-io Jruby lib will no longer be maintained, this repo still contains a valid example.

Following the examples below It should be straightforward to express a bitwrap machine in any language.

Message Json-schema

You can see the json-schema definition used to validate message payloads here:

{
  'type' => 'object',
  'required' => ['signal', 'addresses', 'payload'],
  'properties' => {

    'signal' => { 'type' => 'object',
                  'required' => [ 'schema', 'action' ],
                      'properties' => {
                        'schema' => { 'type' => 'string' },
                        'action' => { 'type' => 'string' },
                        'role' => { 'type' => 'integer' } }},

    'addresses' =>  { 'type' => 'object',
                      'required' => [ 'sender' ],
                      'properties' => {
                        'sender' => { 'type' => 'string' },
                        'target' => { 'type' => 'string' },
                        'source' => { 'type' => 'string' } }},
    'payload' => {}
  }
}

Schema file

This 'wrapfile' defines all valid roles, rules, and places of a bitwrap machine.

{
  "description": "a tokenized reputation network",
  "observers": [
    "karmanom/hooks"
  ],
  "tokens": {
    "BIT": {
      "color": "rgb(201,0,0)",
      "x": 50,
      "y": 250,
      "description": "control-token, system credits ad-hoc to block/permit transactations (expire after each transfer)"
    },
    "NOM": {
      "color": "rgb(0,0,201)",
      "x": 250,
      "y": 175,
      "description": "soft-token - byproduct of hard-token transfers, (used as counters or control roles)"
    },
    "COIN": {
      "color": "rgb(0,201,0)",
      "x": 350,
      "y": 175,
      "description": "hard-token - represents currency, system credits/debits on deposit/withdraw (transferrd by any user)"
    }
  },
  "roles": [
    "subject",
    "user",
    "system"
  ],
  "places": {
    "subject": {
      "token": "BIT",
      "x": 100,
      "y": 125
    },
    "user": {
      "token": "BIT",
      "x": 100,
      "y": 225
    },
    "system": {
      "token": "BIT",
      "x": 100,
      "y": 350
    },
    "positive": {
      "token": "NOM",
      "x": 375,
      "y": 225
    },
    "negative": {
      "token": "NOM",
      "x": 375,
      "y": 275
    },
    "recall_votes": {
      "token": "NOM",
      "x": 375,
      "y": 325
    },
    "bank": {
      "token": "COIN",
      "x": 225,
      "y": 225
    },
    "account": {
      "token": "COIN",
      "x": 200,
      "y": 275
    },
    "wallet": {
      "token": "COIN",
      "x": 225,
      "y": 325
    }
  },
  "vars": {
    "target": {
      "description": "message destination"
    },
    "sender": {
      "description": "message origin"
    },
    "system": {
      "description": "control user"
    }
  },
  "transitions": {
    "refund": {
      "role": "subject",
      "x": 150,
      "y": 100,
      "transact": [
        [
          "debit",
          {
            "target": "recall_votes"
          }
        ],
        [
          "transfer",
          {
            "target": "account",
            "sender": "wallet"
          }
        ]
      ]
    },
    "recall": {
      "role": "subject",
      "x": 150,
      "y": 125,
      "transact": [
        [
          "debit",
          {
            "target": "recall_votes"
          }
        ],
        [
          "debit",
          {
            "target": "negative"
          }
        ],
        [
          "transfer",
          {
            "target": "account",
            "sender": "wallet"
          }
        ]
      ]
    },
    "pay_user": {
      "role": "subject",
      "x": 150,
      "y": 150,
      "transact": [
        [
          "transfer",
          {
            "sender": "account",
            "target": "wallet"
          }
        ]
      ]
    },
    "negative_tip": {
      "role": "user",
      "x": 150,
      "y": 175,
      "transact": [
        [
          "credit",
          {
            "target": "negative"
          }
        ],
        [
          "transfer",
          {
            "sender": "wallet",
            "target": "account"
          }
        ]
      ]
    },
    "negative_donate": {
      "role": "user",
      "x": 150,
      "y": 200,
      "transact": [
        [
          "credit",
          {
            "target": "negative"
          }
        ],
        [
          "transfer",
          {
            "sender": "wallet",
            "target": "bank"
          }
        ]
      ]
    },
    "positive_tip": {
      "role": "user",
      "x": 150,
      "y": 225,
      "transact": [
        [
          "credit",
          {
            "target": "positive"
          }
        ],
        [
          "transfer",
          {
            "sender": "wallet",
            "target": "account"
          }
        ]
      ]
    },
    "positive_donate": {
      "role": "user",
      "x": 150,
      "y": 250,
      "transact": [
        [
          "credit",
          {
            "target": "positive"
          }
        ],
        [
          "transfer",
          {
            "sender": "wallet",
            "target": "bank"
          }
        ]
      ]
    },
    "vote": {
      "role": "user",
      "x": 150,
      "y": 275,
      "transact": [
        [
          "debit",
          {
            "target": "recall_votes"
          }
        ],
        [
          "transfer",
          {
            "target": "account",
            "sender": "wallet"
          }
        ]
      ]
    },
    "deposit": {
      "role": "system",
      "x": 150,
      "y": 300,
      "transact": [
        [
          "transfer",
          {
            "system": "account",
            "target": "wallet"
          }
        ]
      ]
    },
    "deposit_donation": {
      "role": "system",
      "x": 150,
      "y": 325,
      "transact": [
        [
          "transfer",
          {
            "target": "bank",
            "system": "account"
          }
        ]
      ]
    },
    "deposit_system": {
      "role": "system",
      "x": 150,
      "y": 350,
      "transact": [
        [
          "credit",
          {
            "system": "account"
          }
        ]
      ]
    },
    "withdraw": {
      "role": "system",
      "x": 150,
      "y": 375,
      "transact": [
        [
          "transfer",
          {
            "target": "wallet",
            "system": "account"
          }
        ]
      ]
    },
    "withdraw_system": {
      "role": "system",
      "x": 150,
      "y": 400,
      "transact": [
        [
          "debit",
          {
            "system": "account"
          }
        ]
      ]
    }
  }
}
Docker Pull Command
Owner
stackdump
Source Repository