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

nahmii-cli

v1.5.0

Published

CLI interface for using the nahmii by hubii protocol

Downloads

87

Readme

NAHMII BY HUBII CLI

About the CLI

This is a command line interface that aims to make usage of the hubii nahmii APIs as easy and convenient as possible, while maintaining the flexibility of the platform.

About nahmii

nahmii is hubii's scaling solution for the Ethereum block chain. It is a hybrid centralized/decentralized solution that enables instant (micro-) payments, trading and trustless settlements.

About hubii

See www.hubii.com for more information.

Prerequisites

  • To use this software you need a modern version of NodeJS and NPM. We recommend having the current LTS version (v8.x) installed, or later, and updating NPM to the latest available version. You will also need Python and a C++ compiler installed. For a Windows 10 guide, see here: https://blog.risingstack.com/node-js-windows-10-tutorial/
  • You will also need an API key for access to hubii's APIs.
  • An Ethereum wallet stored as an UTC/keystore file, and its passphrase.

Installation

To install and make the command part of your path:

npm install -g nahmii-cli

Configuration

To use the nahmii CLI tool you need to first create a configuration in your home folder as .nahmii/config.yaml

Use the init command to create a new config file:

nahmii init

The config.yaml file is a YAML file where you will need to specify the following properties:

  • apiRoot - The root domain for hubii's APIs.
  • appId - The application ID created in hubii's identity server.
  • appSecret - The matching secret for the application ID.
  • wallet:
    • address - The address of your wallet.
    • secret - The pass-phrase for your wallet's UTC file.

The CLI tool will give a warning in the shell if the configuration file is accessible by anyone besides the owner. To keep your wallet and API access secure, make sure only you have access to the config file.

Example file:

apiRoot: api2.dev.hubii.net
appId: 123456789012345678901234
appSecret: ********************
wallet:
    address: 1234567890123456789012345678901234567890
    secret: ********************

The UTC file is expected to be found in ~/.nahmii/keystore.

Settlement and Withdrawal

For withdrawing the nahmii off-chain balances back to the base layer, it will have to go through the settlement processes. The processes will be as following:

  1. Start the settlements using the command settle with the amount and currency. This will initiate a settlement dispute period, which would last 5 minutes on Ropsten.
  2. Once the settlement period ended, you will need to stage the qualified settlements by using command stage to update the staged balance, which is the maximum available amount for withdrawal.
  3. After the staged balance is successfully updated in the second step, the next is to run the command withdraw to transfer a certain amount for a currency from the nahmii contracts to your wallet.

For details of the settlement and withdrawal commands, please refer to the example below or the help messages for the commands.

Usage

To show the built-in help:

nahmii --help

or to show help for a specific sub-command:

nahmii <command> --help

Initialize configuration

This will create a config folder and file if it doesnt already exist:

nahmii init

To recreate and discard previous settings add the --force flag:

nahmii init --force

Check configuration

nahmii configuration

Deposit funds

Deposit on-chain funds to be available in hubii nahmii:

nahmii deposit 1 ETH

nahmii deposit 1 TT1

Results are printed as JSON. It is recommended to pipe the result through jq to get a pretty output in the shell.

Show balance

Shows your balance in hubii nahmii:

nahmii show balance

Results are printed as JSON. It is recommended to pipe the result through jq to get a pretty output in the shell.

Make a payment

nahmii pay 100 TT1 to 0a24740dcb4ba8fb8469ef4cfe22eeedcf069076

Results are printed as JSON. It is recommended to pipe the result through jq to get a pretty output in the shell.

Show pending payments

nahmii show payments

Results are printed as JSON. It is recommended to pipe the result through jq to get a pretty output in the shell.

Show executed payments

nahmii show receipts

Results are printed as JSON. It is recommended to pipe the result through jq to get a pretty output in the shell.

Get a list of supported currencies

nahmii show tokens

Results are printed as JSON. It is recommended to pipe the result through jq to get a pretty output in the shell.

Start settlements

This will start necessary settlements for the intended stage amount 1 in ETH currency:

nahmii settle 1 ETH

Stage qualified settlements

This will update staged balance(max withdrawal amount) according to the qualified settlements:

nahmii stage ETH

Unstage balance

This will convert an amount of staged balance back to nahmii off-chain balance:

nahmii unstage 1 ETH

Withdraw

This will withdraw 1 ETH from staged balance to base layer:

nahmii withdraw 1 ETH