Giter Club home page Giter Club logo

nodejs-sia's Introduction

Sia Logo Nodejs Wrapper

Build Status js-standard-style devDependency Status dependencies Status license:mit

A Highly Efficient Decentralized Storage Network

This is a Nodejs wrapper for Sia. Use it in your apps to easily interact with the Sia storage network via function calls instead of manual http requests.

Prerequisites

Installation

Run the following to save sia.js in your project's node_modules folder

npm install -S sia.js

Usage

var Siad = require('sia.js')
Siad.call('/daemon/version', function(err, result) {
  console.log(err, result)
})

Should log something like:

null { version:
  '0.4.8' }

The call object passed as the first argument into call() are funneled directly into the request library, so checkout their options to see how to access the full functionality of Sia's API

Siad.call({
  url: '/consensus/block',
  method: 'GET',
  qs: {
    height: 0
  }
}, function(err,result) {
  console.log(err,result)
});

Should log something like:

null { block:
 { parentid: '0000000000000000000000000000000000000000000000000000000000000000',
   nonce: [ 0, 0, 0, 0, 0, 0, 0, 0 ],
   timestamp: 1433600000,
   minerpayouts: null,
   transactions: [ [Object] ] } }

nodejs-sia's People

Contributors

bitspill avatar davidvorick avatar lukechampine avatar mingling94 avatar

Watchers

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