Publishing my Website to the peer-to-peer Web
I’ve been experimenting with the DAT protocol for a little while now and wanted to get my website up on the peer-to-peer Web. There’s a few different ways to do this, but I wanted a method that worked well with my already existing method of deployment.
cargo web build --target=wasm32-unknown-unknown
This creates a folder (
./target/deploy/) that’s ready to “deploy”
I deploy changes to my website using rsync which looks something like:
rsync -aze "ssh -p 9999" ./target/deploy/ user@hostname:/path/to/website/
3. Creating a DAT version
4. Synching Changes to DAT
Synching changes to the DAT version is just a matter of copying the freshly built site (while keeping track of changes1) and running
dat sync using the
dat command line tool:
rsync -r --size-only target/deploy/* ignore/dat/ dat sync --dir=path/to/dat
That’s basically it. For simplicity I add all the commands to a
deploy.sh shell script so I can simply run
bash deploy.sh to deploy changes to both the http(s) and DAT versions of my website in one go.
cp -r ... to
rsync --size-only ... so we don’t needlessly replace files and create new revisions… (I actually blew through my hashbase.io allotment doing this). Perhaps managing all this in a different git repo would make more sense?