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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ipfs-swarm-cli

v1.0.8

Published

A comprehensive CLI tool for managing private IPFS swarms. This tool simplifies the process of setting up and maintaining IPFS nodes in a private swarm configuration.

Downloads

14

Readme

IPFS Swarm CLI

A comprehensive CLI tool for managing private IPFS swarms. This tool simplifies the process of setting up and maintaining IPFS nodes in a private swarm configuration.

Table of Contents

Installation

Global Installation

To install the package globally using npm:

npm install -g ipfs-swarm-cli

Local Installation

To install the package locally:

npm install ipfs-swarm-cli

Usage

Commands

The CLI supports the following commands:

ipfs-swarm-cli [command]

Commands List:

  • init: Initialize IPFS swarm node
  • start: Start IPFS daemon
  • stop: Stop IPFS daemon
  • status: Show swarm status
  • info: Show configuration and connection info
  • test: Test IPFS functionality
  • clean: Clean all IPFS data and configuration

Options

Init Command Options:

ipfs-swarm-cli init [options]
  • --bootstrap: Set up as bootstrap node
  • --regular: Set up as regular node
  • --swarm-key <path>: Path to existing swarm key file
  • --bootstrap-addr <addr>: Bootstrap node multiaddr
  • --port <port>: Base port number (default: 4001)

Configuration

The tool creates a configuration file at ~/.ipfs-swarm/config.json with the following structure:

{
  "nodeType": "bootstrap", // or "regular"
  "swarmKey": "<path-to-swarm-key>",
  "basePort": 4001,
  "bootstrapMultiaddr": "<multiaddr>",
  "nodeId": "<node-id>",
  "lastStarted": "<timestamp>"
}

Setup Process

Bootstrap Node

  1. Initialize the bootstrap node:
    ipfs-swarm-cli init --bootstrap
  2. This will generate a swarm key at ~/.ipfs-swarm/swarm.key
  3. Share the swarm key with other nodes
  4. Start the daemon:
    ipfs-swarm-cli start

Regular Node

  1. Initialize the regular node:
    ipfs-swarm-cli init --regular --swarm-key <path-to-swarm-key> --bootstrap-addr <bootstrap-multiaddr>
  2. Start the daemon:
    ipfs-swarm-cli start

Swarm Key Management

Generating Swarm Key

The swarm key is automatically generated when initializing a bootstrap node. You can also generate it manually using:

ipfs-swarm-cli init --bootstrap

Sharing Swarm Key

  1. Copy the swarm key file from the bootstrap node:
    scp ~/.ipfs-swarm/swarm.key user@remote:/path/to/swarm.key
  2. Use the swarm key when initializing regular nodes:
    ipfs-swarm-cli init --regular --swarm-key /path/to/swarm.key --bootstrap-addr <bootstrap-multiaddr>

Troubleshooting

Common Issues

1. Port Conflicts

  • Symptom: Daemon fails to start with port already in use
  • Solution:
    1. Check if port is in use:
      netstat -tuln | grep <port>
    2. Update configuration to use different port:
      ipfs-swarm-cli init --port <new-port>

2. Connection Issues

  • Symptom: Nodes cannot connect to each other
  • Solution:
    1. Verify bootstrap multiaddr is correct
    2. Check firewall rules
    3. Ensure Tailscale is running (if used)

3. Daemon Not Starting

  • Symptom: Daemon fails to start
  • Solution:
    1. Check logs:
      journalctl -u ipfs -f
    2. Verify IPFS installation
    3. Clean up and retry:
      ipfs-swarm-cli clean && ipfs-swarm-cli init

Debugging

  1. Enable verbose logging:
    DEBUG=* ipfs-swarm-cli <command>
  2. Check IPFS configuration:
    ipfs config show

Advanced Topics

Tailscale Integration

  1. Install Tailscale:
    ipfs-swarm-cli init --regular --install-tailscale
  2. Use Tailscale addresses for bootstrap nodes

Custom Ports

  1. Configure custom base port:
    ipfs-swarm-cli init --port 4002
  2. Update firewall rules to allow traffic on new port

Security Considerations

  1. Swarm Key Security:

    • Never share the swarm key publicly
    • Store swarm key securely
    • Set proper permissions:
      chmod 600 ~/.ipfs-swarm/swarm.key
  2. IPFS Configuration:

    • Restrict API access to localhost
    • Disable MDNS discovery
    • Use secure connection methods

Contributing

  1. Fork the repository
  2. Create a feature branch:
    git checkout -b feature/MyFeature
  3. Commit changes
  4. Push to the branch:
    git push origin feature/MyFeature
  5. Open a Pull Request

License

[Your License Here]