1.0.0-sgc-beta-26 • Published 5 years ago

sgcweb3 v1.0.0-sgc-beta-26

Weekly downloads
3
License
LGPL-3.0
Repository
github
Last release
5 years ago

PREVIEW RELEASE This is a copy of original web3, changed as per SGC requirements!

SGCweb3.js - SGC JavaScript API

You need to run a local or remote SGC node to use this library.

Installation

Node

npm install sgcweb3@latest

Usage

// in node.js
var SGCWeb3 = require('sgcweb3');

var SGCweb3 = new SGCWeb3('ws://localhost:8546');
console.log(SGCweb3);

Additionally you can set a provider using SGCweb3.providers.HttpProvider()

const SGCWeb3 = require('sgcweb3');
const SGCweb3 = new SGCWeb3(new SGCWeb3.providers.HttpProvider('http://13.229.152.61:8501'));

There you go, now you can use it:

SGCweb3.eth.getAccounts()
.then(console.log);

Building

Requirements

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install lerna bootstrap