The datproject is a p2p protocol that enables users to exchange information without having to use a centralized platform, as long as you have an internet connection, you can use the dat protocol.
In this post, we will walk through sharing files using the dat cli.
First you will need NodeJS, you can download and install node from https://nodejs.org
Once installed, you can open up a terminal window or command prompt and run the following command:
npm install dat --global
If you get an error, go to the npm site to learn how to setup up node to install global packages. https://docs.npmjs.com/downloading-and-installing-packages-globally
Now that dat is installed you are ready to share some files, lets create a simple file.
mkdir dat1
cd dat1
echo "Hello from dat" > hello.txt
dat share
You will be prompted to give it a title and description, maybe dat1
and Hello World
.
You will see some out stating that you are ready to share:
Created empty Dat in /Users/twilson63/play/discovery-swarm-lab/dat1/.dat
Now you can add files and share:
* Run dat share to create metadata and sync.
* Copy the unique dat link and securely share it.
dat://93183d8223127c64ca...7e65
Now that you are ready to share your files, simple run:
dat share
And you are sharing your files using the dat hash key.
On another computer you can retrieve your files by installing the dat cli with the same instructions above and running dat clone
dat clone [dat url] [folder name]
You have just transferred files from one computer to another.
If it did not work, then there is a chance you are on a network that does not support the distributed hash table, check out pinning services like https://hashbase.io that can be used to seed your files, or you can use your own server to seed the files as well.