{"id":17939409,"url":"https://github.com/libitx/preserve-cli","last_synced_at":"2025-03-24T10:32:08.514Z","repository":{"id":57329952,"uuid":"178293222","full_name":"libitx/preserve-cli","owner":"libitx","description":"Deploy HTML pages, static assets and entire websites to the Bitcoin blockchain.","archived":false,"fork":false,"pushed_at":"2020-07-10T22:50:42.000Z","size":170,"stargazers_count":22,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T03:41:23.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://preserve.bitpaste.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libitx.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-28T22:43:00.000Z","updated_at":"2024-01-14T03:21:26.000Z","dependencies_parsed_at":"2022-08-29T04:30:18.333Z","dependency_job_id":null,"html_url":"https://github.com/libitx/preserve-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libitx%2Fpreserve-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libitx%2Fpreserve-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libitx%2Fpreserve-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libitx%2Fpreserve-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libitx","download_url":"https://codeload.github.com/libitx/preserve-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245252426,"owners_count":20585060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T00:07:13.830Z","updated_at":"2025-03-24T10:32:08.136Z","avatar_url":"https://github.com/libitx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![license](https://img.shields.io/github/license/libitx/preserve-cli.svg)](https://github.com/libitx/preserve-cli/blob/master/license.md)\n\n# Preserve CLI\n\nDeploy HTML pages, static assets and entire websites to the Bitcoin blockchain.\n\n## Getting started\n\nThe Preserve CLI can be used to deploy files from any folder on your computer, and works great with any static site generator.\n\n### 1. Install Preserve CLI\n\nInstall the *Preserve* CLI on your machine.\n\n```bash\nnpm install -g preserve-cli\n```\n\n### 2. Add Preserve to your project\n\nFrom the root directory of your web project, initialise *Preserve*.\n\n```bash\npreserve init\n```\n\nA new Bitcoin address and private key are generated and saved to a hidden `.bit` file in your working directory.\n**Remember to add it to your `.gitignore` file**.\n\nYou'll need to send a small amount of Bitcoin (SV) to deploy files. Display your wallet information to see your address and balance.\n\n```bash\npreserve wallet\n```\n\n### 3. View your sitemap\n\nBefore deploying any files, view the sitemap to see an overview of the files *Preserve* will deploy.\n\n```bash\npreserve status [path]\n# eg: get status of assets in the 'public' folder\npreserve status public\n```\n\nThe 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.\n\n### 4. Deploy your files\n\nWhen 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.\n\n```bash\npreserve deploy [path]\n# eg: deploy assets in the 'public' folder\npreserve deploy public\n```\n\nNetwork rules currently limit a chain of more than 25 unconfirmed transactions. *Preserve* will fail if it hits this limit. If this happens, with for a confirmation, then try again.\n\n### 5. Configure DNS\n\nThe final step is to configure the DNS for your domain. *Preserve* will generate two DNS records for you to configure with your DNS provider.\n\n```bash\npreserve dns [hostname]\n# eg: generate DNS records for 'www.example.com'\npreserve dns www.example.com\n```\n\nThe generated DNS records will look like this.\n\n```text\nHost:  www.example.com\nType:  CNAME\nData:  dns.preserve.bitpaste.app\n\nHost:  id._bsv.www.example.com\nType:  TXT\nData:  a=138A7KoTj1hbWEfBRYQQAujRk2EV3cLoRh; s=IC5+Ldu3i0Q6KHItq316ez9Bs5a4dmjtGJUWUrPVBn50SzLWx1jm0I+CCwFvm/3lUFcRHELr6eREDHfJWUHCnRA=\n```\nThe first `CNAME` record points requests to your domain to a [Preserve Agent](https://github.com/libitx/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.\n\nThe second `TXT` record contains your Bitcoin address and signature, and is used by the Agent to identify the latest router transaction associated with your domain.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibitx%2Fpreserve-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibitx%2Fpreserve-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibitx%2Fpreserve-cli/lists"}