dPay

dPack CLI

Check Version Of dPack CLI

dPack CLI Menu

dpack help

Quick Demos

To get started using dPack, you can try downloading a dPack and then distributing a dPack of your own.

This will download our demo files to the ~/Downloads/dpack-demo folder. These files are being distributed by a server over dPack (to ensure high availability) but you may connect to any number of users also hosting the content.
You can also also view the files online: dpacks.io/778f8d955175c92e4ced5e4f5563f69bfec0c86cc6f670352c457943666fe639. dpacks.io can download files over dPack and display them on HTTP as long as someone is hosting it. The website temporarily caches data for any visited links (do not view your dpack on dpacks.io if you do not want us to cache your data).

Usage

Usage: dweb <cmd> [<dir>] [options]

Create, Distribute and Sync Files:
   dweb create                  create empty dPack and dweb.json
   dweb dist                    create dPack, import files to the respository and distribute to the dWeb
   dweb sync                    import files to existing dPack & sync with network

Fork, Pull and Sync Files:
   dweb fork <link> [<dir>]     Fork a dPack via link to <dir>
   dweb pull                    Pull updates of a dPack & exit
   dweb sync                    Sync dPack with the dWeb

dPack Info:
   dweb log                     Print a dPack's history
   dweb status                  Prints key and information about a local dPack

dPack Developer Management:
   dweb <cmd> [<repository>]    All commands take <repository> option
   dweb register                Register new repository account
   dweb login                   Login to repository account
   dweb publish                 Publish dPack to repository
   dweb whoami                  Print repository account information
   dweb logout                  Logout from current repository

dPack Shortcut Commands:
   dweb <link> [<dir>]          Fork dPack or Sync dPack in <dir> with dWeb
   dweb <dir>                   Create dPack and sync dPack in <dir> with dWeb

dPack Troubleshooting & Help:
   dweb satoshi                 Check with Dr. Satoshi on the current health of the dWeb
   dweb help                    Print dPack manpage
   dweb <command> --help, -h    Print specific usage parameters for a dPack command
   dweb --version, -v           Print current dPack version

  
Have fun using dPack! Learn more at docs.dpack.io

The first time you run a command, a .dpack folder is created to store the dPack metadata (dpack.json).
Once a dPack is created, you can run all the commands inside that folder, similar to git.

dPack keeps secret keys in the ~/.dpack/secret_keys folder. These are required to write to any dPacks you create.

Usage

Knowing the version is really helpful if you run into any bugs, and will help us troubleshoot your issue.

Check your dPack version:

dpack -v

You should see the dPack semantic version printed, e.g. 1.0.1.

dPack Repository Authentication

dpack create [<dir>]

The create command prompts you to make a dpack.json file and creates a new dPack. Import the files with dweb or dist.

Distributing dPacks

You can start distributing your files with a single command. Unlike git, you do not have to initialize a repository first, dpack dist will do that for you:

dpack dist <dir>

Use dpack dist to create a dPack and sync your files from your computer to other users. dPack scans your files inside <dir>, creating metadata in <dir>/.dpack. dPack stores the public link, version history, and file information inside the dPack Folder.

Usage Example

The quickest way to get started distributing files is to use the dist command:

❯ dpack dist
dweb://3e830227b4b2be197679ff1b573cc85e689f202c0884eb8bdb0e1fcecbd93119
Distributing dPack: 24 files (383 MB)

0 connections | Download 0 B/s Upload 0 B/s

Importing 528 files to Archive (165 MB/s)
[=-----------------------------------------] 3%
ADD: data/expn_cd.csv (403 MB / 920 MB)

Distributing Demo

dPack can distribute files from your computer to anywhere. If you have a friend going through this demo with you, try distributing to them! If not we'll see what we can do. Find a folder on your computer to distribute. Inside the folder can be anything, dPack can handle all sorts of files (dPack works with really big folders too!).

First, you can create a new dPack inside that folder. Using the dpack create command also walks us through making a dpack.json file:

❯ dpack create
Welcome to dPack program!
You can turn any folder on your computer into a dPack.
A dPack is a folder with a dPack/dWeb configuration.

This will create a new (empty) dPack. dPack will print a link, distribute this link to give others access to view your files.

Once we have our dPack, run dpack dist to scan your files and sync them to the network. Distribute the link with your friend to instantly start downloading files.

You can also try viewing your files online. Go to dpacks.io and enter your link to preview on the top left.

Distributing dPacks

Distributing dPacks

You can start distributing your files with a single command. Unlike git, you do not have to initialize a repository first, dpack dist will do that for you:

dpack dist <dir>

Use dpack dist to create a dPack and sync your files from your computer to other users. dPack scans your files inside <dir>, creating metadata in <dir>/.dpack. dPack stores the public link, version history, and file information inside the dPack Folder.

Usage Example

The quickest way to get started distributing files is to use the dist command:

❯ dpack dist
dweb://3e830227b4b2be197679ff1b573cc85e689f202c0884eb8bdb0e1fcecbd93119
Distributing dPack: 24 files (383 MB)

0 connections | Download 0 B/s Upload 0 B/s

Importing 528 files to Archive (165 MB/s)
[=-----------------------------------------] 3%
ADD: data/expn_cd.csv (403 MB / 920 MB)

Distributing Demo

dPack can distribute files from your computer to anywhere. If you have a friend going through this demo with you, try distributing to them! If not we'll see what we can do. Find a folder on your computer to distribute. Inside the folder can be anything, dPack can handle all sorts of files (dPack works with really big folders too!).

First, you can create a new dPack inside that folder. Using the dpack create command also walks us through making a dpack.json file:

❯ dpack create
Welcome to dPack program!
You can turn any folder on your computer into a dPack.
A dPack is a folder with a dPack/dWeb configuration.

This will create a new (empty) dPack. dPack will print a link, distribute this link to give others access to view your files.

Once we have our dPack, run dpack dist to scan your files and sync them to the network. Distribute the link with your friend to instantly start downloading files.

You can also try viewing your files online. Go to dpacks.io and enter your link to preview on the top left.

dPack Repository Authentication

Usage

You can use the dpack command line to register and publish to dPack repositories. dPack plans to support any repositories that are created or forked from our initial dpacks.io distributed repository codebase. Currently, dpacks.io is the lone dWeb repository and the default for the dPack Command CLI.

To register and login you can use the following commands:

dpack register [<repository>]
dpack login
dpack whoami

Once you are logged in to a registry, you can publish a dPack vault:

cd my-repo
dpack create
dpack publish --name my-repo
  • All repository requests take the <repository> option if you'd like to publish to a different repository than dpacks.io.
  • You can deploy your own compatible [Repository server] if you'd rather use your own service.

dPack Repository

Steps to registering as a developer on the dPack repository:

  • Create an account at dpacks.io
  • Login via the dPack CLI by running dpack login
  • Authenticate with the dPacks.io server
  • You are now able to push dSites and dApps via a dPack to the dWeb's official distributed repository.

To test and see if you're completely authenticated - run this command:

dpack fork dpacks.io/dpack/demo-fork

dPack JS Library

Usage

Add dPack to your package.json, npm install dpack --save. dPack exports the [@dpack/core] API via require('dpack'). Use it in your javascript applications! DPack Desktop and DPack command line both use dpack-core to distribute and download dpacks.

Full API documentation is available in the dPack Core Guide section of this documentation

We have dPack installed, let's use it!

dPack's unique design works wherever you store your data. You can create a new dPack from any folder on your computer.

A dPack is a collection of files from your computer or server and a .dpack folder. Each dPack has a unique dweb:// link. With your dWeb link (dweb://), other users can download or fork your files and live sync any updates.

Dr. Satoshi

We've included a tool to identify network issues with dPack.
Dr. Satoshi will run two tests:

  1. Attempt to connect to a public server running a dWeb peer.
  2. Attempt a direct connection between two peers. You will need to run the command on both the computers you are trying to distribute data between.

Start the satoshi by running:

dpack satoshi

For direct connection tests, Dr. Satoshi will print out a command to run on the other computer, dpack satoshi <64-character-string>.
Dr. Satoshi will run through the key steps in the process of distributing data between computers to help identify the issue.

dPacks over dWeb

Usage

dpack dweb [<dir>] [--no-import] [--no-watch]
  • Start distributing your dPack vault over the network.
  • dweb will import new or updated files to the dWeb since you last ran create or dweb.
  • dweb watches files for changes and imports updated files.

  • Use --no-import to not import any new or updated files to the dWeb.

  • Use --no-watch to not watch the dPack directory for changes. --import must be true for --watch to work.

Forking dPacks

Forking/Downloading dPacks

dpack fork dweb://<link> <download-dir>

Use dpack fork to download files from a remote computer distributing files with dPack over the dWeb. This will download the files from dweb://<link> to your <download-dir>. The download exits after it completes but you can continue to update the files later after the fork is done. Use dpack pull to update new files or dpack dweb to live sync changes via the dWeb.

Try out dpack fork with the link above to read more about the protocol!

dPack over HTTP

Usage

dWeb and dPack make it really easy to distribute live files on a HTTP server. This is a cool demo because we can also see how version history works! Serve dPack files on HTTP with the --http option. For example, dpack dweb --http, serves your files to a HTTP website with live reloading and version history! This even works for dpacks you're downloading (add the --thin option to only download files you select via HTTP). The default HTTP port is 8080.

Hint: Use localhost:8080/?version=10 to view a specific version.

Get started using dPack today with the distribute and fork commands.

dPack Ignoring Files

Ignoring Files

By default, dPack will ignore any files in a .dpackignore file, similar to git. Each file should be separated by a newline. dPack also ignores all hidden folders and files. For more information on how dPack ignore works, head over to the dPack Ignore Guide section in this documentation.

dPack CLI Installation

Environment Requirements

  • Node Version 4 or above.
  • NPM (Version installed with your Node installation)

Installation

Install With NPM

npm install -g dpack

Install With YARN

npm install -g dpack

One-Line Installer

If you are unable to use npm to install dPack, you can also download a single file binary distribution version of dpack using the one line install command below. The binary includes a copy of @dpack/core and dpack packaged inside a single file, so you just have to download one file in order to start sharing data across the Distributed Web (dWeb), with no other dependencies needed on your system:

curl https://dpack.io/installer/cli.sh | bash && dpack

Download Bin File

https://github.com/dpacks/cli

dPack Javascript API

You can use dPack in your Javascript application:

var DPack = require('dpack')

DPack('/data', function (err, dpack) {
  // use dpack
})

dPack Key Management and Moving dPacks

Usage

dpack keys provides a few commands to help you move or backup your dPacks.

Writing to a dPack requires the secret key, stored in the ~/.dpack folder. You can export and import these keys between dPacks. First, fork your dPacks to the new location:

  • (original) dpack dist
  • (duplicate) dpack fork <link>

Then transfer the secret key:

  • (original) dpack keys export - copy the secret key printed out.
  • (duplicate) dpack keys import - this will prompt you for the secret key, paste it in here.

Selecting Files

Usage

By default, dPack will download all files. If you want to only download a subset of files within a dPack, you can create a .dpackdownload file which downloads only the files and folders specified. Each should be separated by a newline.

dPack Shortcuts

Shortcut Commands

  • dpack <link> <dir> will run dpack fork for new dPacks or resume the existing dPack in <dir>
  • dpack <dir> is the same as running dpack dweb <dir>

Other Cool Shortcut Commands

A few other highlights. Run dpack help to see the full usage guide.

  • dpack create - Create an empty dPack and dpack.json file.
  • dpack satoshi - dPack's Dr. Satoshi is here. Dr. Satoshi tries to connect to a public peer. Dr. Satoshi also creates a key to test direct connections.
  • dpack log ~/data/dpack-folder/ or dpack log dweb://<dpack-key> - view the history and metadata information for a dPack.

dPack Troubleshooting Guide

Installation Issues

Node & NPM

To use the dPack command line tool you will need to have [node and npm installed][https://docs.benos.io/utilities/installing-node].
Make sure those are installed correctly before installing dPack.
You can check the version of each:

node -v
npm -v

Global Install

The -g option installs dPack globally, allowing you to run it as a command.
Make sure you installed with that option.

  • If you receive an EACCES error, it is a NPM permissions error. Try to use sudo in this event.
  • If you receive an EACCES error, you may also install dPack with sudo: sudo npm install -g dpack.

Debugging Output

If you are having trouble with a specific command, run with the debug environment variable set to dpack (and optionally also dpack-core).
This will help us debug any issues:

DEBUG=dpack,dpack-core dpack fork dweb://<link> dir

Networking Issues

Networking capabilities vary widely with each computer, network, and configuration.
Whenever you run dPack there are several steps to distribute or download files with dWeb peers:

  1. Discovering dWeb Peers
  2. Connecting to dWeb Peers
  3. Sending & Receiving Data

With successful use, dPack will show Connected to 1 dWeb peer after connection.
If you never see a dWeb peer connected, your network may be restricting revelation or connection.
Please try using the dpack satoshi command (see below) between the two computers not connecting. This will help troubleshoot dWeb's distributed network.

Unpacking dPacks

Usage

Once a dPack is forked, you can run either dpack pull or dpack dweb in the folder to update the vault.

dpack pull [<dir>]

Unpacked a forked dPack vault with the latest files and exit.

dpack dweb [<dir>]

Download latest files and keep connection open to continue unpacking as remote source is updated.