GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SergiySW/RaiBlocksJS: [not in active development] JavaScript functions for RaiBlocks node/wallet management via RPC commands

BranchesTags
Open more actions menu

Latest commit

 

History

106 Commits
106 Commits

Folders and files

NameName
Last commit message
Last commit date
scripts
scripts
 
 
tests
tests
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
bignumber.min.js
bignumber.min.js
 
 
blake2b.js
blake2b.js
 
 
nacl.js
nacl.js
 
 
rai.community.js
rai.community.js
 
 
rai.extended.js
rai.extended.js
 
 
rai.pow.js
rai.pow.js
 
 
rai.rpc.js
rai.rpc.js
 
 
sample.css
sample.css
 
 
sample.html
sample.html
 
 

Repository files navigation

RaiBlocksJS

JavaScript functions for RaiBlocks node/wallet management via RPC commands https://github.com/clemahieu/raiblocks/wiki/RPC-protocol

Optimized for 7.9.0 version
If your node/wallet version < 7.6.0 use file versions uploaded before 15/01/2017

  • rai.rpc.js contains very basic RPC request tool + all RPC commands as JS functions
  • rai.core.js contains all RPC commands as JS functions merged with rai.rpc.js
  • rai.extended.js contains some extended functions not available in current RPC implementation
  • rai.community.js contains requests to RaiBlocks.net website
  • sample.html RaiBlocksJS tech demo wallet skeleton

Usage sample

concept

var [connection_name] = new Rai([host]); // create connection
var answer_1 = [connection_name].[action_1]([parameters_1]); // RPC action_1 with parameters_1
var answer_2 = [connection_name].[action_2]([parameters_2]); // RPC action_2 with parameters_2

sample 1

var rai = new Rai(); // default connection to localhost
var blocks = rai.block_count(); // receive block count
var weight = rai.account_weight('xrb_35jjmmmh81kydepzeuf9oec8hzkay7msr6yxagzxpcht7thwa5bus5tomgz9');
// recieve weight of official faucet account

sample 2

var rai_example = new Rai('https://example.tld:5867'); // connection to sample host with HTTPS and different port
var generate = rai_example.work_generate('A703C82F08B1F2A61BDC3254D992025FE9D9566BD9FFDE19535D781BFE79BF92');
// generates work for block
var weight = rai_example.chain('A703C82F08B1F2A61BDC3254D992025FE9D9566BD9FFDE19535D781BFE79BF92', 64);
// retrieve chain of block (up to 64 blocks)

Currrent limitations

  • Impossible to retrieve wallet id via RPC. Replace var wallet in sample.html

Show RPC improvenment progress here: nanocurrency/nano-node#29

External libraries used

  • BigNumber.js https://github.com/MikeMcl/bignumber.js
  • BLAKE.js https://github.com/dcposch/blakejs
  • jQuery https://github.com/jquery/jquery
  • NaCl.js (jaimehgb fork) https://github.com/jaimehgb/tweetnacl-js

About

[not in active development] JavaScript functions for RaiBlocks node/wallet management via RPC commands

Topics

nanocurrencyraiblocksrpc-commands

Resources

Readme
BSD-3-Clause license
Activity

Stars

78 stars

Watchers

8 watching

Forks

18 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.