snet-daemon

module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT

README

snet-daemon

CircleCI

SingularityNET Daemon The daemon is the adapter with which an otherwise SingularityNET-unaware service implementation can be exposed to the SingularityNET platform. It is designed to be deployed as a sidecar proxy alongside the service on a given host. The daemon abstracts the blockchain components away from the clients. The SNET Daemon interacts with the Multi Party Escrow to facilitate authorization and payment for services and acts as a passthrough for making API calls to the service.The daemon is the endpoint a client will submit requests to, and they are then passed to the service after validation by the daemon.

Channel Claim command

Gets the latest channel state of the Channel updated in ETCD by the daemons of the same group and then increments the nonce of the channel. It then sends and ON-Chain transaction to claim funds.The daemons continue their work independently without any confirmation from the treasurer on the blockchain.

Development

These instructions are intended to facilitate the development and testing of SingularityNET Daemon. Users interested in deploying SingularityNET services using SingularityNET Daemon should install the appropriate binary as released.

Prerequisites
Installing
  • Clone the git repository
$ git clone git@github.com:singnet/snet-daemon.git
$ cd snet-daemon
  • Install development/test dependencies
$ ./scripts/install
  • Build snet-daemon (on Linux amd64 platform)
$ ./scripts/build linux amd64
  • Generate default config file snet-daemon (on Linux amd64 platform)
$ ./build/snetd-linux-amd64 init 

**** Please update the registry address in daemon config based on the test network used

Run Deamon
$ ../build/snetd-linux-amd64
Main commands
  • Start snet-daemon
$ ./snetd-linux-amd64
  • Claim funds from the channel

    Refer to the link below on an end to end Example of MPE

    At the moment treasurer server is a part of snet-daemon command line interface.

$ ./snetd-linux-amd64 claim --channel-id 0

  • Full list of commands, use --help to get more information.
$ ./build/snetd-linux-amd64 --help
Usage:
  snetd [flags]
  snetd [command]

Available Commands:
  claim       Claim money from payment channel
  help        Help about any command
  init        Write default configuration to file
  list        List channels, claims in progress, etc
  serve       Is the default option which starts the Daemon.

Flags:
  -c, --config string   config file (default "snetd.config.json")
  -h, --help            help for snetd

Use "snetd [command] --help" for more information about a command.
  • Unit Testing
$ ./scripts/test
Configuration

Release

Precompiled binaries are published with each release.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Directories

Path Synopsis
resources
cmd

Jump to

Keyboard shortcuts

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