The Preserve CLI can be used to deploy files from any folder on your computer, and works great with any static site generator. It requires a Node.js runtime environment, so if necessary install Node.js first.
Install the Preserve CLI on your machine.
npm install -g preserve-cli
From the root directory of your web project, initialise Preserve.
A new Bitcoin address and private key are generated and saved to a hidden
.bit file in your working directory.
Remember to add it to your
You’ll need to send a small amount of Bitcoin (SV) to deploy files. If deploying many files or larger sized files, your wallet should be prepared by splitting the balance into many small UTXOs and waiting for all to confirm.
# Display wallet address and balance
Before deploying any files, view the sitemap to see an overview of the files Preserve will deploy.
preserve status [path]
The displayed sitemap shows a list of all the files in your project, along with file size,
sha256 hash, and whether the file has already been deployed or not.
When ready to deploy the files, and assuming your Bitcoin address has enough funds, Preserve will create and send transactions for every file to the Bitcoin (SV) network.
preserve deploy [path]
Network rules currently limit a chain of more than 25 unconfirmed transactions. Preserve will stop if it hits this limit. If this happens, wait for a confirmation, then try again.
The final step is to configure the DNS for your domain. Preserve will generate two DNS records for you to configure with your DNS provider.
preserve dns [hostname]
The generated DNS records will look like this.
CNAME record points requests to your domain to a Preserve Agent node to handle the request.
dns.preserve.bitpaste.app is a public Preserve Agent node. Alternatively you can run the Agent on your own server.
TXT record contains your Bitcoin address and signature, and is used by the Agent to identify the latest router transaction associated with your domain.