rooot-node-lib

command module
v1.7.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

README

rooot-node-lib

GitHub tag (latest by date) GitHub go.mod Go version GitHub last commit GitHub issues

This library holds the common modules used by the Rooot™ system in Golang. It's specially suited for applications involving the node.

Usage
$ go get github.com/edgewhere/rooot-node-lib

For example, to manipulate transactions, you may import the Transaction model:

import "github.com/edgewhere/rooot-node-lib/models/transaction"

var tx transaction.Transaction

As a reminder, the following presents the general model of a Transaction of any kind in Rooot™:

{
  "transactionId": "",
  "lastBlockId": "",
  "subchain": {
    "initialTransactionId": "",
    "lastStateTransactionId": "",
    "finalTransactionId": ""
  },
  "timestamp": 0,
  "contract": {
    "type": "",
    "channel": "",
    "features": {
      "start": 0,
      "end": 0,
      "maxUse": -1,
      "freq": {
        "firstPeriodId": 0,
        "cycleLength": 0,
        "usePerCycle": 0,
        "currentPeriodId": 0
      },
      "dest": {
        "purpose": ["0xffff"],
        "scope": []
      }
    },
    "signatures": {
      "beneficiary": "",
      "emitter": ""
    }
  },
  "identification": {
    "rand": 0,
    "beneficiary": {
      "id": "",
      "checker": "",
      "depositary": ""
    },
    "emitter": {
      "id": "",
      "checker": "",
      "depositary": ""
    },
    "footprint": ""
  },
  "script": "",
  "oblivionCode": ""
}

And the following the general model of a Block in Rooot™:

{
  "blockId": "",
  "header": {
    "lastMiners": {
      "onPeriod": 0,
      "valid": [],
      "invalid": []
    },
    "newTransactions": [],
    "signature": "",
    "publicKey": "",
    "nonce": ""
  },
  "previousBlockId": "",
  "timestamp": 0,
  "periodId": 0,
  "transactions": [],
  "oblivionHash": ""
}

As of the latest version, there are five types of Transaction: (chronogically) "opt-in", "state", "opt-out", "oblivion" and "oblivion-ar".

Browser library

You might also want to check out the browser library developed by Edgewhere in TypeScript on NPM: rooot-browser-lib. It's working hand in hand with this Go library to allow for building and writing transactions to the Rooot™ blockchain.

License

The use of the Rooot™ node API is subject to fees for commercial purpose. Please contact us to get further information. In any case, the use of this library is subject to the respect of the GNU AGPL-3.0 license.


© 2019-2021 Edgewhere SAS. All rights reserved.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL