DatD - Dat Daemon
DatD is a daemon for keeping track and hosting Dat Archives. It is mainly a cli tool, but also is packaged for use in your applications.
Install
$ npm install --save @wesleytodd/datd
Usage
Basic usage will start a datd process on localhost:29101
and open a database in your working directory .db
:
$ datd
Once the daemon is started, you can begin sending it commands, for example, lets create a new dat in our home director:
$ mkdir ~/test
$ datd create ~/test
┌───────────────┬──────────────────────────────────────────────────────────────────┐
│ Path │ test │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Key │ 467f50218b5d2f86203ba1372f11f966e75c5a0040d9d14dddbff62f53572ad4 │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Discovery Key │ 2aabc18fe138104822fe6f395ec8165d9cfe1942bbca1bbc40dd3acd4962787e │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Owner? │ true │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Live? │ true │
└───────────────┴──────────────────────────────────────────────────────────────────┘
As you can see, it created a dat for you which you can access at dat://467f50218b5d2f86203ba1372f11f966e75c5a0040d9d14dddbff62f53572ad4
in a browser like Beaker.
Now that you have a dat in there, you can see a list of dats currently managed by the daemon:
$ datd ls
┌───────────────────┬──────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────────┬────────┬───────┐
│ Path │ Key │ Discovery Key │ Owner? │ Live? │
├───────────────────┼──────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────┼────────┼───────┤
│ test/ │ 467f50218b5d2f86203ba1372f11f966e75c5a0040d9d14dddbff62f53572ad4 │ 2aabc18fe138104822fe6f395ec8165d9cfe1942bbca1bbc40dd3acd4962787e │ true │ true │
└───────────────────┴──────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────┴────────┴───────┘
TODO: this is a work in progress, more commands to come
- Remove dat
- Start/Stop serving a dat
- Conslidate to one discovery-swarm
- Replicate other dats from the net
- ...
Development
The tests can be run with npm test
, which also runs the linter and any other builds steps for the module.
When a release is ready, use npm to bump the version:
$ npm version minor
$ npm publish
A post publish script pushes the work and the tags. Pull requests should be made against master or the currently active development branch.