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

@prosopo/flux

v2.2.3

Published

Tools for managing Flux deployment

Downloads

460

Readme

@prosopo/flux

This package contains a Command Line Interface (CLI) for interacting with the Flux cloud network.

CLI Usage

Authentication

Authenticate with Flux Main Site only

Use to generate the authentication for a Flux node for a specific app.This allows you to go straight to the RunOnFlux Login and login with the login phrase and signature.

# authenticate with the network for a specific app
npx flux auth
{
  nodeAPIURL: URL {
    href: 'https://api.runonflux.io/',
    origin: 'https://api.runonflux.io',
    ...
  },
  nodeLoginPhrase: 'asdlkadalkdalskdasldkadlkadlkaldkasdlk',
  nodeSignature: 'lkjasdlajsdlkajdlkajdlaskjdlaskjdlaskjdaslkd/9I='
}

Authenticate with a Node and an App

Use to generate the authentication for a Flux node for a specific app. This allows you to go straight to the node for the app you are working with and login with the login phrase and signature.

# authenticate with the network for a specific app
npx flux auth <app_name>
{
  nodeAPIURL: URL {
    # You can now visit this (using port 16126) to login with the login phrase and signature
    href: 'http://x.x.x.x:16127/',
    origin: 'http://x.x.x.x:16127',
    ...
  },
  nodeLoginPhrase: 'asdlkadalkdalskdasldkadlkadlkaldkasdlk',
  nodeSignature: 'lkjasdlajsdlkajdlkajdlaskjdlaskjdlaskjdaslkd/9I='
}

Authenticate with a Node and an App and a specific Node

Use to generate the authentication for a Flux node for a specific app on a specific node.

# authenticate with the network for a specific app at a specific ip
npx flux auth <app_name> --ip <node_ip=x.x.x.x:port>

Get Dapp Details

Get Dapps

Use this command to get a list of all your dapps that are running on the network.

# get all dapps
npx flux getDapps

Get Dapp

Full Details

Use this command to get the full details of a dapp running on the network.

# get details of a specific dapp
npx flux getDapp <app_name>

Nodes only

Use this command to get the IP addresses of the nodes that are running the app.

# get details of a specific dapp and show only the nodes
npx flux getDapp <app_name> --nodes

Redeploy

Soft redeploy

Restart the app on all nodes that are running the app.

# redeploy the app
npx flux redeploy <app_name>
...
ℹ apiUrl: http://x.x.x.x:16127/id/verifylogin                                                                                                                                   deploy.js 15:00:42
ℹ { status: 'success',                                                                                                                                                                deploy.js 15:00:42
  data: { message: '<app_name> queried for global soft redeploy' } }

Hard redeploy

Remove the container and restart the app on all nodes that are running the app.

# hard redeploy the app
npx flux redeploy <app_name> --hard
...
ℹ apiUrl: http://x.x.x.x:16127/id/verifylogin                                                                                                                                   deploy.js 15:00:42
ℹ { status: 'success',                                                                                                                                                                deploy.js 15:00:42
  data: { message: '<app_name> queried for global hard redeploy' } }

Logs

Get Logs

Use this command to get the logs of the app for all nodes.

# get logs of a specific dapp
npx flux getLogs <app_name>

┌─────────┬─────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │               url               │                                              logs                                              │
├─────────┼─────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┤
│    0    │ 'http://x.x.x.x:16126/' │  '{"status":"success","data":"... ...'  │
│    1    │               ''                │ "d-0-...\\nApp running on port 9232\\n * Serving Flask app 'app'" │
│    2    │               ''                │                                  '\\n * Debug mode: off\\n"}'                                  │
│    3    │   'http://x.x.x.x:16186/'   │  '{"status":"success","data":"... ...'  │
│    4    │               ''                │ "d-0-...\\nApp running on port 9232\\n * Serving Flask app 'app'" │
│    5    │               ''                │                                  '\\n * Debug mode: off\\n"}'                                  │
│    6    │  'http://x.x.x.x:16126/'   │  '{"status":"success","data":"... ...'  │
│    7    │               ''                │ "d-0-...\\nApp running on port 9232\\n * Serving Flask app 'app'" │
│    8    │               ''                │                                  '\\n * Debug mode: off\\n"}'                                  │
│    9    │   'http://x.x.x.x:16146/'   │ '<html><body><h2>Flux Node is not confirmed on the network</h2>\nIt may take a few minutes f'  │
│   10    │               ''                │      'or your Flux Node to be available over domain.<br>\nEU-NODES-1-1\n</body></html>\n'      │
└─────────┴─────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┘

Get Logs from a specific Node

Use this command to get the logs of the app from a specific node.

# get logs of a specific dapp at a specific ip
npx flux getLogs <app_name> --ip <node_ip=x.x.x.x:port>

Save the logs to a file

Use this command to get the logs of the app from a specific node.

# get logs of a specific dapp and save them to a file. The log format will be `host | log` with the logs separated by a newline
npx flux getLogs <app_name> --file <file_name>

Sign a Message

Use this command to sign a message with the private key of the node.

# sign a message
> npx flux sign <msg>
CLI:info {
  _: [ 'sign' ],
  '$0': 'node_modules/.bin/flux',
  msg: '<msg>'
}
CLI:info Public Key: 15...b
CLI:info Base64 Signature: H...=

Format an env file

Use this command to format an env file in the array format needed for updating in FluxOS. The output will be printed to the terminal.

# format the env file
> npx flux formatenv .env
CLI:info ["FOO=bar","BAR=BLAH"]

You can write the output to a file by using the --write flag.

# format the env file and write the output to a file
> npx flux formatenv .env --write <file_name>