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

ironfish

v2.9.0

Published

CLI for running and interacting with an Iron Fish node

Downloads

279

Readme

codecov

The main entry point for an Iron Fish CLI that is capable of mining blocks and spending notes. It's created using the oclif CLI framework

Starting the CLI

If you're still in the ironfish directory in your terminal window, run cd ironfish-cli.

  • Otherwise, you'll get a "Command not found" error.

Next, start the CLI with this command:

  • yarn start

Usage Scenarios

Starting a single node

Run this command in the terminal:

  • yarn start start

Interact with the node in a new terminal window:

  • yarn start status
    • Show your node's status
  • yarn start wallet:balance
    • Show the balance of your account, including $IRON from blocks you've mined
    • Tentative balance includes all known transactions. Spending balance includes only transactions on blocks on the main chain
  • yarn start faucet
    • Request a small amount of $IRON for testing payments
  • yarn start wallet:send
    • Send $IRON to another account
  • yarn start wallet:transactions [account]
    • Display transactions from and to your account

Start a node and start mining

Run these commands in two different terminals:

  • yarn start start

    • Defaults to port 9033
    • This is equivalent to yarn start start -d default -p 9033
  • yarn start miners:start

    • The default thread count is 1.

    • You can increase the number of threads by adding --threads <number>. Use -1 to autodetect threads based on your CPU cores.

    • Examples:

      • yarn start miners:start --threads 4
        • To use 4 physical CPU cores
      • yarn start miners:start --threads -1
        • To use all the cores on your CPU
        • This may make your machine unresponsive or perform worse than a lesser number.
        • You may want to start with a low thread count and increase it until your hashrate stops increasing.
    • Note: Hyperthreading (2 miner threads per CPU core) is not fully optimized yet

You should see messages in the second terminal indicating that the miner is running:

  • Starting to mine with 8 threads
  • Mining block 6261 on request 1264... \ 1105974 H/s
    • The H/s number corresponds to the hashrate power of your machine with the given number of mining threads.
    • Performance reference: 8-core 3.8+ GHz AMD Ryzen 7 4700G with 8 threads gave the above 1.1 M H/s.

When a block is mined, you will see a status line in the node's terminal (the first terminal):

  • Successfully mined block xxx (6543) has 1 transactions
  • Mining 1 block can take several hours or days, depending on your machine's hashrate.
  • Your miner may display Submitting hash for block, but this does not necessarily mean you've mined a block. The block still needs to be created, validated, and checked to be heavier by the node before it can be added to the main chain.
    • In these cases, your node will display "Discarding block" or "Failed to add block".

Multiple Nodes

Run these commands in two different terminals:

  • yarn start start -d default -p 9033
  • yarn start start -d client -p 9034 -b ws://localhost:9033

You should see connection messages indicating that the two nodes are talking to each other.

Multiple Nodes with Miners

Node 1

# in tab 1
yarn start start

# in tab 2
yarn start miners:start

Node 2

# in tab 3
yarn start start --datadir ~/.ironfish2 --port 9034 --bootstrap ws://localhost:9033

# in tab 4
yarn start miners:start --datadir ~/.ironfish2

Running a Development Node

# in tab 1
yarn start start --networkId=2 --datadir ~/.ironfish-dev 

# in tab 2
yarn start miners:start --datadir ~/.ironfish-dev

# in tab 3, to check the status of the node
yarn start status --datadir ~/.ironfish-dev 

# in tab 3, to check the wallet balance
yarn start wallet:balance --datadir ~/.ironfish-dev 

More information on local mining and testing

Documentation

CLI Commands