npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

indy-request

v0.1.0

Published

Make requests to Indy (i.e. Sovrin) nodes

Downloads

14

Readme

indy-request

build status

Make requests to Indy (i.e. Sovrin) nodes using node.js

let IndyReq = require('indy-request')

let node = IndyReq({
  genesisTxn: '{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"127.0.0.1","client_port":9702,"node_ip":"127.0.0.1","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"}'
})

let response = await node.send({
  operation: {
    type: IndyReq.type.GET_TXN + '',
    ledgerId: 1,
    data: 9
  },
  identifier: 'MSjKTWkPLtYoPEaTF1TUDb',
  protocolVersion: 2
})

console.log(response)

API

node = IndyReq(conf)

  • conf.host the host string i.e. 10.0.0.2
  • conf.port the port of the indy node you want to connect to
  • conf.serverKey the Buffer of the node's curve25519 key
  • conf.timeout (optional) how long to wait for responses in ms. Default is 1min.
  • conf.genesisTxn instead of host+port+serverKey you can simply pass a line from the genesis transaction to the node you wish to connect to.

p = node.send(data)

Send a request to the server. This will set a reqId for you and track it. This returns a promise that will resolve when the response is recieved.

node.ping()

Send a ping to the indy node

node.close()

This closes the zeromq socket. Any pending requests that have not yet been resolved will be rejected with a 'Closed' error.

node.on('error', function(err){})

When an error not tied to any known request occurs.

node.on('pong', function(){})

When a pong is recieved from the indy node.

node.on('close', function(){})

When node.close() is called.

License

MIT