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

@iota-pico/api-examples-nodejs

v1.0.0

Published

IOTA Pico Framework Examples for NodeJS using TypeScript

Downloads

3

Readme

GitHub license Build Status

IOTA Pico Framework Examples for NodeJS in TypeScript

Example code for using IOTA Pico Framework with NodeJS written in TypeScript.

Installation

npm install @iota-pico/api-examples-nodejs

Running

You can run the examples using the CLI:

node ./bin/ipent

Usage

Usage: ipent [options] [command]


  Options:

    --neighbors <comma separated uris>       Neighbors to add/remove from your node e.g. udp://1.2.3.4:14600
    --bundles <comma separated hashes>       Hashes to search for in bundles
    --addresses <comma separated hashes>     Hashes to search for or get balances in addresses
    --tags <comma separated hashes>          Hashes to search for in tags
    --approvees <comma separated hashes>     Hashes to search for which confirm specified transaction
    --hashes <comma separated hashes>        Hashes to return the trytes for
    --transactions <comma separated hashes>  Hashes to get inclusion states for
    --tips <comma separated hashes>          Hashes to get inclusion states for
    --threshold <int>                        Confirmation threshold
    --depth <int>                            Number of bundles to go back to determine the transactions for approval
    --trunkTransaction <hash>                Trunk transaction to approve
    --branchTransaction <hash>               Branch transaction to approve
    --minWeightMagnitude <int>               Proof of Work intensity. Minimum value is 18
    --trytes <comma separates trytes>        List of trytes (raw transaction data) to attach/broadcast/store in the tangle
    --tails <comma separated hashes>         Hashes for tails to check consistency
    -V, --version                            output the version number
    -h, --help                               output usage information


  Commands:

    getNodeInfo                         Returns information about your node.
    getNeighbors                        Returns the set of neighbors you are connected with.
    addNeighbors [options]              Add neighbors to your node.
    removeNeighbors [options]           Remove neighbors from your node.
    getTips                             Get the list of tips from the node.
    findTransactions [options]          Find the transactions which match the specified input.
    getTrytes [options]                 Get the trytes for the hashes.
    getInclusionStates [options]        Get the inclusion states of a set of transactions.
    getBalances [options]               Get the balances of a set of transactions.
    getTransactionsToApprove [options]  Tip selection which returns trunkTransaction and branchTransaction.
    attachToTangle [options]            Attaches the specified transactions (trytes) to the Tangle by doing Proof of Work.
    interruptAttachingToTangle          Interrupts and completely aborts the attachToTangle process.
    broadcastTransactions [options]     Broadcast a list of transactions to all neighbors.
    storeTransactions [options]         Store transactions into the local storage.
    getMissingTransactions              Get transactions with missing references.
    checkConsistency [options]          Check the consistency of tail hashes.
    wereAddressesSpentFrom [options]    Have the requested addresses been spent from already.

Configuration

If you want to modify the node that is used to service the examples please modify the config file config/networkConfig.json.

To connect to a node use:

{
    "protocol": "https",
    "host": "nodes.thetangle.org",
    "port": 443
}

Library

The IOTA Pico Framework is a multi-layered set of object oriented JavaScript libraries for use with the IOTA tangle.

If you don't want to use the layered versions of the libraries consider using the ready bundled versions:

Each layer is fully abstracted allowing you to replace components with your own implementations very easily.

The layered libraries are written in TypeScript so are all strongly typed. The modules are generated as ES6 so you may need to transpile them when including them for use in older JavaScript eco-systems. The code will run without transpilation in all modern browsers and when used by NodeJs.

Contributing

Contributions are always welcome to the project. Feel free to raise issues, create pull requests or just make suggestions.

Authors

Come and find us on the IOTA Discord development channels

Donations

IOTA donations are always welcome :smile:

pico@tngl-me

License

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