diff --git a/404.html b/404.html index 484b3e9..c15edaa 100644 --- a/404.html +++ b/404.html @@ -17,13 +17,13 @@ - + -

404

How did we get here?
+ - + diff --git a/assets/js/10.08329c87.js b/assets/js/10.d7e3ccb0.js similarity index 99% rename from assets/js/10.08329c87.js rename to assets/js/10.d7e3ccb0.js index 121d1cb..3fa1916 100644 --- a/assets/js/10.08329c87.js +++ b/assets/js/10.d7e3ccb0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{336:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"entity-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#entity-types"}},[t._v("#")]),t._v(" Entity Types")]),t._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("Arweave transactions are composed of transaction headers and data payloads.")]),t._v(" "),a("p",[t._v("ArFS entities, therefore, have their data split between being stored as tags on their transaction header and encoded as JSON and stored as the data of a transaction. In the case of private entities, JSON data and file data payloads are always encrypted according to the protocol processes defined below.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Drive entities require a single metadata transaction, with standard Drive tags and encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("Folder entities require a single metadata transaction, with standard Folder tags and an encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("File entities require a metadata transaction, with standard File tags and an encoded Data JSON with secondary metadata relating to the file.")])]),t._v(" "),a("li",[a("p",[t._v("File entities also require a second data transaction, which includes a limited set of File tags and the actual file data itself.")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities require a single transaction. which contains a Data JSON with all of the Drive’s rolled up ArFS metadata and standard Snapshot GQL tags that identify the Snapshot.")])])]),t._v(" "),a("p",[t._v("ArFS v0.14 introduces the "),a("code",[t._v("isHidden")]),t._v(" metadata property. "),a("code",[t._v("isHidden")]),t._v(" is a boolean (true/false) that tells clients if they should display the file or folder. Hidden files still exist and will be included in "),a("a",{attrs:{href:"#snapshot"}},[t._v("snapshots")]),t._v(", but should not be rendered by clients. If "),a("code",[t._v("isHidden")]),t._v(" is not present, its value should be assumed false.")]),t._v(" "),a("h2",{attrs:{id:"drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#drive"}},[t._v("#")]),t._v(" Drive")]),t._v(" "),a("p",[t._v("A drive is the highest level logical grouping of folders and files. All folders and files must be part of a drive, and reference the Drive ID of that drive.")]),t._v(" "),a("p",[t._v("When creating a Drive, a corresponding folder must be created as well. This will act as the root folder of the drive. This separation of drive and folder entity enables features such as folder view queries, renaming, and linking.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Privacy"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Auth-Mode?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rootFolderId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Drive Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"folder"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#folder"}},[t._v("#")]),t._v(" Folder")]),t._v(" "),a("p",[t._v("A folder is a logical grouping of other folders and files. Folder entity metadata transactions without a parent folder id are considered the Drive Root Folder of their corresponding Drives. All other Folder entities must have a parent folder id. Since folders do not have underlying data, there is no Folder data transaction required.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFolder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Folder Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"file"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file"}},[t._v("#")]),t._v(" File")]),t._v(" "),a("p",[t._v("A File contains uploaded data, like a photo, document, or movie.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("A File entity metadata transaction does not include the actual File data. Instead, the File data must be uploaded as a separate transaction, called the File Data Transaction. The File JSON metadata transaction contains a reference to the File Data Transaction ID so that it can retrieve the actual data. This separation allows for file metadata to be updated without requiring the file itself to be reuploaded. It also ensures that private files can have their JSON Metadata Transaction encrypted as well, ensuring that no one without authorization can see either the file or its metadata.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lastModifiedDate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataTxId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataContentType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pinnedDataOwner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" # Optional\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v(" Pin Files ")]),t._v(" "),a("p",[t._v("Since the version v0.13, ArFS suports Pins. Pins are files whose data may be any transaction uploaded to Arweave, that may or may not be owned by the wallet that created the pin.")]),t._v(" "),a("p",[t._v("When a new File Pin is created, the only created transaction is the Metadata Transaction. The "),a("code",[t._v("dataTxId")]),t._v(" field will point it to any transaction in Arweave, and the optional "),a("code",[t._v("pinnedDataOwner")]),t._v(" field is gonna hold the address of the wallet that owns the original copy of the data transaction.")]),t._v(" "),a("div",{staticClass:"caption"},[t._v("File Data Transaction Example")]),t._v(" "),a("p",[t._v("The File Data Transaction contains limited information about the file, such as the information required to decrypt it, or the Content-Type (mime-type) needed to view in the browser.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("Cipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File Data - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("File Metadata Transaction Example")]),t._v(" "),a("p",[t._v("The the File Metadata Transaction contains the GQL Tags necessary to identify the file within a drive and folder.")]),t._v(" "),a("p",[t._v("Its data contains the JSON metadata for the file. This includes the file name, size, last modified date, data transaction id, and data content type.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File JSON Metadata - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"snapshot"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot"}},[t._v("#")]),t._v(" Snapshot")]),t._v(" "),a("p",[t._v("ArFS applications generate the latest state of a drive by querying for all ArFS transactions made relating to a user's particular "),a("code",[t._v("Drive-Id")]),t._v(". This includes both paged queries for indexed ArFS data via GQL, as well as the ArFS JSON metadata entries for each ArFS transaction.")]),t._v(" "),a("p",[t._v("For small drives (less than 1000 files), a few thousand requests for very small volumes of data can be achieved relatively quickly and reliably. For larger drives, however, this results in long sync times to pull every piece of ArFS metadata when the local database cache is empty. This can also potentially trigger rate-limiting related ArWeave Gateway delays.")]),t._v(" "),a("p",[t._v("Once a drive state has been completely, and accurately generated, in can be rolled up into a single snapshot and uploaded as an Arweave transaction. ArFS clients can use GQL to find and retrieve this snapshot in order to rapidly reconstitute the total state of the drive, or a large portion of it. They can then query individual transactions performed after the snapshot.")]),t._v(" "),a("p",[t._v("This optional method offers convenience and resource efficiency when building the drive state, at the cost of paying for uploading the snapshot data. Using this method means a client will only have to iterate through a few snapshots instead of every transaction performed on the drive.")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-tags"}},[t._v("#")]),t._v(" Snapshot Entity Tags")]),t._v(" "),a("p",[t._v("Snapshot entities require the following tags. These are queried by ArFS clients to find drive snapshots, organize them together with any other transactions not included within them, and build the latest state of the drive.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"snapshot"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nSnapshot-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-End"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nData-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction GQL tags example")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-data"}},[t._v("#")]),t._v(" Snapshot Entity Data")]),t._v(" "),a("p",[t._v("A JSON data object must also be uploaded with every ArFS Snapshot entity. THis data contains all ArFS Drive, Folder, and File metadata changes within the associated drive, as well as any previous Snapshots. The Snapshot Data contains an array "),a("code",[t._v("txSnapshots")]),t._v(". Each item includes both the GQL and ArFS metadata details of each transaction made for the associated drive, within the snapshot's start and end period.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("tsSnapshot")]),t._v(" contains a "),a("code",[t._v("gqlNode")]),t._v(" object which uses the same GQL tags interface returned by the Arweave Gateway. It includes all of the important "),a("code",[t._v("block")]),t._v(", "),a("code",[t._v("owner")]),t._v(", "),a("code",[t._v("tags")]),t._v(", and "),a("code",[t._v("bundledIn")]),t._v(" information needed by ArFS clients. It also contains a "),a("code",[t._v("dataJson")]),t._v(" object which stores the correlated Data JSON for that ArFS entity.")]),t._v(" "),a("p",[t._v("For private drives, the "),a("code",[t._v("dataJson")]),t._v(" object contains the JSON-string-escaped encrypted text of the associated file or folder. This encrypted text uses the file's existing "),a("code",[t._v("Cipher")]),t._v(" and "),a("code",[t._v("Cipher-IV")]),t._v(". This ensures clients can decrypt this information quickly using the existing ArFS privacy protocols.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txSnapshots"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gqlNode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bWCvIc3cOzwVgquD349HUVsn5Dd1_GIri8Dglok41Vg"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"owner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hlWRbyJ6WUoErm3b0wqVgd1l3LTgaQeLBhB36v2HxgY"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bundledIn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"39n5evzP1Ip9MhGytuFm7F3TDaozwHuVUbS55My-MBk"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"block"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1062005")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1669053791")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tags"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Content-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"application/json"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArFS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.11"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Entity-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f27abc4b-ed6f-4108-a9f5-e545fc4ff55b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Privacy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"public"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArDrive-App"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Platform"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Web"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Version"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.39.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Unix-Time"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1669053323"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataJson"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{\\"name\\":\\"november\\",\\"rootFolderId\\":\\"71dfc1cb-5368-4323-972a-e9dd0b1c63a0\\", \\"isHidden\\":false}"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction JSON data example")]),t._v(" "),a("h2",{attrs:{id:"schema-diagrams"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#schema-diagrams"}},[t._v("#")]),t._v(" Schema Diagrams")]),t._v(" "),a("p",[t._v("The following diagrams show complete examples of Drive, Folder, and File entity Schemas.")]),t._v(" "),a("h3",{attrs:{id:"public-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#public-drive"}},[t._v("#")]),t._v(" Public Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/public-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Public Drive Schema")]),t._v(" "),a("h3",{attrs:{id:"private-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#private-drive"}},[t._v("#")]),t._v(" Private Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/private-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Private Drive Schema")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{305:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"entity-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#entity-types"}},[t._v("#")]),t._v(" Entity Types")]),t._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("Arweave transactions are composed of transaction headers and data payloads.")]),t._v(" "),a("p",[t._v("ArFS entities, therefore, have their data split between being stored as tags on their transaction header and encoded as JSON and stored as the data of a transaction. In the case of private entities, JSON data and file data payloads are always encrypted according to the protocol processes defined below.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Drive entities require a single metadata transaction, with standard Drive tags and encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("Folder entities require a single metadata transaction, with standard Folder tags and an encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("File entities require a metadata transaction, with standard File tags and an encoded Data JSON with secondary metadata relating to the file.")])]),t._v(" "),a("li",[a("p",[t._v("File entities also require a second data transaction, which includes a limited set of File tags and the actual file data itself.")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities require a single transaction. which contains a Data JSON with all of the Drive’s rolled up ArFS metadata and standard Snapshot GQL tags that identify the Snapshot.")])])]),t._v(" "),a("p",[t._v("ArFS v0.14 introduces the "),a("code",[t._v("isHidden")]),t._v(" metadata property. "),a("code",[t._v("isHidden")]),t._v(" is a boolean (true/false) that tells clients if they should display the file or folder. Hidden files still exist and will be included in "),a("a",{attrs:{href:"#snapshot"}},[t._v("snapshots")]),t._v(", but should not be rendered by clients. If "),a("code",[t._v("isHidden")]),t._v(" is not present, its value should be assumed false.")]),t._v(" "),a("h2",{attrs:{id:"drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#drive"}},[t._v("#")]),t._v(" Drive")]),t._v(" "),a("p",[t._v("A drive is the highest level logical grouping of folders and files. All folders and files must be part of a drive, and reference the Drive ID of that drive.")]),t._v(" "),a("p",[t._v("When creating a Drive, a corresponding folder must be created as well. This will act as the root folder of the drive. This separation of drive and folder entity enables features such as folder view queries, renaming, and linking.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Privacy"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Auth-Mode?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rootFolderId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Drive Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"folder"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#folder"}},[t._v("#")]),t._v(" Folder")]),t._v(" "),a("p",[t._v("A folder is a logical grouping of other folders and files. Folder entity metadata transactions without a parent folder id are considered the Drive Root Folder of their corresponding Drives. All other Folder entities must have a parent folder id. Since folders do not have underlying data, there is no Folder data transaction required.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFolder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Folder Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"file"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file"}},[t._v("#")]),t._v(" File")]),t._v(" "),a("p",[t._v("A File contains uploaded data, like a photo, document, or movie.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("A File entity metadata transaction does not include the actual File data. Instead, the File data must be uploaded as a separate transaction, called the File Data Transaction. The File JSON metadata transaction contains a reference to the File Data Transaction ID so that it can retrieve the actual data. This separation allows for file metadata to be updated without requiring the file itself to be reuploaded. It also ensures that private files can have their JSON Metadata Transaction encrypted as well, ensuring that no one without authorization can see either the file or its metadata.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lastModifiedDate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataTxId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataContentType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pinnedDataOwner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" # Optional\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v(" Pin Files ")]),t._v(" "),a("p",[t._v("Since the version v0.13, ArFS suports Pins. Pins are files whose data may be any transaction uploaded to Arweave, that may or may not be owned by the wallet that created the pin.")]),t._v(" "),a("p",[t._v("When a new File Pin is created, the only created transaction is the Metadata Transaction. The "),a("code",[t._v("dataTxId")]),t._v(" field will point it to any transaction in Arweave, and the optional "),a("code",[t._v("pinnedDataOwner")]),t._v(" field is gonna hold the address of the wallet that owns the original copy of the data transaction.")]),t._v(" "),a("div",{staticClass:"caption"},[t._v("File Data Transaction Example")]),t._v(" "),a("p",[t._v("The File Data Transaction contains limited information about the file, such as the information required to decrypt it, or the Content-Type (mime-type) needed to view in the browser.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("Cipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File Data - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("File Metadata Transaction Example")]),t._v(" "),a("p",[t._v("The the File Metadata Transaction contains the GQL Tags necessary to identify the file within a drive and folder.")]),t._v(" "),a("p",[t._v("Its data contains the JSON metadata for the file. This includes the file name, size, last modified date, data transaction id, and data content type.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File JSON Metadata - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"snapshot"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot"}},[t._v("#")]),t._v(" Snapshot")]),t._v(" "),a("p",[t._v("ArFS applications generate the latest state of a drive by querying for all ArFS transactions made relating to a user's particular "),a("code",[t._v("Drive-Id")]),t._v(". This includes both paged queries for indexed ArFS data via GQL, as well as the ArFS JSON metadata entries for each ArFS transaction.")]),t._v(" "),a("p",[t._v("For small drives (less than 1000 files), a few thousand requests for very small volumes of data can be achieved relatively quickly and reliably. For larger drives, however, this results in long sync times to pull every piece of ArFS metadata when the local database cache is empty. This can also potentially trigger rate-limiting related ArWeave Gateway delays.")]),t._v(" "),a("p",[t._v("Once a drive state has been completely, and accurately generated, in can be rolled up into a single snapshot and uploaded as an Arweave transaction. ArFS clients can use GQL to find and retrieve this snapshot in order to rapidly reconstitute the total state of the drive, or a large portion of it. They can then query individual transactions performed after the snapshot.")]),t._v(" "),a("p",[t._v("This optional method offers convenience and resource efficiency when building the drive state, at the cost of paying for uploading the snapshot data. Using this method means a client will only have to iterate through a few snapshots instead of every transaction performed on the drive.")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-tags"}},[t._v("#")]),t._v(" Snapshot Entity Tags")]),t._v(" "),a("p",[t._v("Snapshot entities require the following tags. These are queried by ArFS clients to find drive snapshots, organize them together with any other transactions not included within them, and build the latest state of the drive.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"snapshot"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nSnapshot-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-End"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nData-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction GQL tags example")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-data"}},[t._v("#")]),t._v(" Snapshot Entity Data")]),t._v(" "),a("p",[t._v("A JSON data object must also be uploaded with every ArFS Snapshot entity. THis data contains all ArFS Drive, Folder, and File metadata changes within the associated drive, as well as any previous Snapshots. The Snapshot Data contains an array "),a("code",[t._v("txSnapshots")]),t._v(". Each item includes both the GQL and ArFS metadata details of each transaction made for the associated drive, within the snapshot's start and end period.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("tsSnapshot")]),t._v(" contains a "),a("code",[t._v("gqlNode")]),t._v(" object which uses the same GQL tags interface returned by the Arweave Gateway. It includes all of the important "),a("code",[t._v("block")]),t._v(", "),a("code",[t._v("owner")]),t._v(", "),a("code",[t._v("tags")]),t._v(", and "),a("code",[t._v("bundledIn")]),t._v(" information needed by ArFS clients. It also contains a "),a("code",[t._v("dataJson")]),t._v(" object which stores the correlated Data JSON for that ArFS entity.")]),t._v(" "),a("p",[t._v("For private drives, the "),a("code",[t._v("dataJson")]),t._v(" object contains the JSON-string-escaped encrypted text of the associated file or folder. This encrypted text uses the file's existing "),a("code",[t._v("Cipher")]),t._v(" and "),a("code",[t._v("Cipher-IV")]),t._v(". This ensures clients can decrypt this information quickly using the existing ArFS privacy protocols.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txSnapshots"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gqlNode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bWCvIc3cOzwVgquD349HUVsn5Dd1_GIri8Dglok41Vg"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"owner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hlWRbyJ6WUoErm3b0wqVgd1l3LTgaQeLBhB36v2HxgY"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bundledIn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"39n5evzP1Ip9MhGytuFm7F3TDaozwHuVUbS55My-MBk"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"block"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1062005")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1669053791")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tags"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Content-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"application/json"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArFS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.11"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Entity-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f27abc4b-ed6f-4108-a9f5-e545fc4ff55b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Privacy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"public"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArDrive-App"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Platform"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Web"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Version"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.39.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Unix-Time"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1669053323"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataJson"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{\\"name\\":\\"november\\",\\"rootFolderId\\":\\"71dfc1cb-5368-4323-972a-e9dd0b1c63a0\\", \\"isHidden\\":false}"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction JSON data example")]),t._v(" "),a("h2",{attrs:{id:"schema-diagrams"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#schema-diagrams"}},[t._v("#")]),t._v(" Schema Diagrams")]),t._v(" "),a("p",[t._v("The following diagrams show complete examples of Drive, Folder, and File entity Schemas.")]),t._v(" "),a("h3",{attrs:{id:"public-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#public-drive"}},[t._v("#")]),t._v(" Public Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/public-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Public Drive Schema")]),t._v(" "),a("h3",{attrs:{id:"private-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#private-drive"}},[t._v("#")]),t._v(" Private Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/private-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Private Drive Schema")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/11.44ba014e.js b/assets/js/11.273c0017.js similarity index 99% rename from assets/js/11.44ba014e.js rename to assets/js/11.273c0017.js index 4455a1e..082c321 100644 --- a/assets/js/11.44ba014e.js +++ b/assets/js/11.273c0017.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{305:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"arfs-protocol-a-decentralized-file-system-on-arweave"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-protocol-a-decentralized-file-system-on-arweave"}},[e._v("#")]),e._v(" ArFS Protocol: A Decentralized File System on Arweave")]),e._v(" "),t("p",[e._v("Arweave File System, or β€œArFS” is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on "),t("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v("'s otherwise permanent, immutable data storage blockweave.")]),e._v(" "),t("p",[e._v("Due to Arweave's permanent, immutable and public nature traditional file system operations such as permissions, file/folder renaming and moving, and file updates cannot be done by simply updating the on-chain data model.")]),e._v(" "),t("p",[e._v("ArFS works around this by implementing a privacy and encryption pattern and defining an append-only transaction data model using tags within "),t("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#transaction-format",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Transaction headers"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"key-features"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features"}},[e._v("#")]),e._v(" Key Features")]),e._v(" "),t("h3",{attrs:{id:"file-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-structure"}},[e._v("#")]),e._v(" File Structure")]),e._v(" "),t("p",[e._v("ArFS organizes files and folders using a hierarchical structure. Files are stored as individual transactions on the Arweave blockchain, while folders are metadata that reference these file transactions.")]),e._v(" "),t("h3",{attrs:{id:"metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#metadata"}},[e._v("#")]),e._v(" Metadata")]),e._v(" "),t("p",[e._v("Each file and folder has associated metadata, such as the name, type, size, and modification timestamp. ArFS leverages Arweave's tagging system to store this metadata in a standardized format, which allows for easy querying and organization.")]),e._v(" "),t("h3",{attrs:{id:"file-permissions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-permissions"}},[e._v("#")]),e._v(" File Permissions")]),e._v(" "),t("p",[e._v("ArFS supports public and private file permissions. Public files can be accessed by anyone on the network, while private files are encrypted using the owner's private key, ensuring only they can decrypt and access the content.")]),e._v(" "),t("h3",{attrs:{id:"file-versioning"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-versioning"}},[e._v("#")]),e._v(" File Versioning")]),e._v(" "),t("p",[e._v("ArFS supports versioning of files, allowing users to store multiple versions of a file and access previous versions at any time. This is achieved by linking new file transactions to previous versions through the use of metadata tags.")]),e._v(" "),t("h3",{attrs:{id:"data-deduplication"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#data-deduplication"}},[e._v("#")]),e._v(" Data Deduplication")]),e._v(" "),t("p",[e._v("To minimize storage redundancy and costs, ArFS employs data deduplication techniques. If a user tries to store a file that already exists on the network, the protocol will simply create a new reference to the existing file instead of storing a duplicate copy.")]),e._v(" "),t("h3",{attrs:{id:"search-and-discovery"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#search-and-discovery"}},[e._v("#")]),e._v(" Search and Discovery")]),e._v(" "),t("p",[e._v("ArFS enables users to search and discover files based on their metadata, such as file names, types, and tags. This is made possible by indexing the metadata stored within the Arweave blockchain.")]),e._v(" "),t("h3",{attrs:{id:"interoperability"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#interoperability"}},[e._v("#")]),e._v(" Interoperability")]),e._v(" "),t("p",[e._v("ArFS is designed to be interoperable with other decentralized applications and services built on the Arweave network. This allows for seamless integration and collaboration between different applications and users.")]),e._v(" "),t("h2",{attrs:{id:"getting-started"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[e._v("#")]),e._v(" Getting Started")]),e._v(" "),t("p",[e._v("To start using ArFS, you'll need to familiarize yourself with the Arweave ecosystem, acquire AR tokens to cover storage costs, and choose a compatible client or library to interact with the ArFS protocol.")]),e._v(" "),t("h2",{attrs:{id:"arfs-version-history"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-version-history"}},[e._v("#")]),e._v(" ArFS Version History")]),e._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("tr",[t("th",[e._v("Version")]),e._v(" "),t("th",[e._v("Date")]),e._v(" "),t("th",[e._v("Release Notes")])]),e._v(" "),t("tr",[t("td",[e._v("0.10")]),e._v(" "),t("td",[e._v("August 2020")]),e._v(" "),t("td",[e._v("The brief, beta version that was in use during initial testing of ArDrive across Web (Dart) and legacy CLI (Typescript).")])]),e._v(" "),t("tr",[t("td",[e._v("0.11")]),e._v(" "),t("td",[e._v("September 2020")]),e._v(" "),t("td",[e._v("Includes all of the major functionality supporting file systems on Arweave including new drives, folders, files, renames, moves and privacy.")])]),e._v(" "),t("tr",[t("td",[e._v("0.12")]),e._v(" "),t("td",[e._v("December 2022")]),e._v(" "),t("td",[e._v("Added Snapshot entities to support quick synchronization of drive state.")])]),e._v(" "),t("tr",[t("td",[e._v("0.13")]),e._v(" "),t("td",[e._v("August 2023")]),e._v(" "),t("td",[e._v("Added pins")])]),e._v(" "),t("tr",[t("td",[e._v("0.14")]),e._v(" "),t("td",[e._v("January 2024")]),e._v(" "),t("td",[e._v("Added "),t("code",[e._v("isHidden")]),e._v(' property to file and folder metadata to enable clients to "hide" content from end users.')])])])]),e._v(" "),t("h2",{attrs:{id:"resources"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[e._v("#")]),e._v(" Resources")]),e._v(" "),t("p",[e._v("For more information, documentation, and community support, refer to the following resources:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Official Website"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://docs.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Developer Documentation"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://community.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Community Forums"),t("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{306:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"arfs-protocol-a-decentralized-file-system-on-arweave"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-protocol-a-decentralized-file-system-on-arweave"}},[e._v("#")]),e._v(" ArFS Protocol: A Decentralized File System on Arweave")]),e._v(" "),t("p",[e._v("Arweave File System, or β€œArFS” is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on "),t("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v("'s otherwise permanent, immutable data storage blockweave.")]),e._v(" "),t("p",[e._v("Due to Arweave's permanent, immutable and public nature traditional file system operations such as permissions, file/folder renaming and moving, and file updates cannot be done by simply updating the on-chain data model.")]),e._v(" "),t("p",[e._v("ArFS works around this by implementing a privacy and encryption pattern and defining an append-only transaction data model using tags within "),t("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#transaction-format",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Transaction headers"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"key-features"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features"}},[e._v("#")]),e._v(" Key Features")]),e._v(" "),t("h3",{attrs:{id:"file-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-structure"}},[e._v("#")]),e._v(" File Structure")]),e._v(" "),t("p",[e._v("ArFS organizes files and folders using a hierarchical structure. Files are stored as individual transactions on the Arweave blockchain, while folders are metadata that reference these file transactions.")]),e._v(" "),t("h3",{attrs:{id:"metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#metadata"}},[e._v("#")]),e._v(" Metadata")]),e._v(" "),t("p",[e._v("Each file and folder has associated metadata, such as the name, type, size, and modification timestamp. ArFS leverages Arweave's tagging system to store this metadata in a standardized format, which allows for easy querying and organization.")]),e._v(" "),t("h3",{attrs:{id:"file-permissions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-permissions"}},[e._v("#")]),e._v(" File Permissions")]),e._v(" "),t("p",[e._v("ArFS supports public and private file permissions. Public files can be accessed by anyone on the network, while private files are encrypted using the owner's private key, ensuring only they can decrypt and access the content.")]),e._v(" "),t("h3",{attrs:{id:"file-versioning"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-versioning"}},[e._v("#")]),e._v(" File Versioning")]),e._v(" "),t("p",[e._v("ArFS supports versioning of files, allowing users to store multiple versions of a file and access previous versions at any time. This is achieved by linking new file transactions to previous versions through the use of metadata tags.")]),e._v(" "),t("h3",{attrs:{id:"data-deduplication"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#data-deduplication"}},[e._v("#")]),e._v(" Data Deduplication")]),e._v(" "),t("p",[e._v("To minimize storage redundancy and costs, ArFS employs data deduplication techniques. If a user tries to store a file that already exists on the network, the protocol will simply create a new reference to the existing file instead of storing a duplicate copy.")]),e._v(" "),t("h3",{attrs:{id:"search-and-discovery"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#search-and-discovery"}},[e._v("#")]),e._v(" Search and Discovery")]),e._v(" "),t("p",[e._v("ArFS enables users to search and discover files based on their metadata, such as file names, types, and tags. This is made possible by indexing the metadata stored within the Arweave blockchain.")]),e._v(" "),t("h3",{attrs:{id:"interoperability"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#interoperability"}},[e._v("#")]),e._v(" Interoperability")]),e._v(" "),t("p",[e._v("ArFS is designed to be interoperable with other decentralized applications and services built on the Arweave network. This allows for seamless integration and collaboration between different applications and users.")]),e._v(" "),t("h2",{attrs:{id:"getting-started"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[e._v("#")]),e._v(" Getting Started")]),e._v(" "),t("p",[e._v("To start using ArFS, you'll need to familiarize yourself with the Arweave ecosystem, acquire AR tokens to cover storage costs, and choose a compatible client or library to interact with the ArFS protocol.")]),e._v(" "),t("h2",{attrs:{id:"arfs-version-history"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-version-history"}},[e._v("#")]),e._v(" ArFS Version History")]),e._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("tr",[t("th",[e._v("Version")]),e._v(" "),t("th",[e._v("Date")]),e._v(" "),t("th",[e._v("Release Notes")])]),e._v(" "),t("tr",[t("td",[e._v("0.10")]),e._v(" "),t("td",[e._v("August 2020")]),e._v(" "),t("td",[e._v("The brief, beta version that was in use during initial testing of ArDrive across Web (Dart) and legacy CLI (Typescript).")])]),e._v(" "),t("tr",[t("td",[e._v("0.11")]),e._v(" "),t("td",[e._v("September 2020")]),e._v(" "),t("td",[e._v("Includes all of the major functionality supporting file systems on Arweave including new drives, folders, files, renames, moves and privacy.")])]),e._v(" "),t("tr",[t("td",[e._v("0.12")]),e._v(" "),t("td",[e._v("December 2022")]),e._v(" "),t("td",[e._v("Added Snapshot entities to support quick synchronization of drive state.")])]),e._v(" "),t("tr",[t("td",[e._v("0.13")]),e._v(" "),t("td",[e._v("August 2023")]),e._v(" "),t("td",[e._v("Added pins")])]),e._v(" "),t("tr",[t("td",[e._v("0.14")]),e._v(" "),t("td",[e._v("January 2024")]),e._v(" "),t("td",[e._v("Added "),t("code",[e._v("isHidden")]),e._v(' property to file and folder metadata to enable clients to "hide" content from end users.')])])])]),e._v(" "),t("h2",{attrs:{id:"resources"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[e._v("#")]),e._v(" Resources")]),e._v(" "),t("p",[e._v("For more information, documentation, and community support, refer to the following resources:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Official Website"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://docs.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Developer Documentation"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://community.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Community Forums"),t("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/12.52d79d28.js b/assets/js/12.64f87dc2.js similarity index 99% rename from assets/js/12.52d79d28.js rename to assets/js/12.64f87dc2.js index f6ac563..7dd4a16 100644 --- a/assets/js/12.52d79d28.js +++ b/assets/js/12.64f87dc2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{306:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"privacy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#privacy"}},[e._v("#")]),e._v(" Privacy")]),e._v(" "),t("p",[e._v("The Arweave blockweave is inherently public. But with apps that use ArFS, like ArDrive, your private data never leaves your computer without using military grade (and "),t("a",{attrs:{href:"https://blog.boot.dev/cryptography/is-aes-256-quantum-resistant/#:~:text=Symmetric%20encryption%2C%20or%20more%20specifically,key%20sizes%20are%20large%20enough",target:"_blank",rel:"noopener noreferrer"}},[e._v("quantum resistant"),t("OutboundLink")],1),e._v(") encryption. This privacy layer is applied at the Drive level, and users determine whether a Drive is public or private when they first create it. Private drives must follow the ArFS privacy model.")]),e._v(" "),t("p",[e._v("With ArDrive specifically, every file within a Private Drive is symmetrically encrypted using "),t("a",{attrs:{href:"https://iopscience.iop.org/article/10.1088/1742-6596/1019/1/012008/pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-GCM"),t("OutboundLink")],1),e._v(" (for small files and metadata transactions) or "),t("a",{attrs:{href:"https://xilinx.github.io/Vitis_Libraries/security/2020.1/guide_L1/internals/ctr.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-CTR"),t("OutboundLink")],1),e._v(' (for large files, over 100MiB). Every Private drive has a master "Drive Key" which uses a combination of the user\'s Arweave wallet signature, a user defined drive password, and a unique drive identifier ('),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[e._v("uuidv4"),t("OutboundLink")],1),e._v('). Each file has its own "File Key" derived from the "Drive Key". This allows for single files to be shared without exposing access to the other files within the Drive.')]),e._v(" "),t("p",[e._v("Once a file is encrypted and stored on Arweave, it is locked forever and can only be decrypted using its file key.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": Usable encryption standards are not limited to AES-256-GCM or AES-256-CTR. Any Encryption method may be used so long as it is clearly indicated in the "),t("code",[e._v("cipher")]),e._v(" tag.")]),e._v(" "),t("h2",{attrs:{id:"deriving-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deriving-keys"}},[e._v("#")]),e._v(" Deriving Keys")]),e._v(" "),t("p",[e._v("Private drives have a global drive key, "),t("code",[e._v("D")]),e._v(", and multiple file keys "),t("code",[e._v("F")]),e._v(", for encryption. This enables a drive to have as many uniquely encrypted files as needed. One key is used for all versions of a single file (since new file versions use the same File-Id)")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is used for encrypting both Drive and Folder metadata, while "),t("code",[e._v("F")]),e._v(" is used for encrypting File metadata and the actual stored data. Having these different keys, "),t("code",[e._v("D")]),e._v(" and "),t("code",[e._v("F")]),e._v(", allows a user to share specific files without revealing the contents of their entire drive.")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is derived using HKDF-SHA256 with an "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Salt_(cryptography)",target:"_blank",rel:"noopener noreferrer"}},[e._v("unsalted"),t("OutboundLink")],1),e._v(" RSA-PSS signature of the drive's id and a user provided password.")]),e._v(" "),t("p",[t("code",[e._v("F")]),e._v(" is also derived using HKDF-SHA256 with the drive key and the file's id.")]),e._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:e.$withBase("/images/encryption-diagram.png")}}),e._v(" "),t("p",[e._v("Other wallets (like "),t("a",{attrs:{href:"https://www.arconnect.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArConnect"),t("OutboundLink")],1),e._v(") integrate with this Key Derivation protocol just exposing an API to collect a signature from a given Arweave Wallet in order to get the SHA-256 signature needed for the "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/HKDF",target:"_blank",rel:"noopener noreferrer"}},[e._v("HKDF"),t("OutboundLink")],1),e._v(" to derive the Drive Key.")]),e._v(" "),t("p",[e._v("An example implementation, using Dart, is available "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-web/blob/187b3fb30808bda452123c2b18931c898df6a3fb/docs/private_drive_kdf_reference.dart",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", with a Typescript implementation "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-core-js/blob/f19da30efd30a4370be53c9b07834eae764f8535/src/utils/crypto.ts",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"private-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-drives"}},[e._v("#")]),e._v(" Private Drives")]),e._v(" "),t("p",[e._v("Drives can store either public or private data. This is indicated by the "),t("code",[e._v("Drive-Privacy")]),e._v(" tag in the Drive entity metadata.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Drive-Privacy: ""\n')])])]),t("p",[e._v("If a Drive entity is private, an additional tag "),t("code",[e._v("Drive-Auth-Mode")]),e._v(" must also be used to indicate how the Drive Key is derived. ArDrive clients currently leverage a secure password along with the Arweave Wallet private key signature to derive the global Drive Key.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("Drive-Auth-Mode?: 'password'\n")])])]),t("p",[e._v("On every encrypted Drive Entity, a "),t("code",[e._v("Cipher")]),e._v(" tag must be specified, along with the public parameters for decrypting the data. This is done by specifying the parameter with a "),t("code",[e._v("Cipher-*")]),e._v(" tag. eg. "),t("code",[e._v("Cipher-IV")]),e._v(". If the parameter is byte data, it must be encoded as Base64 in the tag.")]),e._v(" "),t("p",[e._v("ArDrive clients currently leverage AES256-GCM for all symmetric encryption, which requires a Cipher Initialization Vector consisting of 12 random bytes.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Additionally, all encrypted transactions must have the "),t("code",[e._v("Content-Type")]),e._v(" tag "),t("code",[e._v("application/octet-stream")]),e._v(" as opposed to "),t("code",[e._v("application/json")])]),e._v(" "),t("p",[e._v("Private Drive Entities and their corresponding Root Folder Entities will both use these keys and ciphers generated to symmetrically encrypt the JSON files that are included in the transaction. This ensures that only the Drive Owner (and whomever the keys have been shared with) can open the drive, discover the root folder, and continue to load the rest of the children in the drive.")]),e._v(" "),t("h2",{attrs:{id:"private-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-files"}},[e._v("#")]),e._v(" Private Files")]),e._v(" "),t("p",[e._v("When a file is uploaded to a private drive, it by default also becomes private and leverages the same drive keys used for its parent drive. Each unique file in a drive will get its own set of file keys based off of that file's unique "),t("code",[e._v("FileId")]),e._v(". If a single file gets a new version, its "),t("code",[e._v("File-Id")]),e._v(" will be reused, effectively leveraging the same File Key for all versions in that file's history.")]),e._v(" "),t("p",[e._v("These file keys can be shared by the drive's owner as needed.")]),e._v(" "),t("p",[e._v("Private File entities have both its metadata and data transactions encrypted using the same File Key, ensuring all facets of the data is truly private. As such, both the file's metadata and data transactions must both have a unique "),t("code",[e._v("Cipher-IV")]),e._v(" and "),t("code",[e._v("Cipher")]),e._v(" tag:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Just like drives, private files must have the "),t("code",[e._v("Content-Type")]),e._v(" tag set as "),t("code",[e._v("application/octet-stream")]),e._v(" in both its metadata and data transactions:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Content-Type: "application/octet-stream"\n')])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{307:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"privacy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#privacy"}},[e._v("#")]),e._v(" Privacy")]),e._v(" "),t("p",[e._v("The Arweave blockweave is inherently public. But with apps that use ArFS, like ArDrive, your private data never leaves your computer without using military grade (and "),t("a",{attrs:{href:"https://blog.boot.dev/cryptography/is-aes-256-quantum-resistant/#:~:text=Symmetric%20encryption%2C%20or%20more%20specifically,key%20sizes%20are%20large%20enough",target:"_blank",rel:"noopener noreferrer"}},[e._v("quantum resistant"),t("OutboundLink")],1),e._v(") encryption. This privacy layer is applied at the Drive level, and users determine whether a Drive is public or private when they first create it. Private drives must follow the ArFS privacy model.")]),e._v(" "),t("p",[e._v("With ArDrive specifically, every file within a Private Drive is symmetrically encrypted using "),t("a",{attrs:{href:"https://iopscience.iop.org/article/10.1088/1742-6596/1019/1/012008/pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-GCM"),t("OutboundLink")],1),e._v(" (for small files and metadata transactions) or "),t("a",{attrs:{href:"https://xilinx.github.io/Vitis_Libraries/security/2020.1/guide_L1/internals/ctr.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-CTR"),t("OutboundLink")],1),e._v(' (for large files, over 100MiB). Every Private drive has a master "Drive Key" which uses a combination of the user\'s Arweave wallet signature, a user defined drive password, and a unique drive identifier ('),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[e._v("uuidv4"),t("OutboundLink")],1),e._v('). Each file has its own "File Key" derived from the "Drive Key". This allows for single files to be shared without exposing access to the other files within the Drive.')]),e._v(" "),t("p",[e._v("Once a file is encrypted and stored on Arweave, it is locked forever and can only be decrypted using its file key.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": Usable encryption standards are not limited to AES-256-GCM or AES-256-CTR. Any Encryption method may be used so long as it is clearly indicated in the "),t("code",[e._v("cipher")]),e._v(" tag.")]),e._v(" "),t("h2",{attrs:{id:"deriving-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deriving-keys"}},[e._v("#")]),e._v(" Deriving Keys")]),e._v(" "),t("p",[e._v("Private drives have a global drive key, "),t("code",[e._v("D")]),e._v(", and multiple file keys "),t("code",[e._v("F")]),e._v(", for encryption. This enables a drive to have as many uniquely encrypted files as needed. One key is used for all versions of a single file (since new file versions use the same File-Id)")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is used for encrypting both Drive and Folder metadata, while "),t("code",[e._v("F")]),e._v(" is used for encrypting File metadata and the actual stored data. Having these different keys, "),t("code",[e._v("D")]),e._v(" and "),t("code",[e._v("F")]),e._v(", allows a user to share specific files without revealing the contents of their entire drive.")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is derived using HKDF-SHA256 with an "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Salt_(cryptography)",target:"_blank",rel:"noopener noreferrer"}},[e._v("unsalted"),t("OutboundLink")],1),e._v(" RSA-PSS signature of the drive's id and a user provided password.")]),e._v(" "),t("p",[t("code",[e._v("F")]),e._v(" is also derived using HKDF-SHA256 with the drive key and the file's id.")]),e._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:e.$withBase("/images/encryption-diagram.png")}}),e._v(" "),t("p",[e._v("Other wallets (like "),t("a",{attrs:{href:"https://www.arconnect.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArConnect"),t("OutboundLink")],1),e._v(") integrate with this Key Derivation protocol just exposing an API to collect a signature from a given Arweave Wallet in order to get the SHA-256 signature needed for the "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/HKDF",target:"_blank",rel:"noopener noreferrer"}},[e._v("HKDF"),t("OutboundLink")],1),e._v(" to derive the Drive Key.")]),e._v(" "),t("p",[e._v("An example implementation, using Dart, is available "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-web/blob/187b3fb30808bda452123c2b18931c898df6a3fb/docs/private_drive_kdf_reference.dart",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", with a Typescript implementation "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-core-js/blob/f19da30efd30a4370be53c9b07834eae764f8535/src/utils/crypto.ts",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"private-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-drives"}},[e._v("#")]),e._v(" Private Drives")]),e._v(" "),t("p",[e._v("Drives can store either public or private data. This is indicated by the "),t("code",[e._v("Drive-Privacy")]),e._v(" tag in the Drive entity metadata.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Drive-Privacy: ""\n')])])]),t("p",[e._v("If a Drive entity is private, an additional tag "),t("code",[e._v("Drive-Auth-Mode")]),e._v(" must also be used to indicate how the Drive Key is derived. ArDrive clients currently leverage a secure password along with the Arweave Wallet private key signature to derive the global Drive Key.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("Drive-Auth-Mode?: 'password'\n")])])]),t("p",[e._v("On every encrypted Drive Entity, a "),t("code",[e._v("Cipher")]),e._v(" tag must be specified, along with the public parameters for decrypting the data. This is done by specifying the parameter with a "),t("code",[e._v("Cipher-*")]),e._v(" tag. eg. "),t("code",[e._v("Cipher-IV")]),e._v(". If the parameter is byte data, it must be encoded as Base64 in the tag.")]),e._v(" "),t("p",[e._v("ArDrive clients currently leverage AES256-GCM for all symmetric encryption, which requires a Cipher Initialization Vector consisting of 12 random bytes.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Additionally, all encrypted transactions must have the "),t("code",[e._v("Content-Type")]),e._v(" tag "),t("code",[e._v("application/octet-stream")]),e._v(" as opposed to "),t("code",[e._v("application/json")])]),e._v(" "),t("p",[e._v("Private Drive Entities and their corresponding Root Folder Entities will both use these keys and ciphers generated to symmetrically encrypt the JSON files that are included in the transaction. This ensures that only the Drive Owner (and whomever the keys have been shared with) can open the drive, discover the root folder, and continue to load the rest of the children in the drive.")]),e._v(" "),t("h2",{attrs:{id:"private-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-files"}},[e._v("#")]),e._v(" Private Files")]),e._v(" "),t("p",[e._v("When a file is uploaded to a private drive, it by default also becomes private and leverages the same drive keys used for its parent drive. Each unique file in a drive will get its own set of file keys based off of that file's unique "),t("code",[e._v("FileId")]),e._v(". If a single file gets a new version, its "),t("code",[e._v("File-Id")]),e._v(" will be reused, effectively leveraging the same File Key for all versions in that file's history.")]),e._v(" "),t("p",[e._v("These file keys can be shared by the drive's owner as needed.")]),e._v(" "),t("p",[e._v("Private File entities have both its metadata and data transactions encrypted using the same File Key, ensuring all facets of the data is truly private. As such, both the file's metadata and data transactions must both have a unique "),t("code",[e._v("Cipher-IV")]),e._v(" and "),t("code",[e._v("Cipher")]),e._v(" tag:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Just like drives, private files must have the "),t("code",[e._v("Content-Type")]),e._v(" tag set as "),t("code",[e._v("application/octet-stream")]),e._v(" in both its metadata and data transactions:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Content-Type: "application/octet-stream"\n')])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/13.6fa21843.js b/assets/js/13.9e65bb5c.js similarity index 95% rename from assets/js/13.6fa21843.js rename to assets/js/13.9e65bb5c.js index 10bbf99..2258fc5 100644 --- a/assets/js/13.6fa21843.js +++ b/assets/js/13.9e65bb5c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{307:function(a,t,e){"use strict";e.r(t);var i=e(10),s=Object(i.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h2",{attrs:{id:"schema-diagrams"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#schema-diagrams"}},[a._v("#")]),a._v(" Schema Diagrams")]),a._v(" "),t("p",[a._v("The following diagrams show complete examples of Drive, Folder, and File entity Schemas.")]),a._v(" "),t("h3",{attrs:{id:"public-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#public-drive"}},[a._v("#")]),a._v(" Public Drive")]),a._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:a.$withBase("/images/public-drive-schema.png")}}),a._v(" "),t("div",{staticClass:"caption"},[a._v("Public Drive Schema")]),a._v(" "),t("h3",{attrs:{id:"private-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-drive"}},[a._v("#")]),a._v(" Private Drive")]),a._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:a.$withBase("/images/private-drive-schema.png")}}),a._v(" "),t("div",{staticClass:"caption"},[a._v("Private Drive Schema")]),a._v(" "),t("p",[a._v("Arweave GQL Tag Byte Limit is restricted to "),t("code",[a._v("2048")]),a._v(". There is no determined limit on Data JSON custom metadata, though more data results in a higher upload cost.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{308:function(a,t,e){"use strict";e.r(t);var i=e(10),s=Object(i.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h2",{attrs:{id:"schema-diagrams"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#schema-diagrams"}},[a._v("#")]),a._v(" Schema Diagrams")]),a._v(" "),t("p",[a._v("The following diagrams show complete examples of Drive, Folder, and File entity Schemas.")]),a._v(" "),t("h3",{attrs:{id:"public-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#public-drive"}},[a._v("#")]),a._v(" Public Drive")]),a._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:a.$withBase("/images/public-drive-schema.png")}}),a._v(" "),t("div",{staticClass:"caption"},[a._v("Public Drive Schema")]),a._v(" "),t("h3",{attrs:{id:"private-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-drive"}},[a._v("#")]),a._v(" Private Drive")]),a._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:a.$withBase("/images/private-drive-schema.png")}}),a._v(" "),t("div",{staticClass:"caption"},[a._v("Private Drive Schema")]),a._v(" "),t("p",[a._v("Arweave GQL Tag Byte Limit is restricted to "),t("code",[a._v("2048")]),a._v(". There is no determined limit on Data JSON custom metadata, though more data results in a higher upload cost.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/14.a9669fbc.js b/assets/js/14.d547cd1d.js similarity index 95% rename from assets/js/14.a9669fbc.js rename to assets/js/14.d547cd1d.js index 4ab2503..31a7243 100644 --- a/assets/js/14.a9669fbc.js +++ b/assets/js/14.d547cd1d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{308:function(e,t,a){"use strict";a.r(t);var r=a(10),n=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"drive-write-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#drive-write-operations"}},[e._v("#")]),e._v(" Drive Write Operations")]),e._v(" "),t("h2",{attrs:{id:"rename-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-drives"}},[e._v("#")]),e._v(" Rename Drives")]),e._v(" "),t("ul",[t("li",[e._v("A new root folder metadata transaction is created when a user wants to rename an existing drive.")]),e._v(" "),t("li",[e._v("The new root folder metadata transaction reuses the existing drive's "),t("code",[e._v("Drive-Id")]),e._v(" and "),t("code",[e._v("Folder-Id")]),e._v(", and copies all of its old metadata values, except the drive's and folder's "),t("code",[e._v("name")]),e._v(" field must be updated in its data JSON to the new drive name.\n"),t("ul",[t("li",[e._v("For private drives, new ciphers are generated for this new root folder metadata transaction.")])])]),e._v(" "),t("li",[e._v("The new root folder transaction must not have any "),t("code",[e._v("Parent-Folder-Id")]),e._v(" since it is a root folder.")])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{310:function(e,t,a){"use strict";a.r(t);var r=a(10),n=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"drive-write-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#drive-write-operations"}},[e._v("#")]),e._v(" Drive Write Operations")]),e._v(" "),t("h2",{attrs:{id:"rename-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-drives"}},[e._v("#")]),e._v(" Rename Drives")]),e._v(" "),t("ul",[t("li",[e._v("A new root folder metadata transaction is created when a user wants to rename an existing drive.")]),e._v(" "),t("li",[e._v("The new root folder metadata transaction reuses the existing drive's "),t("code",[e._v("Drive-Id")]),e._v(" and "),t("code",[e._v("Folder-Id")]),e._v(", and copies all of its old metadata values, except the drive's and folder's "),t("code",[e._v("name")]),e._v(" field must be updated in its data JSON to the new drive name.\n"),t("ul",[t("li",[e._v("For private drives, new ciphers are generated for this new root folder metadata transaction.")])])]),e._v(" "),t("li",[e._v("The new root folder transaction must not have any "),t("code",[e._v("Parent-Folder-Id")]),e._v(" since it is a root folder.")])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/16.b4facc7a.js b/assets/js/16.d38b52bc.js similarity index 97% rename from assets/js/16.b4facc7a.js rename to assets/js/16.d38b52bc.js index 17a52e0..3b3ea0d 100644 --- a/assets/js/16.b4facc7a.js +++ b/assets/js/16.d38b52bc.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{310:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"folder-write-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-write-operations"}},[e._v("#")]),e._v(" Folder Write Operations")]),e._v(" "),t("h2",{attrs:{id:"move-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#move-folder"}},[e._v("#")]),e._v(" Move Folder")]),e._v(" "),t("p",[e._v("Folders can be moved from one folder to another within the same Drive.")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction is created when a user wants to move a folder into a different folder.")]),e._v(" "),t("li",[e._v("The new file metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the file’s "),t("code",[e._v("Parent-Folder-Id")]),e._v(" must be updated to the "),t("code",[e._v("Folder-Id")]),e._v(" of the folder is was just moved to.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.")])]),e._v(" "),t("h2",{attrs:{id:"rename-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-folder"}},[e._v("#")]),e._v(" Rename Folder")]),e._v(" "),t("p",[e._v("Folders can be renamed from one name to another.")]),e._v(" "),t("ul",[t("li",[e._v("A new folder metadata transaction is created when a user wants to rename an existing folder.")]),e._v(" "),t("li",[e._v("The new folder metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the folder’s "),t("code",[e._v("name")]),e._v(" field in its Data JSON must be updated to the new folder name.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{311:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"folder-write-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-write-operations"}},[e._v("#")]),e._v(" Folder Write Operations")]),e._v(" "),t("h2",{attrs:{id:"move-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#move-folder"}},[e._v("#")]),e._v(" Move Folder")]),e._v(" "),t("p",[e._v("Folders can be moved from one folder to another within the same Drive.")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction is created when a user wants to move a folder into a different folder.")]),e._v(" "),t("li",[e._v("The new file metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the file’s "),t("code",[e._v("Parent-Folder-Id")]),e._v(" must be updated to the "),t("code",[e._v("Folder-Id")]),e._v(" of the folder is was just moved to.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.")])]),e._v(" "),t("h2",{attrs:{id:"rename-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-folder"}},[e._v("#")]),e._v(" Rename Folder")]),e._v(" "),t("p",[e._v("Folders can be renamed from one name to another.")]),e._v(" "),t("ul",[t("li",[e._v("A new folder metadata transaction is created when a user wants to rename an existing folder.")]),e._v(" "),t("li",[e._v("The new folder metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the folder’s "),t("code",[e._v("name")]),e._v(" field in its Data JSON must be updated to the new folder name.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/17.bfa916b3.js b/assets/js/17.c2356ca0.js similarity index 77% rename from assets/js/17.bfa916b3.js rename to assets/js/17.c2356ca0.js index d46a9e8..8addf20 100644 --- a/assets/js/17.bfa916b3.js +++ b/assets/js/17.c2356ca0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{311:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{312:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/18.bcf5b6ac.js b/assets/js/18.316dfeab.js similarity index 98% rename from assets/js/18.bcf5b6ac.js rename to assets/js/18.316dfeab.js index a8d30f9..0d56365 100644 --- a/assets/js/18.bcf5b6ac.js +++ b/assets/js/18.316dfeab.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{312:function(e,t,i){"use strict";i.r(t);var r=i(10),v=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"create-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-drive"}},[e._v("#")]),e._v(" Create Drive")]),e._v(" "),t("p",[e._v("To properly create a new drive, two new entities need to be created: a new Drive entity and a new Folder entity to serve as the root folder of that drive.")]),e._v(" "),t("h2",{attrs:{id:"new-drive-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-drive-entity"}},[e._v("#")]),e._v(" New Drive Entity")]),e._v(" "),t("ul",[t("li",[e._v("The user must specify a "),t("code",[e._v("name")]),e._v(" of the drive which is stored within the Drive Entity's metadata JSON.")]),e._v(" "),t("li",[e._v("ArDrive generates a new unique uuidv4 for the drive entity's "),t("code",[e._v("Drive-Id")]),e._v(".")]),e._v(" "),t("li",[e._v("ArDrive also generates a new unique uuidv4 for the drive entity's "),t("code",[e._v("rootFolderId")]),e._v(", which will refer to the "),t("code",[e._v("Folder-Id")]),e._v(" of the new folder entity that will be created.\n"),t("ul",[t("li",[e._v("This "),t("code",[e._v("rootFolderId")]),e._v(" is stored within the Drive Entity's metadata JSON.")])])]),e._v(" "),t("li",[e._v("Drive Entity Metadata transactions must have "),t("code",[e._v('Entity-Type: "drive"')]),e._v(".")]),e._v(" "),t("li",[e._v("ArDrive will that the current local system time as seconds since Unix epoch for the Drive Entity's "),t("code",[e._v("Unix-Time")]),e._v(".")]),e._v(" "),t("li",[e._v("The Drive Entity's "),t("code",[e._v("Drive-Privacy")]),e._v(" must also be set to "),t("code",[e._v("public")]),e._v(" or "),t("code",[e._v("private")]),e._v(" in order for its subfolders and files to have the correct security settings.")]),e._v(" "),t("li",[e._v("If the drive is private:\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the correct encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(").")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for the private drive.")]),e._v(" "),t("li",[e._v("The ArFS client must derive the Drive Key and encrypt the Drive Entity's metadata JSON using the assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")]),e._v(".")])])])]),e._v(" "),t("h2",{attrs:{id:"new-root-folder-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-root-folder-entity"}},[e._v("#")]),e._v(" New Root Folder Entity")]),e._v(" "),t("ul",[t("li",[e._v("The "),t("code",[e._v("name")]),e._v(" of the drive and folder entities must be the same.\n"),t("ul",[t("li",[e._v("This "),t("code",[e._v("name")]),e._v(" is stored within the Folder Entity's metadata JSON.")])])]),e._v(" "),t("li",[e._v("The Folder Entity's "),t("code",[e._v("Folder-Id")]),e._v(" must match the "),t("code",[e._v("rootFolderId")]),e._v(" previously created for the Drive Entity.")]),e._v(" "),t("li",[e._v("The Folder Entity's "),t("code",[e._v("Drive-Id")]),e._v(" must match the "),t("code",[e._v("Drive-Id")]),e._v(" previously created for the Drive Entity.")]),e._v(" "),t("li",[e._v("The Folder Entity must not include a "),t("code",[e._v("Parent-Folder-Id")]),e._v(" tag.\n"),t("ul",[t("li",[e._v("This is how it is determined to be the root folder for a drive.")])])]),e._v(" "),t("li",[e._v("Folder Entity metadata transactions must have "),t("code",[e._v("Entity-Type: 'folder'")]),e._v(".")]),e._v(" "),t("li",[e._v("The client gets the user's local time for the "),t("code",[e._v("Unix-Time")]),e._v(" tag, represented as seconds since Unix Epoch.")]),e._v(" "),t("li",[e._v("Public folders must have the content type "),t("code",[e._v('Content-Type: "application/json"')]),e._v(".")]),e._v(" "),t("li",[e._v("If the folder is private\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the correct encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(").")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for the private folder.")]),e._v(" "),t("li",[e._v("Its content type must be "),t("code",[e._v('Content-Type: "application/octet-stream"')]),e._v(".")]),e._v(" "),t("li",[e._v("The ArFS client must encrypt the Drive Entity's metadata JSON using the assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")]),e._v(".")])])])])])}),[],!1,null,null,null);t.default=v.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{313:function(e,t,i){"use strict";i.r(t);var r=i(10),v=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"create-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-drive"}},[e._v("#")]),e._v(" Create Drive")]),e._v(" "),t("p",[e._v("To properly create a new drive, two new entities need to be created: a new Drive entity and a new Folder entity to serve as the root folder of that drive.")]),e._v(" "),t("h2",{attrs:{id:"new-drive-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-drive-entity"}},[e._v("#")]),e._v(" New Drive Entity")]),e._v(" "),t("ul",[t("li",[e._v("The user must specify a "),t("code",[e._v("name")]),e._v(" of the drive which is stored within the Drive Entity's metadata JSON.")]),e._v(" "),t("li",[e._v("ArDrive generates a new unique uuidv4 for the drive entity's "),t("code",[e._v("Drive-Id")]),e._v(".")]),e._v(" "),t("li",[e._v("ArDrive also generates a new unique uuidv4 for the drive entity's "),t("code",[e._v("rootFolderId")]),e._v(", which will refer to the "),t("code",[e._v("Folder-Id")]),e._v(" of the new folder entity that will be created.\n"),t("ul",[t("li",[e._v("This "),t("code",[e._v("rootFolderId")]),e._v(" is stored within the Drive Entity's metadata JSON.")])])]),e._v(" "),t("li",[e._v("Drive Entity Metadata transactions must have "),t("code",[e._v('Entity-Type: "drive"')]),e._v(".")]),e._v(" "),t("li",[e._v("ArDrive will that the current local system time as seconds since Unix epoch for the Drive Entity's "),t("code",[e._v("Unix-Time")]),e._v(".")]),e._v(" "),t("li",[e._v("The Drive Entity's "),t("code",[e._v("Drive-Privacy")]),e._v(" must also be set to "),t("code",[e._v("public")]),e._v(" or "),t("code",[e._v("private")]),e._v(" in order for its subfolders and files to have the correct security settings.")]),e._v(" "),t("li",[e._v("If the drive is private:\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the correct encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(").")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for the private drive.")]),e._v(" "),t("li",[e._v("The ArFS client must derive the Drive Key and encrypt the Drive Entity's metadata JSON using the assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")]),e._v(".")])])])]),e._v(" "),t("h2",{attrs:{id:"new-root-folder-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-root-folder-entity"}},[e._v("#")]),e._v(" New Root Folder Entity")]),e._v(" "),t("ul",[t("li",[e._v("The "),t("code",[e._v("name")]),e._v(" of the drive and folder entities must be the same.\n"),t("ul",[t("li",[e._v("This "),t("code",[e._v("name")]),e._v(" is stored within the Folder Entity's metadata JSON.")])])]),e._v(" "),t("li",[e._v("The Folder Entity's "),t("code",[e._v("Folder-Id")]),e._v(" must match the "),t("code",[e._v("rootFolderId")]),e._v(" previously created for the Drive Entity.")]),e._v(" "),t("li",[e._v("The Folder Entity's "),t("code",[e._v("Drive-Id")]),e._v(" must match the "),t("code",[e._v("Drive-Id")]),e._v(" previously created for the Drive Entity.")]),e._v(" "),t("li",[e._v("The Folder Entity must not include a "),t("code",[e._v("Parent-Folder-Id")]),e._v(" tag.\n"),t("ul",[t("li",[e._v("This is how it is determined to be the root folder for a drive.")])])]),e._v(" "),t("li",[e._v("Folder Entity metadata transactions must have "),t("code",[e._v("Entity-Type: 'folder'")]),e._v(".")]),e._v(" "),t("li",[e._v("The client gets the user's local time for the "),t("code",[e._v("Unix-Time")]),e._v(" tag, represented as seconds since Unix Epoch.")]),e._v(" "),t("li",[e._v("Public folders must have the content type "),t("code",[e._v('Content-Type: "application/json"')]),e._v(".")]),e._v(" "),t("li",[e._v("If the folder is private\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the correct encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(").")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for the private folder.")]),e._v(" "),t("li",[e._v("Its content type must be "),t("code",[e._v('Content-Type: "application/octet-stream"')]),e._v(".")]),e._v(" "),t("li",[e._v("The ArFS client must encrypt the Drive Entity's metadata JSON using the assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")]),e._v(".")])])])])])}),[],!1,null,null,null);t.default=v.exports}}]); \ No newline at end of file diff --git a/assets/js/19.87af2120.js b/assets/js/19.a66ada0d.js similarity index 97% rename from assets/js/19.87af2120.js rename to assets/js/19.a66ada0d.js index 71e193d..7f9332b 100644 --- a/assets/js/19.87af2120.js +++ b/assets/js/19.a66ada0d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{313:function(e,t,a){"use strict";a.r(t);var i=a(10),n=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"create-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-file"}},[e._v("#")]),e._v(" Create File")]),e._v(" "),t("h2",{attrs:{id:"new-file-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-file-entity"}},[e._v("#")]),e._v(" New File Entity")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction and a separate data transaction are created when a user wants to create a new file.")]),e._v(" "),t("li",[e._v("Files can only be created in existing drives, and must have a valid Drive-Id.")]),e._v(" "),t("li",[e._v("Files can only be created in existing parent folders, and must have a valid Parent-Folder-Id.")]),e._v(" "),t("li",[e._v("The new File Entity Data transaction must only specify the file’s mime type aka Content-Type.")]),e._v(" "),t("li",[e._v("The new file metadata transaction must generate a new UUIDv4 for the File-Id.")]),e._v(" "),t("li",[e._v('File metadata transactions must have Entity-Type: "file".')]),e._v(" "),t("li",[e._v("The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.\n"),t("ul",[t("li",[e._v("The client populates the File Entity Metadata Transaction Data JSON after creating the data transaction.")]),e._v(" "),t("li",[t("code",[e._v("name")]),e._v(" The name of the file including extension.")]),e._v(" "),t("li",[t("code",[e._v("size")]),e._v(" The size of the file on disk, in bytes as an integer.")]),e._v(" "),t("li",[t("code",[e._v("lastModifiedDate")]),e._v(" The file’s last time of modification as reported by the user’s operating system, in milliseconds since Unix epoch.")]),e._v(" "),t("li",[t("code",[e._v("dataTxId")]),e._v(" The Arweave transaction id of this File Entity’s Data Transaction.")]),e._v(" "),t("li",[t("code",[e._v("dataContentType")]),e._v(" The mime time of this File Entity’s data must be determined by the client.")]),e._v(" "),t("li",[t("code",[e._v("isHidden")]),e._v(" A boolean telling clients if they should display the file or not.")])])]),e._v(" "),t("li",[e._v("If the File is private:\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the respective encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(") for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for both the Metadata and Data transactions. Each one has its own unique IV.")]),e._v(" "),t("li",[e._v("It must have the content type "),t("code",[e._v('Content-Type: "application/octet-stream"')]),e._v(" for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("The ArFS client must encrypt the File Entity’s Data and Metadata JSON using their assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{314:function(e,t,a){"use strict";a.r(t);var i=a(10),n=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"create-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-file"}},[e._v("#")]),e._v(" Create File")]),e._v(" "),t("h2",{attrs:{id:"new-file-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-file-entity"}},[e._v("#")]),e._v(" New File Entity")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction and a separate data transaction are created when a user wants to create a new file.")]),e._v(" "),t("li",[e._v("Files can only be created in existing drives, and must have a valid Drive-Id.")]),e._v(" "),t("li",[e._v("Files can only be created in existing parent folders, and must have a valid Parent-Folder-Id.")]),e._v(" "),t("li",[e._v("The new File Entity Data transaction must only specify the file’s mime type aka Content-Type.")]),e._v(" "),t("li",[e._v("The new file metadata transaction must generate a new UUIDv4 for the File-Id.")]),e._v(" "),t("li",[e._v('File metadata transactions must have Entity-Type: "file".')]),e._v(" "),t("li",[e._v("The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.\n"),t("ul",[t("li",[e._v("The client populates the File Entity Metadata Transaction Data JSON after creating the data transaction.")]),e._v(" "),t("li",[t("code",[e._v("name")]),e._v(" The name of the file including extension.")]),e._v(" "),t("li",[t("code",[e._v("size")]),e._v(" The size of the file on disk, in bytes as an integer.")]),e._v(" "),t("li",[t("code",[e._v("lastModifiedDate")]),e._v(" The file’s last time of modification as reported by the user’s operating system, in milliseconds since Unix epoch.")]),e._v(" "),t("li",[t("code",[e._v("dataTxId")]),e._v(" The Arweave transaction id of this File Entity’s Data Transaction.")]),e._v(" "),t("li",[t("code",[e._v("dataContentType")]),e._v(" The mime time of this File Entity’s data must be determined by the client.")]),e._v(" "),t("li",[t("code",[e._v("isHidden")]),e._v(" A boolean telling clients if they should display the file or not.")])])]),e._v(" "),t("li",[e._v("If the File is private:\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the respective encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(") for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for both the Metadata and Data transactions. Each one has its own unique IV.")]),e._v(" "),t("li",[e._v("It must have the content type "),t("code",[e._v('Content-Type: "application/octet-stream"')]),e._v(" for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("The ArFS client must encrypt the File Entity’s Data and Metadata JSON using their assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/21.87cbd7a3.js b/assets/js/21.0b8a84f4.js similarity index 77% rename from assets/js/21.87cbd7a3.js rename to assets/js/21.0b8a84f4.js index 82b3410..a3cffff 100644 --- a/assets/js/21.87cbd7a3.js +++ b/assets/js/21.0b8a84f4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{314:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{316:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/22.9aed6039.js b/assets/js/22.c14d1e2a.js similarity index 96% rename from assets/js/22.9aed6039.js rename to assets/js/22.c14d1e2a.js index a02dcdb..752eccb 100644 --- a/assets/js/22.9aed6039.js +++ b/assets/js/22.c14d1e2a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{316:function(e,t,a){"use strict";a.r(t);var i=a(10),n=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"extending-schemas"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#extending-schemas"}},[e._v("#")]),e._v(" Extending Schemas")]),e._v(" "),t("p",[e._v("Web app and clients can extend the ArFS Schema as needed by adding additional tags into the File and Folder MetaData Transaction JSON. This gives Developers additional flexibility to support specific application needs, without breaking the overall data model or impacting privacy.")]),e._v(" "),t("p",[e._v("For example a Music Sharing App could use the following expanded File Metadata for specific music files.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('{\n "name": "",\n "size": ,\n "lastModifiedDate": \n "dataTxId": "",\n "dataContentType": ""\n "bandName": ""\n "bandAlbum": ""\n "albumSong": ""\n}\n')])])]),t("p",[e._v("Additionally, the above extended Metadata fields could be added directly as a transaction tag as well, in order to support GraphQL queries.")]),e._v(" "),t("h2",{staticStyle:{"border-bottom":"none"}},[e._v("Arweave Transaction Headers can only fit a maximum of 2048 bytes total, so this must be taken into account by clients writing custom GQL tags.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{317:function(e,t,a){"use strict";a.r(t);var i=a(10),n=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"extending-schemas"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#extending-schemas"}},[e._v("#")]),e._v(" Extending Schemas")]),e._v(" "),t("p",[e._v("Web app and clients can extend the ArFS Schema as needed by adding additional tags into the File and Folder MetaData Transaction JSON. This gives Developers additional flexibility to support specific application needs, without breaking the overall data model or impacting privacy.")]),e._v(" "),t("p",[e._v("For example a Music Sharing App could use the following expanded File Metadata for specific music files.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('{\n "name": "",\n "size": ,\n "lastModifiedDate": \n "dataTxId": "",\n "dataContentType": ""\n "bandName": ""\n "bandAlbum": ""\n "albumSong": ""\n}\n')])])]),t("p",[e._v("Additionally, the above extended Metadata fields could be added directly as a transaction tag as well, in order to support GraphQL queries.")]),e._v(" "),t("h2",{staticStyle:{"border-bottom":"none"}},[e._v("Arweave Transaction Headers can only fit a maximum of 2048 bytes total, so this must be taken into account by clients writing custom GQL tags.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/23.d58430df.js b/assets/js/23.37707ee1.js similarity index 98% rename from assets/js/23.d58430df.js rename to assets/js/23.37707ee1.js index fd29b4d..c435939 100644 --- a/assets/js/23.d58430df.js +++ b/assets/js/23.37707ee1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{317:function(e,t,i){"use strict";i.r(t);var r=i(10),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"read-arfs-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#read-arfs-data"}},[e._v("#")]),e._v(" Read ArFS Data")]),e._v(" "),t("p",[e._v("Clients can perform read operations to create a timeline of entity write transactions which can then be replayed to construct the Drive state. This is done by querying an Arweave GraphQL index for the user’s respective transactions. "),t("a",{attrs:{href:"https://gql-guide.vercel.app/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave GraphQL Guide"),t("OutboundLink")],1),e._v(" can provide more information on how to use Arweave GraphQL. If no GraphQL index is available, drive state can only be generated by downloading and inspecting all transactions made by the user’s wallet")]),e._v(" "),t("p",[e._v("This timeline of transactions should be grouped by the block number of each transaction. At every step of the timeline, the client can check if the entity was written by an authorized user. This also conveniently enables the client to surface a trusted entity version history to the user.")]),e._v(" "),t("p",[e._v("To determine the owner of a Drive, clients must check for who created the first Drive Entity transaction using that "),t("code",[e._v("Drive-Id")]),e._v(". Until a trusted permissions or ACL system is put in place, any transaction in a drive created by any wallet other than the one who created the first Drive Entity transaction could be considered spam.")]),e._v(" "),t("p",[e._v("The "),t("code",[e._v("Unix-Time")]),e._v(" defined on each transaction should be reserved for tie-breaking same entity updates in the same block and should not be trusted as the source of truth for entity write ordering. This is unimportant for single owner drives but is crucial for multi-owner drives with updateable permissions (currently undefined in this spec) as a malicious user could fake the "),t("code",[e._v("Unix-Time")]),e._v(" to modify the drive timeline for other users.")]),e._v(" "),t("ul",[t("li",[e._v("Drives that have been updated many times can have a long entity timeline which can be a performance bottleneck. To avoid this, clients can cache the drive state locally and sync updates to the file system by only querying for entities in blocks higher than the last time they checked.")]),e._v(" "),t("li",[e._v("Not checking for Drive Ownership could result in seeing incorrect drive state and GraphQL queries.")])]),e._v(" "),t("h2",{attrs:{id:"folder-file-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-file-paths"}},[e._v("#")]),e._v(" Folder/File Paths")]),e._v(" "),t("p",[e._v("ArweaveFS does not store folder or file paths along with entities as these paths will need to be updated whenever the parent folder name changes which can require many updates for deeply nested file systems. Instead, folder/file paths are left for the client to generate from the folder/file names.")]),e._v(" "),t("h2",{attrs:{id:"folder-view-queries"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-view-queries"}},[e._v("#")]),e._v(" Folder View Queries")]),e._v(" "),t("p",[e._v("Clients that want to provide users with a quick view of a single folder can simply query for an entity timeline for a particular folder by its id. Clients with multi-owner permissions will additionally have to query for the folder's parent drive entity for permission based filtering of the timeline.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{318:function(e,t,i){"use strict";i.r(t);var r=i(10),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"read-arfs-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#read-arfs-data"}},[e._v("#")]),e._v(" Read ArFS Data")]),e._v(" "),t("p",[e._v("Clients can perform read operations to create a timeline of entity write transactions which can then be replayed to construct the Drive state. This is done by querying an Arweave GraphQL index for the user’s respective transactions. "),t("a",{attrs:{href:"https://gql-guide.vercel.app/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave GraphQL Guide"),t("OutboundLink")],1),e._v(" can provide more information on how to use Arweave GraphQL. If no GraphQL index is available, drive state can only be generated by downloading and inspecting all transactions made by the user’s wallet")]),e._v(" "),t("p",[e._v("This timeline of transactions should be grouped by the block number of each transaction. At every step of the timeline, the client can check if the entity was written by an authorized user. This also conveniently enables the client to surface a trusted entity version history to the user.")]),e._v(" "),t("p",[e._v("To determine the owner of a Drive, clients must check for who created the first Drive Entity transaction using that "),t("code",[e._v("Drive-Id")]),e._v(". Until a trusted permissions or ACL system is put in place, any transaction in a drive created by any wallet other than the one who created the first Drive Entity transaction could be considered spam.")]),e._v(" "),t("p",[e._v("The "),t("code",[e._v("Unix-Time")]),e._v(" defined on each transaction should be reserved for tie-breaking same entity updates in the same block and should not be trusted as the source of truth for entity write ordering. This is unimportant for single owner drives but is crucial for multi-owner drives with updateable permissions (currently undefined in this spec) as a malicious user could fake the "),t("code",[e._v("Unix-Time")]),e._v(" to modify the drive timeline for other users.")]),e._v(" "),t("ul",[t("li",[e._v("Drives that have been updated many times can have a long entity timeline which can be a performance bottleneck. To avoid this, clients can cache the drive state locally and sync updates to the file system by only querying for entities in blocks higher than the last time they checked.")]),e._v(" "),t("li",[e._v("Not checking for Drive Ownership could result in seeing incorrect drive state and GraphQL queries.")])]),e._v(" "),t("h2",{attrs:{id:"folder-file-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-file-paths"}},[e._v("#")]),e._v(" Folder/File Paths")]),e._v(" "),t("p",[e._v("ArweaveFS does not store folder or file paths along with entities as these paths will need to be updated whenever the parent folder name changes which can require many updates for deeply nested file systems. Instead, folder/file paths are left for the client to generate from the folder/file names.")]),e._v(" "),t("h2",{attrs:{id:"folder-view-queries"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-view-queries"}},[e._v("#")]),e._v(" Folder View Queries")]),e._v(" "),t("p",[e._v("Clients that want to provide users with a quick view of a single folder can simply query for an entity timeline for a particular folder by its id. Clients with multi-owner permissions will additionally have to query for the folder's parent drive entity for permission based filtering of the timeline.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/24.1bf54df5.js b/assets/js/24.5b153833.js similarity index 98% rename from assets/js/24.1bf54df5.js rename to assets/js/24.5b153833.js index 7b109b0..3506ad8 100644 --- a/assets/js/24.1bf54df5.js +++ b/assets/js/24.5b153833.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{318:function(a,e,t){"use strict";t.r(e);var r=t(10),s=Object(r.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"all-ardrive-cli-commands"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#all-ardrive-cli-commands"}},[a._v("#")]),a._v(" All ArDrive CLI Commands")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v(" β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• β•šβ•β•β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘\n β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•\n\n\nWrite ArFS\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\ncreate-drive\ncreate-folder\nupload-file\ncreate-manifest\n\nmove-file\nmove-folder\n\nretry-tx\n\n\nRead ArFS\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\nfile-info\nfolder-info\ndrive-info\n\nlist-folder\nlist-drive\nlist-all-drives\n\ndownload-file\ndownload-folder\ndownload-drive\n\nWallet Ops\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\ngenerate-seedphrase\ngenerate-wallet\n\nget-address\nget-balance\nsend-ar\n\nget-drive-key\nget-file-key\n\nlast-tx\n\n\nArweave Ops\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\nbase-reward\nget-mempool\ncreate-tx\nsend-tx\ntx-status\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Learn more about a command:")]),a._v("\nardrive "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("command"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v("\n")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{320:function(a,e,t){"use strict";t.r(e);var r=t(10),s=Object(r.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"all-ardrive-cli-commands"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#all-ardrive-cli-commands"}},[a._v("#")]),a._v(" All ArDrive CLI Commands")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v(" β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• β•šβ•β•β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘\n β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•\n\n\nWrite ArFS\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\ncreate-drive\ncreate-folder\nupload-file\ncreate-manifest\n\nmove-file\nmove-folder\n\nretry-tx\n\n\nRead ArFS\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\nfile-info\nfolder-info\ndrive-info\n\nlist-folder\nlist-drive\nlist-all-drives\n\ndownload-file\ndownload-folder\ndownload-drive\n\nWallet Ops\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\ngenerate-seedphrase\ngenerate-wallet\n\nget-address\nget-balance\nsend-ar\n\nget-drive-key\nget-file-key\n\nlast-tx\n\n\nArweave Ops\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("==")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\nbase-reward\nget-mempool\ncreate-tx\nsend-tx\ntx-status\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Learn more about a command:")]),a._v("\nardrive "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("command"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v("\n")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/26.1cf9a876.js b/assets/js/26.9df4a032.js similarity index 99% rename from assets/js/26.1cf9a876.js rename to assets/js/26.9df4a032.js index 34c1d0f..d6fb199 100644 --- a/assets/js/26.1cf9a876.js +++ b/assets/js/26.9df4a032.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{323:function(e,t,a){"use strict";a.r(t);var s=a(10),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"getting-started"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[e._v("#")]),e._v(" Getting Started")]),e._v(" "),t("p",[e._v("To simply install the latest version of the CLI to your local system and get started, follow the "),t("a",{attrs:{href:"#quick-start"}},[e._v("Quick Start")]),e._v(" instructions. To build and/or develop the CLI from source, follow the "),t("a",{attrs:{href:"#build-from-source"}},[e._v("Build and Run from Source")]),e._v(" instructions. In either case, be sure to satisfy the requirements in the "),t("a",{attrs:{href:"#prerequisites"}},[e._v("Prerequisites")]),e._v(" section.")]),e._v(" "),t("h2",{attrs:{id:"prerequisites"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[e._v("#")]),e._v(" Prerequisites")]),e._v(" "),t("p",[e._v("The following tools must be installed whether performing a "),t("a",{attrs:{href:"#quick-start"}},[e._v("Quick Start")]),e._v(" or "),t("a",{attrs:{href:"#build-from-source"}},[e._v("Building from Source")]),e._v(":")]),e._v(" "),t("h3",{attrs:{id:"git"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#git"}},[e._v("#")]),e._v(" Git")]),e._v(" "),t("p",[e._v("Some of ArDrive's dependencies are transitively installed via Git. Install it, if necessary, and ensure that it's available within your terminal environment:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download Git"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"nvm-optional-recommended"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nvm-optional-recommended"}},[e._v("#")]),e._v(" NVM (Optional - Recommended)"),t("a",{attrs:{id:"nvm"}})]),e._v(" "),t("p",[e._v("This project uses the Node Version Manager (NVM) and an "),t("code",[e._v(".nvmrc")]),e._v(" file to lock the recommended Node version used by the latest version of "),t("code",[e._v("ardrive-core-js")]),e._v(".")]),e._v(" "),t("p",[t("strong",[e._v("Note for Windows: We recommend using WSL for setting up NVM on Windows using the "),t("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[e._v("instructions described here"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("Follow these steps to get NVM up and running on your system:")]),e._v(" "),t("ol",[t("li",[e._v("Install NVM using "),t("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[e._v("these installation instructions"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Navigate to this project's root directory")]),e._v(" "),t("li",[e._v("Ensure that the correct version of Node is installed by performing: "),t("code",[e._v("nvm install")])]),e._v(" "),t("li",[e._v("Use the correct version of Node, by performing: "),t("code",[e._v("nvm use")])])]),e._v(" "),t("p",[t("strong",[e._v("IT IS STRONGLY RECOMMENDED THAT YOU AVOID GENERATING WALLETS VIA SEED PHRASE WITH THE CLI USING ANY NODE VERSION OTHER THAN THE ONE SPECIFIED IN "),t("code",[e._v(".nvmrc")]),e._v(".")])]),e._v(" "),t("h2",{attrs:{id:"quick-start"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#quick-start"}},[e._v("#")]),e._v(" Quick Start")]),e._v(" "),t("p",[e._v("Once you've satisfied any necessary "),t("a",{attrs:{href:"#prerequisites"}},[e._v("prerequisites")]),e._v(", the fastest way to get up and running is to globally install the latest version of the ArDrive CLI to your local system via NPM:")]),e._v(" "),t("h3",{attrs:{id:"installing-and-starting-the-cli-from-npm-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installing-and-starting-the-cli-from-npm-package"}},[e._v("#")]),e._v(" Installing and Starting the CLI From NPM Package"),t("a",{attrs:{id:"install-from-npm"}})]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" ardrive-cli\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# then invoke the CLI from anywhere on your system:")]),e._v("\nardrive\n")])])]),t("h3",{attrs:{id:"upgrading-to-the-latest-version"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrading-to-the-latest-version"}},[e._v("#")]),e._v(" Upgrading to the Latest Version"),t("a",{attrs:{id:"upgrading"}})]),e._v(" "),t("p",[e._v("If you globally installed the CLI via NPM, then upgrade to the latest version by simply performing:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" update "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" ardrive-cli\n")])])]),t("h2",{attrs:{id:"build-and-run-from-source"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-and-run-from-source"}},[e._v("#")]),e._v(" Build and Run from Source"),t("a",{attrs:{id:"build-from-source"}})]),e._v(" "),t("h3",{attrs:{id:"install-yarn-3"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-yarn-3"}},[e._v("#")]),e._v(" Install Yarn 3"),t("a",{attrs:{id:"yarn3"}})]),e._v(" "),t("p",[e._v("Both the ArDrive CLI and ArDrive Core JS use Yarn 3 to manage dependencies and initiate workflows, so follow the "),t("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("yarn installation instructions"),t("OutboundLink")],1),e._v(" in order to get the latest version. In most cases:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Brew (OSX):")]),e._v("\nbrew "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Or with NPM (all supported platforms):")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n")])])]),t("h3",{attrs:{id:"husky-developers-only"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#husky-developers-only"}},[e._v("#")]),e._v(" Husky (Developers Only)"),t("a",{attrs:{id:"husky"}})]),e._v(" "),t("p",[e._v("We use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" husky "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v("\n")])])]),t("p",[e._v("to enable git hooks for your local checkout. Without doing so, you risk committing non-compliant code to the repository.")]),e._v(" "),t("h3",{attrs:{id:"using-a-custom-ardrive-core-js-optional"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-a-custom-ardrive-core-js-optional"}},[e._v("#")]),e._v(" Using a custom ArDrive-Core-JS (Optional)"),t("a",{attrs:{id:"custom-ardrive-core-js"}})]),e._v(" "),t("p",[e._v("To test a with a custom version of the "),t("code",[e._v("ardrive-core-js")]),e._v(" library on your local system, change the "),t("code",[e._v('"ardrive-core-js"')]),e._v(" line in "),t("code",[e._v("package.json")]),e._v(" to the root of your local "),t("code",[e._v("ardrive-core-js")]),e._v(" repo:")]),e._v(" "),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "ardrive-core-js": "1.0.0"\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "ardrive-core-js": "../ardrive-core-js/"\n')])])])])]),t("h3",{attrs:{id:"installing-and-starting-the-cli-from-source"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installing-and-starting-the-cli-from-source"}},[e._v("#")]),e._v(" Installing and Starting the CLI From Source"),t("a",{attrs:{id:"install-from-src"}})]),e._v(" "),t("p",[e._v("Now that your runtime and/or development environment is set up, to install the package simply run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&&")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" build\n")])])]),t("p",[e._v("And then start the CLI (always from the root of this repository):")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" ardrive\n")])])]),t("p",[e._v("For convenience in the "),t("strong",[e._v("non-developer case")]),e._v(", you can install the CLI globally on your system by performing the following step:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" pack\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# then using the path generated by yarn from the step above:")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" i "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" /path/to/package.tgz\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# then invoke the CLI from anywhere on your system:")]),e._v("\nardrive\n")])])]),t("h3",{attrs:{id:"recommended-visual-studio-code-extensions-developers-only"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions-developers-only"}},[e._v("#")]),e._v(" Recommended Visual Studio Code extensions (Developers Only)"),t("a",{attrs:{id:"vs-extensions"}})]),e._v(" "),t("p",[e._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[e._v("ES-Lint"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[e._v("Editor-Config"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prettier"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZipFS"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"limitations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#limitations"}},[e._v("#")]),e._v(" Limitations")]),e._v(" "),t("p",[t("strong",[e._v("Number of files in a bulk upload:")]),e._v(" Theoretically unlimited"),t("br"),e._v(" "),t("strong",[e._v("Max individual file size")]),e._v(": 2GB (Node.js limitation)"),t("br"),e._v(" "),t("strong",[e._v("Max file name length")]),e._v(": 255 bytes"),t("br"),e._v(" "),t("strong",[e._v("Max ANS-104 bundled transaction size:")]),e._v(" 500 MiB per bundle. App will handle creating multiple bundles."),t("br"),e._v(" "),t("strong",[e._v("Max ANS-104 data item counts per bundled transaction:")]),e._v(" 250 Files per bundle (500 Data Items).")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{322:function(e,t,a){"use strict";a.r(t);var s=a(10),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"getting-started"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[e._v("#")]),e._v(" Getting Started")]),e._v(" "),t("p",[e._v("To simply install the latest version of the CLI to your local system and get started, follow the "),t("a",{attrs:{href:"#quick-start"}},[e._v("Quick Start")]),e._v(" instructions. To build and/or develop the CLI from source, follow the "),t("a",{attrs:{href:"#build-from-source"}},[e._v("Build and Run from Source")]),e._v(" instructions. In either case, be sure to satisfy the requirements in the "),t("a",{attrs:{href:"#prerequisites"}},[e._v("Prerequisites")]),e._v(" section.")]),e._v(" "),t("h2",{attrs:{id:"prerequisites"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[e._v("#")]),e._v(" Prerequisites")]),e._v(" "),t("p",[e._v("The following tools must be installed whether performing a "),t("a",{attrs:{href:"#quick-start"}},[e._v("Quick Start")]),e._v(" or "),t("a",{attrs:{href:"#build-from-source"}},[e._v("Building from Source")]),e._v(":")]),e._v(" "),t("h3",{attrs:{id:"git"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#git"}},[e._v("#")]),e._v(" Git")]),e._v(" "),t("p",[e._v("Some of ArDrive's dependencies are transitively installed via Git. Install it, if necessary, and ensure that it's available within your terminal environment:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download Git"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"nvm-optional-recommended"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nvm-optional-recommended"}},[e._v("#")]),e._v(" NVM (Optional - Recommended)"),t("a",{attrs:{id:"nvm"}})]),e._v(" "),t("p",[e._v("This project uses the Node Version Manager (NVM) and an "),t("code",[e._v(".nvmrc")]),e._v(" file to lock the recommended Node version used by the latest version of "),t("code",[e._v("ardrive-core-js")]),e._v(".")]),e._v(" "),t("p",[t("strong",[e._v("Note for Windows: We recommend using WSL for setting up NVM on Windows using the "),t("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[e._v("instructions described here"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("Follow these steps to get NVM up and running on your system:")]),e._v(" "),t("ol",[t("li",[e._v("Install NVM using "),t("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[e._v("these installation instructions"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Navigate to this project's root directory")]),e._v(" "),t("li",[e._v("Ensure that the correct version of Node is installed by performing: "),t("code",[e._v("nvm install")])]),e._v(" "),t("li",[e._v("Use the correct version of Node, by performing: "),t("code",[e._v("nvm use")])])]),e._v(" "),t("p",[t("strong",[e._v("IT IS STRONGLY RECOMMENDED THAT YOU AVOID GENERATING WALLETS VIA SEED PHRASE WITH THE CLI USING ANY NODE VERSION OTHER THAN THE ONE SPECIFIED IN "),t("code",[e._v(".nvmrc")]),e._v(".")])]),e._v(" "),t("h2",{attrs:{id:"quick-start"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#quick-start"}},[e._v("#")]),e._v(" Quick Start")]),e._v(" "),t("p",[e._v("Once you've satisfied any necessary "),t("a",{attrs:{href:"#prerequisites"}},[e._v("prerequisites")]),e._v(", the fastest way to get up and running is to globally install the latest version of the ArDrive CLI to your local system via NPM:")]),e._v(" "),t("h3",{attrs:{id:"installing-and-starting-the-cli-from-npm-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installing-and-starting-the-cli-from-npm-package"}},[e._v("#")]),e._v(" Installing and Starting the CLI From NPM Package"),t("a",{attrs:{id:"install-from-npm"}})]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" ardrive-cli\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# then invoke the CLI from anywhere on your system:")]),e._v("\nardrive\n")])])]),t("h3",{attrs:{id:"upgrading-to-the-latest-version"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrading-to-the-latest-version"}},[e._v("#")]),e._v(" Upgrading to the Latest Version"),t("a",{attrs:{id:"upgrading"}})]),e._v(" "),t("p",[e._v("If you globally installed the CLI via NPM, then upgrade to the latest version by simply performing:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" update "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" ardrive-cli\n")])])]),t("h2",{attrs:{id:"build-and-run-from-source"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-and-run-from-source"}},[e._v("#")]),e._v(" Build and Run from Source"),t("a",{attrs:{id:"build-from-source"}})]),e._v(" "),t("h3",{attrs:{id:"install-yarn-3"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-yarn-3"}},[e._v("#")]),e._v(" Install Yarn 3"),t("a",{attrs:{id:"yarn3"}})]),e._v(" "),t("p",[e._v("Both the ArDrive CLI and ArDrive Core JS use Yarn 3 to manage dependencies and initiate workflows, so follow the "),t("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("yarn installation instructions"),t("OutboundLink")],1),e._v(" in order to get the latest version. In most cases:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Brew (OSX):")]),e._v("\nbrew "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Or with NPM (all supported platforms):")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n")])])]),t("h3",{attrs:{id:"husky-developers-only"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#husky-developers-only"}},[e._v("#")]),e._v(" Husky (Developers Only)"),t("a",{attrs:{id:"husky"}})]),e._v(" "),t("p",[e._v("We use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" husky "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v("\n")])])]),t("p",[e._v("to enable git hooks for your local checkout. Without doing so, you risk committing non-compliant code to the repository.")]),e._v(" "),t("h3",{attrs:{id:"using-a-custom-ardrive-core-js-optional"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-a-custom-ardrive-core-js-optional"}},[e._v("#")]),e._v(" Using a custom ArDrive-Core-JS (Optional)"),t("a",{attrs:{id:"custom-ardrive-core-js"}})]),e._v(" "),t("p",[e._v("To test a with a custom version of the "),t("code",[e._v("ardrive-core-js")]),e._v(" library on your local system, change the "),t("code",[e._v('"ardrive-core-js"')]),e._v(" line in "),t("code",[e._v("package.json")]),e._v(" to the root of your local "),t("code",[e._v("ardrive-core-js")]),e._v(" repo:")]),e._v(" "),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "ardrive-core-js": "1.0.0"\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "ardrive-core-js": "../ardrive-core-js/"\n')])])])])]),t("h3",{attrs:{id:"installing-and-starting-the-cli-from-source"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installing-and-starting-the-cli-from-source"}},[e._v("#")]),e._v(" Installing and Starting the CLI From Source"),t("a",{attrs:{id:"install-from-src"}})]),e._v(" "),t("p",[e._v("Now that your runtime and/or development environment is set up, to install the package simply run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&&")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" build\n")])])]),t("p",[e._v("And then start the CLI (always from the root of this repository):")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" ardrive\n")])])]),t("p",[e._v("For convenience in the "),t("strong",[e._v("non-developer case")]),e._v(", you can install the CLI globally on your system by performing the following step:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" pack\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# then using the path generated by yarn from the step above:")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" i "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" /path/to/package.tgz\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# then invoke the CLI from anywhere on your system:")]),e._v("\nardrive\n")])])]),t("h3",{attrs:{id:"recommended-visual-studio-code-extensions-developers-only"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions-developers-only"}},[e._v("#")]),e._v(" Recommended Visual Studio Code extensions (Developers Only)"),t("a",{attrs:{id:"vs-extensions"}})]),e._v(" "),t("p",[e._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[e._v("ES-Lint"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[e._v("Editor-Config"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prettier"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZipFS"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"limitations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#limitations"}},[e._v("#")]),e._v(" Limitations")]),e._v(" "),t("p",[t("strong",[e._v("Number of files in a bulk upload:")]),e._v(" Theoretically unlimited"),t("br"),e._v(" "),t("strong",[e._v("Max individual file size")]),e._v(": 2GB (Node.js limitation)"),t("br"),e._v(" "),t("strong",[e._v("Max file name length")]),e._v(": 255 bytes"),t("br"),e._v(" "),t("strong",[e._v("Max ANS-104 bundled transaction size:")]),e._v(" 500 MiB per bundle. App will handle creating multiple bundles."),t("br"),e._v(" "),t("strong",[e._v("Max ANS-104 data item counts per bundled transaction:")]),e._v(" 250 Files per bundle (500 Data Items).")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/27.f4b16956.js b/assets/js/27.9cdfa8f0.js similarity index 99% rename from assets/js/27.f4b16956.js rename to assets/js/27.9cdfa8f0.js index 0a89259..7868eef 100644 --- a/assets/js/27.f4b16956.js +++ b/assets/js/27.9cdfa8f0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{320:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cli"}},[t._v("#")]),t._v(" CLI")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("ArDrive Command Line Interface (CLI)")]),t._v(" is a Node.js application for terminal-based "),s("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive"),s("OutboundLink")],1),t._v(" workflows. It also offers utility operations for securely interacting with Arweave wallets and inspecting various "),s("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Arweave"),s("OutboundLink")],1),t._v(" blockchain conditions.")]),t._v(" "),s("p",[t._v("Create your first drive and permanently store your first file on the permaweb with a series of simple CLI commands like so:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("ardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Teenage Love Poetry"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"created"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"giv2R8Xj0bbe6l5taBTQJk_38zwIrMH_g1-knSCisjU"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"898687ea-b678-4f86-b4e7-49560b190356"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundledIn"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityName"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Teenage Love Poetry"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"VljnttwUxRStnVuPYakF9e2whjhYJVWB0nSxD5dVyJ8"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f0c58c11-430c-4383-8e54-4d864cc7e927"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundledIn"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityName"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Teenage Love Poetry"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundle"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundleTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tips"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"44579472"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f0c58c11-430c-4383-8e54-4d864cc7e927"')]),t._v(" --local-path ./helloworld.txt --dest-file-name "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ode_to_ardrive.txt"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"created"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityName"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ode_to_ardrive.txt"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tSMcfvAQu_tKLUkdvRRbqdX93oAf3h6c9eJsSj8mXL4"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"EvE06MmE9IKeUzFMnxSgY1M5tJX4uHU64-n8Pf_lZfU"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundledIn"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sourceUri"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file://Users/BestArDriver/Uploads/helloworld.txt"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundle"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundleTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tips"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"i325n3L2UvgcavEM8UnFfY0OWBiyf2RrbNsLStPI73o"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"winston"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("44579472")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("strong",[t._v("This project is in a state of active development. Use at your own risk!")])]),t._v(" "),s("h1",{attrs:{id:"ardrive"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ardrive"}},[t._v("#")]),t._v(" ArDrive")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive"),s("OutboundLink")],1),t._v(" is a permanent storage platform whose "),s("a",{attrs:{href:"https://github.com/ardriveapp/",target:"_blank",rel:"noopener noreferrer"}},[t._v("applications and core libraries"),s("OutboundLink")],1),t._v(" offer hierarchical organization, privacy via complete end-to-end encryption, flexibility, extensibility, and access control over your most valuable data, all made possible by its innovative core technology, the "),s("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/m6P1vJDo",target:"_blank",rel:"noopener noreferrer"}},[t._v("Arweave File System (ArFS) Protocol"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"arfs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arfs"}},[t._v("#")]),t._v(" ArFS")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/m6P1vJDo",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArFS"),s("OutboundLink")],1),t._v(" is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on "),s("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Arweave"),s("OutboundLink")],1),t._v("'s otherwise permanent, immutable data storage blockweave.")]),t._v(" "),s("h2",{attrs:{id:"data-portability"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#data-portability"}},[t._v("#")]),t._v(" Data Portability")]),t._v(" "),s("p",[t._v("Data uploaded via the ArDrive CLI, once indexed by Arweave's Gateways and sufficiently seeded across enough nodes on the network, can be accessed via all other ArDrive applications including the "),s("a",{attrs:{href:"https://app.ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive Web application"),s("OutboundLink")],1),t._v(" at https://app.ardrive.io.")]),t._v(" "),s("p",[t._v("All transactions successfully executed by ArDrive can always be inspected in the "),s("a",{attrs:{href:"https://viewblock.io/arweave/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Viewblock blockchain explorer"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"intended-audience"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#intended-audience"}},[t._v("#")]),t._v(" Intended Audience")]),t._v(" "),s("p",[t._v("This tool is intended for use by:")]),t._v(" "),s("ul",[s("li",[t._v("ArDrive power users with advanced workflows and resource efficiency in mind: bulk uploaders, those with larger storage demand, game developers, nft creators, storage/db admins, etc.")]),t._v(" "),s("li",[t._v("Automation tools")]),t._v(" "),s("li",[t._v("Services")]),t._v(" "),s("li",[t._v("Terminal aficionados")]),t._v(" "),s("li",[t._v("Extant and aspiring cypherpunks")])]),t._v(" "),s("p",[t._v("For deeper integrations with the "),s("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive"),s("OutboundLink")],1),t._v(" platform, consider using the "),s("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-core-js",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive Core"),s("OutboundLink")],1),t._v(" (Node) library's configurable and intuitive class interfaces directly within your application.")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{321:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cli"}},[t._v("#")]),t._v(" CLI")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("ArDrive Command Line Interface (CLI)")]),t._v(" is a Node.js application for terminal-based "),s("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive"),s("OutboundLink")],1),t._v(" workflows. It also offers utility operations for securely interacting with Arweave wallets and inspecting various "),s("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Arweave"),s("OutboundLink")],1),t._v(" blockchain conditions.")]),t._v(" "),s("p",[t._v("Create your first drive and permanently store your first file on the permaweb with a series of simple CLI commands like so:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("ardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Teenage Love Poetry"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"created"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"giv2R8Xj0bbe6l5taBTQJk_38zwIrMH_g1-knSCisjU"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"898687ea-b678-4f86-b4e7-49560b190356"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundledIn"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityName"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Teenage Love Poetry"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"VljnttwUxRStnVuPYakF9e2whjhYJVWB0nSxD5dVyJ8"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f0c58c11-430c-4383-8e54-4d864cc7e927"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundledIn"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityName"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Teenage Love Poetry"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundle"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundleTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tips"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"44579472"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f0c58c11-430c-4383-8e54-4d864cc7e927"')]),t._v(" --local-path ./helloworld.txt --dest-file-name "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ode_to_ardrive.txt"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"created"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityName"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ode_to_ardrive.txt"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"entityId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tSMcfvAQu_tKLUkdvRRbqdX93oAf3h6c9eJsSj8mXL4"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadataTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"EvE06MmE9IKeUzFMnxSgY1M5tJX4uHU64-n8Pf_lZfU"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundledIn"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sourceUri"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file://Users/BestArDriver/Uploads/helloworld.txt"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundle"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bundleTxId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tips"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txId"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"i325n3L2UvgcavEM8UnFfY0OWBiyf2RrbNsLStPI73o"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"winston"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("44579472")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("strong",[t._v("This project is in a state of active development. Use at your own risk!")])]),t._v(" "),s("h1",{attrs:{id:"ardrive"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ardrive"}},[t._v("#")]),t._v(" ArDrive")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive"),s("OutboundLink")],1),t._v(" is a permanent storage platform whose "),s("a",{attrs:{href:"https://github.com/ardriveapp/",target:"_blank",rel:"noopener noreferrer"}},[t._v("applications and core libraries"),s("OutboundLink")],1),t._v(" offer hierarchical organization, privacy via complete end-to-end encryption, flexibility, extensibility, and access control over your most valuable data, all made possible by its innovative core technology, the "),s("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/m6P1vJDo",target:"_blank",rel:"noopener noreferrer"}},[t._v("Arweave File System (ArFS) Protocol"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"arfs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arfs"}},[t._v("#")]),t._v(" ArFS")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/m6P1vJDo",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArFS"),s("OutboundLink")],1),t._v(" is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on "),s("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Arweave"),s("OutboundLink")],1),t._v("'s otherwise permanent, immutable data storage blockweave.")]),t._v(" "),s("h2",{attrs:{id:"data-portability"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#data-portability"}},[t._v("#")]),t._v(" Data Portability")]),t._v(" "),s("p",[t._v("Data uploaded via the ArDrive CLI, once indexed by Arweave's Gateways and sufficiently seeded across enough nodes on the network, can be accessed via all other ArDrive applications including the "),s("a",{attrs:{href:"https://app.ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive Web application"),s("OutboundLink")],1),t._v(" at https://app.ardrive.io.")]),t._v(" "),s("p",[t._v("All transactions successfully executed by ArDrive can always be inspected in the "),s("a",{attrs:{href:"https://viewblock.io/arweave/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Viewblock blockchain explorer"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"intended-audience"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#intended-audience"}},[t._v("#")]),t._v(" Intended Audience")]),t._v(" "),s("p",[t._v("This tool is intended for use by:")]),t._v(" "),s("ul",[s("li",[t._v("ArDrive power users with advanced workflows and resource efficiency in mind: bulk uploaders, those with larger storage demand, game developers, nft creators, storage/db admins, etc.")]),t._v(" "),s("li",[t._v("Automation tools")]),t._v(" "),s("li",[t._v("Services")]),t._v(" "),s("li",[t._v("Terminal aficionados")]),t._v(" "),s("li",[t._v("Extant and aspiring cypherpunks")])]),t._v(" "),s("p",[t._v("For deeper integrations with the "),s("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive"),s("OutboundLink")],1),t._v(" platform, consider using the "),s("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-core-js",target:"_blank",rel:"noopener noreferrer"}},[t._v("ArDrive Core"),s("OutboundLink")],1),t._v(" (Node) library's configurable and intuitive class interfaces directly within your application.")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/28.c03c1b8a.js b/assets/js/28.f732f00d.js similarity index 99% rename from assets/js/28.c03c1b8a.js rename to assets/js/28.f732f00d.js index d0a17b3..821ae66 100644 --- a/assets/js/28.c03c1b8a.js +++ b/assets/js/28.f732f00d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{321:function(a,t,e){"use strict";e.r(t);var s=e(10),n=Object(s.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"using-the-cli"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-the-cli"}},[a._v("#")]),a._v(" Using the CLI")]),a._v(" "),t("h2",{attrs:{id:"cli-help"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#cli-help"}},[a._v("#")]),a._v(" CLI Help")]),a._v(" "),t("p",[a._v("Learn to use any command:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v("\n")])])]),t("h2",{attrs:{id:"cli-version"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#cli-version"}},[a._v("#")]),a._v(" CLI Version")]),a._v(" "),t("p",[a._v("You can print out the version by running any of:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-V")]),a._v("\n")])])]),t("h2",{attrs:{id:"wallet-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wallet-operations"}},[a._v("#")]),a._v(" Wallet Operations")]),a._v(" "),t("p",[a._v("Browsing of ArDrive public data is possible without the need for an "),t("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/FpK8FuoQ",target:"_blank",rel:"noopener noreferrer"}},[a._v("Arweave wallet"),t("OutboundLink")],1),a._v(". However, for all write operations, or read operations without encryption/decryption keys, you'll need a wallet.")]),a._v(" "),t("p",[a._v("As you utilize the CLI, you can use either your wallet file or your seed phrase interchangeably. Consider the security implications of each approach for your particular use case carefully. If at any time you'd like to generate a new wallet altogether, start by generating a new seed phase. And if you'd like to use that seed phrase in the form of a wallet file, or if you'd like to recover an existing wallet via its seed phrase, use either or both of the following commands:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Generate seed-phrase")]),a._v("\nardrive generate-seedphrase\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"this is an example twelve word seed phrase that you could use"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Generate/recover wallet file (with example output file path)")]),a._v("\nardrive generate-wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-s")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"this is an example twelve word seed phrase that you could use"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" /path/to/wallet/file.json\n")])])]),t("p",[a._v("Public attributes of Arweave wallets can be retrieved via their 43-character Arweave wallet address. You can retrieve the wallet address associated with "),t("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/FpK8FuoQ",target:"_blank",rel:"noopener noreferrer"}},[a._v("your wallet file or 12-word seed phrase"),t("OutboundLink")],1),a._v(" (e.g. wallets generated by "),t("a",{attrs:{href:"https://arconnect.io/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArConnect"),t("OutboundLink")],1),a._v(") like so:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Wallet file")]),a._v("\nardrive get-address "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet/file.json\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Seed Phrase (with sample output)")]),a._v("\nardrive get-address "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-s")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"this is an example twelve word seed phrase that you could use"')]),a._v("\nHTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k\n")])])]),t("p",[a._v("You'll need AR in your wallet for any write operations you perform in ArDrive. You can always check your wallet balance (in both AR and Winston units) by performing:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Getting the balance for your own wallet")]),a._v("\nardrive get-balance "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet/file.json\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Getting the balance for ANY wallet (with sample output)")]),a._v("\nardrive get-balance "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1500000000000")]),a._v(" Winston\n"),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1.5")]),a._v(" AR\n")])])]),t("p",[a._v("If, at any time, you need to send AR out of your wallet to another wallet address, you may perform:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Using our previously generated wallet as the destination...")]),a._v("\nardrive send-ar "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet/file.json --dest-address "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"')]),a._v(" --ar-amount "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2.12345")]),a._v("\n")])])]),t("h2",{attrs:{id:"working-with-entities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-entities"}},[a._v("#")]),a._v(" Working With Entities")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive"),t("OutboundLink")],1),a._v("'s "),t("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/m6P1vJDo",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArFS"),t("OutboundLink")],1),a._v(" integration provides for hierarchical organization of your file and folder data on Arweave.")]),a._v(" "),t("p",[a._v("The fundamental entity types specified by ArFS are:")]),a._v(" "),t("ul",[t("li",[a._v("Drives")]),a._v(" "),t("li",[a._v("Folders")]),a._v(" "),t("li",[a._v("Files")])]),a._v(" "),t("p",[a._v("Each instance of these entities have a Version 4 UUID entity ID that is commonly referred to by its entity type, i.e. drive ID, folder ID, and file ID.")]),a._v(" "),t("p",[a._v("When you execute write functions with the CLI, the JSON output will contain information about the Arweave Transaction IDs that were registered when writing your entities to the blockweave, any miner rewards or "),t("a",{attrs:{href:"https://ardrive.io/community/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive Community"),t("OutboundLink")],1),a._v(" tips that were disbursed from your wallet, and any new entity IDs and, when applicable, encryption keys that were generated in the process of creating the entities. Typically, you'll want to keep track of those and get proficient with retrieving them in order to build your drive hierarchy to your liking. See "),t("a",{attrs:{href:"#understanding-drive-and-file-keys"}},[a._v("Understanding Drive and File Keys")]),a._v(" for more info.")]),a._v(" "),t("h3",{attrs:{id:"dry-run"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#dry-run"}},[a._v("#")]),a._v(" Dry Run")]),a._v(" "),t("p",[a._v("An important feature of the ArDrive CLI is the "),t("code",[a._v("--dry-run")]),a._v(' flag. On each command that would write an ArFS entity, there is the option to run it as a "dry run". This will run all of the steps and print the outputs of a regular ArFS write, but will skip sending the actual transaction:')]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("my-command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("other-options"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" --dry-run\n")])])]),t("p",[a._v("This can be very useful for gathering price estimations or to confirm that you've copy-pasted your entity IDs correctly before committing to an upload.")]),a._v(" "),t("h3",{attrs:{id:"uploading-to-turbo-beta"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-to-turbo-beta"}},[a._v("#")]),a._v(" Uploading to Turbo (BETA) "),t("a",{attrs:{id:"upload-to-turbo"}})]),a._v(" "),t("p",[a._v("Users can optionally choose to send each ArFS entities created to "),t("a",{attrs:{href:"https://ardrive.io/turbo/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive Turbo"),t("OutboundLink")],1),a._v(" using the "),t("code",[a._v("--turbo")]),a._v(" flag. Instead of using AR from an Arweave wallet, you can use Turbo Credits or take advantage of free/discounted upload promotions.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("my-command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("other-options"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--turbo")]),a._v("\n")])])]),t("p",[a._v("This flag will skip any balance check on the CLI side. Turbo will check a user's balance and accept/reject a data item at the time of upload. The "),t("code",[a._v("--turbo")]),a._v(" flag by default will send your files to "),t("code",[a._v("upload.ardrive.io")]),a._v(" to be bundled. To change the Turbo destination, users can use the "),t("code",[a._v("--turbo-url")]),a._v(" flag.")]),a._v(" "),t("h2",{attrs:{id:"working-with-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-drives"}},[a._v("#")]),a._v(" Working With Drives")]),a._v(" "),t("h3",{attrs:{id:"understanding-drive-hierarchies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#understanding-drive-hierarchies"}},[a._v("#")]),a._v(" Understanding Drive Hierarchies")]),a._v(" "),t("p",[a._v('At the root of every data tree is a "Drive" entity. When a drive is created, a Root Folder is also created for it. The entity IDs for both are generated and returned when you create a new drive:')]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Use `tee` to keep a receipt of the full set of transactions info and `jq` to focus on the data of interest")]),a._v("\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Teenage Love Poetry"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" created_drive.json "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v("\njq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'[.created[] | del(.metadataTxId, .entityName, .bundledIn)]'")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"drive"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"d1535126-fded-4990-809f-83a06f2a1118"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])]),t("p",[a._v("The relationship between the drive and its root folder is clearly visible when retrieving the drive's info:"),t("a",{attrs:{id:"drive-info"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive drive-info "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{driveId, rootFolderId}'")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"rootFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"d1535126-fded-4990-809f-83a06f2a1118"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n")])])]),t("p",[a._v('All file and folder entities in the drive will be anchored to it by a "Drive-ID" GQL Tag. And they\'ll each be anchored to a parent folder ID, tracked via the "Parent-Folder-ID" GQL tag, forming a tree structure whose base terminates at the Root Folder.')]),a._v(" "),t("h3",{attrs:{id:"understanding-drive-and-file-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#understanding-drive-and-file-keys"}},[a._v("#")]),a._v(" Understanding Drive and File Keys")]),a._v(" "),t("p",[a._v('Private Drives achieve privacy via end-to-end encryption facilitated by hash-derived "Keys". Drive Keys encrypt/decrypt Drive and Folder data, and File Keys encrypt/decrypt File Data.')]),a._v(" "),t("p",[a._v("The relationships among your data and their keys is as follows:")]),a._v(" "),t("ul",[t("li",[a._v("Drive Key = functionOf(Wallet Signature, Randomly Generated Drive ID, User-specified Drive Password)")]),a._v(" "),t("li",[a._v("File Key = functionOf(Randomly Generated File ID, Drive Key)")])]),a._v(" "),t("p",[a._v("When you create private entities, the returned JSON data from the ArDrive CLI will contain the keys needed to decrypt the encrypted representation of your entity that is now securely and permanently stored on the blockweave.")]),a._v(" "),t("p",[a._v("To derive the drive key again for a drive, perform the following:"),t("a",{attrs:{id:"derive-drive-key"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Will throw an error if the wallet or password specified can't be used to decrypt the on-chain drive")]),a._v("\nardrive get-drive-key "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n")])])]),t("p",[a._v("To derive the file key again for a file, perform the following:"),t("a",{attrs:{id:"derive-file-key"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Will throw an error if the drive key or drive-key-derivation data specified can't be used to decrypt the on-chain file")]),a._v("\nardrive get-file-key --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0"')]),a._v(" --drive-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" --drive-key "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"yHdCjpCK3EcuhQcKNx2d/NN5ReEjoKfZVqKunlCnPEo"')]),a._v("\n")])])]),t("h3",{attrs:{id:"managing-drive-passwords"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#managing-drive-passwords"}},[a._v("#")]),a._v(" Managing Drive Passwords")]),a._v(" "),t("p",[a._v("The ArDrive CLI's private drive and folder functions all require either a drive password OR a drive key. Private file functions require either the drive password or the file key. "),t("strong",[a._v("Keys and passwords are sensitive data, so manage the entry, display, storage, and transmission of them very carefully.")])]),a._v(" "),t("p",[a._v("Drive passwords are the most portable, and fundamental, encryption facet, so a few options are available during private drive operations for supplying them:")]),a._v(" "),t("ul",[t("li",[a._v("Environment Variable")]),a._v(" "),t("li",[a._v("STDIN")]),a._v(" "),t("li",[a._v("Secure Prompt")])]),a._v(" "),t("h4",{attrs:{id:"supplying-your-password-environment-variable"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supplying-your-password-environment-variable"}},[a._v("#")]),a._v(" Supplying Your Password: Environment Variable"),t("a",{attrs:{id:"pw-environment-variable"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Securely type your password into a read prompt, store it to TMP_ARDRIVE_PW, and export it for the shell session")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("read")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-rs")]),a._v(" TMP_ARDRIVE_PW\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ARDRIVE_DRIVE_PW")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("TMP_ARDRIVE_PW"),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n")])])]),t("h4",{attrs:{id:"supplying-your-password-stdin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supplying-your-password-stdin"}},[a._v("#")]),a._v(" Supplying Your Password: STDIN"),t("a",{attrs:{id:"pw-stdin"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Pipe your drive password to the ArDrive CLI")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" /path/to/my/drive/password.txt "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" ardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Redirect your drive password to the ArDrive CLI")]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v(" /path/to/my/drive/password.txt\n")])])]),t("h4",{attrs:{id:"supplying-your-password-prompt"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supplying-your-password-prompt"}},[a._v("#")]),a._v(" Supplying Your Password: Prompt"),t("a",{attrs:{id:"pw-prompt"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# When all other options fail, the CLI will prompt for your password (NOT COMPATIBLE WITH PIPES AND REDIRECTS!)")]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n? Enter drive password: β€Ί ********\n")])])]),t("h3",{attrs:{id:"creating-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-drives"}},[a._v("#")]),a._v(" Creating Drives")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Public drive")]),a._v("\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My Public Archive"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Private drive")]),a._v("\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Teenage Love Poetry"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n")])])]),t("h3",{attrs:{id:"listing-drives-for-an-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-drives-for-an-address"}},[a._v("#")]),a._v(" Listing Drives for an Address")]),a._v(" "),t("p",[a._v("You can list all the drives associated with any Arweave wallet address, though the details of private drives will be obfuscated from you unless you provide the necessary decryption data.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List all your own drives")]),a._v("\nardrive list-all-drives "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List any address's drives")]),a._v("\nardrive list-all-drives "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--address")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"')]),a._v("\n")])])]),t("h3",{attrs:{id:"listing-every-entity-in-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-every-entity-in-a-drive"}},[a._v("#")]),a._v(" Listing Every Entity in a Drive"),t("a",{attrs:{id:"list-drive"}})]),a._v(" "),t("p",[a._v("Useful notes on listing the contents of drives:")]),a._v(" "),t("ul",[t("li",[a._v("Listing a drive is effectively the same as listing its root folder.")]),a._v(" "),t("li",[a._v("You can control the tree depth of the data returned.")]),a._v(" "),t("li",[a._v("path, txPath, and entityIdPath properties on entities can provide useful handholds for other forms of data navigation")])]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List everything in a private drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List a private drive including the `fileKey` and/or `driveKey` of all listed entitites")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v(" --with-keys\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List the contents of a public drive up to and including those in the grandchild folders of the root folder")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n")])])]),t("h3",{attrs:{id:"list-drive-pipeline-examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#list-drive-pipeline-examples"}},[a._v("#")]),a._v(" List Drive Pipeline Examples")]),a._v(" "),t("p",[a._v("You can utilize "),t("code",[a._v("jq")]),a._v(" and the list commands to reshape the commands' output data into useful forms and stats for many use cases. Here are a few examples:")]),a._v(" "),t("p",[t("a",{attrs:{id:"get-share-links"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Get share links for a PUBLIC drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" a44482fd-592e-45fa-a08a-e526c31b87f1 "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('\'.[] | select(.entityType == "file") | "https://app.ardrive.io/#/file/" + .entityId + "/view"\'')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/1337babe-f000-dead-beef-ffffffffffff/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/cdbc9ddd-1cab-41d9-acbd-fd4328929de3/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/f19bc712-b57a-4e0d-8e5c-b7f1786b34a1/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/4f8e081b-42f2-442d-be41-57f6f906e1c8/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/0e02d254-c853-4ff0-9b6e-c4d23d2a95f5/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/c098b869-29d1-4a86-960f-a9e10433f0b0/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/4afc8cdf-4d27-408a-bfb9-0a2ec21eebf8/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/85fe488d-fcf7-48ca-9df8-2b39958bbf15/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n")])])]),t("p",[t("a",{attrs:{id:"get-total-size"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Get total size of all files within drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" 13c3c232-6687-4d11-8ac1-35284102c7db "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("' map(select(.entityType == \"file\") | .size) | add'")]),a._v("\n")])])]),t("p",[t("a",{attrs:{id:"get-file-count"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Get total number of files within drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" 01ea6ba3-9e58-42e7-899d-622fd110211c "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'[ .[] | select(.entityType == \"file\") ] | length'")]),a._v("\n")])])]),t("h2",{attrs:{id:"working-with-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-folders"}},[a._v("#")]),a._v(" Working With Folders")]),a._v(" "),t("p",[a._v("As discussed previously, all folders in a drive are linked by way of parent folder references back to the root folder of a drive. Folders can be moved into any folder in the hierarchy that's not in their own subtree.")]),a._v(" "),t("h3",{attrs:{id:"creating-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-folders"}},[a._v("#")]),a._v(" Creating Folders")]),a._v(" "),t("p",[a._v("Creating folders manually is straightforward:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"63153bb3-2ca9-4d42-9106-0ce82e793321"')]),a._v(" --folder-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My Awesome Folder"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"created"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"metadataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"AYFMBVmwqhbg9y5Fbj3Iasy5oxUqhauOW7PcS1sl4Dk"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"d1b7c514-fb12-4603-aad8-002cf63015d3"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"key"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"yHdCjpCKD2cuhQcKNx2d/XF5ReEjoKfZVqKunlCnPEk"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My Awesome Folder"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tips"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"AYFMBVmwqhbg9y5Fbj3Iasy5oxUqhauOW7PcS1sl4Dk"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1378052")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("Note: Folders can also be created by supplying a folder as the --local-path of an upload-file command. In this case, the folder hierarchy on the local disk will be reconstructed on chain during the course of the recursive bulk upload.")]),a._v(" "),t("h3",{attrs:{id:"moving-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#moving-folders"}},[a._v("#")]),a._v(" Moving Folders")]),a._v(" "),t("p",[a._v("Moving a folder is as simple as supplying a new parent folder ID. Note that naming collisions among entities within a folder are not allowed.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive move-folder --folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513921"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"renaming-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#renaming-folders"}},[a._v("#")]),a._v(" Renaming Folders"),t("a",{attrs:{id:"rename-folder"}})]),a._v(" "),t("p",[a._v("In order to rename a folder you must provide a name different from its current one, and it must not create naming conflicts with its sibling entities.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive rename-folder --folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"568d5eba-dbf3-4a49-8129-1c58f7fd35bc"')]),a._v(" --folder-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Folder with cool stuff"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"./wallet.json"')]),a._v("\n")])])]),t("h3",{attrs:{id:"viewing-folder-metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#viewing-folder-metadata"}},[a._v("#")]),a._v(" Viewing Folder Metadata")]),a._v(" "),t("p",[a._v("To view the metadata of a folder, users can use the "),t("code",[a._v("folder-info")]),a._v(" command:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive folder-info --folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v("\n")])])]),t("h3",{attrs:{id:"listing-contents-of-a-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-contents-of-a-folder"}},[a._v("#")]),a._v(" Listing Contents of a Folder")]),a._v(" "),t("p",[a._v("Similar to drives, the "),t("code",[a._v("list-folder")]),a._v(" command can be used to fetch the metadata of each entity within a folder. But by default, the command will fetch only the immediate children of that folder ("),t("code",[a._v("--max-depth 0")]),a._v("):")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# List immediate children of folder "My Public Folder"')]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mytestfolder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HYiKyfLwY7PT9NleTQoTiM_-qPVUwf4ClDhx1sjUAEU"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1635102772")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"03df2929-1440-4ab4-bbf0-9dc776e1ed96"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/mytestfolder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/HYiKyfLwY7PT9NleTQoTiM_-qPVUwf4ClDhx1sjUAEU"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/03df2929-1440-4ab4-bbf0-9dc776e1ed96"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Super sonic public folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"VUk1B_vo1va2-EHLtqjsotzy0Rdn6lU4hQo3RD2xoTI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631283259")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"452c6aec-43dc-4015-9abd-20083068d432"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/Super sonic sub folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/VUk1B_vo1va2-EHLtqjsotzy0Rdn6lU4hQo3RD2xoTI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/452c6aec-43dc-4015-9abd-20083068d432"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"test-number-twelve.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"429zBqnd7ZBNzgukaix26RYz3g5SeXCCo_oIY6CPZLg"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631722234")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("47")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631722217028")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"vA-BxAS7I6n90cH4Fzsk4cWS3EOPb1KOhj8yeI88dj0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"text/plain"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5948327-d6de-4acf-a6fe-e091ecf78d71"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/test-number-twelve.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/429zBqnd7ZBNzgukaix26RYz3g5SeXCCo_oIY6CPZLg"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/e5948327-d6de-4acf-a6fe-e091ecf78d71"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wonderful-test-file.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6CokwlzB81Fx7dq-lB654VM0XQykdU6eYohDmEJ2gk4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631671275")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("23")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631283389232")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"UP8THwA_1gvyRqNRqYmTpWvU4-UzNWBN7SiX_AIihg4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"text/plain"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3274dae9-3487-41eb-94d5-8d5d3d8bc343"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/wonderful-test-file.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/6CokwlzB81Fx7dq-lB654VM0XQykdU6eYohDmEJ2gk4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/3274dae9-3487-41eb-94d5-8d5d3d8bc343"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])]),t("p",[a._v("To list further than the immediate children, you can make use of the flags: "),t("code",[a._v("--all")]),a._v(" and "),t("code",[a._v("--max-depth")]),a._v(".")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List all contents of a public folder")]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--all")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List the contents of a public folder with custom depth")]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n")])])]),t("p",[a._v("In the case of private entitites, the "),t("code",[a._v("--with-keys")]),a._v(" flag will make the command to include the keys in the output.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List all contents of a private folder including the `fileKey` and/or `driveKey` of all listed entitites")]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1b027047-4cfc-4eee-88a8-9af694f660c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /my/wallet.json --with-keys\n")])])]),t("h2",{attrs:{id:"working-with-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-files"}},[a._v("#")]),a._v(" Working With Files")]),a._v(" "),t("p",[a._v("Similar to folders, files are linked to a parent folder which ultimately chains the file back to the root folder of its parent drive. As such, a parent folder ID is required in order to upload files. Files can be freely moved to other folders within their original drive.")]),a._v(" "),t("p",[a._v("The important difference for file entities is that they also hold a reference to their data transaction ID, which is the "),t("code",[a._v("dataTxId")]),a._v(" as returned by the "),t("code",[a._v("file-info")]),a._v(" command. This is where your uploaded data lives on the permaweb.")]),a._v(" "),t("p",[t("strong",[a._v("NOTE: The CLI currently (v1.0.0) has progress logging on uploads DISABLED for producing clean JSON outputs that can be piped in the terminal. On larger uploads, remember to be patient. You can check your system's "),t("code",[a._v("node")]),a._v(" process to confirm the process is still uploading.")])]),a._v(" "),t("h3",{attrs:{id:"uploading-a-single-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-single-file"}},[a._v("#")]),a._v(" Uploading a Single File")]),a._v(" "),t("p",[a._v("To upload a file, you'll need a parent folder id, the file to upload's file path, and the path to your wallet:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Supply the parent folder ID to upload-file")]),a._v("\nardrive upload-file --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"created"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file.txt"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6613395a-cf19-4420-846a-f88b7b765c05"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"l4iNWyBapfAIj7OU-nB8z9XrBhawyqzs5O9qhk-3EnI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"metadataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"YfdDXUyerPCpBbGTm_gv_x5hR3tu5fnz8bM-jPL__JE"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bundledIn"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sourceUri"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file:///path/to/file.txt"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bundle"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bundleTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tips"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"recipient"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3mxGJ4xLcQQNv6_TiKx0F0d5XVE0mNvONQI5GZXJXkt"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"winston"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"10000000"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("42819829")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("NOTE: To upload to the root of a drive, specify its root folder ID as the parent folder ID for the upload destination. You can retrieve it like so:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive drive-info "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.rootFolderId'")]),a._v("\n")])])]),t("h3",{attrs:{id:"ipfs-cid-tagging"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ipfs-cid-tagging"}},[a._v("#")]),a._v(" IPFS CID Tagging")]),a._v(" "),t("p",[a._v("Certain nodes on the Arweave network may be running the "),t("a",{attrs:{href:"https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3",target:"_blank",rel:"noopener noreferrer"}},[a._v("IPFS+Arweave bridge"),t("OutboundLink")],1),a._v(". Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your "),t("strong",[a._v("PUBLIC")]),a._v(" file uploads, you may use the '--add-ipfs-tag' flag:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --add-ipfs-tag --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"progress-logging-of-transaction-uploads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#progress-logging-of-transaction-uploads"}},[a._v("#")]),a._v(" Progress Logging of Transaction Uploads")]),a._v(" "),t("p",[a._v("Progress logging of transaction uploads to stderr can be enabled by setting the "),t("code",[a._v("ARDRIVE_PROGRESS_LOG")]),a._v(" environment variable to "),t("code",[a._v("1")]),a._v(":")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("Uploading "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" transaction "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v(" of total "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(" transactions"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("35")]),a._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("66")]),a._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("100")]),a._v("%\nUploading "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" transaction "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(" of total "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(" transactions"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("13")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("28")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("42")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("60")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("76")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("91")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("100")]),a._v("%\n")])])]),t("h3",{attrs:{id:"download-a-single-file-beta"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#download-a-single-file-beta"}},[a._v("#")]),a._v(" Download a Single file (BETA)"),t("a",{attrs:{id:"download-file"}})]),a._v(" "),t("p",[a._v("By using the "),t("code",[a._v("download-file")]),a._v(" command you can download a file on chain to a folder in your local storage specified by --local-path (or to your current working directory if not specified):")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ff450770-a9cb-46a5-9234-89cbd9796610"')]),a._v(" --local-path /my_ardrive_downloads/\n")])])]),t("p",[a._v("Specify a filename in the --local-path if you'd like to use a different name than the one that's used in your drive:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ff450770-a9cb-46a5-9234-89cbd9796610"')]),a._v(" --local-path /my_ardrive_downloads/my_pic.png\n")])])]),t("h3",{attrs:{id:"rename-a-single-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-a-single-file"}},[a._v("#")]),a._v(" Rename a Single File"),t("a",{attrs:{id:"rename-file"}})]),a._v(" "),t("p",[a._v("To rename an on-chain file you can make use of the "),t("code",[a._v("rename-file")]),a._v(" command. The required parameters are the file ID and the new name, as well as the owner wallet or seed phrase.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive rename-file --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"290a3f9a-37b2-4f0f-a899-6fac983833b3"')]),a._v(" --file-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My custom file name.txt"')]),a._v(" --wallet-file "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wallet.json"')]),a._v("\n")])])]),t("h3",{attrs:{id:"uploading-a-folder-with-files-bulk-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-folder-with-files-bulk-upload"}},[a._v("#")]),a._v(" Uploading a Folder with Files (Bulk Upload)"),t("a",{attrs:{id:"bulk-upload"}})]),a._v(" "),t("p",[a._v("Users can perform a bulk upload by using the upload-file command on a target folder. The command will reconstruct the folder hierarchy on local disk as ArFS folders on the permaweb and upload each file into their corresponding folders:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --local-path /path/to/folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"downloading-a-folder-with-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#downloading-a-folder-with-files"}},[a._v("#")]),a._v(" Downloading a Folder with Files"),t("a",{attrs:{id:"download-folder"}})]),a._v(" "),t("p",[a._v("You can download a folder from ArDrive to your local machine with the "),t("code",[a._v("download-folder")]),a._v(' command. In the following examples, assume that a folder with ID "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" exists in your drive and is named "MyArDriveFolder".')]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# Downloads "MyArDriveFolder" into the current working directory, i.e. ./MyArDriveFolder/')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v("\n")])])]),t("p",[a._v("By specifying the "),t("code",[a._v("--local-path")]),a._v(" option, you can choose the local parent folder into which the on-chain folder will be downloaded. When the parameter is omitted, its value defaults to the current working directory (i.e. "),t("code",[a._v("./")]),a._v(").")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# Downloads "MyArDriveFolder" into /my_ardrive_downloads/MyArDriveFolder')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path /my_ardrive_downloads/\n")])])]),t("p",[a._v("The "),t("code",[a._v("--max-depth")]),a._v(" parameter lets you to choose a custom folder depth to download. When omitted, the entire subtree of the folder will be downloaded. In the following example, only the immediate children of the folder will be downloaded:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n")])])]),t("p",[a._v("The behaviors of "),t("code",[a._v("--local-path")]),a._v(" are similar to those of "),t("code",[a._v("cp")]),a._v(" and "),t("code",[a._v("mv")]),a._v(" in Unix systems, e.g.:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# folder downloaded to "/existing_folder/MyArDriveFolder"')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/existing_folder"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# folder downloaded to "/existing_folder/MyArDriveFolder/MyArDriveFolder" as "/existing_folder/MyArDriveFolder" already exists')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/existing_folder/MyArDriveFolder"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# folder downloaded to "/existing_folder/non_existent_folder"')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/existing_folder/non_existent_folder"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ERROR!")]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/non_existent_folder_1/non_existent_folder_2"')]),a._v("\n")])])]),t("h3",{attrs:{id:"downloading-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#downloading-a-drive"}},[a._v("#")]),a._v(" Downloading a Drive"),t("a",{attrs:{id:"download-drive"}})]),a._v(" "),t("p",[a._v("To download the whole drive you can use the "),t("code",[a._v("download-drive")]),a._v(" command.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c0c8ba1c-efc5-420d-a07c-a755dc67f6b2"')]),a._v("\n")])])]),t("p",[a._v("This is equivalent to running the "),t("code",[a._v("download-folder")]),a._v(" command against the root folder of the drive.")]),a._v(" "),t("h3",{attrs:{id:"uploading-multiple-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-multiple-files"}},[a._v("#")]),a._v(" Uploading Multiple Files"),t("a",{attrs:{id:"multi-file-upload"}})]),a._v(" "),t("p",[a._v("To upload an arbitrary number of files or folders, pass a space-separated list of paths to "),t("code",[a._v("--local-paths")]),a._v(":")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Specifying a mixed set of file and folder paths")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" --local-paths ./image.png ~/backups/ "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v("/another_file.txt\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Example using glob expansion to upload all .json files in the current folder")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" --local-paths ./*.json\n")])])]),t("h3",{attrs:{id:"name-conflict-resolution-on-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#name-conflict-resolution-on-upload"}},[a._v("#")]),a._v(" Name Conflict Resolution on Upload"),t("a",{attrs:{id:"conflict-resolution"}})]),a._v(" "),t("p",[a._v("By default, the "),t("code",[a._v("upload-file")]),a._v(" command will use the upsert behavior if existing entities are encountered in the destination folder tree that would cause naming conflicts.")]),a._v(" "),t("p",[a._v("Expect the behaviors from the following table for each of these resolution settings:")]),a._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("tr",[t("th",[a._v("Source Type")]),a._v(" "),t("th",[a._v("Conflict at Dest")]),a._v(" "),t("th",[a._v("`skip`")]),a._v(" "),t("th",[a._v("`replace`")]),a._v(" "),t("th",[a._v("`upsert` (default)")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("None")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Matching File")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Update")]),a._v(" "),t("td",[a._v("Skip")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Different File")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Update")]),a._v(" "),t("td",[a._v("Update")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Fail")]),a._v(" "),t("td",[a._v("Fail")])]),a._v(" "),t("tr",[t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("None")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")])]),a._v(" "),t("tr",[t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Fail")]),a._v(" "),t("td",[a._v("Fail")])]),a._v(" "),t("tr",[t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("Re-use")]),a._v(" "),t("td",[a._v("Re-use")]),a._v(" "),t("td",[a._v("Re-use")])])])]),a._v(" "),t("p",[a._v("The default upsert behavior will check the destination folder for a file with a conflicting name. If no conflicts are found, it will insert (upload) the file.")]),a._v(" "),t("p",[a._v("In the case that there is a FILE to FILE name conflict found, it will only update it if necessary. To determine if an update is necessary, upsert will compare the last modified dates of conflicting file and the file being uploaded. When they are matching, the upload will be skipped. Otherwise the file will be updated as a new revision.")]),a._v(" "),t("p",[a._v("To override the upsert behavior, use the "),t("code",[a._v("--replace")]),a._v(" option to always make new revisions of a file or the "),t("code",[a._v("--skip")]),a._v(" option to always skip the upload on name conflicts:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--replace")]),a._v(" --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--skip")]),a._v(" --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("Alternatively, the upload-file commands now also supports the "),t("code",[a._v("--ask")]),a._v(" conflict resolution option. This setting will always provide an interactive prompt on name conflicts that allows users to decide how to resolve each conflict found:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--ask")]),a._v(" --local-file-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n\nDestination folder has a "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" to "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" name conflict"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("!")]),a._v("\n\nFile name: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(".png\nFile ID: efbc0370-b69f-44d9-812c-0d272b019027\nThis "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" has a DIFFERENT last modified "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("date")]),a._v("\n\nPlease "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" how to proceed:\n β€Ί - Use arrow-keys. Return to submit.\n❯ Replace as new "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" revision\n Upload with a different "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" name\n Skip this "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" upload\n")])])]),t("h3",{attrs:{id:"understanding-bundled-transactions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#understanding-bundled-transactions"}},[a._v("#")]),a._v(" Understanding Bundled Transactions"),t("a",{attrs:{id:"bundles"}})]),a._v(" "),t("p",[a._v("The ArDrive CLI currently uses two different methods for uploading transactions to the Arweave network: standard transactions and Direct to Network (D2N) bundled transactions. By default, the CLI will send a D2N bundled transaction for any action that would result in multiple transactions. This bundling functionality is currently used on the "),t("code",[a._v("upload-file")]),a._v(" and "),t("code",[a._v("create-drive")]),a._v(" commands.")]),a._v(" "),t("p",[a._v("D2N bundled transactions come with several benefits and implications:")]),a._v(" "),t("ul",[t("li",[a._v("Bundling saves AR and enhances ArFS reliability by sending associated ArFS transactions up as one atomic bundle.")]),a._v(" "),t("li",[a._v('Bundled transactions are treated as a single data transaction by the Arweave network, but can be presented as separate transactions by the Arweave Gateway once they have been "unbundled".')]),a._v(" "),t("li",[a._v("Un-bundling can take anywhere from a few minutes up to an hour. During that time, the files in the bundle will neither appear in list- commands nor be downloadable. Similarly, they will not appear in the web app after syncs until un-bundling is complete. "),t("strong",[a._v("This can negatively affect the accuracy of upsert operations")]),a._v(", so it's best to wait before retrying bulk uploads.")]),a._v(" "),t("li",[a._v("Bundling reliability on the gateway side degrades once bundles reach either 500 data items (or ~250 files) or 500 MiB, so the CLI will create and upload multiple bundles as necessary, or will send files that are simply too large for reliable bundling as unbundled txs.")])]),a._v(" "),t("h3",{attrs:{id:"uploading-a-non-bundled-transaction-not-recommended"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-non-bundled-transaction-not-recommended"}},[a._v("#")]),a._v(" Uploading a Non-Bundled Transaction (NOT RECOMMENDED)"),t("a",{attrs:{id:"no-bundle"}})]),a._v(" "),t("p",[a._v("While not recommended, the CLI does provide the option to forcibly send all transactions as standard transactions rather than attempting to bundle them together. To do this, simply add the "),t("code",[a._v("--no-bundle")]),a._v(" flag to the "),t("code",[a._v("upload-file")]),a._v(" or "),t("code",[a._v("create-drive")]),a._v(" command:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --no-bundle --local-path /path/to/file --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"fetching-the-metadata-of-a-file-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#fetching-the-metadata-of-a-file-entity"}},[a._v("#")]),a._v(" Fetching the Metadata of a File Entity")]),a._v(" "),t("p",[a._v("Simply perform the file-info command to retrieve the metadata of a file:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive file-info --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-Web"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.1.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"51062487-2e8b-4af7-bd81-4345dc28ea5d"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2_depth.png"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"CZKdjqwnmxbWchGA1hjSO5ZH--4OYodIGWzI-FmX28U"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1633625081")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("41946")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1605157729000")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fileId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Jz0WsWyAGVc0aE3UzACo-YJqG8OPrN3UucmDdt8Fbjc"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"image/png"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("h3",{attrs:{id:"retrying-a-failed-file-data-transaction-public-unbundled-files-only"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#retrying-a-failed-file-data-transaction-public-unbundled-files-only"}},[a._v("#")]),a._v(" Retrying a Failed File Data Transaction (Public Unbundled Files Only)"),t("a",{attrs:{id:"retry-tx"}})]),a._v(" "),t("p",[a._v("Arweave data upload transactions are split into two phases: transaction posting and chunks uploading. Once the transaction post phase has been completed, you've effectively \"paid\" the network for storage of the data chunks that you'll send in the next stage.")]),a._v(" "),t("p",[a._v("If your system encounters an error while posting the transaction, you can retry posting the transaction for as long as your tx_anchor is valid ("),t("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#field-definitions",target:"_blank",rel:"noopener noreferrer"}},[a._v("learn more about tx_anchors here"),t("OutboundLink")],1),a._v("). You may retry and/or resume posting chunks at any time after your transaction has posted. The ArDrive CLI allows you to take advantage of this Arweave protocol capability.")]),a._v(" "),t("p",[a._v("Using the CLI, when the transaction post has succeeded but the chunk upload step fails, the data transaction's ID could be lost. There are a few options to recover this ID. If the failed transaction is the most recent one sent from a wallet, the transaction ID can be recovered with the "),t("code",[a._v("ardrive last-tx -w /path/to/wallet")]),a._v(" command AFTER the transaction's headers have been mined (It can take 5-10 minutes for the tx-id to become available with the last-tx approach). Other options for finding the partially uploaded transaction's ID include:")]),a._v(" "),t("ul",[t("li",[a._v("Using an Arweave gateway GQL http endpoint to search for transactions that belong to the wallet. See this "),t("a",{attrs:{href:"https://gql-guide.vercel.app/#owners",target:"_blank",rel:"noopener noreferrer"}},[a._v("Arweave GQL Guide"),t("OutboundLink")],1),a._v(" for more info.")]),a._v(" "),t("li",[a._v("Browse the recent transactions associated with the wallet via a block explorer tool like "),t("a",{attrs:{href:"https://viewblock.io/arweave/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ViewBlock"),t("OutboundLink")],1),a._v(".")])]),a._v(" "),t("p",[a._v("In order to re-seed the chunks for an unbundled ArFS data transaction, a user must have the data transaction ID, the original file data, and either a destination folder ID or a valid file ID for the file. Supply that information to the "),t("code",[a._v("retry-tx")]),a._v(" command like so:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive retry-tx --tx-id "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" Data Transaction ID "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" Destination Folder ID "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(" --local-path /path/to/file --wallet-file /path/to/wallet\n")])])]),t("p",[t("strong",[a._v("Note: Retry feature is currently only available for PUBLIC unbundled file transactions. It is also perfectly safe to mistakenly re-seed the chunks of a healthy transaction, the transaction will remain stable and the wallet balance will not be affected.")])]),a._v(" "),t("h3",{attrs:{id:"moving-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#moving-files"}},[a._v("#")]),a._v(" Moving Files"),t("a",{attrs:{id:"moving-files"}})]),a._v(" "),t("p",[a._v("Files can be moved from one folder to another within the same drive. Moving a file is simply the process of uploading a new file metadata revision with an updated File ID <> Parent Folder ID relationship. The following command will move a file from its current location in a public drive to a new parent folder in that drive:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive move-file --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63"')]),a._v("\n")])])]),t("h3",{attrs:{id:"uploading-manifests"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-manifests"}},[a._v("#")]),a._v(" Uploading Manifests")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://github.com/ArweaveTeam/arweave/wiki/Path-Manifests",target:"_blank",rel:"noopener noreferrer"}},[a._v("Arweave Path Manifests"),t("OutboundLink")],1),a._v(" are are special "),t("code",[a._v(".json")]),a._v(" files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. So if, for example, your manifest file had an arweave.net URL like:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("https://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("manifest tx id"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("Then, all the mapped transactions and paths in the manifest file would be addressable at URLs like:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("https://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("manifest tx id"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/foo.txt\nhttps://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("manifest tx id"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/bar/baz.png\n")])])]),t("p",[a._v("ArDrive supports the creation of these Arweave manifests using any of your PUBLIC folders. The generated manifest paths will be links to each of the file entities within the specified folder. The manifest file entity will be created at the root of the folder.")]),a._v(" "),t("p",[a._v("To create a manifest of an entire public drive, specify the root folder of that drive:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bc9af866-6421-40f1-ac89-202bddb5c487"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v("\n")])])]),t("p",[a._v("You can also create a manifest of a folder's file entities at a custom depth by using the "),t("code",[a._v("--max-depth")]),a._v(" option:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Create manifest of a folder's local file contents, excluding all sub-folders")]),a._v("\nardrive create-manifest --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"867228d8-4413-4c0e-a499-e1decbf2ea38"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v("\n")])])]),t("p",[a._v("Creating a "),t("code",[a._v(".json")]),a._v(" file of your manifest links output can be accomplished here with some "),t("code",[a._v("jq")]),a._v(" parsing and piping to a file:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6c312b3e-4778-4a18-8243-f2b346f5e7cb"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{links}'")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" links.json\n")])])]),t("p",[a._v("If you'd like to preview the contents of your manifest before uploading, you can perform a dry run and do some lightweight post processing to isolate the data:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6c312b3e-4778-4a18-8243-f2b346f5e7cb"')]),a._v(" --dry-run "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{manifest}.manifest'")]),a._v("\n")])])]),t("p",[t("a",{attrs:{id:"manifest-json"}})]),a._v(" "),t("div",{staticClass:"language-json extra-class"},[t("pre",{pre:!0,attrs:{class:"language-json"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"manifest"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arweave/paths"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"version"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.1.0"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"index"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"index.html"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"paths"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"hello_world.txt"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"id"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Y7GFF8r9y0MEU_oi1aZeD87vrmai97JdRQ2L0cbGJ68"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"index.html"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"id"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"pELonjVebHyBsdxVymvxbGTmHD96v9PuuUXj8GUHGoY"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("The manifest data transaction is tagged with a unique content-type, "),t("code",[a._v("application/x.arweave-manifest+json")]),a._v(", which tells the gateway to treat this file as a manifest. The manifest file itself is a "),t("code",[a._v(".json")]),a._v(" file that holds the paths (the data transaction ids) to each file within the specified folder.")]),a._v(" "),t("p",[a._v("When your folder is later changed by adding files or updating them with new revisions, the original manifest will NOT be updated on its own. A manifest is a permanent record of your files in their current state.")]),a._v(" "),t("p",[a._v("However, creating a subsequent manifest with the same manifest name will create a new revision of that manifest in its new current state. Manifests follow the same name conflict resolution as outlined for files above (upsert by default).")]),a._v(" "),t("h4",{attrs:{id:"hosting-a-webpage-with-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hosting-a-webpage-with-manifest"}},[a._v("#")]),a._v(" Hosting a Webpage with Manifest")]),a._v(" "),t("p",[a._v("When creating a manifest, it is possible to host a webpage or web app. You can do this by creating a manifest on a folder that has an "),t("code",[a._v("index.html")]),a._v(" file in its root.")]),a._v(" "),t("p",[a._v("Using generated build folders from popular frameworks works as well. One requirement here to note is that the "),t("code",[a._v("href=")]),a._v(" paths from your generated "),t("code",[a._v("index.html")]),a._v(" file must not have leading a "),t("code",[a._v("/")]),a._v(". This means that the manifest will not resolve a path of "),t("code",[a._v("/dist/index.js")]),a._v(" but it will resolve "),t("code",[a._v("dist/index.js")]),a._v(" or "),t("code",[a._v("./dist/index.js")]),a._v(".")]),a._v(" "),t("p",[a._v("As an example, here is a flow of creating a React app and hosting it with an ArDrive Manifest. First, generate a React app:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("yarn")]),a._v(" create react-app my-app\n")])])]),t("p",[a._v("Next, add this field to the generated "),t("code",[a._v("package.json")]),a._v(" so that the paths will resolve correctly:")]),a._v(" "),t("div",{staticClass:"language-json extra-class"},[t("pre",{pre:!0,attrs:{class:"language-json"}},[t("code",[t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"homepage"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"."')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),t("p",[a._v("Then, create an optimized production build from within the app's directory:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("yarn")]),a._v(" build\n")])])]),t("p",[a._v("Now, we can create and upload that produced build folder on ArDrive to any of your existing ArFS folder entities:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-l")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/build"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bc9af866-6421-40f1-ac89-202bddb5c487"')]),a._v("\n")])])]),t("p",[a._v("And finally, create the manifest using the generated Folder ID from the build folder creation:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Create manifest using the Folder ID of the `/build` folder")]),a._v("\nardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"41759f05-614d-45ad-846b-63f3767504a4"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v("\n")])])]),t("p",[a._v("In the return output, the top link will be a link to the deployed web app:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"links"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/asset-manifest.json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/favicon.ico"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/index.html"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("This is effectively hosting a web app with ArDrive. Check out the ArDrive Price Calculator React App hosted as an "),t("a",{attrs:{href:"https://arweave.net/qozq9YIUPEHfZhoTp9DkBpJuA_KNULBnfLiMroj5pZI",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive Manifest"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("h3",{attrs:{id:"uploading-with-a-custom-content-type"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-with-a-custom-content-type"}},[a._v("#")]),a._v(" Uploading With a Custom Content Type"),t("a",{attrs:{id:"custom-content-type"}})]),a._v(" "),t("p",[a._v("Each file uploaded to the Arweave network receives a "),t("code",[a._v('"Content-Type"')]),a._v(" GraphQL tag that contains the MIME type for the file. The gateway will use this content type to determine how to serve that file's data transaction at the "),t("code",[a._v("arweave.net/{data tx id}")]),a._v(" endpoint.")]),a._v(" "),t("p",[a._v("By default, the CLI will attempt to derive this content type from the file extension of the provided file. In most cases, the content type that is derived will be correct and the gateway will properly serve the file.")]),a._v(" "),t("p",[a._v("The CLI also provides the option for users to upload files with a custom content type using the "),t("code",[a._v("--content-type")]),a._v(" flag:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --content-type "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(" --local-path /path/to/file --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("It is currently possible to set this value to any given string, but the gateway will still only serve valid content types. Check out this list of commonly used MIME types to ensure you're providing a valid content type: "),t("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types",target:"_blank",rel:"noopener noreferrer"}},[a._v("Common MIME types"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("p",[a._v("Note: In the case of multi-file uploads or recursive folder uploads, setting this "),t("code",[a._v("--content-type")]),a._v(" flag will set the provided custom content type on EVERY file entity within a given upload.")]),a._v(" "),t("h3",{attrs:{id:"uploading-from-a-remote-url"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-from-a-remote-url"}},[a._v("#")]),a._v(" Uploading From a Remote URL"),t("a",{attrs:{id:"remote-path"}})]),a._v(" "),t("p",[a._v("You can upload a file from an existing url using the "),t("code",[a._v("--remote-path")]),a._v(" flag. This must be used in conjunction with "),t("code",[a._v("--dest-file-name")]),a._v(".")]),a._v(" "),t("p",[a._v("You can use a custom content type using the "),t("code",[a._v("--content-type")]),a._v(" flag, but if this isn't used the app will use the content type from the response header of the request for the remote data.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --remote-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://url/to/file"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"example.jpg"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"uploading-a-custom-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-custom-manifest"}},[a._v("#")]),a._v(" Uploading a Custom Manifest"),t("a",{attrs:{id:"custom-manifest"}})]),a._v(" "),t("p",[a._v("Using the custom content type feature, it is possible for users to upload their own custom manifests. The Arweave gateways use this special content type in order to identify an uploaded file as a manifest:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("application/x.arweave-manifest+json\n")])])]),t("p",[a._v("In addition to this content type, the manifest must also adhere to the "),t("a",{attrs:{href:"#manifest-json"}},[a._v("correct JSON structure")]),a._v(" of an Arweave manifest. A user can create their own manifest from scratch, or start by piping a generated manifest to a JSON file and editing it to their specifications:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6c312b3e-4778-4a18-8243-f2b346f5e7cb"')]),a._v(" --dry-run "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{manifest}.manifest'")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" my-custom-manifest.json\n")])])]),t("p",[a._v("After editing the generated manifest, simply perform an "),t("code",[a._v("upload-file")]),a._v(" command with the custom Arweave manifest content type to any PUBLIC folder:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --content-type "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/x.arweave-manifest+json"')]),a._v(" --local-path my-custom-manifest.json --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("The returned "),t("code",[a._v("dataTxId")]),a._v(" field on the created "),t("code",[a._v("file")]),a._v(" entity will be the endpoint that the manifest can be found on Arweave, just as explained in the "),t("a",{attrs:{href:"#uploading-manifests"}},[a._v("manifest sections")]),a._v(" above:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("https://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("dataTxId"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nhttps://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("dataTxId"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/custom-file-1\nhttps://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("dataTxId"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/custom-file-2\n")])])]),t("h3",{attrs:{id:"uploading-files-with-custom-metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-files-with-custom-metadata"}},[a._v("#")]),a._v(" Uploading Files with Custom MetaData")]),a._v(" "),t("p",[a._v("ArDrive CLI has the capability of attaching custom metadata to ArFS File and Folder MetaData Transactions during the "),t("code",[a._v("upload-file")]),a._v(" command. This metadata can be applied to either the GQL tags on the MetaData Transaction and/or into the MetaData Transaction's Data JSON.")]),a._v(" "),t("p",[a._v("All custom metadata applied must ultimately adhere to the following JSON shapes:")]),a._v(" "),t("div",{staticClass:"language-ts extra-class"},[t("pre",{pre:!0,attrs:{class:"language-ts"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("// GQL Tags")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("type")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[a._v("CustomMetaDataGqlTags")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v(" Record"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("// Data JSON Fields")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("type")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[a._v("CustomMetaDataJsonFields")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v(" Record"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" JsonSerializable"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("export")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("type")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[a._v("JsonSerializable")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("number")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("boolean")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("null")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("member"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" JsonSerializable "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" JsonSerializable"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),t("p",[a._v("e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" IPFS-Add: "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'MY_HASH'")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# or")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'Custom Name'")]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'Val 1'")]),a._v(", "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'Val 2'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("When the custom metadata is attached to the MetaData Transaction's GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.")]),a._v(" "),t("p",[a._v("When these tags are added to the MetaData Transaction's Data JSON they can be read by downloading the JSON data directly from "),t("code",[a._v("https://arweave.net/METADATA_TX_ID")]),a._v(".")]),a._v(" "),t("p",[a._v("To add this custom metadata to your file metadata transactions, CLI users can pass custom metadata these parameters:")]),a._v(" "),t("ul",[t("li",[t("code",[a._v("--metadata-file path/to/json/schema")])]),a._v(" "),t("li",[t("code",[a._v('--metadata-json \'{"key": "val", "key-2": true, "key-3": 420, "key-4": ["more", 1337]}\'')])]),a._v(" "),t("li",[t("code",[a._v('--metadata-gql-tags "Tag-Name" "Tag Val"')])])]),a._v(" "),t("p",[a._v("The "),t("code",[a._v("--metadata-file")]),a._v(" will accept a file path to JSON file containing custom metadata:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --metadata-file path/to/metadata/json "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("This JSON schema object must contain instructions on where to put this metadata with the "),t("code",[a._v("metaDataJson")]),a._v(" and "),t("code",[a._v("metaDataGqlTags")]),a._v(" keys. e.g:")]),a._v(" "),t("div",{staticClass:"language-json extra-class"},[t("pre",{pre:!0,attrs:{class:"language-json"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"metaDataJson"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"Tag-Name"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Value-1"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Value-2"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"metaDataGqlTags"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"GQL Tag Name"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag Value"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("The "),t("code",[a._v("--metadata-gql-tags")]),a._v(" parameter accepts an array of string values to be applied to the MetaData Tx GQL Tags. This method of CLI input does not support multiple tag values for a given tag name and the input must be an EVEN number of string values. (Known bug: String values starting with the "),t("code",[a._v('"-"')]),a._v(" character are currently not supported. Use --metadata-file parameter instead.) e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("upload-file --metadata-gql-tags "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Custom Tag Name"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Custom Value"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("And the "),t("code",[a._v("--metadata-json")]),a._v(" parameter will accept a stringified JSON input. It will apply all declared JSON fields directly to the MetaData Tx's Data JSON. e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v(" upload-file --metadata-json "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('\' { "json field": "value", "another fields": false } \'')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("Custom metadata applied to files and/or folders during the "),t("code",[a._v("upload-file")]),a._v(" command will be read back through all existing read commands. e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive file-info "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" 067c4008-9cbe-422e-b697-05442f73da2b\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1.17.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"967215ca-a489-494b-97ec-0dd428d7be34"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unique-name-9718"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sxg8bNu6_bbaHkJTxAINVVoz_F-LiFe6s7OnxzoJJk4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1657655070")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("262148")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1655409872705")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ublZcIff77ejl3m0uEA8lXEfnTWmSBOFoz-HibqKeyk"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"text/plain"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"97bc4fb5-aca4-4ffe-938f-1285153d98ca"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"067c4008-9cbe-422e-b697-05442f73da2b"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fileId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"067c4008-9cbe-422e-b697-05442f73da2b"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"IPFS-Add"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"MY_HASH"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag-1"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Val"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag-2"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Val"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag-3"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Val"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Boost"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1.05"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("h4",{attrs:{id:"applying-unique-custom-metadata-during-bulk-workflows"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#applying-unique-custom-metadata-during-bulk-workflows"}},[a._v("#")]),a._v(" Applying Unique Custom MetaData During Bulk Workflows")]),a._v(" "),t("p",[a._v("With some custom scripting and the "),t("code",[a._v("--metadata-file")]),a._v(" parameter, the ArDrive CLI can be used to apply custom metadata to each file individually in a bulk workflow. For example, if you choose a numbered file naming pattern you can make use of a "),t("code",[a._v("for")]),a._v(" loop:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("for")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token for-or-select variable"}},[a._v("i")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("in")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("5")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("do")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" f0c58c11-430c-4383-8e54-4d864cc7e927 --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"../uploads/test-file-'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$i")]),a._v('.txt"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet.json"')]),a._v(" --metadata-file "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"../custom/metadata-'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$i")]),a._v('.json"')]),a._v(" --dry-run "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file-result-'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$i")]),a._v('.json"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("done")]),a._v("\n")])])]),t("h2",{attrs:{id:"other-utility-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-utility-operations"}},[a._v("#")]),a._v(" Other Utility Operations")]),a._v(" "),t("h3",{attrs:{id:"monitoring-transactions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#monitoring-transactions"}},[a._v("#")]),a._v(" Monitoring Transactions")]),a._v(" "),t("p",[a._v("Block time on Arweave is typically between 2-3 minutes in duration, so transactions can be mined within that time frame when "),t("a",{attrs:{href:"#dealing-with-network-congestion"}},[a._v("network congestion")]),a._v(" is low. Transactions, in the general case, proceed through the following set of states:")]),a._v(" "),t("ul",[t("li",[a._v('Pending: the transaction is waiting the "mempool" to be mined')]),a._v(" "),t("li",[a._v("Confirming: the transaction was mined on an Arweave Node, but has not yet been confirmed by at least 15 total nodes on the network")]),a._v(" "),t("li",[a._v("Confirmed: the transaction was mined on an Arweave Node and confirmed by at least 15 total nodes on the network")]),a._v(" "),t("li",[a._v("Not Found: the transaction is not available for any of the following reasons:\n"),t("ul",[t("li",[a._v("Insufficient reward to join the mempool")]),a._v(" "),t("li",[a._v("Insufficient reward to be mined within 50 blocks during a period of network congestion")]),a._v(" "),t("li",[a._v("Transaction is transitioning between states")]),a._v(" "),t("li",[a._v("Transaction ID is invalid")])])])]),a._v(" "),t("p",[a._v("Monitor any Arweave transaction's status via its transaction ID by performing:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Peek at the status:")]),a._v("\nardrive tx-status "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-t")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs"')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs: Mined at block height "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("775810")]),a._v(" with "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("22439")]),a._v(" confirmations\n")])])]),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Reprint the status every 10 seconds:")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("watch")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-n")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("10")]),a._v(" ardrive tx-status "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-t")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs"')]),a._v("\n")])])]),t("h3",{attrs:{id:"dealing-with-network-congestion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#dealing-with-network-congestion"}},[a._v("#")]),a._v(" Dealing With Network Congestion")]),a._v(" "),t("p",[a._v("Currently, Arweave blocks hold up to 1000 transactions per block. The \"mempool\", where pending transactions reside until they've been included into a block, will only hold a transaction for 50 blocks (~100-150 minutes) before it's discarded by the network resulting in no fees or data being transacted. During periods of network congestion (i.e. those where the mempool contains 1000 or more pending transactions), it may make sense to either:")]),a._v(" "),t("p",[a._v("a) wait for congestion to dissipate before attempting your transactions.")]),a._v(" "),t("p",[a._v("b) apply the fee boost multiplier to your transactions rewards with the --boost parameter during write operations in order to front-run some of the congestion.")]),a._v(" "),t("h4",{attrs:{id:"check-for-network-congestion-before-uploading"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#check-for-network-congestion-before-uploading"}},[a._v("#")]),a._v(" Check for network congestion before uploading"),t("a",{attrs:{id:"check-congestion"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# See all the transactions in the mempool")]),a._v("\nardrive get-mempool\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Return the count of the transactions in the mempool")]),a._v("\nardrive get-mempool "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'length'")]),a._v("\n")])])]),t("h4",{attrs:{id:"front-run-congestion-by-boosting-miner-rewards"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#front-run-congestion-by-boosting-miner-rewards"}},[a._v("#")]),a._v(" Front-run Congestion By Boosting Miner Rewards"),t("a",{attrs:{id:"boost"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Increase the miner reward on your transactions by 50%")]),a._v("\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"f0c58c11-430c-4383-8e54-4d864cc7e927"')]),a._v(" --local-path ./helloworld.txt "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--boost")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1.5")]),a._v("\n")])])]),t("h4",{attrs:{id:"send-ar-transactions-from-a-cold-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#send-ar-transactions-from-a-cold-wallet"}},[a._v("#")]),a._v(" Send AR Transactions From a Cold Wallet"),t("a",{attrs:{id:"cold-tx"}})]),a._v(" "),t("p",[a._v("The best cold wallet storage never exposes your seed phrase and/or private keys to the Internet or a compromised system interface. You can use the ArDrive CLI to facilitate cold storage and transfer of AR.")]),a._v(" "),t("p",[a._v("If you need a new cold AR wallet, generate one from an air-gapped machine capable of running the ArDrive CLI by following the instructions in the "),t("a",{attrs:{href:"#wallet-operations"}},[a._v("Wallet Operations")]),a._v(" section. Fund your cold wallet from whatever external sources you'd like. NOTE: Your cold wallet won't appear on chain until it has received AR.")]),a._v(" "),t("p",[a._v("The workflow to send the AR out from your cold wallet requires you to generate a signed transaction with your cold wallet on your air-gapped machine via the ArDrive CLI, and then to transfer the signed transaction (e.g. by a file on a clean thumb drive) to an Internet-connected machine and send the transaction to the network via the ArDrive CLI. You'll need two inputs from the Internet-connected machine:")]),a._v(" "),t("ul",[t("li",[a._v("the last transaction sent OUT from the cold wallet (or an empty string if none has ever been sent out)")]),a._v(" "),t("li",[a._v("the base fee for an Arweave transaction (i.e. a zero bye transaction). Note that this value could change if a sufficient amount of time passes between the time you fetch this value, create the transaction, and send the transaction.")])]),a._v(" "),t("p",[a._v("To get the last transaction sent from your cold wallet, use the "),t("code",[a._v("last-tx")]),a._v(" command and specify your wallet address e.g.:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("ardrive last-tx -a \n")])])]),t("p",[a._v("To get the base transaction reward required for an AR transaction, use the "),t("code",[a._v("base-reward")]),a._v(" function, optionally applying a reward boost multiple if you're looking to front-run network congestion:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("ardrive base-reward --boost 1.5\n")])])]),t("p",[a._v("Write down or securely copy the values you derived from the Internet-connected machine and run the following commands on the airgapped machine, piping the outputted signed transaction data to a file in the process, e.g. "),t("code",[a._v("sendme.json")]),a._v(" (if that's your signed transaction transfer medium preference):")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v('ardrive create-tx -w /path/to/wallet/file.json -d -a --last-tx --reward "" > sendme.json\n')])])]),t("p",[a._v("Transport your signed transaction to the Internet-connected machine and run the following command to send your transaction to the Arweave network:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("ardrive send-tx -x /path/to/sendme.json\n")])])]),t("h3",{attrs:{id:"using-a-custom-arweave-gateway"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-a-custom-arweave-gateway"}},[a._v("#")]),a._v(" Using a Custom Arweave Gateway")]),a._v(" "),t("p",[a._v("On each command that uses a gateway, it is possible to supply your own custom Arweave gateway using the flag "),t("code",[a._v("--gateway")]),a._v(" or by setting an environment variable named "),t("code",[a._v("ARWEAVE_GATEWAY")]),a._v(".")]),a._v(" "),t("p",[a._v("For example, you could test out that your ArFS transactions are working as expected on a local test network such as "),t("a",{attrs:{href:"https://github.com/textury/arlocal",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArLocal"),t("OutboundLink")],1),a._v(" with this flow:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Setup ArLocal instance on port 1984")]),a._v("\nnpx arlocal\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# In another terminal, fund your wallet with AR")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("curl")]),a._v(" http://localhost:1984/mint/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" your public wallet address "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/99999999999999\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Create drive and root folder on ArLocal using `--gateway` flag")]),a._v("\nardrive create-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--gateway")]),a._v(" http://127.0.0.1:1984 "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-n")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'my-test-drive'")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Setup ARWEAVE_GATEWAY as ENV variable")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ARWEAVE_GATEWAY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"http://localhost:1984"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Mine block with drive + root folder transactions")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("curl")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ARWEAVE_GATEWAY")]),a._v('/mine"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Upload file to ArLocal with ENV var")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" root folder "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),a._v(" from create drive "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-l")]),a._v(" /path/to/file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Mine block with file transaction")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("curl")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ARWEAVE_GATEWAY")]),a._v('/mine"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Inspect meta data of created entities")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" drive "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),a._v(" from create drive "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Download file to verify integrity")]),a._v("\nardrive download-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),a._v(" from upload "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("h3",{attrs:{id:"persistent-caching-of-arfs-entity-metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#persistent-caching-of-arfs-entity-metadata"}},[a._v("#")]),a._v(" Persistent Caching of ArFS Entity Metadata"),t("a",{attrs:{id:"metadata-caching"}})]),a._v(" "),t("p",[a._v("To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("Windows: /ardrive-caches/metadata\nNon-Windows: /.ardrive/caches/metadata\n")])])]),t("p",[a._v("The "),t("code",[a._v("XDG_CACHE_HOME")]),a._v(" environment variable is honored, where applicable, and will be used in place of "),t("code",[a._v("os.homedir()")]),a._v(" in the scenarios described above.")]),a._v(" "),t("p",[a._v("Metadata cache logging to stderr can be enabled by setting the "),t("code",[a._v("ARDRIVE_CACHE_LOG")]),a._v(" environment variable to "),t("code",[a._v("1")]),a._v(".")]),a._v(" "),t("p",[a._v("Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.")]),a._v(" "),t("p",[a._v("The cache can be manually cleared safely at any time that any integrating app is not in operation.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{323:function(a,t,e){"use strict";e.r(t);var s=e(10),n=Object(s.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"using-the-cli"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-the-cli"}},[a._v("#")]),a._v(" Using the CLI")]),a._v(" "),t("h2",{attrs:{id:"cli-help"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#cli-help"}},[a._v("#")]),a._v(" CLI Help")]),a._v(" "),t("p",[a._v("Learn to use any command:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v("\n")])])]),t("h2",{attrs:{id:"cli-version"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#cli-version"}},[a._v("#")]),a._v(" CLI Version")]),a._v(" "),t("p",[a._v("You can print out the version by running any of:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-V")]),a._v("\n")])])]),t("h2",{attrs:{id:"wallet-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wallet-operations"}},[a._v("#")]),a._v(" Wallet Operations")]),a._v(" "),t("p",[a._v("Browsing of ArDrive public data is possible without the need for an "),t("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/FpK8FuoQ",target:"_blank",rel:"noopener noreferrer"}},[a._v("Arweave wallet"),t("OutboundLink")],1),a._v(". However, for all write operations, or read operations without encryption/decryption keys, you'll need a wallet.")]),a._v(" "),t("p",[a._v("As you utilize the CLI, you can use either your wallet file or your seed phrase interchangeably. Consider the security implications of each approach for your particular use case carefully. If at any time you'd like to generate a new wallet altogether, start by generating a new seed phase. And if you'd like to use that seed phrase in the form of a wallet file, or if you'd like to recover an existing wallet via its seed phrase, use either or both of the following commands:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Generate seed-phrase")]),a._v("\nardrive generate-seedphrase\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"this is an example twelve word seed phrase that you could use"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Generate/recover wallet file (with example output file path)")]),a._v("\nardrive generate-wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-s")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"this is an example twelve word seed phrase that you could use"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" /path/to/wallet/file.json\n")])])]),t("p",[a._v("Public attributes of Arweave wallets can be retrieved via their 43-character Arweave wallet address. You can retrieve the wallet address associated with "),t("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/FpK8FuoQ",target:"_blank",rel:"noopener noreferrer"}},[a._v("your wallet file or 12-word seed phrase"),t("OutboundLink")],1),a._v(" (e.g. wallets generated by "),t("a",{attrs:{href:"https://arconnect.io/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArConnect"),t("OutboundLink")],1),a._v(") like so:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Wallet file")]),a._v("\nardrive get-address "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet/file.json\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Seed Phrase (with sample output)")]),a._v("\nardrive get-address "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-s")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"this is an example twelve word seed phrase that you could use"')]),a._v("\nHTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k\n")])])]),t("p",[a._v("You'll need AR in your wallet for any write operations you perform in ArDrive. You can always check your wallet balance (in both AR and Winston units) by performing:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Getting the balance for your own wallet")]),a._v("\nardrive get-balance "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet/file.json\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Getting the balance for ANY wallet (with sample output)")]),a._v("\nardrive get-balance "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1500000000000")]),a._v(" Winston\n"),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1.5")]),a._v(" AR\n")])])]),t("p",[a._v("If, at any time, you need to send AR out of your wallet to another wallet address, you may perform:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Using our previously generated wallet as the destination...")]),a._v("\nardrive send-ar "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet/file.json --dest-address "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"')]),a._v(" --ar-amount "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2.12345")]),a._v("\n")])])]),t("h2",{attrs:{id:"working-with-entities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-entities"}},[a._v("#")]),a._v(" Working With Entities")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive"),t("OutboundLink")],1),a._v("'s "),t("a",{attrs:{href:"https://ardrive.atlassian.net/l/c/m6P1vJDo",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArFS"),t("OutboundLink")],1),a._v(" integration provides for hierarchical organization of your file and folder data on Arweave.")]),a._v(" "),t("p",[a._v("The fundamental entity types specified by ArFS are:")]),a._v(" "),t("ul",[t("li",[a._v("Drives")]),a._v(" "),t("li",[a._v("Folders")]),a._v(" "),t("li",[a._v("Files")])]),a._v(" "),t("p",[a._v("Each instance of these entities have a Version 4 UUID entity ID that is commonly referred to by its entity type, i.e. drive ID, folder ID, and file ID.")]),a._v(" "),t("p",[a._v("When you execute write functions with the CLI, the JSON output will contain information about the Arweave Transaction IDs that were registered when writing your entities to the blockweave, any miner rewards or "),t("a",{attrs:{href:"https://ardrive.io/community/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive Community"),t("OutboundLink")],1),a._v(" tips that were disbursed from your wallet, and any new entity IDs and, when applicable, encryption keys that were generated in the process of creating the entities. Typically, you'll want to keep track of those and get proficient with retrieving them in order to build your drive hierarchy to your liking. See "),t("a",{attrs:{href:"#understanding-drive-and-file-keys"}},[a._v("Understanding Drive and File Keys")]),a._v(" for more info.")]),a._v(" "),t("h3",{attrs:{id:"dry-run"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#dry-run"}},[a._v("#")]),a._v(" Dry Run")]),a._v(" "),t("p",[a._v("An important feature of the ArDrive CLI is the "),t("code",[a._v("--dry-run")]),a._v(' flag. On each command that would write an ArFS entity, there is the option to run it as a "dry run". This will run all of the steps and print the outputs of a regular ArFS write, but will skip sending the actual transaction:')]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("my-command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("other-options"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" --dry-run\n")])])]),t("p",[a._v("This can be very useful for gathering price estimations or to confirm that you've copy-pasted your entity IDs correctly before committing to an upload.")]),a._v(" "),t("h3",{attrs:{id:"uploading-to-turbo-beta"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-to-turbo-beta"}},[a._v("#")]),a._v(" Uploading to Turbo (BETA) "),t("a",{attrs:{id:"upload-to-turbo"}})]),a._v(" "),t("p",[a._v("Users can optionally choose to send each ArFS entities created to "),t("a",{attrs:{href:"https://ardrive.io/turbo/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive Turbo"),t("OutboundLink")],1),a._v(" using the "),t("code",[a._v("--turbo")]),a._v(" flag. Instead of using AR from an Arweave wallet, you can use Turbo Credits or take advantage of free/discounted upload promotions.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("my-command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("other-options"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--turbo")]),a._v("\n")])])]),t("p",[a._v("This flag will skip any balance check on the CLI side. Turbo will check a user's balance and accept/reject a data item at the time of upload. The "),t("code",[a._v("--turbo")]),a._v(" flag by default will send your files to "),t("code",[a._v("upload.ardrive.io")]),a._v(" to be bundled. To change the Turbo destination, users can use the "),t("code",[a._v("--turbo-url")]),a._v(" flag.")]),a._v(" "),t("h2",{attrs:{id:"working-with-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-drives"}},[a._v("#")]),a._v(" Working With Drives")]),a._v(" "),t("h3",{attrs:{id:"understanding-drive-hierarchies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#understanding-drive-hierarchies"}},[a._v("#")]),a._v(" Understanding Drive Hierarchies")]),a._v(" "),t("p",[a._v('At the root of every data tree is a "Drive" entity. When a drive is created, a Root Folder is also created for it. The entity IDs for both are generated and returned when you create a new drive:')]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Use `tee` to keep a receipt of the full set of transactions info and `jq` to focus on the data of interest")]),a._v("\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Teenage Love Poetry"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" created_drive.json "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v("\njq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'[.created[] | del(.metadataTxId, .entityName, .bundledIn)]'")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"drive"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"d1535126-fded-4990-809f-83a06f2a1118"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])]),t("p",[a._v("The relationship between the drive and its root folder is clearly visible when retrieving the drive's info:"),t("a",{attrs:{id:"drive-info"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive drive-info "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{driveId, rootFolderId}'")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"rootFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"d1535126-fded-4990-809f-83a06f2a1118"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n")])])]),t("p",[a._v('All file and folder entities in the drive will be anchored to it by a "Drive-ID" GQL Tag. And they\'ll each be anchored to a parent folder ID, tracked via the "Parent-Folder-ID" GQL tag, forming a tree structure whose base terminates at the Root Folder.')]),a._v(" "),t("h3",{attrs:{id:"understanding-drive-and-file-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#understanding-drive-and-file-keys"}},[a._v("#")]),a._v(" Understanding Drive and File Keys")]),a._v(" "),t("p",[a._v('Private Drives achieve privacy via end-to-end encryption facilitated by hash-derived "Keys". Drive Keys encrypt/decrypt Drive and Folder data, and File Keys encrypt/decrypt File Data.')]),a._v(" "),t("p",[a._v("The relationships among your data and their keys is as follows:")]),a._v(" "),t("ul",[t("li",[a._v("Drive Key = functionOf(Wallet Signature, Randomly Generated Drive ID, User-specified Drive Password)")]),a._v(" "),t("li",[a._v("File Key = functionOf(Randomly Generated File ID, Drive Key)")])]),a._v(" "),t("p",[a._v("When you create private entities, the returned JSON data from the ArDrive CLI will contain the keys needed to decrypt the encrypted representation of your entity that is now securely and permanently stored on the blockweave.")]),a._v(" "),t("p",[a._v("To derive the drive key again for a drive, perform the following:"),t("a",{attrs:{id:"derive-drive-key"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Will throw an error if the wallet or password specified can't be used to decrypt the on-chain drive")]),a._v("\nardrive get-drive-key "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n")])])]),t("p",[a._v("To derive the file key again for a file, perform the following:"),t("a",{attrs:{id:"derive-file-key"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Will throw an error if the drive key or drive-key-derivation data specified can't be used to decrypt the on-chain file")]),a._v("\nardrive get-file-key --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0"')]),a._v(" --drive-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" --drive-key "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"yHdCjpCK3EcuhQcKNx2d/NN5ReEjoKfZVqKunlCnPEo"')]),a._v("\n")])])]),t("h3",{attrs:{id:"managing-drive-passwords"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#managing-drive-passwords"}},[a._v("#")]),a._v(" Managing Drive Passwords")]),a._v(" "),t("p",[a._v("The ArDrive CLI's private drive and folder functions all require either a drive password OR a drive key. Private file functions require either the drive password or the file key. "),t("strong",[a._v("Keys and passwords are sensitive data, so manage the entry, display, storage, and transmission of them very carefully.")])]),a._v(" "),t("p",[a._v("Drive passwords are the most portable, and fundamental, encryption facet, so a few options are available during private drive operations for supplying them:")]),a._v(" "),t("ul",[t("li",[a._v("Environment Variable")]),a._v(" "),t("li",[a._v("STDIN")]),a._v(" "),t("li",[a._v("Secure Prompt")])]),a._v(" "),t("h4",{attrs:{id:"supplying-your-password-environment-variable"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supplying-your-password-environment-variable"}},[a._v("#")]),a._v(" Supplying Your Password: Environment Variable"),t("a",{attrs:{id:"pw-environment-variable"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Securely type your password into a read prompt, store it to TMP_ARDRIVE_PW, and export it for the shell session")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("read")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-rs")]),a._v(" TMP_ARDRIVE_PW\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ARDRIVE_DRIVE_PW")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("TMP_ARDRIVE_PW"),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n")])])]),t("h4",{attrs:{id:"supplying-your-password-stdin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supplying-your-password-stdin"}},[a._v("#")]),a._v(" Supplying Your Password: STDIN"),t("a",{attrs:{id:"pw-stdin"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Pipe your drive password to the ArDrive CLI")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" /path/to/my/drive/password.txt "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" ardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Redirect your drive password to the ArDrive CLI")]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v(" /path/to/my/drive/password.txt\n")])])]),t("h4",{attrs:{id:"supplying-your-password-prompt"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supplying-your-password-prompt"}},[a._v("#")]),a._v(" Supplying Your Password: Prompt"),t("a",{attrs:{id:"pw-prompt"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# When all other options fail, the CLI will prompt for your password (NOT COMPATIBLE WITH PIPES AND REDIRECTS!)")]),a._v("\nardrive "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("some private command"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n? Enter drive password: β€Ί ********\n")])])]),t("h3",{attrs:{id:"creating-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-drives"}},[a._v("#")]),a._v(" Creating Drives")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Public drive")]),a._v("\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My Public Archive"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Private drive")]),a._v("\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Teenage Love Poetry"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n")])])]),t("h3",{attrs:{id:"listing-drives-for-an-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-drives-for-an-address"}},[a._v("#")]),a._v(" Listing Drives for an Address")]),a._v(" "),t("p",[a._v("You can list all the drives associated with any Arweave wallet address, though the details of private drives will be obfuscated from you unless you provide the necessary decryption data.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List all your own drives")]),a._v("\nardrive list-all-drives "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List any address's drives")]),a._v("\nardrive list-all-drives "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--address")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"')]),a._v("\n")])])]),t("h3",{attrs:{id:"listing-every-entity-in-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-every-entity-in-a-drive"}},[a._v("#")]),a._v(" Listing Every Entity in a Drive"),t("a",{attrs:{id:"list-drive"}})]),a._v(" "),t("p",[a._v("Useful notes on listing the contents of drives:")]),a._v(" "),t("ul",[t("li",[a._v("Listing a drive is effectively the same as listing its root folder.")]),a._v(" "),t("li",[a._v("You can control the tree depth of the data returned.")]),a._v(" "),t("li",[a._v("path, txPath, and entityIdPath properties on entities can provide useful handholds for other forms of data navigation")])]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List everything in a private drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List a private drive including the `fileKey` and/or `driveKey` of all listed entitites")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/my/wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-P")]),a._v(" --with-keys\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List the contents of a public drive up to and including those in the grandchild folders of the root folder")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n")])])]),t("h3",{attrs:{id:"list-drive-pipeline-examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#list-drive-pipeline-examples"}},[a._v("#")]),a._v(" List Drive Pipeline Examples")]),a._v(" "),t("p",[a._v("You can utilize "),t("code",[a._v("jq")]),a._v(" and the list commands to reshape the commands' output data into useful forms and stats for many use cases. Here are a few examples:")]),a._v(" "),t("p",[t("a",{attrs:{id:"get-share-links"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Get share links for a PUBLIC drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" a44482fd-592e-45fa-a08a-e526c31b87f1 "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('\'.[] | select(.entityType == "file") | "https://app.ardrive.io/#/file/" + .entityId + "/view"\'')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/1337babe-f000-dead-beef-ffffffffffff/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/cdbc9ddd-1cab-41d9-acbd-fd4328929de3/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/f19bc712-b57a-4e0d-8e5c-b7f1786b34a1/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/4f8e081b-42f2-442d-be41-57f6f906e1c8/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/0e02d254-c853-4ff0-9b6e-c4d23d2a95f5/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/c098b869-29d1-4a86-960f-a9e10433f0b0/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/4afc8cdf-4d27-408a-bfb9-0a2ec21eebf8/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://app.ardrive.io/#/file/85fe488d-fcf7-48ca-9df8-2b39958bbf15/view"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n")])])]),t("p",[t("a",{attrs:{id:"get-total-size"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Get total size of all files within drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" 13c3c232-6687-4d11-8ac1-35284102c7db "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("' map(select(.entityType == \"file\") | .size) | add'")]),a._v("\n")])])]),t("p",[t("a",{attrs:{id:"get-file-count"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Get total number of files within drive")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" 01ea6ba3-9e58-42e7-899d-622fd110211c "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'[ .[] | select(.entityType == \"file\") ] | length'")]),a._v("\n")])])]),t("h2",{attrs:{id:"working-with-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-folders"}},[a._v("#")]),a._v(" Working With Folders")]),a._v(" "),t("p",[a._v("As discussed previously, all folders in a drive are linked by way of parent folder references back to the root folder of a drive. Folders can be moved into any folder in the hierarchy that's not in their own subtree.")]),a._v(" "),t("h3",{attrs:{id:"creating-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-folders"}},[a._v("#")]),a._v(" Creating Folders")]),a._v(" "),t("p",[a._v("Creating folders manually is straightforward:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"63153bb3-2ca9-4d42-9106-0ce82e793321"')]),a._v(" --folder-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My Awesome Folder"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"created"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"metadataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"AYFMBVmwqhbg9y5Fbj3Iasy5oxUqhauOW7PcS1sl4Dk"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"d1b7c514-fb12-4603-aad8-002cf63015d3"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"key"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"yHdCjpCKD2cuhQcKNx2d/XF5ReEjoKfZVqKunlCnPEk"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My Awesome Folder"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tips"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"AYFMBVmwqhbg9y5Fbj3Iasy5oxUqhauOW7PcS1sl4Dk"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1378052")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("Note: Folders can also be created by supplying a folder as the --local-path of an upload-file command. In this case, the folder hierarchy on the local disk will be reconstructed on chain during the course of the recursive bulk upload.")]),a._v(" "),t("h3",{attrs:{id:"moving-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#moving-folders"}},[a._v("#")]),a._v(" Moving Folders")]),a._v(" "),t("p",[a._v("Moving a folder is as simple as supplying a new parent folder ID. Note that naming collisions among entities within a folder are not allowed.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive move-folder --folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513921"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"renaming-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#renaming-folders"}},[a._v("#")]),a._v(" Renaming Folders"),t("a",{attrs:{id:"rename-folder"}})]),a._v(" "),t("p",[a._v("In order to rename a folder you must provide a name different from its current one, and it must not create naming conflicts with its sibling entities.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive rename-folder --folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"568d5eba-dbf3-4a49-8129-1c58f7fd35bc"')]),a._v(" --folder-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Folder with cool stuff"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"./wallet.json"')]),a._v("\n")])])]),t("h3",{attrs:{id:"viewing-folder-metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#viewing-folder-metadata"}},[a._v("#")]),a._v(" Viewing Folder Metadata")]),a._v(" "),t("p",[a._v("To view the metadata of a folder, users can use the "),t("code",[a._v("folder-info")]),a._v(" command:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive folder-info --folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v("\n")])])]),t("h3",{attrs:{id:"listing-contents-of-a-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-contents-of-a-folder"}},[a._v("#")]),a._v(" Listing Contents of a Folder")]),a._v(" "),t("p",[a._v("Similar to drives, the "),t("code",[a._v("list-folder")]),a._v(" command can be used to fetch the metadata of each entity within a folder. But by default, the command will fetch only the immediate children of that folder ("),t("code",[a._v("--max-depth 0")]),a._v("):")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# List immediate children of folder "My Public Folder"')]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mytestfolder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"HYiKyfLwY7PT9NleTQoTiM_-qPVUwf4ClDhx1sjUAEU"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1635102772")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"03df2929-1440-4ab4-bbf0-9dc776e1ed96"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/mytestfolder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/HYiKyfLwY7PT9NleTQoTiM_-qPVUwf4ClDhx1sjUAEU"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/03df2929-1440-4ab4-bbf0-9dc776e1ed96"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Super sonic public folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"VUk1B_vo1va2-EHLtqjsotzy0Rdn6lU4hQo3RD2xoTI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631283259")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"452c6aec-43dc-4015-9abd-20083068d432"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/Super sonic sub folder"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/VUk1B_vo1va2-EHLtqjsotzy0Rdn6lU4hQo3RD2xoTI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/452c6aec-43dc-4015-9abd-20083068d432"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"test-number-twelve.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"429zBqnd7ZBNzgukaix26RYz3g5SeXCCo_oIY6CPZLg"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631722234")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("47")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631722217028")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"vA-BxAS7I6n90cH4Fzsk4cWS3EOPb1KOhj8yeI88dj0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"text/plain"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5948327-d6de-4acf-a6fe-e091ecf78d71"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/test-number-twelve.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/429zBqnd7ZBNzgukaix26RYz3g5SeXCCo_oIY6CPZLg"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/e5948327-d6de-4acf-a6fe-e091ecf78d71"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01ea6ba3-9e58-42e7-899d-622fd110211a"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wonderful-test-file.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6CokwlzB81Fx7dq-lB654VM0XQykdU6eYohDmEJ2gk4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631671275")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("23")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1631283389232")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"UP8THwA_1gvyRqNRqYmTpWvU4-UzNWBN7SiX_AIihg4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"text/plain"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"29850ab7-56d4-4e1f-a5be-cb86d5513940"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3274dae9-3487-41eb-94d5-8d5d3d8bc343"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/My Public Folder/wonderful-test-file.txt"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/6CokwlzB81Fx7dq-lB654VM0XQykdU6eYohDmEJ2gk4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityIdPath"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/29850ab7-56d4-4e1f-a5be-cb86d5513940/3274dae9-3487-41eb-94d5-8d5d3d8bc343"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])]),t("p",[a._v("To list further than the immediate children, you can make use of the flags: "),t("code",[a._v("--all")]),a._v(" and "),t("code",[a._v("--max-depth")]),a._v(".")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List all contents of a public folder")]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--all")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List the contents of a public folder with custom depth")]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n")])])]),t("p",[a._v("In the case of private entitites, the "),t("code",[a._v("--with-keys")]),a._v(" flag will make the command to include the keys in the output.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# List all contents of a private folder including the `fileKey` and/or `driveKey` of all listed entitites")]),a._v("\nardrive list-folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1b027047-4cfc-4eee-88a8-9af694f660c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /my/wallet.json --with-keys\n")])])]),t("h2",{attrs:{id:"working-with-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#working-with-files"}},[a._v("#")]),a._v(" Working With Files")]),a._v(" "),t("p",[a._v("Similar to folders, files are linked to a parent folder which ultimately chains the file back to the root folder of its parent drive. As such, a parent folder ID is required in order to upload files. Files can be freely moved to other folders within their original drive.")]),a._v(" "),t("p",[a._v("The important difference for file entities is that they also hold a reference to their data transaction ID, which is the "),t("code",[a._v("dataTxId")]),a._v(" as returned by the "),t("code",[a._v("file-info")]),a._v(" command. This is where your uploaded data lives on the permaweb.")]),a._v(" "),t("p",[t("strong",[a._v("NOTE: The CLI currently (v1.0.0) has progress logging on uploads DISABLED for producing clean JSON outputs that can be piped in the terminal. On larger uploads, remember to be patient. You can check your system's "),t("code",[a._v("node")]),a._v(" process to confirm the process is still uploading.")])]),a._v(" "),t("h3",{attrs:{id:"uploading-a-single-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-single-file"}},[a._v("#")]),a._v(" Uploading a Single File")]),a._v(" "),t("p",[a._v("To upload a file, you'll need a parent folder id, the file to upload's file path, and the path to your wallet:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Supply the parent folder ID to upload-file")]),a._v("\nardrive upload-file --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"created"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file.txt"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6613395a-cf19-4420-846a-f88b7b765c05"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"l4iNWyBapfAIj7OU-nB8z9XrBhawyqzs5O9qhk-3EnI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"metadataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"YfdDXUyerPCpBbGTm_gv_x5hR3tu5fnz8bM-jPL__JE"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bundledIn"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sourceUri"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file:///path/to/file.txt"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bundle"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bundleTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tips"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"recipient"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3mxGJ4xLcQQNv6_TiKx0F0d5XVE0mNvONQI5GZXJXkt"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"winston"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"10000000"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("42819829")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("NOTE: To upload to the root of a drive, specify its root folder ID as the parent folder ID for the upload destination. You can retrieve it like so:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive drive-info "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c7f87712-b54e-4491-bc96-1c5fa7b1da50"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.rootFolderId'")]),a._v("\n")])])]),t("h3",{attrs:{id:"ipfs-cid-tagging"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ipfs-cid-tagging"}},[a._v("#")]),a._v(" IPFS CID Tagging")]),a._v(" "),t("p",[a._v("Certain nodes on the Arweave network may be running the "),t("a",{attrs:{href:"https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3",target:"_blank",rel:"noopener noreferrer"}},[a._v("IPFS+Arweave bridge"),t("OutboundLink")],1),a._v(". Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your "),t("strong",[a._v("PUBLIC")]),a._v(" file uploads, you may use the '--add-ipfs-tag' flag:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --add-ipfs-tag --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"progress-logging-of-transaction-uploads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#progress-logging-of-transaction-uploads"}},[a._v("#")]),a._v(" Progress Logging of Transaction Uploads")]),a._v(" "),t("p",[a._v("Progress logging of transaction uploads to stderr can be enabled by setting the "),t("code",[a._v("ARDRIVE_PROGRESS_LOG")]),a._v(" environment variable to "),t("code",[a._v("1")]),a._v(":")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("Uploading "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" transaction "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v(" of total "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(" transactions"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("35")]),a._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("66")]),a._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("100")]),a._v("%\nUploading "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" transaction "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(" of total "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(" transactions"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("13")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("28")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("42")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("60")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("76")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("91")]),a._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("100")]),a._v("%\n")])])]),t("h3",{attrs:{id:"download-a-single-file-beta"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#download-a-single-file-beta"}},[a._v("#")]),a._v(" Download a Single file (BETA)"),t("a",{attrs:{id:"download-file"}})]),a._v(" "),t("p",[a._v("By using the "),t("code",[a._v("download-file")]),a._v(" command you can download a file on chain to a folder in your local storage specified by --local-path (or to your current working directory if not specified):")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ff450770-a9cb-46a5-9234-89cbd9796610"')]),a._v(" --local-path /my_ardrive_downloads/\n")])])]),t("p",[a._v("Specify a filename in the --local-path if you'd like to use a different name than the one that's used in your drive:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ff450770-a9cb-46a5-9234-89cbd9796610"')]),a._v(" --local-path /my_ardrive_downloads/my_pic.png\n")])])]),t("h3",{attrs:{id:"rename-a-single-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-a-single-file"}},[a._v("#")]),a._v(" Rename a Single File"),t("a",{attrs:{id:"rename-file"}})]),a._v(" "),t("p",[a._v("To rename an on-chain file you can make use of the "),t("code",[a._v("rename-file")]),a._v(" command. The required parameters are the file ID and the new name, as well as the owner wallet or seed phrase.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive rename-file --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"290a3f9a-37b2-4f0f-a899-6fac983833b3"')]),a._v(" --file-name "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"My custom file name.txt"')]),a._v(" --wallet-file "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wallet.json"')]),a._v("\n")])])]),t("h3",{attrs:{id:"uploading-a-folder-with-files-bulk-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-folder-with-files-bulk-upload"}},[a._v("#")]),a._v(" Uploading a Folder with Files (Bulk Upload)"),t("a",{attrs:{id:"bulk-upload"}})]),a._v(" "),t("p",[a._v("Users can perform a bulk upload by using the upload-file command on a target folder. The command will reconstruct the folder hierarchy on local disk as ArFS folders on the permaweb and upload each file into their corresponding folders:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --local-path /path/to/folder --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"downloading-a-folder-with-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#downloading-a-folder-with-files"}},[a._v("#")]),a._v(" Downloading a Folder with Files"),t("a",{attrs:{id:"download-folder"}})]),a._v(" "),t("p",[a._v("You can download a folder from ArDrive to your local machine with the "),t("code",[a._v("download-folder")]),a._v(' command. In the following examples, assume that a folder with ID "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" exists in your drive and is named "MyArDriveFolder".')]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# Downloads "MyArDriveFolder" into the current working directory, i.e. ./MyArDriveFolder/')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v("\n")])])]),t("p",[a._v("By specifying the "),t("code",[a._v("--local-path")]),a._v(" option, you can choose the local parent folder into which the on-chain folder will be downloaded. When the parameter is omitted, its value defaults to the current working directory (i.e. "),t("code",[a._v("./")]),a._v(").")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# Downloads "MyArDriveFolder" into /my_ardrive_downloads/MyArDriveFolder')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path /my_ardrive_downloads/\n")])])]),t("p",[a._v("The "),t("code",[a._v("--max-depth")]),a._v(" parameter lets you to choose a custom folder depth to download. When omitted, the entire subtree of the folder will be downloaded. In the following example, only the immediate children of the folder will be downloaded:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n")])])]),t("p",[a._v("The behaviors of "),t("code",[a._v("--local-path")]),a._v(" are similar to those of "),t("code",[a._v("cp")]),a._v(" and "),t("code",[a._v("mv")]),a._v(" in Unix systems, e.g.:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# folder downloaded to "/existing_folder/MyArDriveFolder"')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/existing_folder"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# folder downloaded to "/existing_folder/MyArDriveFolder/MyArDriveFolder" as "/existing_folder/MyArDriveFolder" already exists')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/existing_folder/MyArDriveFolder"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v('# folder downloaded to "/existing_folder/non_existent_folder"')]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/existing_folder/non_existent_folder"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ERROR!")]),a._v("\nardrive download-folder "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"47f5bde9-61ba-49c7-b409-1aa4a9e250f6"')]),a._v(" --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/non_existent_folder_1/non_existent_folder_2"')]),a._v("\n")])])]),t("h3",{attrs:{id:"downloading-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#downloading-a-drive"}},[a._v("#")]),a._v(" Downloading a Drive"),t("a",{attrs:{id:"download-drive"}})]),a._v(" "),t("p",[a._v("To download the whole drive you can use the "),t("code",[a._v("download-drive")]),a._v(" command.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive download-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c0c8ba1c-efc5-420d-a07c-a755dc67f6b2"')]),a._v("\n")])])]),t("p",[a._v("This is equivalent to running the "),t("code",[a._v("download-folder")]),a._v(" command against the root folder of the drive.")]),a._v(" "),t("h3",{attrs:{id:"uploading-multiple-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-multiple-files"}},[a._v("#")]),a._v(" Uploading Multiple Files"),t("a",{attrs:{id:"multi-file-upload"}})]),a._v(" "),t("p",[a._v("To upload an arbitrary number of files or folders, pass a space-separated list of paths to "),t("code",[a._v("--local-paths")]),a._v(":")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Specifying a mixed set of file and folder paths")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" --local-paths ./image.png ~/backups/ "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v("/another_file.txt\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Example using glob expansion to upload all .json files in the current folder")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" wallet.json "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6939b9e0-cc98-42cb-bae0-5888eca78885"')]),a._v(" --local-paths ./*.json\n")])])]),t("h3",{attrs:{id:"name-conflict-resolution-on-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#name-conflict-resolution-on-upload"}},[a._v("#")]),a._v(" Name Conflict Resolution on Upload"),t("a",{attrs:{id:"conflict-resolution"}})]),a._v(" "),t("p",[a._v("By default, the "),t("code",[a._v("upload-file")]),a._v(" command will use the upsert behavior if existing entities are encountered in the destination folder tree that would cause naming conflicts.")]),a._v(" "),t("p",[a._v("Expect the behaviors from the following table for each of these resolution settings:")]),a._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("tr",[t("th",[a._v("Source Type")]),a._v(" "),t("th",[a._v("Conflict at Dest")]),a._v(" "),t("th",[a._v("`skip`")]),a._v(" "),t("th",[a._v("`replace`")]),a._v(" "),t("th",[a._v("`upsert` (default)")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("None")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Matching File")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Update")]),a._v(" "),t("td",[a._v("Skip")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Different File")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Update")]),a._v(" "),t("td",[a._v("Update")])]),a._v(" "),t("tr",[t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Fail")]),a._v(" "),t("td",[a._v("Fail")])]),a._v(" "),t("tr",[t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("None")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")]),a._v(" "),t("td",[a._v("Insert")])]),a._v(" "),t("tr",[t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("File")]),a._v(" "),t("td",[a._v("Skip")]),a._v(" "),t("td",[a._v("Fail")]),a._v(" "),t("td",[a._v("Fail")])]),a._v(" "),t("tr",[t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("Folder")]),a._v(" "),t("td",[a._v("Re-use")]),a._v(" "),t("td",[a._v("Re-use")]),a._v(" "),t("td",[a._v("Re-use")])])])]),a._v(" "),t("p",[a._v("The default upsert behavior will check the destination folder for a file with a conflicting name. If no conflicts are found, it will insert (upload) the file.")]),a._v(" "),t("p",[a._v("In the case that there is a FILE to FILE name conflict found, it will only update it if necessary. To determine if an update is necessary, upsert will compare the last modified dates of conflicting file and the file being uploaded. When they are matching, the upload will be skipped. Otherwise the file will be updated as a new revision.")]),a._v(" "),t("p",[a._v("To override the upsert behavior, use the "),t("code",[a._v("--replace")]),a._v(" option to always make new revisions of a file or the "),t("code",[a._v("--skip")]),a._v(" option to always skip the upload on name conflicts:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--replace")]),a._v(" --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--skip")]),a._v(" --local-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("Alternatively, the upload-file commands now also supports the "),t("code",[a._v("--ask")]),a._v(" conflict resolution option. This setting will always provide an interactive prompt on name conflicts that allows users to decide how to resolve each conflict found:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--ask")]),a._v(" --local-file-path /path/to/file.txt --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n\nDestination folder has a "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" to "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" name conflict"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("!")]),a._v("\n\nFile name: "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v(".png\nFile ID: efbc0370-b69f-44d9-812c-0d272b019027\nThis "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" has a DIFFERENT last modified "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("date")]),a._v("\n\nPlease "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" how to proceed:\n β€Ί - Use arrow-keys. Return to submit.\n❯ Replace as new "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" revision\n Upload with a different "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" name\n Skip this "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" upload\n")])])]),t("h3",{attrs:{id:"understanding-bundled-transactions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#understanding-bundled-transactions"}},[a._v("#")]),a._v(" Understanding Bundled Transactions"),t("a",{attrs:{id:"bundles"}})]),a._v(" "),t("p",[a._v("The ArDrive CLI currently uses two different methods for uploading transactions to the Arweave network: standard transactions and Direct to Network (D2N) bundled transactions. By default, the CLI will send a D2N bundled transaction for any action that would result in multiple transactions. This bundling functionality is currently used on the "),t("code",[a._v("upload-file")]),a._v(" and "),t("code",[a._v("create-drive")]),a._v(" commands.")]),a._v(" "),t("p",[a._v("D2N bundled transactions come with several benefits and implications:")]),a._v(" "),t("ul",[t("li",[a._v("Bundling saves AR and enhances ArFS reliability by sending associated ArFS transactions up as one atomic bundle.")]),a._v(" "),t("li",[a._v('Bundled transactions are treated as a single data transaction by the Arweave network, but can be presented as separate transactions by the Arweave Gateway once they have been "unbundled".')]),a._v(" "),t("li",[a._v("Un-bundling can take anywhere from a few minutes up to an hour. During that time, the files in the bundle will neither appear in list- commands nor be downloadable. Similarly, they will not appear in the web app after syncs until un-bundling is complete. "),t("strong",[a._v("This can negatively affect the accuracy of upsert operations")]),a._v(", so it's best to wait before retrying bulk uploads.")]),a._v(" "),t("li",[a._v("Bundling reliability on the gateway side degrades once bundles reach either 500 data items (or ~250 files) or 500 MiB, so the CLI will create and upload multiple bundles as necessary, or will send files that are simply too large for reliable bundling as unbundled txs.")])]),a._v(" "),t("h3",{attrs:{id:"uploading-a-non-bundled-transaction-not-recommended"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-non-bundled-transaction-not-recommended"}},[a._v("#")]),a._v(" Uploading a Non-Bundled Transaction (NOT RECOMMENDED)"),t("a",{attrs:{id:"no-bundle"}})]),a._v(" "),t("p",[a._v("While not recommended, the CLI does provide the option to forcibly send all transactions as standard transactions rather than attempting to bundle them together. To do this, simply add the "),t("code",[a._v("--no-bundle")]),a._v(" flag to the "),t("code",[a._v("upload-file")]),a._v(" or "),t("code",[a._v("create-drive")]),a._v(" command:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --no-bundle --local-path /path/to/file --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"fetching-the-metadata-of-a-file-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#fetching-the-metadata-of-a-file-entity"}},[a._v("#")]),a._v(" Fetching the Metadata of a File Entity")]),a._v(" "),t("p",[a._v("Simply perform the file-info command to retrieve the metadata of a file:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive file-info --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-Web"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.1.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"51062487-2e8b-4af7-bd81-4345dc28ea5d"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"2_depth.png"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"CZKdjqwnmxbWchGA1hjSO5ZH--4OYodIGWzI-FmX28U"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1633625081")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("41946")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1605157729000")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fileId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Jz0WsWyAGVc0aE3UzACo-YJqG8OPrN3UucmDdt8Fbjc"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"image/png"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("h3",{attrs:{id:"retrying-a-failed-file-data-transaction-public-unbundled-files-only"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#retrying-a-failed-file-data-transaction-public-unbundled-files-only"}},[a._v("#")]),a._v(" Retrying a Failed File Data Transaction (Public Unbundled Files Only)"),t("a",{attrs:{id:"retry-tx"}})]),a._v(" "),t("p",[a._v("Arweave data upload transactions are split into two phases: transaction posting and chunks uploading. Once the transaction post phase has been completed, you've effectively \"paid\" the network for storage of the data chunks that you'll send in the next stage.")]),a._v(" "),t("p",[a._v("If your system encounters an error while posting the transaction, you can retry posting the transaction for as long as your tx_anchor is valid ("),t("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#field-definitions",target:"_blank",rel:"noopener noreferrer"}},[a._v("learn more about tx_anchors here"),t("OutboundLink")],1),a._v("). You may retry and/or resume posting chunks at any time after your transaction has posted. The ArDrive CLI allows you to take advantage of this Arweave protocol capability.")]),a._v(" "),t("p",[a._v("Using the CLI, when the transaction post has succeeded but the chunk upload step fails, the data transaction's ID could be lost. There are a few options to recover this ID. If the failed transaction is the most recent one sent from a wallet, the transaction ID can be recovered with the "),t("code",[a._v("ardrive last-tx -w /path/to/wallet")]),a._v(" command AFTER the transaction's headers have been mined (It can take 5-10 minutes for the tx-id to become available with the last-tx approach). Other options for finding the partially uploaded transaction's ID include:")]),a._v(" "),t("ul",[t("li",[a._v("Using an Arweave gateway GQL http endpoint to search for transactions that belong to the wallet. See this "),t("a",{attrs:{href:"https://gql-guide.vercel.app/#owners",target:"_blank",rel:"noopener noreferrer"}},[a._v("Arweave GQL Guide"),t("OutboundLink")],1),a._v(" for more info.")]),a._v(" "),t("li",[a._v("Browse the recent transactions associated with the wallet via a block explorer tool like "),t("a",{attrs:{href:"https://viewblock.io/arweave/",target:"_blank",rel:"noopener noreferrer"}},[a._v("ViewBlock"),t("OutboundLink")],1),a._v(".")])]),a._v(" "),t("p",[a._v("In order to re-seed the chunks for an unbundled ArFS data transaction, a user must have the data transaction ID, the original file data, and either a destination folder ID or a valid file ID for the file. Supply that information to the "),t("code",[a._v("retry-tx")]),a._v(" command like so:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive retry-tx --tx-id "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" Data Transaction ID "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" Destination Folder ID "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(" --local-path /path/to/file --wallet-file /path/to/wallet\n")])])]),t("p",[t("strong",[a._v("Note: Retry feature is currently only available for PUBLIC unbundled file transactions. It is also perfectly safe to mistakenly re-seed the chunks of a healthy transaction, the transaction will remain stable and the wallet balance will not be affected.")])]),a._v(" "),t("h3",{attrs:{id:"moving-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#moving-files"}},[a._v("#")]),a._v(" Moving Files"),t("a",{attrs:{id:"moving-files"}})]),a._v(" "),t("p",[a._v("Files can be moved from one folder to another within the same drive. Moving a file is simply the process of uploading a new file metadata revision with an updated File ID <> Parent Folder ID relationship. The following command will move a file from its current location in a public drive to a new parent folder in that drive:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive move-file --file-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63"')]),a._v("\n")])])]),t("h3",{attrs:{id:"uploading-manifests"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-manifests"}},[a._v("#")]),a._v(" Uploading Manifests")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://github.com/ArweaveTeam/arweave/wiki/Path-Manifests",target:"_blank",rel:"noopener noreferrer"}},[a._v("Arweave Path Manifests"),t("OutboundLink")],1),a._v(" are are special "),t("code",[a._v(".json")]),a._v(" files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. So if, for example, your manifest file had an arweave.net URL like:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("https://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("manifest tx id"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("Then, all the mapped transactions and paths in the manifest file would be addressable at URLs like:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("https://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("manifest tx id"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/foo.txt\nhttps://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("manifest tx id"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/bar/baz.png\n")])])]),t("p",[a._v("ArDrive supports the creation of these Arweave manifests using any of your PUBLIC folders. The generated manifest paths will be links to each of the file entities within the specified folder. The manifest file entity will be created at the root of the folder.")]),a._v(" "),t("p",[a._v("To create a manifest of an entire public drive, specify the root folder of that drive:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bc9af866-6421-40f1-ac89-202bddb5c487"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v("\n")])])]),t("p",[a._v("You can also create a manifest of a folder's file entities at a custom depth by using the "),t("code",[a._v("--max-depth")]),a._v(" option:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Create manifest of a folder's local file contents, excluding all sub-folders")]),a._v("\nardrive create-manifest --max-depth "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"867228d8-4413-4c0e-a499-e1decbf2ea38"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v("\n")])])]),t("p",[a._v("Creating a "),t("code",[a._v(".json")]),a._v(" file of your manifest links output can be accomplished here with some "),t("code",[a._v("jq")]),a._v(" parsing and piping to a file:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6c312b3e-4778-4a18-8243-f2b346f5e7cb"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{links}'")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" links.json\n")])])]),t("p",[a._v("If you'd like to preview the contents of your manifest before uploading, you can perform a dry run and do some lightweight post processing to isolate the data:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6c312b3e-4778-4a18-8243-f2b346f5e7cb"')]),a._v(" --dry-run "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{manifest}.manifest'")]),a._v("\n")])])]),t("p",[t("a",{attrs:{id:"manifest-json"}})]),a._v(" "),t("div",{staticClass:"language-json extra-class"},[t("pre",{pre:!0,attrs:{class:"language-json"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"manifest"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arweave/paths"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"version"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.1.0"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"index"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"path"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"index.html"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"paths"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"hello_world.txt"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"id"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Y7GFF8r9y0MEU_oi1aZeD87vrmai97JdRQ2L0cbGJ68"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"index.html"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"id"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"pELonjVebHyBsdxVymvxbGTmHD96v9PuuUXj8GUHGoY"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("The manifest data transaction is tagged with a unique content-type, "),t("code",[a._v("application/x.arweave-manifest+json")]),a._v(", which tells the gateway to treat this file as a manifest. The manifest file itself is a "),t("code",[a._v(".json")]),a._v(" file that holds the paths (the data transaction ids) to each file within the specified folder.")]),a._v(" "),t("p",[a._v("When your folder is later changed by adding files or updating them with new revisions, the original manifest will NOT be updated on its own. A manifest is a permanent record of your files in their current state.")]),a._v(" "),t("p",[a._v("However, creating a subsequent manifest with the same manifest name will create a new revision of that manifest in its new current state. Manifests follow the same name conflict resolution as outlined for files above (upsert by default).")]),a._v(" "),t("h4",{attrs:{id:"hosting-a-webpage-with-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hosting-a-webpage-with-manifest"}},[a._v("#")]),a._v(" Hosting a Webpage with Manifest")]),a._v(" "),t("p",[a._v("When creating a manifest, it is possible to host a webpage or web app. You can do this by creating a manifest on a folder that has an "),t("code",[a._v("index.html")]),a._v(" file in its root.")]),a._v(" "),t("p",[a._v("Using generated build folders from popular frameworks works as well. One requirement here to note is that the "),t("code",[a._v("href=")]),a._v(" paths from your generated "),t("code",[a._v("index.html")]),a._v(" file must not have leading a "),t("code",[a._v("/")]),a._v(". This means that the manifest will not resolve a path of "),t("code",[a._v("/dist/index.js")]),a._v(" but it will resolve "),t("code",[a._v("dist/index.js")]),a._v(" or "),t("code",[a._v("./dist/index.js")]),a._v(".")]),a._v(" "),t("p",[a._v("As an example, here is a flow of creating a React app and hosting it with an ArDrive Manifest. First, generate a React app:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("yarn")]),a._v(" create react-app my-app\n")])])]),t("p",[a._v("Next, add this field to the generated "),t("code",[a._v("package.json")]),a._v(" so that the paths will resolve correctly:")]),a._v(" "),t("div",{staticClass:"language-json extra-class"},[t("pre",{pre:!0,attrs:{class:"language-json"}},[t("code",[t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"homepage"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"."')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),t("p",[a._v("Then, create an optimized production build from within the app's directory:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("yarn")]),a._v(" build\n")])])]),t("p",[a._v("Now, we can create and upload that produced build folder on ArDrive to any of your existing ArFS folder entities:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-l")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/build"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bc9af866-6421-40f1-ac89-202bddb5c487"')]),a._v("\n")])])]),t("p",[a._v("And finally, create the manifest using the generated Folder ID from the build folder creation:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Create manifest using the Folder ID of the `/build` folder")]),a._v("\nardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"41759f05-614d-45ad-846b-63f3767504a4"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet"')]),a._v("\n")])])]),t("p",[a._v("In the return output, the top link will be a link to the deployed web app:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"links"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/asset-manifest.json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/favicon.ico"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/index.html"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("This is effectively hosting a web app with ArDrive. Check out the ArDrive Price Calculator React App hosted as an "),t("a",{attrs:{href:"https://arweave.net/qozq9YIUPEHfZhoTp9DkBpJuA_KNULBnfLiMroj5pZI",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArDrive Manifest"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("h3",{attrs:{id:"uploading-with-a-custom-content-type"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-with-a-custom-content-type"}},[a._v("#")]),a._v(" Uploading With a Custom Content Type"),t("a",{attrs:{id:"custom-content-type"}})]),a._v(" "),t("p",[a._v("Each file uploaded to the Arweave network receives a "),t("code",[a._v('"Content-Type"')]),a._v(" GraphQL tag that contains the MIME type for the file. The gateway will use this content type to determine how to serve that file's data transaction at the "),t("code",[a._v("arweave.net/{data tx id}")]),a._v(" endpoint.")]),a._v(" "),t("p",[a._v("By default, the CLI will attempt to derive this content type from the file extension of the provided file. In most cases, the content type that is derived will be correct and the gateway will properly serve the file.")]),a._v(" "),t("p",[a._v("The CLI also provides the option for users to upload files with a custom content type using the "),t("code",[a._v("--content-type")]),a._v(" flag:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --content-type "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(" --local-path /path/to/file --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("It is currently possible to set this value to any given string, but the gateway will still only serve valid content types. Check out this list of commonly used MIME types to ensure you're providing a valid content type: "),t("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types",target:"_blank",rel:"noopener noreferrer"}},[a._v("Common MIME types"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("p",[a._v("Note: In the case of multi-file uploads or recursive folder uploads, setting this "),t("code",[a._v("--content-type")]),a._v(" flag will set the provided custom content type on EVERY file entity within a given upload.")]),a._v(" "),t("h3",{attrs:{id:"uploading-from-a-remote-url"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-from-a-remote-url"}},[a._v("#")]),a._v(" Uploading From a Remote URL"),t("a",{attrs:{id:"remote-path"}})]),a._v(" "),t("p",[a._v("You can upload a file from an existing url using the "),t("code",[a._v("--remote-path")]),a._v(" flag. This must be used in conjunction with "),t("code",[a._v("--dest-file-name")]),a._v(".")]),a._v(" "),t("p",[a._v("You can use a custom content type using the "),t("code",[a._v("--content-type")]),a._v(" flag, but if this isn't used the app will use the content type from the response header of the request for the remote data.")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --remote-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"https://url/to/file"')]),a._v(" --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"example.jpg"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("h3",{attrs:{id:"uploading-a-custom-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-a-custom-manifest"}},[a._v("#")]),a._v(" Uploading a Custom Manifest"),t("a",{attrs:{id:"custom-manifest"}})]),a._v(" "),t("p",[a._v("Using the custom content type feature, it is possible for users to upload their own custom manifests. The Arweave gateways use this special content type in order to identify an uploaded file as a manifest:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("application/x.arweave-manifest+json\n")])])]),t("p",[a._v("In addition to this content type, the manifest must also adhere to the "),t("a",{attrs:{href:"#manifest-json"}},[a._v("correct JSON structure")]),a._v(" of an Arweave manifest. A user can create their own manifest from scratch, or start by piping a generated manifest to a JSON file and editing it to their specifications:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive create-manifest "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6c312b3e-4778-4a18-8243-f2b346f5e7cb"')]),a._v(" --dry-run "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'{manifest}.manifest'")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" my-custom-manifest.json\n")])])]),t("p",[a._v("After editing the generated manifest, simply perform an "),t("code",[a._v("upload-file")]),a._v(" command with the custom Arweave manifest content type to any PUBLIC folder:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --content-type "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/x.arweave-manifest+json"')]),a._v(" --local-path my-custom-manifest.json --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"9af694f6-4cfc-4eee-88a8-1b02704760c0"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet.json\n")])])]),t("p",[a._v("The returned "),t("code",[a._v("dataTxId")]),a._v(" field on the created "),t("code",[a._v("file")]),a._v(" entity will be the endpoint that the manifest can be found on Arweave, just as explained in the "),t("a",{attrs:{href:"#uploading-manifests"}},[a._v("manifest sections")]),a._v(" above:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("https://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("dataTxId"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nhttps://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("dataTxId"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/custom-file-1\nhttps://arweave.net/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("dataTxId"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/custom-file-2\n")])])]),t("h3",{attrs:{id:"uploading-files-with-custom-metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#uploading-files-with-custom-metadata"}},[a._v("#")]),a._v(" Uploading Files with Custom MetaData")]),a._v(" "),t("p",[a._v("ArDrive CLI has the capability of attaching custom metadata to ArFS File and Folder MetaData Transactions during the "),t("code",[a._v("upload-file")]),a._v(" command. This metadata can be applied to either the GQL tags on the MetaData Transaction and/or into the MetaData Transaction's Data JSON.")]),a._v(" "),t("p",[a._v("All custom metadata applied must ultimately adhere to the following JSON shapes:")]),a._v(" "),t("div",{staticClass:"language-ts extra-class"},[t("pre",{pre:!0,attrs:{class:"language-ts"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("// GQL Tags")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("type")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[a._v("CustomMetaDataGqlTags")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v(" Record"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("// Data JSON Fields")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("type")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[a._v("CustomMetaDataJsonFields")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v(" Record"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" JsonSerializable"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("export")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("type")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[a._v("JsonSerializable")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("number")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("boolean")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("null")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("member"),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" JsonSerializable "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" JsonSerializable"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),t("p",[a._v("e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" IPFS-Add: "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'MY_HASH'")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# or")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'Custom Name'")]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'Val 1'")]),a._v(", "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'Val 2'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("When the custom metadata is attached to the MetaData Transaction's GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.")]),a._v(" "),t("p",[a._v("When these tags are added to the MetaData Transaction's Data JSON they can be read by downloading the JSON data directly from "),t("code",[a._v("https://arweave.net/METADATA_TX_ID")]),a._v(".")]),a._v(" "),t("p",[a._v("To add this custom metadata to your file metadata transactions, CLI users can pass custom metadata these parameters:")]),a._v(" "),t("ul",[t("li",[t("code",[a._v("--metadata-file path/to/json/schema")])]),a._v(" "),t("li",[t("code",[a._v('--metadata-json \'{"key": "val", "key-2": true, "key-3": 420, "key-4": ["more", 1337]}\'')])]),a._v(" "),t("li",[t("code",[a._v('--metadata-gql-tags "Tag-Name" "Tag Val"')])])]),a._v(" "),t("p",[a._v("The "),t("code",[a._v("--metadata-file")]),a._v(" will accept a file path to JSON file containing custom metadata:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive upload-file --metadata-file path/to/metadata/json "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("This JSON schema object must contain instructions on where to put this metadata with the "),t("code",[a._v("metaDataJson")]),a._v(" and "),t("code",[a._v("metaDataGqlTags")]),a._v(" keys. e.g:")]),a._v(" "),t("div",{staticClass:"language-json extra-class"},[t("pre",{pre:!0,attrs:{class:"language-json"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"metaDataJson"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"Tag-Name"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Value-1"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Value-2"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"metaDataGqlTags"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token property"}},[a._v('"GQL Tag Name"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag Value"')]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("p",[a._v("The "),t("code",[a._v("--metadata-gql-tags")]),a._v(" parameter accepts an array of string values to be applied to the MetaData Tx GQL Tags. This method of CLI input does not support multiple tag values for a given tag name and the input must be an EVEN number of string values. (Known bug: String values starting with the "),t("code",[a._v('"-"')]),a._v(" character are currently not supported. Use --metadata-file parameter instead.) e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("upload-file --metadata-gql-tags "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Custom Tag Name"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Custom Value"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("And the "),t("code",[a._v("--metadata-json")]),a._v(" parameter will accept a stringified JSON input. It will apply all declared JSON fields directly to the MetaData Tx's Data JSON. e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v(" upload-file --metadata-json "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('\' { "json field": "value", "another fields": false } \'')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ...")]),a._v("\n")])])]),t("p",[a._v("Custom metadata applied to files and/or folders during the "),t("code",[a._v("upload-file")]),a._v(" command will be read back through all existing read commands. e.g:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ardrive file-info "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" 067c4008-9cbe-422e-b697-05442f73da2b\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appName"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ArDrive-CLI"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"appVersion"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1.17.0"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"arFS"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0.11"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"application/json"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"driveId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"967215ca-a489-494b-97ec-0dd428d7be34"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unique-name-9718"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sxg8bNu6_bbaHkJTxAINVVoz_F-LiFe6s7OnxzoJJk4"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"unixTime"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1657655070")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"size"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("262148")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"lastModifiedDate"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1655409872705")]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataTxId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ublZcIff77ejl3m0uEA8lXEfnTWmSBOFoz-HibqKeyk"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dataContentType"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"text/plain"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"parentFolderId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"97bc4fb5-aca4-4ffe-938f-1285153d98ca"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"entityId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"067c4008-9cbe-422e-b697-05442f73da2b"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fileId"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"067c4008-9cbe-422e-b697-05442f73da2b"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"IPFS-Add"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"MY_HASH"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag-1"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Val"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag-2"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Val"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Tag-3"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Val"')]),a._v(",\n "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"Boost"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"1.05"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("h4",{attrs:{id:"applying-unique-custom-metadata-during-bulk-workflows"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#applying-unique-custom-metadata-during-bulk-workflows"}},[a._v("#")]),a._v(" Applying Unique Custom MetaData During Bulk Workflows")]),a._v(" "),t("p",[a._v("With some custom scripting and the "),t("code",[a._v("--metadata-file")]),a._v(" parameter, the ArDrive CLI can be used to apply custom metadata to each file individually in a bulk workflow. For example, if you choose a numbered file naming pattern you can make use of a "),t("code",[a._v("for")]),a._v(" loop:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("for")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token for-or-select variable"}},[a._v("i")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("in")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("5")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("do")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" f0c58c11-430c-4383-8e54-4d864cc7e927 --local-path "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"../uploads/test-file-'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$i")]),a._v('.txt"')]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/path/to/wallet.json"')]),a._v(" --metadata-file "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"../custom/metadata-'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$i")]),a._v('.json"')]),a._v(" --dry-run "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"file-result-'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$i")]),a._v('.json"')]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("done")]),a._v("\n")])])]),t("h2",{attrs:{id:"other-utility-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-utility-operations"}},[a._v("#")]),a._v(" Other Utility Operations")]),a._v(" "),t("h3",{attrs:{id:"monitoring-transactions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#monitoring-transactions"}},[a._v("#")]),a._v(" Monitoring Transactions")]),a._v(" "),t("p",[a._v("Block time on Arweave is typically between 2-3 minutes in duration, so transactions can be mined within that time frame when "),t("a",{attrs:{href:"#dealing-with-network-congestion"}},[a._v("network congestion")]),a._v(" is low. Transactions, in the general case, proceed through the following set of states:")]),a._v(" "),t("ul",[t("li",[a._v('Pending: the transaction is waiting the "mempool" to be mined')]),a._v(" "),t("li",[a._v("Confirming: the transaction was mined on an Arweave Node, but has not yet been confirmed by at least 15 total nodes on the network")]),a._v(" "),t("li",[a._v("Confirmed: the transaction was mined on an Arweave Node and confirmed by at least 15 total nodes on the network")]),a._v(" "),t("li",[a._v("Not Found: the transaction is not available for any of the following reasons:\n"),t("ul",[t("li",[a._v("Insufficient reward to join the mempool")]),a._v(" "),t("li",[a._v("Insufficient reward to be mined within 50 blocks during a period of network congestion")]),a._v(" "),t("li",[a._v("Transaction is transitioning between states")]),a._v(" "),t("li",[a._v("Transaction ID is invalid")])])])]),a._v(" "),t("p",[a._v("Monitor any Arweave transaction's status via its transaction ID by performing:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Peek at the status:")]),a._v("\nardrive tx-status "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-t")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs"')]),a._v("\n")])])]),t("p",[a._v("Example output:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[a._v("ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs: Mined at block height "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("775810")]),a._v(" with "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("22439")]),a._v(" confirmations\n")])])]),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Reprint the status every 10 seconds:")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("watch")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-n")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("10")]),a._v(" ardrive tx-status "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-t")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs"')]),a._v("\n")])])]),t("h3",{attrs:{id:"dealing-with-network-congestion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#dealing-with-network-congestion"}},[a._v("#")]),a._v(" Dealing With Network Congestion")]),a._v(" "),t("p",[a._v("Currently, Arweave blocks hold up to 1000 transactions per block. The \"mempool\", where pending transactions reside until they've been included into a block, will only hold a transaction for 50 blocks (~100-150 minutes) before it's discarded by the network resulting in no fees or data being transacted. During periods of network congestion (i.e. those where the mempool contains 1000 or more pending transactions), it may make sense to either:")]),a._v(" "),t("p",[a._v("a) wait for congestion to dissipate before attempting your transactions.")]),a._v(" "),t("p",[a._v("b) apply the fee boost multiplier to your transactions rewards with the --boost parameter during write operations in order to front-run some of the congestion.")]),a._v(" "),t("h4",{attrs:{id:"check-for-network-congestion-before-uploading"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#check-for-network-congestion-before-uploading"}},[a._v("#")]),a._v(" Check for network congestion before uploading"),t("a",{attrs:{id:"check-congestion"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# See all the transactions in the mempool")]),a._v("\nardrive get-mempool\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Return the count of the transactions in the mempool")]),a._v("\nardrive get-mempool "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'length'")]),a._v("\n")])])]),t("h4",{attrs:{id:"front-run-congestion-by-boosting-miner-rewards"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#front-run-congestion-by-boosting-miner-rewards"}},[a._v("#")]),a._v(" Front-run Congestion By Boosting Miner Rewards"),t("a",{attrs:{id:"boost"}})]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Increase the miner reward on your transactions by 50%")]),a._v("\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"f0c58c11-430c-4383-8e54-4d864cc7e927"')]),a._v(" --local-path ./helloworld.txt "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--boost")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("1.5")]),a._v("\n")])])]),t("h4",{attrs:{id:"send-ar-transactions-from-a-cold-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#send-ar-transactions-from-a-cold-wallet"}},[a._v("#")]),a._v(" Send AR Transactions From a Cold Wallet"),t("a",{attrs:{id:"cold-tx"}})]),a._v(" "),t("p",[a._v("The best cold wallet storage never exposes your seed phrase and/or private keys to the Internet or a compromised system interface. You can use the ArDrive CLI to facilitate cold storage and transfer of AR.")]),a._v(" "),t("p",[a._v("If you need a new cold AR wallet, generate one from an air-gapped machine capable of running the ArDrive CLI by following the instructions in the "),t("a",{attrs:{href:"#wallet-operations"}},[a._v("Wallet Operations")]),a._v(" section. Fund your cold wallet from whatever external sources you'd like. NOTE: Your cold wallet won't appear on chain until it has received AR.")]),a._v(" "),t("p",[a._v("The workflow to send the AR out from your cold wallet requires you to generate a signed transaction with your cold wallet on your air-gapped machine via the ArDrive CLI, and then to transfer the signed transaction (e.g. by a file on a clean thumb drive) to an Internet-connected machine and send the transaction to the network via the ArDrive CLI. You'll need two inputs from the Internet-connected machine:")]),a._v(" "),t("ul",[t("li",[a._v("the last transaction sent OUT from the cold wallet (or an empty string if none has ever been sent out)")]),a._v(" "),t("li",[a._v("the base fee for an Arweave transaction (i.e. a zero bye transaction). Note that this value could change if a sufficient amount of time passes between the time you fetch this value, create the transaction, and send the transaction.")])]),a._v(" "),t("p",[a._v("To get the last transaction sent from your cold wallet, use the "),t("code",[a._v("last-tx")]),a._v(" command and specify your wallet address e.g.:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("ardrive last-tx -a \n")])])]),t("p",[a._v("To get the base transaction reward required for an AR transaction, use the "),t("code",[a._v("base-reward")]),a._v(" function, optionally applying a reward boost multiple if you're looking to front-run network congestion:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("ardrive base-reward --boost 1.5\n")])])]),t("p",[a._v("Write down or securely copy the values you derived from the Internet-connected machine and run the following commands on the airgapped machine, piping the outputted signed transaction data to a file in the process, e.g. "),t("code",[a._v("sendme.json")]),a._v(" (if that's your signed transaction transfer medium preference):")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v('ardrive create-tx -w /path/to/wallet/file.json -d -a --last-tx --reward "" > sendme.json\n')])])]),t("p",[a._v("Transport your signed transaction to the Internet-connected machine and run the following command to send your transaction to the Arweave network:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("ardrive send-tx -x /path/to/sendme.json\n")])])]),t("h3",{attrs:{id:"using-a-custom-arweave-gateway"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-a-custom-arweave-gateway"}},[a._v("#")]),a._v(" Using a Custom Arweave Gateway")]),a._v(" "),t("p",[a._v("On each command that uses a gateway, it is possible to supply your own custom Arweave gateway using the flag "),t("code",[a._v("--gateway")]),a._v(" or by setting an environment variable named "),t("code",[a._v("ARWEAVE_GATEWAY")]),a._v(".")]),a._v(" "),t("p",[a._v("For example, you could test out that your ArFS transactions are working as expected on a local test network such as "),t("a",{attrs:{href:"https://github.com/textury/arlocal",target:"_blank",rel:"noopener noreferrer"}},[a._v("ArLocal"),t("OutboundLink")],1),a._v(" with this flow:")]),a._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Setup ArLocal instance on port 1984")]),a._v("\nnpx arlocal\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# In another terminal, fund your wallet with AR")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("curl")]),a._v(" http://localhost:1984/mint/"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" your public wallet address "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("/99999999999999\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Create drive and root folder on ArLocal using `--gateway` flag")]),a._v("\nardrive create-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--gateway")]),a._v(" http://127.0.0.1:1984 "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-n")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v("'my-test-drive'")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Setup ARWEAVE_GATEWAY as ENV variable")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ARWEAVE_GATEWAY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"http://localhost:1984"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Mine block with drive + root folder transactions")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("curl")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ARWEAVE_GATEWAY")]),a._v('/mine"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Upload file to ArLocal with ENV var")]),a._v("\nardrive upload-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-F")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" root folder "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),a._v(" from create drive "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-l")]),a._v(" /path/to/file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" /path/to/wallet\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Mine block with file transaction")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("curl")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[a._v('"'),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ARWEAVE_GATEWAY")]),a._v('/mine"')]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Inspect meta data of created entities")]),a._v("\nardrive list-drive "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" drive "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),a._v(" from create drive "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Download file to verify integrity")]),a._v("\nardrive download-file "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),a._v(" from upload "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("file")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),t("h3",{attrs:{id:"persistent-caching-of-arfs-entity-metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#persistent-caching-of-arfs-entity-metadata"}},[a._v("#")]),a._v(" Persistent Caching of ArFS Entity Metadata"),t("a",{attrs:{id:"metadata-caching"}})]),a._v(" "),t("p",[a._v("To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("Windows: /ardrive-caches/metadata\nNon-Windows: /.ardrive/caches/metadata\n")])])]),t("p",[a._v("The "),t("code",[a._v("XDG_CACHE_HOME")]),a._v(" environment variable is honored, where applicable, and will be used in place of "),t("code",[a._v("os.homedir()")]),a._v(" in the scenarios described above.")]),a._v(" "),t("p",[a._v("Metadata cache logging to stderr can be enabled by setting the "),t("code",[a._v("ARDRIVE_CACHE_LOG")]),a._v(" environment variable to "),t("code",[a._v("1")]),a._v(".")]),a._v(" "),t("p",[a._v("Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.")]),a._v(" "),t("p",[a._v("The cache can be manually cleared safely at any time that any integrating app is not in operation.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/29.ad31f1b2.js b/assets/js/29.6828cc78.js similarity index 99% rename from assets/js/29.ad31f1b2.js rename to assets/js/29.6828cc78.js index e11f212..b1e4843 100644 --- a/assets/js/29.ad31f1b2.js +++ b/assets/js/29.6828cc78.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{322:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("ArDrive Core is a TypeScript library that contains the essential back end application features to support the ArDrive CLI and Desktop apps, such as file management, Permaweb upload/download, wallet management, and other common functions.")]),t._v(" "),a("p",[t._v("Engage with the community in "),a("a",{attrs:{href:"https://discord.gg/7RuTBckX",target:"_blank",rel:"noopener noreferrer"}},[t._v("Discord"),a("OutboundLink")],1),t._v(" for more information.")]),t._v(" "),a("h2",{attrs:{id:"integrating-with-ardrive-core"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#integrating-with-ardrive-core"}},[t._v("#")]),t._v(" Integrating with ArDrive Core")]),t._v(" "),a("p",[t._v("To add the ArDrive Core library to your project, simply add it as a dependency:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" ardrive-core-js\n")])])]),a("p",[t._v("The recommended approach for integrating with ArDrive Core as a dependency in your project is to construct and use the methods provided on the "),a("code",[t._v("ArDrive")]),t._v(" class. Developers can use the convenience function "),a("code",[t._v("arDriveFactory")]),t._v(" to construct the "),a("code",[t._v("ArDrive")]),t._v(" class.")]),t._v(" "),a("p",[t._v("Below are a few common examples of interacting with Core:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" readJWKFile"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arDriveFactory "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Read wallet from file")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("readJWKFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'/path/to/wallet'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct ArDrive class")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")])]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a public drive and its root folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createDriveResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPublicDrive")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" driveName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Drive'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap file for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct a safe Entity ID Type")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'10108b54a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a public file to destination folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" deriveDriveKey "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from password, wallet, and drive ID")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("deriveDriveKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mySecretPassWord'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'12345674a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("myWallet "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" JWKWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a private folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createFolderResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPrivateFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n folderName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My New Private Folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n parentFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'47162534a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" EntityKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from raw drive key string")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EntityKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Buffer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MyAwesomeDriveKeyZZZZZZZZZZZZZZZZZZZZFAKE/s'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'base64'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap folder and all of its contents for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedFolder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a private folder and all its contents")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" wrappedFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'76543214a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// And some other public file to a different destination 🀯")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" someOtherWrappedFile\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'675489321-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload ArFS Entities To Turbo (BETA)")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// The presence of `turboSettings` in `arDriveFactory` enables sending to Turbo")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" turboSettings"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h2",{attrs:{id:"development-environment-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#development-environment-setup"}},[t._v("#")]),t._v(" Development Environment Setup")]),t._v(" "),a("p",[t._v("We use nvm to manage our Node engine version and, if necessary, to install an npm version that we can then use to install Yarn.")]),t._v(" "),a("p",[t._v("Note for Windows: "),a("strong",[t._v("We recommend using WSL")]),t._v(" for setting up NVM on Windows using the "),a("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[t._v("instructions described here"),a("OutboundLink")],1),t._v(" then continue the steps below.")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Install nvm "),a("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[t._v("using their instructions"),a("OutboundLink")],1),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("We use Node 18.x -- ensure that the correct Node version is installed and activated by performing "),a("code",[t._v("nvm install")]),t._v(" and then "),a("code",[t._v("nvm use")])])]),t._v(" "),a("li",[a("p",[t._v("We use Yarn 3.x please "),a("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow the installation guidelines here"),a("OutboundLink")],1)])]),t._v(" "),a("li",[a("p",[t._v("We use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run:\n"),a("code",[t._v("yarn husky install")]),t._v("\nto enable git hooks for this local repository. Without doing so, you risk committing non-compliant code to the repository.")])]),t._v(" "),a("li",[a("p",[t._v("Install all node package dependencies by running "),a("code",[t._v("yarn install --check-cache")])])])]),t._v(" "),a("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[t._v("#")]),t._v(" Recommended Visual Studio Code extensions")]),t._v(" "),a("p",[t._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[t._v("ES-Lint"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[t._v("Editor-Config"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[t._v("Prettier"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[t._v("ZipFS"),a("OutboundLink")],1)])]),t._v(" "),a("h2",{attrs:{id:"building-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#building-the-library"}},[t._v("#")]),t._v(" Building the Library")]),t._v(" "),a("p",[t._v("Simply run "),a("code",[t._v("yarn build")]),t._v(". This will clean the project and compile the TypeScript library.")]),t._v(" "),a("h2",{attrs:{id:"testing-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#testing-the-library"}},[t._v("#")]),t._v(" Testing the Library")]),t._v(" "),a("p",[t._v("This library is setup for "),a("a",{attrs:{href:"https://github.com/mochajs/mocha",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mocha"),a("OutboundLink")],1),t._v(" testing with "),a("a",{attrs:{href:"https://github.com/chaijs/chai",target:"_blank",rel:"noopener noreferrer"}},[t._v("Chai"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://github.com/sinonjs/sinon",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sinon"),a("OutboundLink")],1),t._v(". Configuration for Mocha can be found in "),a("code",[t._v(".mocharc.js")])]),t._v(" "),a("p",[t._v("To run all of the tests use:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("p",[t._v("To run a specific test, use Mocha's "),a("a",{attrs:{href:"https://mochajs.org/#-grep-regexp-g-regexp",target:"_blank",rel:"noopener noreferrer"}},[t._v("grep"),a("OutboundLink")],1),t._v(" command. This will cause Mocha to only run the tests that contain the provided RegExp.")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("-g")]),t._v(" command will "),a("strong",[t._v("only")]),t._v(" match the characters used in the "),a("code",[t._v("describe()")]),t._v(" and "),a("code",[t._v("it()")]),t._v(" title arguments. It will "),a("strong",[t._v("not")]),t._v(" match files names or folders.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),t._v("\n")])])]),a("p",[t._v("Will run this test:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("describe")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("it")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'functions correctly'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"coverage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#coverage"}},[t._v("#")]),t._v(" Coverage")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/istanbuljs/nyc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Istanbul.js (nyc)"),a("OutboundLink")],1),t._v(" has been added for code coverage reporting. Configuration for the nyc package can be found in "),a("code",[t._v("nyc.config.js")])]),t._v(" "),a("p",[t._v("On each "),a("code",[t._v("yarn test")]),t._v(" command, nyc will output a code coverage summary in the terminal. In addition, a more detailed HTML version will output to the "),a("code",[t._v("/coverage")]),t._v(" directory. Simply run "),a("code",[t._v("/coverage/index.html")]),t._v(" in your browser to view the HTML version.")]),t._v(" "),a("p",[t._v("Alternatively, you can view a verbose coverage output in the terminal by running:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" coverage\n")])])]),a("h3",{attrs:{id:"adding-tests"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-tests"}},[t._v("#")]),t._v(" Adding tests")]),t._v(" "),a("p",[t._v("There are many different syntax options available with the Chai library, which can be found in their "),a("a",{attrs:{href:"https://www.chaijs.com/api/bdd/",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(". For examples on unit testing, visit "),a("code",[t._v("src/example.test.ts")]),t._v(", and for integration testing: "),a("code",[t._v("tests/example.test.ts")]),t._v(".")]),t._v(" "),a("p",[t._v("Unit tests should be located adjacent (or right next to) the file they are referencing. They should also be named the same with the "),a("code",[t._v(".test.ts")]),t._v(" extension. In contrast, integration tests will live in the "),a("code",[t._v("/tests")]),t._v(" directory.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("ardrive-core-js/\nβ”œβ”€β”€ src\nβ”‚ β”œβ”€β”€ fileToTest.ts\nβ”‚ └── fileToTest.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("-- Unit "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n└── tests\n └── bestApi.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("----- Integration "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("h3",{attrs:{id:"using-sinon"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-sinon"}},[t._v("#")]),t._v(" Using Sinon")]),t._v(" "),a("p",[t._v("Sinon can be used to create spies, mocks, fakes, stubs, and more. There are some basic examples of using the library shown in the example test files shared above.")]),t._v(" "),a("p",[t._v("For more information on what you can do with Sinon, visit their "),a("a",{attrs:{href:"https://sinonjs.org/releases/latest",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"debugging-with-power-assert"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#debugging-with-power-assert"}},[t._v("#")]),t._v(" Debugging with Power-Assert")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/power-assert-js/power-assert",target:"_blank",rel:"noopener noreferrer"}},[t._v("Power-Assert"),a("OutboundLink")],1),t._v(" is setup as another testing tool. The library can be used to provide a very detailed output of your failing test cases. This can become super useful while debugging a test.")]),t._v(" "),a("p",[t._v("To use this tool, it must be imported using this syntax:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" assert "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'assert'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Then use "),a("code",[t._v("assert")]),t._v(" in your error throwing test case. Commenting out the Chai assertion will produce a cleaner output:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// expect(failingOutput).to.equal(expectedOutput);")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("assert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("failingOutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" expectedOutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("And finally, to view the detailed error messages in your terminal:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" power-assert "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My test case'")]),t._v("\n")])])]),a("h3",{attrs:{id:"progress-logging-of-transaction-uploads"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#progress-logging-of-transaction-uploads"}},[t._v("#")]),t._v(" Progress Logging of Transaction Uploads")]),t._v(" "),a("p",[t._v("Progress logging of transaction uploads to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_PROGRESS_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Uploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\nUploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("76")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\n")])])]),a("h3",{attrs:{id:"persistent-caching-of-arfs-entity-metadata"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#persistent-caching-of-arfs-entity-metadata"}},[t._v("#")]),t._v(" Persistent Caching of ArFS Entity Metadata")]),t._v(" "),a("p",[t._v("To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/ardrive-caches/metadata\nNon-Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/.ardrive/caches/metadata\n")])])]),a("p",[t._v("The "),a("code",[t._v("XDG_CACHE_HOME")]),t._v(" environment variable is honored, where applicable, and will be used in place of "),a("code",[t._v("os.homedir()")]),t._v(" in the scenarios described above.")]),t._v(" "),a("p",[t._v("Metadata cache logging to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_CACHE_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(".")]),t._v(" "),a("p",[t._v("Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.")]),t._v(" "),a("p",[t._v("The cache can be manually cleared safely at any time that any integrating app is not in operation.")]),t._v(" "),a("h3",{attrs:{id:"applying-custom-metadata-to-arfs-file-transactions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#applying-custom-metadata-to-arfs-file-transactions"}},[t._v("#")]),t._v(" Applying Custom MetaData to ArFS File Transactions")]),t._v(" "),a("p",[t._v("Custom metadata can be attached to ArFS File Transactions. Metadata can be applied to either the GQL tags on the MetaData Transaction, the MetaData Transaction's Data JSON, or both.")]),t._v(" "),a("p",[t._v("All custom tags can be accessed by using by using "),a("code",[t._v("ArDrive")]),t._v(" class read methods such as "),a("code",[t._v("getPublicFile")]),t._v(", "),a("code",[t._v("getPrivateFile")]),t._v(", "),a("code",[t._v("listPrivateFolder")]),t._v(", etc.")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveAnonymousFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileInfo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPublicFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" fileId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataGqlTags "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataJsonFields "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataJson"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("When the custom metadata is attached to the MetaData Transaction's GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.")]),t._v(" "),a("p",[t._v("When these tags are added to the MetaData Transaction's Data JSON they can be read by downloading the JSON data directly from "),a("code",[t._v("https://arweave.net/")]),t._v(".")]),t._v(" "),a("p",[t._v("To add this custom metadata to your file metadata transactions, users can pass an object containing custom tags when wrapping content to upload:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileToUpload "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file/on/system'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File or Folder Path")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'application/custom-content-type'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom Content Type")]),t._v("\n customMetaData"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom MetaData")]),t._v("\n metaDataJson"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Custom-Tag-Name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Single-Custom-Value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n metaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Another-Custom-Tag'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'First-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Second-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Third-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{324:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("ArDrive Core is a TypeScript library that contains the essential back end application features to support the ArDrive CLI and Desktop apps, such as file management, Permaweb upload/download, wallet management, and other common functions.")]),t._v(" "),a("p",[t._v("Engage with the community in "),a("a",{attrs:{href:"https://discord.gg/7RuTBckX",target:"_blank",rel:"noopener noreferrer"}},[t._v("Discord"),a("OutboundLink")],1),t._v(" for more information.")]),t._v(" "),a("h2",{attrs:{id:"integrating-with-ardrive-core"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#integrating-with-ardrive-core"}},[t._v("#")]),t._v(" Integrating with ArDrive Core")]),t._v(" "),a("p",[t._v("To add the ArDrive Core library to your project, simply add it as a dependency:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" ardrive-core-js\n")])])]),a("p",[t._v("The recommended approach for integrating with ArDrive Core as a dependency in your project is to construct and use the methods provided on the "),a("code",[t._v("ArDrive")]),t._v(" class. Developers can use the convenience function "),a("code",[t._v("arDriveFactory")]),t._v(" to construct the "),a("code",[t._v("ArDrive")]),t._v(" class.")]),t._v(" "),a("p",[t._v("Below are a few common examples of interacting with Core:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" readJWKFile"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arDriveFactory "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Read wallet from file")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("readJWKFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'/path/to/wallet'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct ArDrive class")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")])]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a public drive and its root folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createDriveResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPublicDrive")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" driveName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Drive'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap file for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct a safe Entity ID Type")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'10108b54a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a public file to destination folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" deriveDriveKey "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from password, wallet, and drive ID")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("deriveDriveKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mySecretPassWord'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'12345674a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("myWallet "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" JWKWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a private folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createFolderResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPrivateFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n folderName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My New Private Folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n parentFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'47162534a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" EntityKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from raw drive key string")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EntityKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Buffer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MyAwesomeDriveKeyZZZZZZZZZZZZZZZZZZZZFAKE/s'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'base64'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap folder and all of its contents for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedFolder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a private folder and all its contents")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" wrappedFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'76543214a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// And some other public file to a different destination 🀯")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" someOtherWrappedFile\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'675489321-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload ArFS Entities To Turbo (BETA)")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// The presence of `turboSettings` in `arDriveFactory` enables sending to Turbo")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" turboSettings"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h2",{attrs:{id:"development-environment-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#development-environment-setup"}},[t._v("#")]),t._v(" Development Environment Setup")]),t._v(" "),a("p",[t._v("We use nvm to manage our Node engine version and, if necessary, to install an npm version that we can then use to install Yarn.")]),t._v(" "),a("p",[t._v("Note for Windows: "),a("strong",[t._v("We recommend using WSL")]),t._v(" for setting up NVM on Windows using the "),a("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[t._v("instructions described here"),a("OutboundLink")],1),t._v(" then continue the steps below.")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Install nvm "),a("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[t._v("using their instructions"),a("OutboundLink")],1),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("We use Node 18.x -- ensure that the correct Node version is installed and activated by performing "),a("code",[t._v("nvm install")]),t._v(" and then "),a("code",[t._v("nvm use")])])]),t._v(" "),a("li",[a("p",[t._v("We use Yarn 3.x please "),a("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow the installation guidelines here"),a("OutboundLink")],1)])]),t._v(" "),a("li",[a("p",[t._v("We use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run:\n"),a("code",[t._v("yarn husky install")]),t._v("\nto enable git hooks for this local repository. Without doing so, you risk committing non-compliant code to the repository.")])]),t._v(" "),a("li",[a("p",[t._v("Install all node package dependencies by running "),a("code",[t._v("yarn install --check-cache")])])])]),t._v(" "),a("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[t._v("#")]),t._v(" Recommended Visual Studio Code extensions")]),t._v(" "),a("p",[t._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[t._v("ES-Lint"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[t._v("Editor-Config"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[t._v("Prettier"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[t._v("ZipFS"),a("OutboundLink")],1)])]),t._v(" "),a("h2",{attrs:{id:"building-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#building-the-library"}},[t._v("#")]),t._v(" Building the Library")]),t._v(" "),a("p",[t._v("Simply run "),a("code",[t._v("yarn build")]),t._v(". This will clean the project and compile the TypeScript library.")]),t._v(" "),a("h2",{attrs:{id:"testing-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#testing-the-library"}},[t._v("#")]),t._v(" Testing the Library")]),t._v(" "),a("p",[t._v("This library is setup for "),a("a",{attrs:{href:"https://github.com/mochajs/mocha",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mocha"),a("OutboundLink")],1),t._v(" testing with "),a("a",{attrs:{href:"https://github.com/chaijs/chai",target:"_blank",rel:"noopener noreferrer"}},[t._v("Chai"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://github.com/sinonjs/sinon",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sinon"),a("OutboundLink")],1),t._v(". Configuration for Mocha can be found in "),a("code",[t._v(".mocharc.js")])]),t._v(" "),a("p",[t._v("To run all of the tests use:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("p",[t._v("To run a specific test, use Mocha's "),a("a",{attrs:{href:"https://mochajs.org/#-grep-regexp-g-regexp",target:"_blank",rel:"noopener noreferrer"}},[t._v("grep"),a("OutboundLink")],1),t._v(" command. This will cause Mocha to only run the tests that contain the provided RegExp.")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("-g")]),t._v(" command will "),a("strong",[t._v("only")]),t._v(" match the characters used in the "),a("code",[t._v("describe()")]),t._v(" and "),a("code",[t._v("it()")]),t._v(" title arguments. It will "),a("strong",[t._v("not")]),t._v(" match files names or folders.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),t._v("\n")])])]),a("p",[t._v("Will run this test:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("describe")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("it")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'functions correctly'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"coverage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#coverage"}},[t._v("#")]),t._v(" Coverage")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/istanbuljs/nyc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Istanbul.js (nyc)"),a("OutboundLink")],1),t._v(" has been added for code coverage reporting. Configuration for the nyc package can be found in "),a("code",[t._v("nyc.config.js")])]),t._v(" "),a("p",[t._v("On each "),a("code",[t._v("yarn test")]),t._v(" command, nyc will output a code coverage summary in the terminal. In addition, a more detailed HTML version will output to the "),a("code",[t._v("/coverage")]),t._v(" directory. Simply run "),a("code",[t._v("/coverage/index.html")]),t._v(" in your browser to view the HTML version.")]),t._v(" "),a("p",[t._v("Alternatively, you can view a verbose coverage output in the terminal by running:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" coverage\n")])])]),a("h3",{attrs:{id:"adding-tests"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-tests"}},[t._v("#")]),t._v(" Adding tests")]),t._v(" "),a("p",[t._v("There are many different syntax options available with the Chai library, which can be found in their "),a("a",{attrs:{href:"https://www.chaijs.com/api/bdd/",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(". For examples on unit testing, visit "),a("code",[t._v("src/example.test.ts")]),t._v(", and for integration testing: "),a("code",[t._v("tests/example.test.ts")]),t._v(".")]),t._v(" "),a("p",[t._v("Unit tests should be located adjacent (or right next to) the file they are referencing. They should also be named the same with the "),a("code",[t._v(".test.ts")]),t._v(" extension. In contrast, integration tests will live in the "),a("code",[t._v("/tests")]),t._v(" directory.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("ardrive-core-js/\nβ”œβ”€β”€ src\nβ”‚ β”œβ”€β”€ fileToTest.ts\nβ”‚ └── fileToTest.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("-- Unit "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n└── tests\n └── bestApi.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("----- Integration "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("h3",{attrs:{id:"using-sinon"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-sinon"}},[t._v("#")]),t._v(" Using Sinon")]),t._v(" "),a("p",[t._v("Sinon can be used to create spies, mocks, fakes, stubs, and more. There are some basic examples of using the library shown in the example test files shared above.")]),t._v(" "),a("p",[t._v("For more information on what you can do with Sinon, visit their "),a("a",{attrs:{href:"https://sinonjs.org/releases/latest",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"debugging-with-power-assert"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#debugging-with-power-assert"}},[t._v("#")]),t._v(" Debugging with Power-Assert")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/power-assert-js/power-assert",target:"_blank",rel:"noopener noreferrer"}},[t._v("Power-Assert"),a("OutboundLink")],1),t._v(" is setup as another testing tool. The library can be used to provide a very detailed output of your failing test cases. This can become super useful while debugging a test.")]),t._v(" "),a("p",[t._v("To use this tool, it must be imported using this syntax:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" assert "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'assert'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Then use "),a("code",[t._v("assert")]),t._v(" in your error throwing test case. Commenting out the Chai assertion will produce a cleaner output:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// expect(failingOutput).to.equal(expectedOutput);")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("assert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("failingOutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" expectedOutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("And finally, to view the detailed error messages in your terminal:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" power-assert "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My test case'")]),t._v("\n")])])]),a("h3",{attrs:{id:"progress-logging-of-transaction-uploads"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#progress-logging-of-transaction-uploads"}},[t._v("#")]),t._v(" Progress Logging of Transaction Uploads")]),t._v(" "),a("p",[t._v("Progress logging of transaction uploads to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_PROGRESS_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Uploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\nUploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("76")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\n")])])]),a("h3",{attrs:{id:"persistent-caching-of-arfs-entity-metadata"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#persistent-caching-of-arfs-entity-metadata"}},[t._v("#")]),t._v(" Persistent Caching of ArFS Entity Metadata")]),t._v(" "),a("p",[t._v("To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/ardrive-caches/metadata\nNon-Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/.ardrive/caches/metadata\n")])])]),a("p",[t._v("The "),a("code",[t._v("XDG_CACHE_HOME")]),t._v(" environment variable is honored, where applicable, and will be used in place of "),a("code",[t._v("os.homedir()")]),t._v(" in the scenarios described above.")]),t._v(" "),a("p",[t._v("Metadata cache logging to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_CACHE_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(".")]),t._v(" "),a("p",[t._v("Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.")]),t._v(" "),a("p",[t._v("The cache can be manually cleared safely at any time that any integrating app is not in operation.")]),t._v(" "),a("h3",{attrs:{id:"applying-custom-metadata-to-arfs-file-transactions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#applying-custom-metadata-to-arfs-file-transactions"}},[t._v("#")]),t._v(" Applying Custom MetaData to ArFS File Transactions")]),t._v(" "),a("p",[t._v("Custom metadata can be attached to ArFS File Transactions. Metadata can be applied to either the GQL tags on the MetaData Transaction, the MetaData Transaction's Data JSON, or both.")]),t._v(" "),a("p",[t._v("All custom tags can be accessed by using by using "),a("code",[t._v("ArDrive")]),t._v(" class read methods such as "),a("code",[t._v("getPublicFile")]),t._v(", "),a("code",[t._v("getPrivateFile")]),t._v(", "),a("code",[t._v("listPrivateFolder")]),t._v(", etc.")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveAnonymousFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileInfo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPublicFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" fileId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataGqlTags "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataJsonFields "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataJson"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("When the custom metadata is attached to the MetaData Transaction's GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.")]),t._v(" "),a("p",[t._v("When these tags are added to the MetaData Transaction's Data JSON they can be read by downloading the JSON data directly from "),a("code",[t._v("https://arweave.net/")]),t._v(".")]),t._v(" "),a("p",[t._v("To add this custom metadata to your file metadata transactions, users can pass an object containing custom tags when wrapping content to upload:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileToUpload "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file/on/system'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File or Folder Path")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'application/custom-content-type'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom Content Type")]),t._v("\n customMetaData"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom MetaData")]),t._v("\n metaDataJson"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Custom-Tag-Name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Single-Custom-Value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n metaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Another-Custom-Tag'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'First-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Second-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Third-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/30.54ebb572.js b/assets/js/30.06ab7fce.js similarity index 98% rename from assets/js/30.54ebb572.js rename to assets/js/30.06ab7fce.js index 291fd8b..be85f9f 100644 --- a/assets/js/30.54ebb572.js +++ b/assets/js/30.06ab7fce.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{324:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"deploying-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying-your-dapp"}},[e._v("#")]),e._v(" Deploying your dApp")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("This guide will outline the steps needed to deploy your dApp onto the Arweave blockchain using the ArDrive web app. It assumes you have already prepared your dApp to use hash routing and relative file paths, and built static files for any dApp in a language or framework that requires it (like React).")]),e._v(" "),t("h2",{attrs:{id:"deploying"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying"}},[e._v("#")]),e._v(" Deploying")]),e._v(" "),t("h3",{attrs:{id:"step-1-log-into-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-log-into-ardrive"}},[e._v("#")]),e._v(" Step 1: Log into ArDrive")]),e._v(" "),t("p",[e._v("Go to the "),t("a",{attrs:{href:"https://app.ardrive.io/#/sign-in",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive web app"),t("OutboundLink")],1),e._v(" and log in using the method of your choosing. If you don't already have an account, you will need to follow the instructions to set one up.")]),e._v(" "),t("h3",{attrs:{id:"step-2-select-or-create-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-select-or-create-a-drive"}},[e._v("#")]),e._v(" Step 2: Select or Create a Drive")]),e._v(" "),t("p",[e._v('Once logged in, navigate to the drive where you want your project to be hosted. If you haven\'t created a drive yet, or if you want a new one specifically for this project, click the big red "New" button at the top left and create a new drive. Remember, the drive needs to be set to public for your dApp to be accessible to others.')]),e._v(" "),t("h3",{attrs:{id:"step-3-upload-your-project"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-3-upload-your-project"}},[e._v("#")]),e._v(" Step 3: Upload your project")]),e._v(" "),t("p",[e._v('With your drive selected, click the big red "New" button again, but this time, select "Upload Folder". Navigate to your project\'s root directory, or the built directory if required, and select it. This will upload the entire directory, maintaining your project\'s file structure.')]),e._v(" "),t("h3",{attrs:{id:"step-4-confirm-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-4-confirm-upload"}},[e._v("#")]),e._v(" Step 4: Confirm Upload")]),e._v(" "),t("p",[e._v('You\'ll be given a chance to review the upload and the associated cost. If everything looks right, click "Confirm". Remember, uploading to Arweave isnt free, but the cost is usually quite small and the benefits of having your dApp hosted on the permaweb are significant.')]),e._v(" "),t("h3",{attrs:{id:"step-5-create-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-5-create-the-manifest"}},[e._v("#")]),e._v(" Step 5: Create the Manifest")]),e._v(" "),t("p",[e._v('While ArDrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on Arweave. The manifest acts as a map to all the files your dApp needs to function. After you confirm your upload, navigate into your newly created folder by double clicking on it. Click the big red "New" button again and select "Create manifest". You\'ll be prompted to name the manifest and choose where to save it. Be sure to save it inside the folder you just created.')]),e._v(" "),t("h3",{attrs:{id:"step-6-get-the-data-tx-id"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-6-get-the-data-tx-id"}},[e._v("#")]),e._v(" Step 6: Get the Data TX ID")]),e._v(" "),t("p",[e._v('Once the manifest is created, click on it to expand its details. On the bottom right, there\'s a line labeled "Data TX ID". This is the unique identifier for your uploaded dApp on Arweave. Copy this value.')]),e._v(" "),t("h3",{attrs:{id:"step-7-view-and-share-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-7-view-and-share-your-dapp"}},[e._v("#")]),e._v(" Step 7: View and Share your dApp")]),e._v(" "),t("p",[e._v("Your dApp is now available on the permaweb forever! Append the Data TX ID you just copied to the end of an Arweave gateway URL, like "),t("code",[e._v("https://arweave.net/")]),e._v(" . It might take a few minutes for all of your files to finish propagating through the network, but once they do your dApp will be accessible to anyone, anywhere, at any time.")]),e._v(" "),t("h2",{attrs:{id:"updating-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-your-dapp"}},[e._v("#")]),e._v(" Updating your dApp")]),e._v(" "),t("p",[e._v("Files uploaded to Arweave are permanent and immutable. They cannot be changed. However, the "),t("RouterLink",{attrs:{to:"/docs/arfs/overview.html"}},[e._v("Arweave File System (ArFS)")]),e._v(' protocol used (and created) by ArDrive lets you "replace" them with new versions while still being able to access the old ones. You can do this with entire dApps as well. The old files won\'t be displayed in the ArDrive web app unless you click on a file to view its history.')],1),e._v(" "),t("p",[e._v('Once you have made changes to your dApp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. Follow all the same steps listed above for uploading your dApp. You will need to create a new manifest to correctly point to the updated files. Give it the same name as the old manifest in order to "replace" it. Creating the new manifest will generate a new TX ID used to view the updated dApp.')]),e._v(" "),t("p",[e._v("The old version of the dApp will always be available to anyone who has the correct TX ID")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{325:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"deploying-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying-your-dapp"}},[e._v("#")]),e._v(" Deploying your dApp")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("This guide will outline the steps needed to deploy your dApp onto the Arweave blockchain using the ArDrive web app. It assumes you have already prepared your dApp to use hash routing and relative file paths, and built static files for any dApp in a language or framework that requires it (like React).")]),e._v(" "),t("h2",{attrs:{id:"deploying"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying"}},[e._v("#")]),e._v(" Deploying")]),e._v(" "),t("h3",{attrs:{id:"step-1-log-into-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-log-into-ardrive"}},[e._v("#")]),e._v(" Step 1: Log into ArDrive")]),e._v(" "),t("p",[e._v("Go to the "),t("a",{attrs:{href:"https://app.ardrive.io/#/sign-in",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive web app"),t("OutboundLink")],1),e._v(" and log in using the method of your choosing. If you don't already have an account, you will need to follow the instructions to set one up.")]),e._v(" "),t("h3",{attrs:{id:"step-2-select-or-create-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-select-or-create-a-drive"}},[e._v("#")]),e._v(" Step 2: Select or Create a Drive")]),e._v(" "),t("p",[e._v('Once logged in, navigate to the drive where you want your project to be hosted. If you haven\'t created a drive yet, or if you want a new one specifically for this project, click the big red "New" button at the top left and create a new drive. Remember, the drive needs to be set to public for your dApp to be accessible to others.')]),e._v(" "),t("h3",{attrs:{id:"step-3-upload-your-project"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-3-upload-your-project"}},[e._v("#")]),e._v(" Step 3: Upload your project")]),e._v(" "),t("p",[e._v('With your drive selected, click the big red "New" button again, but this time, select "Upload Folder". Navigate to your project\'s root directory, or the built directory if required, and select it. This will upload the entire directory, maintaining your project\'s file structure.')]),e._v(" "),t("h3",{attrs:{id:"step-4-confirm-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-4-confirm-upload"}},[e._v("#")]),e._v(" Step 4: Confirm Upload")]),e._v(" "),t("p",[e._v('You\'ll be given a chance to review the upload and the associated cost. If everything looks right, click "Confirm". Remember, uploading to Arweave isnt free, but the cost is usually quite small and the benefits of having your dApp hosted on the permaweb are significant.')]),e._v(" "),t("h3",{attrs:{id:"step-5-create-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-5-create-the-manifest"}},[e._v("#")]),e._v(" Step 5: Create the Manifest")]),e._v(" "),t("p",[e._v('While ArDrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on Arweave. The manifest acts as a map to all the files your dApp needs to function. After you confirm your upload, navigate into your newly created folder by double clicking on it. Click the big red "New" button again and select "Create manifest". You\'ll be prompted to name the manifest and choose where to save it. Be sure to save it inside the folder you just created.')]),e._v(" "),t("h3",{attrs:{id:"step-6-get-the-data-tx-id"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-6-get-the-data-tx-id"}},[e._v("#")]),e._v(" Step 6: Get the Data TX ID")]),e._v(" "),t("p",[e._v('Once the manifest is created, click on it to expand its details. On the bottom right, there\'s a line labeled "Data TX ID". This is the unique identifier for your uploaded dApp on Arweave. Copy this value.')]),e._v(" "),t("h3",{attrs:{id:"step-7-view-and-share-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-7-view-and-share-your-dapp"}},[e._v("#")]),e._v(" Step 7: View and Share your dApp")]),e._v(" "),t("p",[e._v("Your dApp is now available on the permaweb forever! Append the Data TX ID you just copied to the end of an Arweave gateway URL, like "),t("code",[e._v("https://arweave.net/")]),e._v(" . It might take a few minutes for all of your files to finish propagating through the network, but once they do your dApp will be accessible to anyone, anywhere, at any time.")]),e._v(" "),t("h2",{attrs:{id:"updating-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-your-dapp"}},[e._v("#")]),e._v(" Updating your dApp")]),e._v(" "),t("p",[e._v("Files uploaded to Arweave are permanent and immutable. They cannot be changed. However, the "),t("RouterLink",{attrs:{to:"/docs/arfs/overview.html"}},[e._v("Arweave File System (ArFS)")]),e._v(' protocol used (and created) by ArDrive lets you "replace" them with new versions while still being able to access the old ones. You can do this with entire dApps as well. The old files won\'t be displayed in the ArDrive web app unless you click on a file to view its history.')],1),e._v(" "),t("p",[e._v('Once you have made changes to your dApp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. Follow all the same steps listed above for uploading your dApp. You will need to create a new manifest to correctly point to the updated files. Give it the same name as the old manifest in order to "replace" it. Creating the new manifest will generate a new TX ID used to view the updated dApp.')]),e._v(" "),t("p",[e._v("The old version of the dApp will always be available to anyone who has the correct TX ID")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/31.8c270832.js b/assets/js/31.3d7a96b2.js similarity index 97% rename from assets/js/31.8c270832.js rename to assets/js/31.3d7a96b2.js index 292dd7e..93f7a52 100644 --- a/assets/js/31.8c270832.js +++ b/assets/js/31.3d7a96b2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{341:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[e._v("#")]),e._v(" Examples")]),e._v(" "),t("p",[e._v("Below are some basic websites built with different languages or frameworks that provide more detailed information on how to configure your dApp for that framework. Each one has been deployed to Arweave itself to show that it functions correctly, and can be accessed through any Arweave gateway by using its TX ID. These are all very basic examples, but if you follow the principles explained, your dApp will function correctly when deployed to the permaweb no matter how big or complex it becomes.")]),e._v(" "),t("h2",{attrs:{id:"basic-html"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#basic-html"}},[e._v("#")]),e._v(" Basic HTML")]),e._v(" "),t("p",[e._v("A basic HTML website with a javascript script to facilitate hash routing:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50",target:"_blank",rel:"noopener noreferrer"}},[e._v("GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"react"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#react"}},[e._v("#")]),e._v(" React")]),e._v(" "),t("p",[e._v("A React dApp created using Create-React-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0",target:"_blank",rel:"noopener noreferrer"}},[e._v("BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"next"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#next"}},[e._v("#")]),e._v(" Next")]),e._v(" "),t("p",[e._v("A Nextjs dApp created using Create-Next-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s",target:"_blank",rel:"noopener noreferrer"}},[e._v("01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU",target:"_blank",rel:"noopener noreferrer"}},[e._v("ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{333:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[e._v("#")]),e._v(" Examples")]),e._v(" "),t("p",[e._v("Below are some basic websites built with different languages or frameworks that provide more detailed information on how to configure your dApp for that framework. Each one has been deployed to Arweave itself to show that it functions correctly, and can be accessed through any Arweave gateway by using its TX ID. These are all very basic examples, but if you follow the principles explained, your dApp will function correctly when deployed to the permaweb no matter how big or complex it becomes.")]),e._v(" "),t("h2",{attrs:{id:"basic-html"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#basic-html"}},[e._v("#")]),e._v(" Basic HTML")]),e._v(" "),t("p",[e._v("A basic HTML website with a javascript script to facilitate hash routing:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50",target:"_blank",rel:"noopener noreferrer"}},[e._v("GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"react"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#react"}},[e._v("#")]),e._v(" React")]),e._v(" "),t("p",[e._v("A React dApp created using Create-React-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0",target:"_blank",rel:"noopener noreferrer"}},[e._v("BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"next"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#next"}},[e._v("#")]),e._v(" Next")]),e._v(" "),t("p",[e._v("A Nextjs dApp created using Create-Next-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s",target:"_blank",rel:"noopener noreferrer"}},[e._v("01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU",target:"_blank",rel:"noopener noreferrer"}},[e._v("ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/32.eee35eae.js b/assets/js/32.00467e0b.js similarity index 98% rename from assets/js/32.eee35eae.js rename to assets/js/32.00467e0b.js index e9a85e7..544051c 100644 --- a/assets/js/32.eee35eae.js +++ b/assets/js/32.00467e0b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{325:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"file-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-paths"}},[e._v("#")]),e._v(" File Paths")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("File paths are needed to locate resources in your file system or on a server. There are two types of file paths: absolute and relative. Because there is no way to know exactly from where a user will access a dApp deployed on Arweave, all file paths used need to be relative.")]),e._v(" "),t("h2",{attrs:{id:"absolute-vs-relative"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#absolute-vs-relative"}},[e._v("#")]),e._v(" Absolute Vs. Relative")]),e._v(" "),t("p",[e._v("An absolute path is the full URL to a resource, starting from the root. For example, "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" is an absolute path. It points directly to the image no matter where the code referencing it is located.")]),e._v(" "),t("p",[e._v("A relative path is a path relative to the current location. If you have an HTML file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path "),t("code",[e._v("images/myImage.jpg")]),e._v(" to reference the image.")]),e._v(" "),t("h2",{attrs:{id:"why-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-relative-paths"}},[e._v("#")]),e._v(" Why Relative Paths")]),e._v(" "),t("p",[e._v("When deploying dApps on Arweave, relative paths are essential because:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Domain agnostic")]),e._v(": Arweave permaweb dApps can be accessed from various gateways, not just one domain. Absolute paths tied to a specific domain will not work.")]),e._v(" "),t("li",[t("strong",[e._v("Decentralized")]),e._v(": Arweave is a decentralized network. There is no root directory or server configuration to reference. All file paths must be relative to the file trying to find an asset, or your dApp wont be able to find it.")])]),e._v(" "),t("h2",{attrs:{id:"identifying-relative-and-absolute-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#identifying-relative-and-absolute-paths"}},[e._v("#")]),e._v(" Identifying Relative and Absolute Paths")]),e._v(" "),t("p",[e._v("The key difference between relative and absolute file paths is where they start from:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Absolute Paths")]),e._v(" start with a slash (/) or a full URL (including the protocol, such as "),t("code",[e._v("http://")]),e._v("). For example, "),t("code",[e._v("/images/myImage.jpg")]),e._v(" or "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" are absolute paths.")]),e._v(" "),t("li",[t("strong",[e._v("Relative Paths")]),e._v(" do not start with a slash. They are relative to the current directory. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" or "),t("code",[e._v("../myImage.jpg")]),e._v(" are relative paths.")])]),e._v(" "),t("h2",{attrs:{id:"navigating-with-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#navigating-with-relative-paths"}},[e._v("#")]),e._v(" Navigating with Relative Paths")]),e._v(" "),t("p",[e._v("You can navigate around the files of your project with relative paths by following these principles:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Same Directory")]),e._v(": If the file you're trying to reference is in the same directory as the current file, you can just use the filename. For example, if "),t("code",[e._v("index.html")]),e._v(" and "),t("code",[e._v("about.html")]),e._v(" are in the same directory, you can link to "),t("code",[e._v("about.html")]),e._v(" just using "),t("code",[e._v("about.html")]),e._v(".")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Subdirectory")]),e._v(": If the file is in a subdirectory, you can use the directory name followed by the filename. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" will point to the "),t("code",[e._v("myImage.jpg")]),e._v(" file in the "),t("code",[e._v("images")]),e._v(" subdirectory.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Parent Directory")]),e._v(": If the file is in a parent directory, you can use "),t("code",[e._v("../")]),e._v(" to go up one level. For example, "),t("code",[e._v("../index.html")]),e._v(" will point to "),t("code",[e._v("index.html")]),e._v(" in the parent directory. You can use multiple "),t("code",[e._v("../")]),e._v(" to go up multiple levels, like "),t("code",[e._v("../../index.html")]),e._v(".")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{326:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"file-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-paths"}},[e._v("#")]),e._v(" File Paths")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("File paths are needed to locate resources in your file system or on a server. There are two types of file paths: absolute and relative. Because there is no way to know exactly from where a user will access a dApp deployed on Arweave, all file paths used need to be relative.")]),e._v(" "),t("h2",{attrs:{id:"absolute-vs-relative"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#absolute-vs-relative"}},[e._v("#")]),e._v(" Absolute Vs. Relative")]),e._v(" "),t("p",[e._v("An absolute path is the full URL to a resource, starting from the root. For example, "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" is an absolute path. It points directly to the image no matter where the code referencing it is located.")]),e._v(" "),t("p",[e._v("A relative path is a path relative to the current location. If you have an HTML file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path "),t("code",[e._v("images/myImage.jpg")]),e._v(" to reference the image.")]),e._v(" "),t("h2",{attrs:{id:"why-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-relative-paths"}},[e._v("#")]),e._v(" Why Relative Paths")]),e._v(" "),t("p",[e._v("When deploying dApps on Arweave, relative paths are essential because:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Domain agnostic")]),e._v(": Arweave permaweb dApps can be accessed from various gateways, not just one domain. Absolute paths tied to a specific domain will not work.")]),e._v(" "),t("li",[t("strong",[e._v("Decentralized")]),e._v(": Arweave is a decentralized network. There is no root directory or server configuration to reference. All file paths must be relative to the file trying to find an asset, or your dApp wont be able to find it.")])]),e._v(" "),t("h2",{attrs:{id:"identifying-relative-and-absolute-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#identifying-relative-and-absolute-paths"}},[e._v("#")]),e._v(" Identifying Relative and Absolute Paths")]),e._v(" "),t("p",[e._v("The key difference between relative and absolute file paths is where they start from:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Absolute Paths")]),e._v(" start with a slash (/) or a full URL (including the protocol, such as "),t("code",[e._v("http://")]),e._v("). For example, "),t("code",[e._v("/images/myImage.jpg")]),e._v(" or "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" are absolute paths.")]),e._v(" "),t("li",[t("strong",[e._v("Relative Paths")]),e._v(" do not start with a slash. They are relative to the current directory. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" or "),t("code",[e._v("../myImage.jpg")]),e._v(" are relative paths.")])]),e._v(" "),t("h2",{attrs:{id:"navigating-with-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#navigating-with-relative-paths"}},[e._v("#")]),e._v(" Navigating with Relative Paths")]),e._v(" "),t("p",[e._v("You can navigate around the files of your project with relative paths by following these principles:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Same Directory")]),e._v(": If the file you're trying to reference is in the same directory as the current file, you can just use the filename. For example, if "),t("code",[e._v("index.html")]),e._v(" and "),t("code",[e._v("about.html")]),e._v(" are in the same directory, you can link to "),t("code",[e._v("about.html")]),e._v(" just using "),t("code",[e._v("about.html")]),e._v(".")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Subdirectory")]),e._v(": If the file is in a subdirectory, you can use the directory name followed by the filename. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" will point to the "),t("code",[e._v("myImage.jpg")]),e._v(" file in the "),t("code",[e._v("images")]),e._v(" subdirectory.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Parent Directory")]),e._v(": If the file is in a parent directory, you can use "),t("code",[e._v("../")]),e._v(" to go up one level. For example, "),t("code",[e._v("../index.html")]),e._v(" will point to "),t("code",[e._v("index.html")]),e._v(" in the parent directory. You can use multiple "),t("code",[e._v("../")]),e._v(" to go up multiple levels, like "),t("code",[e._v("../../index.html")]),e._v(".")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/33.9fd23a16.js b/assets/js/33.cf63c8d8.js similarity index 95% rename from assets/js/33.9fd23a16.js rename to assets/js/33.cf63c8d8.js index dcc226f..42b31e3 100644 --- a/assets/js/33.9fd23a16.js +++ b/assets/js/33.cf63c8d8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{326:function(e,t,r){"use strict";r.r(t);var o=r(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"preparing-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preparing-your-dapp"}},[e._v("#")]),e._v(" Preparing Your dApp")]),e._v(" "),t("p",[e._v("To make sure dApps work correctly on the Arweave blockchain, they need to be set up in a specific manner. This is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. Your dApp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. This is done by ensuring the following:")]),e._v(" "),t("ul",[t("li",[e._v("Your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/routing.html"}},[e._v("hash routing")])],1),e._v(" "),t("li",[e._v("All internal links in your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/paths.html"}},[e._v("relative file paths")]),e._v(".")],1)]),e._v(" "),t("p",[e._v("Failure to properly implement either will result in your dApp not working the way it should once it is deployed onto Arweave.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{327:function(e,t,r){"use strict";r.r(t);var o=r(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"preparing-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preparing-your-dapp"}},[e._v("#")]),e._v(" Preparing Your dApp")]),e._v(" "),t("p",[e._v("To make sure dApps work correctly on the Arweave blockchain, they need to be set up in a specific manner. This is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. Your dApp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. This is done by ensuring the following:")]),e._v(" "),t("ul",[t("li",[e._v("Your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/routing.html"}},[e._v("hash routing")])],1),e._v(" "),t("li",[e._v("All internal links in your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/paths.html"}},[e._v("relative file paths")]),e._v(".")],1)]),e._v(" "),t("p",[e._v("Failure to properly implement either will result in your dApp not working the way it should once it is deployed onto Arweave.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/34.646dac02.js b/assets/js/34.317b309f.js similarity index 97% rename from assets/js/34.646dac02.js rename to assets/js/34.317b309f.js index 8782e99..a4431be 100644 --- a/assets/js/34.646dac02.js +++ b/assets/js/34.317b309f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{327:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"hash-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing"}},[e._v("#")]),e._v(" Hash Routing")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v('Hash routing is a popular technique in single page applications (SPAs) where the site navigation is handled using JavaScript. The "hash" in hash routing refers to the hash symbol (#) inserted into the URL. The part of the URL after the hash symbol is used to determine which "page" to show.')]),e._v(" "),t("p",[e._v('For example, if your URL is "http://www.example.com/#about", the part after the hash (about) would be used to show an app\'s "about" page.')]),e._v(" "),t("h2",{attrs:{id:"hash-routing-vs-history-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing-vs-history-routing"}},[e._v("#")]),e._v(" Hash Routing Vs. History Routing")]),e._v(" "),t("p",[e._v('Traditional web apps use history routing, where each unique URL represents a different source or asset contained in a server. The URL "http://www.example.com/about" would fetch the "about" page from the app\'s server and display it for a user. History routing requires a server be available to provide the correct files every time a user navigates around an app.')]),e._v(" "),t("p",[e._v("In contrast, with hash routing, all navigation is handled by the client's browser, so no server is needed for navigation.")]),e._v(" "),t("h2",{attrs:{id:"why-hash-routing-for-dapps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-hash-routing-for-dapps"}},[e._v("#")]),e._v(" Why Hash Routing for dApps")]),e._v(" "),t("p",[e._v("Hash routing is particularly useful for apps deployed on Arweave for several reasons:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Serverless")]),e._v(": Arweave is a decentralized storage network. There's no server to process requests, so routing cannot be handled by a server.")]),e._v(" "),t("li",[t("strong",[e._v("Persistence")]),e._v(': Once data is stored on Arweave, it can\'t be changed. Hash routing allows you to have "dynamic" content within this immutable structure.')]),e._v(" "),t("li",[t("strong",[e._v("Performance")]),e._v(": With hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{328:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"hash-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing"}},[e._v("#")]),e._v(" Hash Routing")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v('Hash routing is a popular technique in single page applications (SPAs) where the site navigation is handled using JavaScript. The "hash" in hash routing refers to the hash symbol (#) inserted into the URL. The part of the URL after the hash symbol is used to determine which "page" to show.')]),e._v(" "),t("p",[e._v('For example, if your URL is "http://www.example.com/#about", the part after the hash (about) would be used to show an app\'s "about" page.')]),e._v(" "),t("h2",{attrs:{id:"hash-routing-vs-history-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing-vs-history-routing"}},[e._v("#")]),e._v(" Hash Routing Vs. History Routing")]),e._v(" "),t("p",[e._v('Traditional web apps use history routing, where each unique URL represents a different source or asset contained in a server. The URL "http://www.example.com/about" would fetch the "about" page from the app\'s server and display it for a user. History routing requires a server be available to provide the correct files every time a user navigates around an app.')]),e._v(" "),t("p",[e._v("In contrast, with hash routing, all navigation is handled by the client's browser, so no server is needed for navigation.")]),e._v(" "),t("h2",{attrs:{id:"why-hash-routing-for-dapps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-hash-routing-for-dapps"}},[e._v("#")]),e._v(" Why Hash Routing for dApps")]),e._v(" "),t("p",[e._v("Hash routing is particularly useful for apps deployed on Arweave for several reasons:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Serverless")]),e._v(": Arweave is a decentralized storage network. There's no server to process requests, so routing cannot be handled by a server.")]),e._v(" "),t("li",[t("strong",[e._v("Persistence")]),e._v(': Once data is stored on Arweave, it can\'t be changed. Hash routing allows you to have "dynamic" content within this immutable structure.')]),e._v(" "),t("li",[t("strong",[e._v("Performance")]),e._v(": With hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/35.99917f3f.js b/assets/js/35.886d922d.js similarity index 98% rename from assets/js/35.99917f3f.js rename to assets/js/35.886d922d.js index 28a3dd9..8705c82 100644 --- a/assets/js/35.99917f3f.js +++ b/assets/js/35.886d922d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{328:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ethareum"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ethareum"}},[e._v("#")]),e._v(" EthAReum")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("EthAReum is a new key derivation protocol that enables the generation of private keys for an Arweave wallet using a signature from an Ethereum wallet. This allows users to create an Arweave wallet directly through an Ethereum wallet provider like "),t("a",{attrs:{href:"https://metamask.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("MetaMask"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("These generated private keys provide a fully functional Arweave wallet, equipped to perform all standard operations, including holding AR tokens and "),t("RouterLink",{attrs:{to:"/docs/turbo/what-is-turbo.html"}},[e._v("Turbo Credits")]),e._v(", and uploading data to the Arweave network.")],1),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Recommended Browser")]),e._v(" "),t("p",[e._v("For optimal performance, it is recommended MetaMask users access ArDrive using the Chrome browser. While EthAReum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.")])]),e._v(" "),t("h2",{attrs:{id:"password"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#password"}},[e._v("#")]),e._v(" Password")]),e._v(" "),t("p",[e._v("The EthAReum protocol incorporates a user-generated password in the process of deriving an Arweave wallet from an Ethereum wallet. This password provides an extra layer of security by contributing additional entropy to the wallet's derivation. It also serves as a critical verification step for wallet access.")]),e._v(" "),t("p",[e._v("For instance, when creating a new account with ArDrive, users are required to set a password for their wallet. This password is then used for subsequent logins and for encrypting private uploads. The password established during the wallet derivation process on ArDrive will be the same password used for future logins.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": The password used during the derivation of private keys is permanent and "),t("em",[t("strong",[e._v("CAN NOT")])]),e._v(" be changed or recovered by an administrator (ArDrive is a decentralized platform and has no account administration). It is crucial to keep this password secure.")]),e._v(" "),t("h2",{attrs:{id:"public-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#public-address"}},[e._v("#")]),e._v(" Public Address")]),e._v(" "),t("p",[e._v("The Public address of the generated Arweave wallet is derived from its public key. The public address of the generated wallet will be different from the public address of the Ethereum wallet used to generate it.")]),e._v(" "),t("p",[e._v("The exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dApp you use for interacting with the protocol. With ArDrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"keyfile-and-seed-phrase"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#keyfile-and-seed-phrase"}},[e._v("#")]),e._v(" Keyfile and Seed Phrase")]),e._v(" "),t("p",[e._v("The primary method used in the Arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in Ethereum wallet providers. Seed phrases are supported though, so you will be able to obtain a seed phrase for your generated Arweave wallet and use it to import the wallet into other dApps or wallet providers in the Arweave ecosystem. Just be aware that not every dApp in the ecosystem has an interface that can facilitate this.")]),e._v(" "),t("p",[e._v("A keyfile is a json file that contains a Json Web Key (JWK) which act as the private keys for a wallet. Always be sure to treat your keyfile with the same care as you would the private keys for an Ethereum wallet. Find out more about keyfiles from the "),t("a",{attrs:{href:"https://cookbook.arweave.dev/concepts/keyfiles-and-wallets.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Cookbook"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Similar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dApp you used to generate your wallet. With ArDrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"security"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#security"}},[e._v("#")]),e._v(" Security")]),e._v(" "),t("p",[e._v("EthAReum generates the private keys of an Arweave wallet using a signature from your Ethereum wallet, ensuring that control only extends in one direction. The EthAReum protocol does not access or control the Ethereum wallet used for generation, thereby safeguarding your Ethereum assets.")]),e._v(" "),t("p",[e._v("However, it's important to be vigilant as some malicious dApps or websites may disguise a high-risk authorization transaction as a simple signature request. Always ensure that you only provide signatures to reputable and trusted dApps like "),t("a",{attrs:{href:"https://app.ardrive.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive"),t("OutboundLink")],1),e._v(".")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{329:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ethareum"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ethareum"}},[e._v("#")]),e._v(" EthAReum")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("EthAReum is a new key derivation protocol that enables the generation of private keys for an Arweave wallet using a signature from an Ethereum wallet. This allows users to create an Arweave wallet directly through an Ethereum wallet provider like "),t("a",{attrs:{href:"https://metamask.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("MetaMask"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("These generated private keys provide a fully functional Arweave wallet, equipped to perform all standard operations, including holding AR tokens and "),t("RouterLink",{attrs:{to:"/docs/turbo/what-is-turbo.html"}},[e._v("Turbo Credits")]),e._v(", and uploading data to the Arweave network.")],1),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Recommended Browser")]),e._v(" "),t("p",[e._v("For optimal performance, it is recommended MetaMask users access ArDrive using the Chrome browser. While EthAReum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.")])]),e._v(" "),t("h2",{attrs:{id:"password"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#password"}},[e._v("#")]),e._v(" Password")]),e._v(" "),t("p",[e._v("The EthAReum protocol incorporates a user-generated password in the process of deriving an Arweave wallet from an Ethereum wallet. This password provides an extra layer of security by contributing additional entropy to the wallet's derivation. It also serves as a critical verification step for wallet access.")]),e._v(" "),t("p",[e._v("For instance, when creating a new account with ArDrive, users are required to set a password for their wallet. This password is then used for subsequent logins and for encrypting private uploads. The password established during the wallet derivation process on ArDrive will be the same password used for future logins.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": The password used during the derivation of private keys is permanent and "),t("em",[t("strong",[e._v("CAN NOT")])]),e._v(" be changed or recovered by an administrator (ArDrive is a decentralized platform and has no account administration). It is crucial to keep this password secure.")]),e._v(" "),t("h2",{attrs:{id:"public-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#public-address"}},[e._v("#")]),e._v(" Public Address")]),e._v(" "),t("p",[e._v("The Public address of the generated Arweave wallet is derived from its public key. The public address of the generated wallet will be different from the public address of the Ethereum wallet used to generate it.")]),e._v(" "),t("p",[e._v("The exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dApp you use for interacting with the protocol. With ArDrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"keyfile-and-seed-phrase"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#keyfile-and-seed-phrase"}},[e._v("#")]),e._v(" Keyfile and Seed Phrase")]),e._v(" "),t("p",[e._v("The primary method used in the Arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in Ethereum wallet providers. Seed phrases are supported though, so you will be able to obtain a seed phrase for your generated Arweave wallet and use it to import the wallet into other dApps or wallet providers in the Arweave ecosystem. Just be aware that not every dApp in the ecosystem has an interface that can facilitate this.")]),e._v(" "),t("p",[e._v("A keyfile is a json file that contains a Json Web Key (JWK) which act as the private keys for a wallet. Always be sure to treat your keyfile with the same care as you would the private keys for an Ethereum wallet. Find out more about keyfiles from the "),t("a",{attrs:{href:"https://cookbook.arweave.dev/concepts/keyfiles-and-wallets.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Cookbook"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Similar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dApp you used to generate your wallet. With ArDrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"security"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#security"}},[e._v("#")]),e._v(" Security")]),e._v(" "),t("p",[e._v("EthAReum generates the private keys of an Arweave wallet using a signature from your Ethereum wallet, ensuring that control only extends in one direction. The EthAReum protocol does not access or control the Ethereum wallet used for generation, thereby safeguarding your Ethereum assets.")]),e._v(" "),t("p",[e._v("However, it's important to be vigilant as some malicious dApps or websites may disguise a high-risk authorization transaction as a simple signature request. Always ensure that you only provide signatures to reputable and trusted dApps like "),t("a",{attrs:{href:"https://app.ardrive.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive"),t("OutboundLink")],1),e._v(".")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/36.2eec7b3b.js b/assets/js/36.fef6255c.js similarity index 99% rename from assets/js/36.2eec7b3b.js rename to assets/js/36.fef6255c.js index eb98498..48c1306 100644 --- a/assets/js/36.2eec7b3b.js +++ b/assets/js/36.fef6255c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{329:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"how-to-save-a-website-permanently"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-to-save-a-website-permanently"}},[e._v("#")]),e._v(" How to Save a Website Permanently")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("ArDrive offers the ability to save working copies of static websites permanently on "),t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v(". This means that websites made on WordPress, Wix, SquareSpace and other CMS platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.")]),e._v(" "),t("p",[e._v("Resources like the "),t("a",{attrs:{href:"https://archive.org/web/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wayback Machine"),t("OutboundLink")],1),e._v(" are useful to research the past life of old websites. But the Wayback Machine’s archives are not comprehensive and often only capture partial copies of historic sites. By leveraging the utility of Arweave manifests, ArDrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.")]),e._v(" "),t("p",[e._v("The process to make a β€˜permasite’ takes 10 steps which are outlined below. Advanced users can accomplish similar results by using manifests within the "),t("RouterLink",{attrs:{to:"/docs/cli/intro.html"}},[e._v("ArDrive CLI")]),e._v(".")],1),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_1-download-static-site-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-download-static-site-files"}},[e._v("#")]),e._v(" 1. Download Static Site Files")]),e._v(" "),t("p",[e._v("ArDrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:")]),e._v(" "),t("ul",[t("li",[e._v("Permanent sites will not enable backend interaction with your website’s CMS,")]),e._v(" "),t("li",[e._v("nor allow you to make further changes to the content of your site,")]),e._v(" "),t("li",[e._v("nor support dynamic functionality like contact forms and eCommerce.")])]),e._v(" "),t("p",[e._v("To generate your static site files, we recommend:")]),e._v(" "),t("h3",{attrs:{id:"windows-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#windows-users"}},[e._v("#")]),e._v(" Windows Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.cyotek.com/cyotek-webcopy",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebCopy"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://www.httrack.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("HtTrack"),t("OutboundLink")],1),e._v(" enable Windows users to download static copies of entire websites.")]),e._v(" "),t("h3",{attrs:{id:"mac-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#mac-users"}},[e._v("#")]),e._v(" Mac Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://apps.apple.com/us/app/offline-pages-pro/id391462107",target:"_blank",rel:"noopener noreferrer"}},[e._v("Offline Pages Pro"),t("OutboundLink")],1),e._v(" (Mac users only), which creates files that work well with this process. After saving your site with Offline Pages Pro, go to File > Export > Local Website to download the local static files."),t("br"),e._v(" "),t("a",{attrs:{href:"https://ricks-apps.com/osx/sitesucker/index.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("SiteSucker"),t("OutboundLink")],1),e._v(" is another option for Mac users.")]),e._v(" "),t("h3",{attrs:{id:"command-line-utility"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#command-line-utility"}},[e._v("#")]),e._v(" Command Line Utility")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.gnu.org/software/wget/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wget"),t("OutboundLink")],1),e._v(" is a free tool that helps capture static versions of websites. While Wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. It offers a simple way to save your site's current look and feel as static files at no cost.")]),e._v(" "),t("h3",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://wordpress.org/plugins/simply-static/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Simply Static"),t("OutboundLink")],1),e._v(" is a plugin that generates static files for WordPress websites. Some users note that Simply Static fails to properly associate CSS and JS files with your static site, but others have had success with this free WordPress plugin.")]),e._v(" "),t("h2",{attrs:{id:"_2-create-an-account-on-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-an-account-on-ardrive"}},[e._v("#")]),e._v(" 2. Create an Account on ArDrive")]),e._v(" "),t("p",[e._v("Account creation is free as are uploads of small files (currently up to 500 KB). Remember that ArDrive empowers you to be in control of your data; no one else has your password but you. Therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.")]),e._v(" "),t("h2",{attrs:{id:"_3-create-a-new-public-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-create-a-new-public-drive"}},[e._v("#")]),e._v(" 3. Create a New Public Drive")]),e._v(" "),t("p",[e._v("Click on the red +New button and create a Drive. Name your Drive and set it as β€œPublic”. ArDrive also offers β€œPrivate” file storage; however, permanent websites must be public in order to maintain functionality.")]),e._v(" "),t("h2",{attrs:{id:"_4-top-up"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4-top-up"}},[e._v("#")]),e._v(" 4. Top Up")]),e._v(" "),t("p",[e._v("To pay for permanent storage on the Arweave network you must either purchase ArDrive Turbo credits with a credit card or (or the advanced option) ensure your wallet has $AR, the native token of the Arweave ecosystem. Most websites will cost less than $1 to save permanently. "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("See current prices"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_5-upload-static-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_5-upload-static-files"}},[e._v("#")]),e._v(" 5. Upload Static Files")]),e._v(" "),t("p",[e._v("Upload the static files to your new Public Drive. Offline Pages Pro will generate an index.html file that is "),t("em",[e._v("separate")]),e._v(" from a large folder of assets (images, css, fonts, etc). Simply Static will add the index.html file to the rest of your assets. Either way, upload all the files you receive from your static site generator to your new Public Drive.")]),e._v(" "),t("h2",{attrs:{id:"_6-wait"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_6-wait"}},[e._v("#")]),e._v(" 6. Wait")]),e._v(" "),t("p",[e._v("Permanence takes patience. Once static files have been uploaded, they need to be sent to the Arweave network before being assembled together. This process can take as little as 5 seconds (when using Turbo credits) or up to 30 minutes or more (when using $AR). Make sure to keep your browser tab open and do not refresh your browser while you wait.")]),e._v(" "),t("p",[e._v("To check on the status of your files, you can click the refresh icon in the top right of ArDrive. You’ll know your file is ready when the light on the icon turns from yellow to green. (Pro Tip: some files uploaded with Turbo are ready before they are green.)")]),e._v(" "),t("h2",{attrs:{id:"_7-create-a-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_7-create-a-manifest"}},[e._v("#")]),e._v(" 7. Create a Manifest")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://ardrive.io/manifests/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Manifests"),t("OutboundLink")],1),e._v(" are specialΒ "),t("code",[e._v(".json")]),e._v("Β files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. In other words, they are the secret sauce that brings a permasite together.")]),e._v(" "),t("p",[e._v("Click on the red +New button and select Advanced > New Manifest. Select the location for your manifest, ensuring it is in the same place as your index.html file.")]),e._v(" "),t("p",[e._v("Give your Manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ArDrive.")]),e._v(" "),t("h2",{attrs:{id:"_8-wait-again"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_8-wait-again"}},[e._v("#")]),e._v(" 8. Wait Again")]),e._v(" "),t("p",[e._v("Now the manifest needs to be sent to the Arweave network. Again, this process can take just a few seconds or up to 30 minutes or more.")]),e._v(" "),t("p",[e._v("After a bit, you can refresh your Drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.")]),e._v(" "),t("h2",{attrs:{id:"_9-preview-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_9-preview-the-manifest"}},[e._v("#")]),e._v(" 9. Preview the Manifest")]),e._v(" "),t("p",[e._v("Got a green light? You’re ready to go. Click on your manifest file and you will see a panel of options appear on the right side of your screen. Click on the Preview icon in the top right and it will open a new tab with your permasite.")]),e._v(" "),t("p",[e._v("If a website appears with a long, random-looking URL in the browser bar, then congrats, you made a permasite!")]),e._v(" "),t("p",[e._v("Try clicking around and make sure all your pages are preserved. If they are not it could be a limitation of your static site generator or an issue with the manifest (see Notes below).")]),e._v(" "),t("h2",{attrs:{id:"_10-add-a-redirect-or-domain-masking"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_10-add-a-redirect-or-domain-masking"}},[e._v("#")]),e._v(" 10. Add a Redirect or Domain Masking")]),e._v(" "),t("p",[e._v("You’ll notice that your permasite has a long, random-looking URL generated by Arweave. These long URLs are designed to remain for decades, but they also are not very memorable.")]),e._v(" "),t("p",[e._v("Try redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. You can also acquire an "),t("a",{attrs:{href:"https://ar.io/docs/arns/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArNS name"),t("OutboundLink")],1),e._v(" that enables you to create a custom, permanent name for your permasite.")]),e._v(" "),t("h2",{attrs:{id:"notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#notes"}},[e._v("#")]),e._v(" Notes")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("There’s no delete button with Arweave. Once your permasite is up, it’s up forever. Make sure your content is something you want future humanity to have.")])]),e._v(" "),t("li",[t("p",[e._v("Only static sites can become permasites through the ArDrive web app. Advanced functionality is available for developers who use the "),t("a",{attrs:{href:"https://app.ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive CLI"),t("OutboundLink")],1),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("Links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.")])]),e._v(" "),t("li",[t("p",[e._v("Non-English characters in the URLs of your permasite can be problematic for ArDrive manifests, but non-English characters should work well on the permasite itself.")])])]),e._v(" "),t("h2",{attrs:{id:"other-use-cases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-use-cases"}},[e._v("#")]),e._v(" Other Use Cases")]),e._v(" "),t("p",[e._v("Permasites can be used to archive web content before it disappears from the internet. Or they can be used to create working copies of websites before it a particular site is replaced by new versions.")]),e._v(" "),t("p",[e._v("Manifests can also be used to make reliable perma-backups. Many web hosts offer good daily backups and some offer reliable offsite backups as well. Permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.")]),e._v(" "),t("h2",{attrs:{id:"example"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" Example")]),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{330:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"how-to-save-a-website-permanently"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-to-save-a-website-permanently"}},[e._v("#")]),e._v(" How to Save a Website Permanently")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("ArDrive offers the ability to save working copies of static websites permanently on "),t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v(". This means that websites made on WordPress, Wix, SquareSpace and other CMS platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.")]),e._v(" "),t("p",[e._v("Resources like the "),t("a",{attrs:{href:"https://archive.org/web/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wayback Machine"),t("OutboundLink")],1),e._v(" are useful to research the past life of old websites. But the Wayback Machine’s archives are not comprehensive and often only capture partial copies of historic sites. By leveraging the utility of Arweave manifests, ArDrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.")]),e._v(" "),t("p",[e._v("The process to make a β€˜permasite’ takes 10 steps which are outlined below. Advanced users can accomplish similar results by using manifests within the "),t("RouterLink",{attrs:{to:"/docs/cli/intro.html"}},[e._v("ArDrive CLI")]),e._v(".")],1),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_1-download-static-site-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-download-static-site-files"}},[e._v("#")]),e._v(" 1. Download Static Site Files")]),e._v(" "),t("p",[e._v("ArDrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:")]),e._v(" "),t("ul",[t("li",[e._v("Permanent sites will not enable backend interaction with your website’s CMS,")]),e._v(" "),t("li",[e._v("nor allow you to make further changes to the content of your site,")]),e._v(" "),t("li",[e._v("nor support dynamic functionality like contact forms and eCommerce.")])]),e._v(" "),t("p",[e._v("To generate your static site files, we recommend:")]),e._v(" "),t("h3",{attrs:{id:"windows-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#windows-users"}},[e._v("#")]),e._v(" Windows Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.cyotek.com/cyotek-webcopy",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebCopy"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://www.httrack.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("HtTrack"),t("OutboundLink")],1),e._v(" enable Windows users to download static copies of entire websites.")]),e._v(" "),t("h3",{attrs:{id:"mac-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#mac-users"}},[e._v("#")]),e._v(" Mac Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://apps.apple.com/us/app/offline-pages-pro/id391462107",target:"_blank",rel:"noopener noreferrer"}},[e._v("Offline Pages Pro"),t("OutboundLink")],1),e._v(" (Mac users only), which creates files that work well with this process. After saving your site with Offline Pages Pro, go to File > Export > Local Website to download the local static files."),t("br"),e._v(" "),t("a",{attrs:{href:"https://ricks-apps.com/osx/sitesucker/index.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("SiteSucker"),t("OutboundLink")],1),e._v(" is another option for Mac users.")]),e._v(" "),t("h3",{attrs:{id:"command-line-utility"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#command-line-utility"}},[e._v("#")]),e._v(" Command Line Utility")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.gnu.org/software/wget/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wget"),t("OutboundLink")],1),e._v(" is a free tool that helps capture static versions of websites. While Wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. It offers a simple way to save your site's current look and feel as static files at no cost.")]),e._v(" "),t("h3",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://wordpress.org/plugins/simply-static/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Simply Static"),t("OutboundLink")],1),e._v(" is a plugin that generates static files for WordPress websites. Some users note that Simply Static fails to properly associate CSS and JS files with your static site, but others have had success with this free WordPress plugin.")]),e._v(" "),t("h2",{attrs:{id:"_2-create-an-account-on-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-an-account-on-ardrive"}},[e._v("#")]),e._v(" 2. Create an Account on ArDrive")]),e._v(" "),t("p",[e._v("Account creation is free as are uploads of small files (currently up to 500 KB). Remember that ArDrive empowers you to be in control of your data; no one else has your password but you. Therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.")]),e._v(" "),t("h2",{attrs:{id:"_3-create-a-new-public-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-create-a-new-public-drive"}},[e._v("#")]),e._v(" 3. Create a New Public Drive")]),e._v(" "),t("p",[e._v("Click on the red +New button and create a Drive. Name your Drive and set it as β€œPublic”. ArDrive also offers β€œPrivate” file storage; however, permanent websites must be public in order to maintain functionality.")]),e._v(" "),t("h2",{attrs:{id:"_4-top-up"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4-top-up"}},[e._v("#")]),e._v(" 4. Top Up")]),e._v(" "),t("p",[e._v("To pay for permanent storage on the Arweave network you must either purchase ArDrive Turbo credits with a credit card or (or the advanced option) ensure your wallet has $AR, the native token of the Arweave ecosystem. Most websites will cost less than $1 to save permanently. "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("See current prices"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_5-upload-static-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_5-upload-static-files"}},[e._v("#")]),e._v(" 5. Upload Static Files")]),e._v(" "),t("p",[e._v("Upload the static files to your new Public Drive. Offline Pages Pro will generate an index.html file that is "),t("em",[e._v("separate")]),e._v(" from a large folder of assets (images, css, fonts, etc). Simply Static will add the index.html file to the rest of your assets. Either way, upload all the files you receive from your static site generator to your new Public Drive.")]),e._v(" "),t("h2",{attrs:{id:"_6-wait"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_6-wait"}},[e._v("#")]),e._v(" 6. Wait")]),e._v(" "),t("p",[e._v("Permanence takes patience. Once static files have been uploaded, they need to be sent to the Arweave network before being assembled together. This process can take as little as 5 seconds (when using Turbo credits) or up to 30 minutes or more (when using $AR). Make sure to keep your browser tab open and do not refresh your browser while you wait.")]),e._v(" "),t("p",[e._v("To check on the status of your files, you can click the refresh icon in the top right of ArDrive. You’ll know your file is ready when the light on the icon turns from yellow to green. (Pro Tip: some files uploaded with Turbo are ready before they are green.)")]),e._v(" "),t("h2",{attrs:{id:"_7-create-a-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_7-create-a-manifest"}},[e._v("#")]),e._v(" 7. Create a Manifest")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://ardrive.io/manifests/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Manifests"),t("OutboundLink")],1),e._v(" are specialΒ "),t("code",[e._v(".json")]),e._v("Β files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. In other words, they are the secret sauce that brings a permasite together.")]),e._v(" "),t("p",[e._v("Click on the red +New button and select Advanced > New Manifest. Select the location for your manifest, ensuring it is in the same place as your index.html file.")]),e._v(" "),t("p",[e._v("Give your Manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ArDrive.")]),e._v(" "),t("h2",{attrs:{id:"_8-wait-again"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_8-wait-again"}},[e._v("#")]),e._v(" 8. Wait Again")]),e._v(" "),t("p",[e._v("Now the manifest needs to be sent to the Arweave network. Again, this process can take just a few seconds or up to 30 minutes or more.")]),e._v(" "),t("p",[e._v("After a bit, you can refresh your Drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.")]),e._v(" "),t("h2",{attrs:{id:"_9-preview-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_9-preview-the-manifest"}},[e._v("#")]),e._v(" 9. Preview the Manifest")]),e._v(" "),t("p",[e._v("Got a green light? You’re ready to go. Click on your manifest file and you will see a panel of options appear on the right side of your screen. Click on the Preview icon in the top right and it will open a new tab with your permasite.")]),e._v(" "),t("p",[e._v("If a website appears with a long, random-looking URL in the browser bar, then congrats, you made a permasite!")]),e._v(" "),t("p",[e._v("Try clicking around and make sure all your pages are preserved. If they are not it could be a limitation of your static site generator or an issue with the manifest (see Notes below).")]),e._v(" "),t("h2",{attrs:{id:"_10-add-a-redirect-or-domain-masking"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_10-add-a-redirect-or-domain-masking"}},[e._v("#")]),e._v(" 10. Add a Redirect or Domain Masking")]),e._v(" "),t("p",[e._v("You’ll notice that your permasite has a long, random-looking URL generated by Arweave. These long URLs are designed to remain for decades, but they also are not very memorable.")]),e._v(" "),t("p",[e._v("Try redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. You can also acquire an "),t("a",{attrs:{href:"https://ar.io/docs/arns/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArNS name"),t("OutboundLink")],1),e._v(" that enables you to create a custom, permanent name for your permasite.")]),e._v(" "),t("h2",{attrs:{id:"notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#notes"}},[e._v("#")]),e._v(" Notes")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("There’s no delete button with Arweave. Once your permasite is up, it’s up forever. Make sure your content is something you want future humanity to have.")])]),e._v(" "),t("li",[t("p",[e._v("Only static sites can become permasites through the ArDrive web app. Advanced functionality is available for developers who use the "),t("a",{attrs:{href:"https://app.ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive CLI"),t("OutboundLink")],1),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("Links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.")])]),e._v(" "),t("li",[t("p",[e._v("Non-English characters in the URLs of your permasite can be problematic for ArDrive manifests, but non-English characters should work well on the permasite itself.")])])]),e._v(" "),t("h2",{attrs:{id:"other-use-cases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-use-cases"}},[e._v("#")]),e._v(" Other Use Cases")]),e._v(" "),t("p",[e._v("Permasites can be used to archive web content before it disappears from the internet. Or they can be used to create working copies of websites before it a particular site is replaced by new versions.")]),e._v(" "),t("p",[e._v("Manifests can also be used to make reliable perma-backups. Many web hosts offer good daily backups and some offer reliable offsite backups as well. Permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.")]),e._v(" "),t("h2",{attrs:{id:"example"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" Example")]),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/37.aaed2390.js b/assets/js/37.77ab9219.js similarity index 99% rename from assets/js/37.aaed2390.js rename to assets/js/37.77ab9219.js index f5d6b99..5684bf2 100644 --- a/assets/js/37.aaed2390.js +++ b/assets/js/37.77ab9219.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{330:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ardrive-price-calculator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ardrive-price-calculator"}},[e._v("#")]),e._v(" ArDrive Price Calculator")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive Price Calculator website"),t("OutboundLink")],1),e._v(" is open source, and its code can be viewed "),t("a",{attrs:{href:"https://github.com/ardriveapp/price-calculator",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("This website is intended to calculate the cost, in a wide variety of denominations and cryptocurrencies, of uploading data to Arweave. You can spin up your own version by cloning the code from Github and following these steps.")]),e._v(" "),t("h2",{attrs:{id:"developer-setup"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#developer-setup"}},[e._v("#")]),e._v(" Developer Setup")]),e._v(" "),t("p",[e._v("Follow these steps to get the developer environment up and running:")]),e._v(" "),t("h3",{attrs:{id:"install-yarn-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-yarn-2"}},[e._v("#")]),e._v(" Install Yarn 2")]),e._v(" "),t("p",[e._v("The ArDrive Price Calculator uses Yarn 2, so install the latest version with the "),t("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("yarn installation instructions"),t("OutboundLink")],1),e._v(". In most cases:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Brew:")]),e._v("\nbrew "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Or with NPM:")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n")])])]),t("p",[e._v("We also use husky to manage the git commit hooks that help to improve the quality of our commits. Without installing husky, you risk committing non-compliant code to the repository.")]),e._v(" "),t("p",[e._v("Using husky triggers two pre-commit hooks. The first will run "),t("code",[e._v("lint-staged")]),e._v(" on each staged file, which includes running prettier to format, eslint for linting, and also tsc-files for quickly checking that TypeScript can compile the code. The second hook will test the codebase prior to committing, ensuring that all tests must pass.")]),e._v(" "),t("p",[e._v("To enable hooks locally, you will need to run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" husky "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v("\n")])])]),t("h3",{attrs:{id:"nvm"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nvm"}},[e._v("#")]),e._v(" NVM")]),e._v(" "),t("p",[e._v("This repository uses NVM and an "),t("code",[e._v(".nvmrc")]),e._v(" file to lock the Node version to the current version used by "),t("code",[e._v("ardrive-core-js")]),e._v(".")]),e._v(" "),t("p",[e._v("Note for Windows: "),t("strong",[e._v("We recommend using WSL")]),e._v(" for setting up NVM on Windows using the "),t("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[e._v("instructions described here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("Follow these steps to get NVM up and running on your system:")]),e._v(" "),t("ol",[t("li",[e._v("Install NVM using "),t("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[e._v("these installation instructions"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Navigate to this project's root directory")]),e._v(" "),t("li",[e._v("Ensure that the correct version of Node is installed by performing: "),t("code",[e._v("nvm install")])]),e._v(" "),t("li",[t("strong",[e._v("Every time you start a new terminal session or switch to this project from another NPM project")]),e._v(", you should set the correct version of Node by running: "),t("code",[e._v("nvm use")])])]),e._v(" "),t("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[e._v("#")]),e._v(" Recommended Visual Studio Code extensions")]),e._v(" "),t("p",[e._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[e._v("ES-Lint"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[e._v("Editor-Config"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prettier"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZipFS"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"available-scripts"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#available-scripts"}},[e._v("#")]),e._v(" Available Scripts")]),e._v(" "),t("h3",{attrs:{id:"yarn-start"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-start"}},[e._v("#")]),e._v(" yarn start")]),e._v(" "),t("p",[e._v("Runs the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.")]),e._v(" "),t("p",[e._v("The page will reload if you make edits.\nYou will also see any lint errors in the console.")]),e._v(" "),t("h3",{attrs:{id:"yarn-build"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-build"}},[e._v("#")]),e._v(" yarn build")]),e._v(" "),t("p",[e._v("Builds a static copy of your site to the "),t("code",[e._v("build/")]),e._v(" folder.\nYour app is ready to be deployed!")]),e._v(" "),t("h3",{attrs:{id:"yarn-test"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-test"}},[e._v("#")]),e._v(" yarn test")]),e._v(" "),t("p",[e._v("Launches the application test runner.\nRun with the "),t("code",[e._v("--watch")]),e._v(" flag ("),t("code",[e._v("yarn test -- --watch")]),e._v(") to run in interactive watch mode.")]),e._v(" "),t("h3",{attrs:{id:"yarn-run-prod"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-run-prod"}},[e._v("#")]),e._v(" yarn run:prod")]),e._v(" "),t("p",[e._v("Builds a fresh snowpack production build to the "),t("code",[e._v("build/")]),e._v(" folder\nThen launches that copy with "),t("code",[e._v("http-server-spa")]),e._v(" for local testing\nThe build will be available for preview at: "),t("a",{attrs:{href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"}},[e._v("http://localhost:8080"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{332:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ardrive-price-calculator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ardrive-price-calculator"}},[e._v("#")]),e._v(" ArDrive Price Calculator")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive Price Calculator website"),t("OutboundLink")],1),e._v(" is open source, and its code can be viewed "),t("a",{attrs:{href:"https://github.com/ardriveapp/price-calculator",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("This website is intended to calculate the cost, in a wide variety of denominations and cryptocurrencies, of uploading data to Arweave. You can spin up your own version by cloning the code from Github and following these steps.")]),e._v(" "),t("h2",{attrs:{id:"developer-setup"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#developer-setup"}},[e._v("#")]),e._v(" Developer Setup")]),e._v(" "),t("p",[e._v("Follow these steps to get the developer environment up and running:")]),e._v(" "),t("h3",{attrs:{id:"install-yarn-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-yarn-2"}},[e._v("#")]),e._v(" Install Yarn 2")]),e._v(" "),t("p",[e._v("The ArDrive Price Calculator uses Yarn 2, so install the latest version with the "),t("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("yarn installation instructions"),t("OutboundLink")],1),e._v(". In most cases:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Brew:")]),e._v("\nbrew "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Or with NPM:")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n")])])]),t("p",[e._v("We also use husky to manage the git commit hooks that help to improve the quality of our commits. Without installing husky, you risk committing non-compliant code to the repository.")]),e._v(" "),t("p",[e._v("Using husky triggers two pre-commit hooks. The first will run "),t("code",[e._v("lint-staged")]),e._v(" on each staged file, which includes running prettier to format, eslint for linting, and also tsc-files for quickly checking that TypeScript can compile the code. The second hook will test the codebase prior to committing, ensuring that all tests must pass.")]),e._v(" "),t("p",[e._v("To enable hooks locally, you will need to run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" husky "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v("\n")])])]),t("h3",{attrs:{id:"nvm"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nvm"}},[e._v("#")]),e._v(" NVM")]),e._v(" "),t("p",[e._v("This repository uses NVM and an "),t("code",[e._v(".nvmrc")]),e._v(" file to lock the Node version to the current version used by "),t("code",[e._v("ardrive-core-js")]),e._v(".")]),e._v(" "),t("p",[e._v("Note for Windows: "),t("strong",[e._v("We recommend using WSL")]),e._v(" for setting up NVM on Windows using the "),t("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[e._v("instructions described here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("Follow these steps to get NVM up and running on your system:")]),e._v(" "),t("ol",[t("li",[e._v("Install NVM using "),t("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[e._v("these installation instructions"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Navigate to this project's root directory")]),e._v(" "),t("li",[e._v("Ensure that the correct version of Node is installed by performing: "),t("code",[e._v("nvm install")])]),e._v(" "),t("li",[t("strong",[e._v("Every time you start a new terminal session or switch to this project from another NPM project")]),e._v(", you should set the correct version of Node by running: "),t("code",[e._v("nvm use")])])]),e._v(" "),t("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[e._v("#")]),e._v(" Recommended Visual Studio Code extensions")]),e._v(" "),t("p",[e._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[e._v("ES-Lint"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[e._v("Editor-Config"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prettier"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZipFS"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"available-scripts"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#available-scripts"}},[e._v("#")]),e._v(" Available Scripts")]),e._v(" "),t("h3",{attrs:{id:"yarn-start"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-start"}},[e._v("#")]),e._v(" yarn start")]),e._v(" "),t("p",[e._v("Runs the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.")]),e._v(" "),t("p",[e._v("The page will reload if you make edits.\nYou will also see any lint errors in the console.")]),e._v(" "),t("h3",{attrs:{id:"yarn-build"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-build"}},[e._v("#")]),e._v(" yarn build")]),e._v(" "),t("p",[e._v("Builds a static copy of your site to the "),t("code",[e._v("build/")]),e._v(" folder.\nYour app is ready to be deployed!")]),e._v(" "),t("h3",{attrs:{id:"yarn-test"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-test"}},[e._v("#")]),e._v(" yarn test")]),e._v(" "),t("p",[e._v("Launches the application test runner.\nRun with the "),t("code",[e._v("--watch")]),e._v(" flag ("),t("code",[e._v("yarn test -- --watch")]),e._v(") to run in interactive watch mode.")]),e._v(" "),t("h3",{attrs:{id:"yarn-run-prod"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-run-prod"}},[e._v("#")]),e._v(" yarn run:prod")]),e._v(" "),t("p",[e._v("Builds a fresh snowpack production build to the "),t("code",[e._v("build/")]),e._v(" folder\nThen launches that copy with "),t("code",[e._v("http-server-spa")]),e._v(" for local testing\nThe build will be available for preview at: "),t("a",{attrs:{href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"}},[e._v("http://localhost:8080"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/39.56ae0201.js b/assets/js/39.99eb1c7e.js similarity index 99% rename from assets/js/39.56ae0201.js rename to assets/js/39.99eb1c7e.js index 06bcc3f..0ddce1c 100644 --- a/assets/js/39.56ae0201.js +++ b/assets/js/39.99eb1c7e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{332:function(n,a,e){"use strict";e.r(a);var t=e(10),r=Object(t.a)({},(function(){var n=this,a=n._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":n.$parent.slotKey}},[a("h1",{attrs:{id:"payment-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#payment-api"}},[n._v("#")]),n._v(" Payment API")]),n._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[n._v("#")]),n._v(" Overview")]),n._v(" "),a("p",[n._v('ArDrive offers several API endpoints to help manage and determine costs associated with converting currencies into Turbo credits. The below endpoints offer access to useful information that can help stay in control when uploading data to Arweave using Turbo. "winc" refers to "winston credits", the smallest denomination of a Turbo credit.')]),n._v(" "),a("p",[a("strong",[n._v("Note")]),n._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),a("a",{attrs:{href:"https://payment.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(", or view the raw json for that documentation "),a("a",{attrs:{href:"https://payment.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(".")]),n._v(" "),a("h2",{attrs:{id:"endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#endpoints"}},[n._v("#")]),n._v(" Endpoints")]),n._v(" "),a("p",[n._v("The host url for all below endpoints is:")]),n._v(" "),a("p",[a("code",[n._v("https://payment.ardrive.io/v1")])]),n._v(" "),a("p",[n._v("All of these endpoints use GET requests")]),n._v(" "),a("h3",{attrs:{id:"get-amount-of-credits-for-byte-count"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-amount-of-credits-for-byte-count"}},[n._v("#")]),n._v(" Get Amount of Credits for Byte Count")]),n._v(" "),a("p",[n._v("Returns the current amount of winc it will cost to upload a provided byte count worth of data.")]),n._v(" "),a("p",[a("code",[n._v("/price/bytes/{byteCount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("byteCount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/bytes/5242880\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1676650364",\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-2514975546"\n }\n ]\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-winc-for-payment-type-and-amount"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-winc-for-payment-type-and-amount"}},[n._v("#")]),n._v(" Get winc for Payment Type and Amount")]),n._v(" "),a("p",[n._v("Returns the current amount of winc Turbo will quote for a given payment type and amount.")]),n._v(" "),a("p",[a("code",[n._v("/price/{type}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-2"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("type")]),n._v('*: string - must match a supported currency, such as "usd" - (path)')]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/usd/1000\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1365248226950"\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-current-balance-of-winc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-current-balance-of-winc"}},[n._v("#")]),n._v(" Get Current Balance of winc")]),n._v(" "),a("p",[n._v("use a signed request of a previously obtained JWT to get the signing wallet's current service balance in winc.")]),n._v(" "),a("p",[a("code",[n._v("/balance")])]),n._v(" "),a("h4",{attrs:{id:"parameters-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-3"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("x-signature")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-nonce")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-public-key")]),n._v("*: string - (header)")]),n._v(" "),a("h3",{attrs:{id:"get-quote-for-credits"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-quote-for-credits"}},[n._v("#")]),n._v(" Get Quote for Credits")]),n._v(" "),a("p",[n._v("Gets a quote and payment session for a given payment method, destination address, currency type, and payment amount")]),n._v(" "),a("p",[a("code",[n._v("/top-up/{method}/{address}/{currency}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-4"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("method")]),n._v("*: string - payment-intent | checkout-session - (path)")]),n._v(" "),a("p",[a("code",[n._v("address")]),n._v("*: string - public address of wallet - (path)")]),n._v(" "),a("p",[a("code",[n._v("currency")]),n._v("*: string - must match supported currency, such as usd - (path)")]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - amount of the currency to convert to winc, usd has a minimum transaction amount of 1000 ($10.00) - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-3"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/top-up/checkout-session/cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q/usd/1000\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "topUpQuote": {\n "topUpQuoteId": "54f57b67-4fcf-47fb-85e6-85d4a8c96f25",\n "destinationAddressType": "arweave",\n "paymentAmount": 1000,\n "winstonCreditAmount": "1360424028269",\n "destinationAddress": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "currencyType": "usd",\n "quoteExpirationDate": "2023-07-27T01:56:26.436Z",\n "paymentProvider": "stripe"\n },\n "paymentSession": {\n "id": "cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51",\n "object": "checkout.session",\n "after_expiration": null,\n "allow_promotion_codes": null,\n "amount_subtotal": 1000,\n "amount_total": 1000,\n "automatic_tax": {\n "enabled": false,\n "status": null\n },\n "billing_address_collection": null,\n "cancel_url": "https://app.ardrive.io",\n "client_reference_id": null,\n "consent": null,\n "consent_collection": null,\n "created": 1690422686,\n "currency": "usd",\n "currency_conversion": null,\n "custom_fields": [],\n "custom_text": {\n "shipping_address": null,\n "submit": null\n },\n "customer": null,\n "customer_creation": "if_required",\n "customer_details": null,\n "customer_email": null,\n "expires_at": 1690509086,\n "invoice": null,\n "invoice_creation": {\n "enabled": false,\n "invoice_data": {\n "account_tax_ids": null,\n "custom_fields": null,\n "description": null,\n "footer": null,\n "metadata": {},\n "rendering_options": null\n }\n },\n "livemode": true,\n "locale": null,\n "metadata": {},\n "mode": "payment",\n "payment_intent": null,\n "payment_link": null,\n "payment_method_collection": "always",\n "payment_method_options": {},\n "payment_method_types": [\n "card"\n ],\n "payment_status": "unpaid",\n "phone_number_collection": {\n "enabled": false\n },\n "recovered_from": null,\n "setup_intent": null,\n "shipping_address_collection": null,\n "shipping_cost": null,\n "shipping_details": null,\n "shipping_options": [],\n "status": "open",\n "submit_type": null,\n "subscription": null,\n "success_url": "https://app.ardrive.io",\n "total_details": {\n "amount_discount": 0,\n "amount_shipping": 0,\n "amount_tax": 0\n },\n "url": "https://checkout.stripe.com/c/pay/cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51#fidkdWxOYHwnPyd1blppbHNgWjA0T1BEcXJGPWR1VUpSbkFJSFR0S0M8dlV1Y2tgS1ZVa3JdPVxfPXw0Q0tBaTNzPDFtX0xyf2JDVlxpNzJnUkAxSmp2PUZJdHBwa1B2ck53TmZkQW1BSjNoNTU3XG88RGBObycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-currencies"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-currencies"}},[n._v("#")]),n._v(" Get Supported Currencies")]),n._v(" "),a("p",[n._v("Returns a list of currency types supported by Turbo")]),n._v(" "),a("p",[a("code",[n._v("/currencies")])]),n._v(" "),a("h4",{attrs:{id:"parameters-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-5"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-4"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/currencies\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "supportedCurrencies": [\n "aud",\n "brl",\n "cad",\n "eur",\n "gbp",\n "hkd",\n "inr",\n "jpy",\n "sgd",\n "usd"\n ],\n "limits": {\n "aud": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "brl": {\n "maximumPaymentAmount": 5000000,\n "minimumPaymentAmount": 5000,\n "suggestedPaymentAmounts": [\n 12500,\n 25000,\n 50000\n ],\n "zeroDecimalCurrency": false\n },\n "cad": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1400,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "eur": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "gbp": {\n "maximumPaymentAmount": 770000,\n "minimumPaymentAmount": 780,\n "suggestedPaymentAmounts": [\n 2000,\n 4000,\n 8000\n ],\n "zeroDecimalCurrency": false\n },\n "hkd": {\n "maximumPaymentAmount": 7800000,\n "minimumPaymentAmount": 7900,\n "suggestedPaymentAmounts": [\n 20000,\n 40000,\n 80000\n ],\n "zeroDecimalCurrency": false\n },\n "inr": {\n "maximumPaymentAmount": 90000000,\n "minimumPaymentAmount": 83000,\n "suggestedPaymentAmounts": [\n 200000,\n 400000,\n 800000\n ],\n "zeroDecimalCurrency": false\n },\n "jpy": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 3500,\n 6500,\n 15000\n ],\n "zeroDecimalCurrency": true\n },\n "sgd": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "usd": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n }\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-countries"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-countries"}},[n._v("#")]),n._v(" Get Supported Countries")]),n._v(" "),a("p",[n._v("Returns a list of countries where Turbo is available")]),n._v(" "),a("p",[a("code",[n._v("/countries")])]),n._v(" "),a("h4",{attrs:{id:"parameters-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-6"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-5"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/countries\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('[\n "United States",\n "United Kingdom",\n "Afghanistan",\n "Albania",\n "Algeria",\n "Andorra",\n "Angola",\n "Antigua and Barbuda",\n "Argentina",\n "Armenia",\n "Australia",\n "Austria",\n "Azerbaijan",\n "Bahamas",\n "Bahrain",\n "Bangladesh",\n "Barbados",\n "Belarus",\n "Belgium",\n "Belize",\n "Benin",\n "Bhutan",\n "Bolivia",\n "Bosnia and Herzegovina",\n "Botswana",\n "Brazil",\n "Brunei",\n "Bulgaria",\n "Burkina Faso",\n "Burundi",\n "Cabo Verde",\n "Cambodia",\n "Cameroon",\n "Canada",\n "Central African Republic",\n "Chad",\n "Chile",\n "China",\n "Colombia",\n "Comoros",\n "Congo",\n "Costa Rica",\n "Cote d\'Ivoire",\n "Croatia",\n "Cyprus",\n "Czech Republic",\n "Democratic Republic of the Congo",\n "Denmark",\n "Djibouti",\n "Dominica",\n "Dominican Republic",\n "East Timor",\n "Ecuador",\n "Egypt",\n "El Salvador",\n "Equatorial Guinea",\n "Eritrea",\n "Estonia",\n "Eswatini",\n "Ethiopia",\n "Fiji",\n "Finland",\n "France",\n "Gabon",\n "Gambia",\n "Georgia",\n "Germany",\n "Ghana",\n "Greece",\n "Grenada",\n "Guatemala",\n "Guinea",\n "Guinea-Bissau",\n "Guyana",\n "Haiti",\n "Honduras",\n "Hungary",\n "Iceland",\n "India",\n "Indonesia",\n "Iraq",\n "Ireland",\n "Israel",\n "Italy",\n "Jamaica",\n "Japan",\n "Jordan",\n "Kazakhstan",\n "Kenya",\n "Kiribati",\n "Kuwait",\n "Kyrgyzstan",\n "Laos",\n "Latvia",\n "Lebanon",\n "Lesotho",\n "Liberia",\n "Libya",\n "Liechtenstein",\n "Lithuania",\n "Luxembourg",\n "Madagascar",\n "Malawi",\n "Malaysia",\n "Maldives",\n "Mali",\n "Malta",\n "Marshall Islands",\n "Mauritania",\n "Mauritius",\n "Mexico",\n "Micronesia",\n "Moldova",\n "Monaco",\n "Mongolia",\n "Montenegro",\n "Morocco",\n "Mozambique",\n "Myanmar",\n "Namibia",\n "Nauru",\n "Nepal",\n "Netherlands",\n "New Zealand",\n "Nicaragua",\n "Niger",\n "Nigeria",\n "North Macedonia",\n "Norway",\n "Oman",\n "Pakistan",\n "Palau",\n "Palestine",\n "Panama",\n "Papua New Guinea",\n "Paraguay",\n "Peru",\n "Philippines",\n "Poland",\n "Portugal",\n "Qatar",\n "Romania",\n "Russia",\n "Rwanda",\n "Saint Kitts and Nevis",\n "Saint Lucia",\n "Saint Vincent and the Grenadines",\n "Samoa",\n "San Marino",\n "Sao Tome and Principe",\n "Saudi Arabia",\n "Senegal",\n "Serbia",\n "Seychelles",\n "Sierra Leone",\n "Singapore",\n "Slovakia",\n "Slovenia",\n "Solomon Islands",\n "Somalia",\n "South Africa",\n "South Korea",\n "South Sudan",\n "Spain",\n "Sri Lanka",\n "Sudan",\n "Suriname",\n "Sweden",\n "Switzerland",\n "Taiwan",\n "Tajikistan",\n "Tanzania",\n "Thailand",\n "Togo",\n "Tonga",\n "Trinidad and Tobago",\n "Tunisia",\n "Turkey",\n "Turkmenistan",\n "Tuvalu",\n "Uganda",\n "Ukraine",\n "United Arab Emirates",\n "Uruguay",\n "Uzbekistan",\n "Vanuatu",\n "Vatican City",\n "Venezuela",\n "Vietnam",\n "Yemen",\n "Zambia",\n "Zimbabwe"\n]\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-conversion-rates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-conversion-rates"}},[n._v("#")]),n._v(" Get Conversion Rates")]),n._v(" "),a("p",[n._v("Returns supported fiat conversion rates for 1GB of storage based on current market prices")]),n._v(" "),a("p",[a("code",[n._v("/rates")])]),n._v(" "),a("h4",{attrs:{id:"parameters-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-7"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-6"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/rates\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "343168912867",\n "fiat": {\n "aud": 3.52873729722864,\n "brl": 11.34598786477272,\n "cad": 3.15729126594135,\n "eur": 2.1569195680425,\n "gbp": 1.8487882011791101,\n "hkd": 18.66938404981161,\n "inr": 196.24591287088242,\n "jpy": 334.744630809484,\n "sgd": 3.16995419882613,\n "usd": 2.39329431522465\n },\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-514753369299"\n }\n ]\n}\n')])])])]),n._v(" "),a("p",[n._v("* required")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{334:function(n,a,e){"use strict";e.r(a);var t=e(10),r=Object(t.a)({},(function(){var n=this,a=n._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":n.$parent.slotKey}},[a("h1",{attrs:{id:"payment-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#payment-api"}},[n._v("#")]),n._v(" Payment API")]),n._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[n._v("#")]),n._v(" Overview")]),n._v(" "),a("p",[n._v('ArDrive offers several API endpoints to help manage and determine costs associated with converting currencies into Turbo credits. The below endpoints offer access to useful information that can help stay in control when uploading data to Arweave using Turbo. "winc" refers to "winston credits", the smallest denomination of a Turbo credit.')]),n._v(" "),a("p",[a("strong",[n._v("Note")]),n._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),a("a",{attrs:{href:"https://payment.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(", or view the raw json for that documentation "),a("a",{attrs:{href:"https://payment.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(".")]),n._v(" "),a("h2",{attrs:{id:"endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#endpoints"}},[n._v("#")]),n._v(" Endpoints")]),n._v(" "),a("p",[n._v("The host url for all below endpoints is:")]),n._v(" "),a("p",[a("code",[n._v("https://payment.ardrive.io/v1")])]),n._v(" "),a("p",[n._v("All of these endpoints use GET requests")]),n._v(" "),a("h3",{attrs:{id:"get-amount-of-credits-for-byte-count"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-amount-of-credits-for-byte-count"}},[n._v("#")]),n._v(" Get Amount of Credits for Byte Count")]),n._v(" "),a("p",[n._v("Returns the current amount of winc it will cost to upload a provided byte count worth of data.")]),n._v(" "),a("p",[a("code",[n._v("/price/bytes/{byteCount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("byteCount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/bytes/5242880\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1676650364",\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-2514975546"\n }\n ]\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-winc-for-payment-type-and-amount"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-winc-for-payment-type-and-amount"}},[n._v("#")]),n._v(" Get winc for Payment Type and Amount")]),n._v(" "),a("p",[n._v("Returns the current amount of winc Turbo will quote for a given payment type and amount.")]),n._v(" "),a("p",[a("code",[n._v("/price/{type}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-2"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("type")]),n._v('*: string - must match a supported currency, such as "usd" - (path)')]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/usd/1000\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1365248226950"\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-current-balance-of-winc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-current-balance-of-winc"}},[n._v("#")]),n._v(" Get Current Balance of winc")]),n._v(" "),a("p",[n._v("use a signed request of a previously obtained JWT to get the signing wallet's current service balance in winc.")]),n._v(" "),a("p",[a("code",[n._v("/balance")])]),n._v(" "),a("h4",{attrs:{id:"parameters-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-3"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("x-signature")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-nonce")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-public-key")]),n._v("*: string - (header)")]),n._v(" "),a("h3",{attrs:{id:"get-quote-for-credits"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-quote-for-credits"}},[n._v("#")]),n._v(" Get Quote for Credits")]),n._v(" "),a("p",[n._v("Gets a quote and payment session for a given payment method, destination address, currency type, and payment amount")]),n._v(" "),a("p",[a("code",[n._v("/top-up/{method}/{address}/{currency}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-4"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("method")]),n._v("*: string - payment-intent | checkout-session - (path)")]),n._v(" "),a("p",[a("code",[n._v("address")]),n._v("*: string - public address of wallet - (path)")]),n._v(" "),a("p",[a("code",[n._v("currency")]),n._v("*: string - must match supported currency, such as usd - (path)")]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - amount of the currency to convert to winc, usd has a minimum transaction amount of 1000 ($10.00) - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-3"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/top-up/checkout-session/cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q/usd/1000\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "topUpQuote": {\n "topUpQuoteId": "54f57b67-4fcf-47fb-85e6-85d4a8c96f25",\n "destinationAddressType": "arweave",\n "paymentAmount": 1000,\n "winstonCreditAmount": "1360424028269",\n "destinationAddress": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "currencyType": "usd",\n "quoteExpirationDate": "2023-07-27T01:56:26.436Z",\n "paymentProvider": "stripe"\n },\n "paymentSession": {\n "id": "cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51",\n "object": "checkout.session",\n "after_expiration": null,\n "allow_promotion_codes": null,\n "amount_subtotal": 1000,\n "amount_total": 1000,\n "automatic_tax": {\n "enabled": false,\n "status": null\n },\n "billing_address_collection": null,\n "cancel_url": "https://app.ardrive.io",\n "client_reference_id": null,\n "consent": null,\n "consent_collection": null,\n "created": 1690422686,\n "currency": "usd",\n "currency_conversion": null,\n "custom_fields": [],\n "custom_text": {\n "shipping_address": null,\n "submit": null\n },\n "customer": null,\n "customer_creation": "if_required",\n "customer_details": null,\n "customer_email": null,\n "expires_at": 1690509086,\n "invoice": null,\n "invoice_creation": {\n "enabled": false,\n "invoice_data": {\n "account_tax_ids": null,\n "custom_fields": null,\n "description": null,\n "footer": null,\n "metadata": {},\n "rendering_options": null\n }\n },\n "livemode": true,\n "locale": null,\n "metadata": {},\n "mode": "payment",\n "payment_intent": null,\n "payment_link": null,\n "payment_method_collection": "always",\n "payment_method_options": {},\n "payment_method_types": [\n "card"\n ],\n "payment_status": "unpaid",\n "phone_number_collection": {\n "enabled": false\n },\n "recovered_from": null,\n "setup_intent": null,\n "shipping_address_collection": null,\n "shipping_cost": null,\n "shipping_details": null,\n "shipping_options": [],\n "status": "open",\n "submit_type": null,\n "subscription": null,\n "success_url": "https://app.ardrive.io",\n "total_details": {\n "amount_discount": 0,\n "amount_shipping": 0,\n "amount_tax": 0\n },\n "url": "https://checkout.stripe.com/c/pay/cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51#fidkdWxOYHwnPyd1blppbHNgWjA0T1BEcXJGPWR1VUpSbkFJSFR0S0M8dlV1Y2tgS1ZVa3JdPVxfPXw0Q0tBaTNzPDFtX0xyf2JDVlxpNzJnUkAxSmp2PUZJdHBwa1B2ck53TmZkQW1BSjNoNTU3XG88RGBObycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-currencies"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-currencies"}},[n._v("#")]),n._v(" Get Supported Currencies")]),n._v(" "),a("p",[n._v("Returns a list of currency types supported by Turbo")]),n._v(" "),a("p",[a("code",[n._v("/currencies")])]),n._v(" "),a("h4",{attrs:{id:"parameters-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-5"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-4"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/currencies\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "supportedCurrencies": [\n "aud",\n "brl",\n "cad",\n "eur",\n "gbp",\n "hkd",\n "inr",\n "jpy",\n "sgd",\n "usd"\n ],\n "limits": {\n "aud": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "brl": {\n "maximumPaymentAmount": 5000000,\n "minimumPaymentAmount": 5000,\n "suggestedPaymentAmounts": [\n 12500,\n 25000,\n 50000\n ],\n "zeroDecimalCurrency": false\n },\n "cad": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1400,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "eur": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "gbp": {\n "maximumPaymentAmount": 770000,\n "minimumPaymentAmount": 780,\n "suggestedPaymentAmounts": [\n 2000,\n 4000,\n 8000\n ],\n "zeroDecimalCurrency": false\n },\n "hkd": {\n "maximumPaymentAmount": 7800000,\n "minimumPaymentAmount": 7900,\n "suggestedPaymentAmounts": [\n 20000,\n 40000,\n 80000\n ],\n "zeroDecimalCurrency": false\n },\n "inr": {\n "maximumPaymentAmount": 90000000,\n "minimumPaymentAmount": 83000,\n "suggestedPaymentAmounts": [\n 200000,\n 400000,\n 800000\n ],\n "zeroDecimalCurrency": false\n },\n "jpy": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 3500,\n 6500,\n 15000\n ],\n "zeroDecimalCurrency": true\n },\n "sgd": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "usd": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n }\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-countries"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-countries"}},[n._v("#")]),n._v(" Get Supported Countries")]),n._v(" "),a("p",[n._v("Returns a list of countries where Turbo is available")]),n._v(" "),a("p",[a("code",[n._v("/countries")])]),n._v(" "),a("h4",{attrs:{id:"parameters-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-6"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-5"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/countries\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('[\n "United States",\n "United Kingdom",\n "Afghanistan",\n "Albania",\n "Algeria",\n "Andorra",\n "Angola",\n "Antigua and Barbuda",\n "Argentina",\n "Armenia",\n "Australia",\n "Austria",\n "Azerbaijan",\n "Bahamas",\n "Bahrain",\n "Bangladesh",\n "Barbados",\n "Belarus",\n "Belgium",\n "Belize",\n "Benin",\n "Bhutan",\n "Bolivia",\n "Bosnia and Herzegovina",\n "Botswana",\n "Brazil",\n "Brunei",\n "Bulgaria",\n "Burkina Faso",\n "Burundi",\n "Cabo Verde",\n "Cambodia",\n "Cameroon",\n "Canada",\n "Central African Republic",\n "Chad",\n "Chile",\n "China",\n "Colombia",\n "Comoros",\n "Congo",\n "Costa Rica",\n "Cote d\'Ivoire",\n "Croatia",\n "Cyprus",\n "Czech Republic",\n "Democratic Republic of the Congo",\n "Denmark",\n "Djibouti",\n "Dominica",\n "Dominican Republic",\n "East Timor",\n "Ecuador",\n "Egypt",\n "El Salvador",\n "Equatorial Guinea",\n "Eritrea",\n "Estonia",\n "Eswatini",\n "Ethiopia",\n "Fiji",\n "Finland",\n "France",\n "Gabon",\n "Gambia",\n "Georgia",\n "Germany",\n "Ghana",\n "Greece",\n "Grenada",\n "Guatemala",\n "Guinea",\n "Guinea-Bissau",\n "Guyana",\n "Haiti",\n "Honduras",\n "Hungary",\n "Iceland",\n "India",\n "Indonesia",\n "Iraq",\n "Ireland",\n "Israel",\n "Italy",\n "Jamaica",\n "Japan",\n "Jordan",\n "Kazakhstan",\n "Kenya",\n "Kiribati",\n "Kuwait",\n "Kyrgyzstan",\n "Laos",\n "Latvia",\n "Lebanon",\n "Lesotho",\n "Liberia",\n "Libya",\n "Liechtenstein",\n "Lithuania",\n "Luxembourg",\n "Madagascar",\n "Malawi",\n "Malaysia",\n "Maldives",\n "Mali",\n "Malta",\n "Marshall Islands",\n "Mauritania",\n "Mauritius",\n "Mexico",\n "Micronesia",\n "Moldova",\n "Monaco",\n "Mongolia",\n "Montenegro",\n "Morocco",\n "Mozambique",\n "Myanmar",\n "Namibia",\n "Nauru",\n "Nepal",\n "Netherlands",\n "New Zealand",\n "Nicaragua",\n "Niger",\n "Nigeria",\n "North Macedonia",\n "Norway",\n "Oman",\n "Pakistan",\n "Palau",\n "Palestine",\n "Panama",\n "Papua New Guinea",\n "Paraguay",\n "Peru",\n "Philippines",\n "Poland",\n "Portugal",\n "Qatar",\n "Romania",\n "Russia",\n "Rwanda",\n "Saint Kitts and Nevis",\n "Saint Lucia",\n "Saint Vincent and the Grenadines",\n "Samoa",\n "San Marino",\n "Sao Tome and Principe",\n "Saudi Arabia",\n "Senegal",\n "Serbia",\n "Seychelles",\n "Sierra Leone",\n "Singapore",\n "Slovakia",\n "Slovenia",\n "Solomon Islands",\n "Somalia",\n "South Africa",\n "South Korea",\n "South Sudan",\n "Spain",\n "Sri Lanka",\n "Sudan",\n "Suriname",\n "Sweden",\n "Switzerland",\n "Taiwan",\n "Tajikistan",\n "Tanzania",\n "Thailand",\n "Togo",\n "Tonga",\n "Trinidad and Tobago",\n "Tunisia",\n "Turkey",\n "Turkmenistan",\n "Tuvalu",\n "Uganda",\n "Ukraine",\n "United Arab Emirates",\n "Uruguay",\n "Uzbekistan",\n "Vanuatu",\n "Vatican City",\n "Venezuela",\n "Vietnam",\n "Yemen",\n "Zambia",\n "Zimbabwe"\n]\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-conversion-rates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-conversion-rates"}},[n._v("#")]),n._v(" Get Conversion Rates")]),n._v(" "),a("p",[n._v("Returns supported fiat conversion rates for 1GB of storage based on current market prices")]),n._v(" "),a("p",[a("code",[n._v("/rates")])]),n._v(" "),a("h4",{attrs:{id:"parameters-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-7"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-6"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/rates\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "343168912867",\n "fiat": {\n "aud": 3.52873729722864,\n "brl": 11.34598786477272,\n "cad": 3.15729126594135,\n "eur": 2.1569195680425,\n "gbp": 1.8487882011791101,\n "hkd": 18.66938404981161,\n "inr": 196.24591287088242,\n "jpy": 334.744630809484,\n "sgd": 3.16995419882613,\n "usd": 2.39329431522465\n },\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-514753369299"\n }\n ]\n}\n')])])])]),n._v(" "),a("p",[n._v("* required")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/40.67c4ab0c.js b/assets/js/40.4e87f60e.js similarity index 98% rename from assets/js/40.67c4ab0c.js rename to assets/js/40.4e87f60e.js index 06ccfb8..a16861c 100644 --- a/assets/js/40.67c4ab0c.js +++ b/assets/js/40.4e87f60e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{333:function(e,t,a){"use strict";a.r(t);var n=a(10),s=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"upload-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upload-api"}},[e._v("#")]),e._v(" Upload API")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The Turbo Upload Service supports payment for signed data-items to upload.ardrive.io using Turbo Credits. An API endpoint has been created to facilitate the payments. A signed data-item can be posted to upload.ardrive.io using the below schema.")]),e._v(" "),t("p",[t("strong",[e._v("Note")]),e._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),t("a",{attrs:{href:"https://upload.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", or view the raw json for that documentation "),t("a",{attrs:{href:"https://upload.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"endpoint"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#endpoint"}},[e._v("#")]),e._v(" Endpoint")]),e._v(" "),t("p",[t("code",[e._v("https://upload.ardrive.io/v1/tx")])]),e._v(" "),t("h2",{attrs:{id:"schema"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#schema"}},[e._v("#")]),e._v(" Schema")]),e._v(" "),t("h3",{attrs:{id:"headers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#headers"}},[e._v("#")]),e._v(" Headers")]),e._v(" "),t("p",[t("code",[e._v("content-type")]),e._v('*: "application/octet-stream"')]),e._v(" "),t("p",[t("code",[e._v("accept")]),e._v('*: string - media type, such as "application/json"')]),e._v(" "),t("h3",{attrs:{id:"body"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#body"}},[e._v("#")]),e._v(" Body")]),e._v(" "),t("p",[e._v("The body of your request should contain a signed data-item.")]),e._v(" "),t("p",[e._v("Data-items can be created and signed with the arbundles library, following the below example.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('// Initiates the arbundles Arweave signer with your wallet\nconst signer = new ArweaveSigner(jwk);\n\n// Sets the data you would like to use to create a data-item\nconst data = "Any value can Go here";\n\n// Creates a data-item using your data and the Arweave Signer\nconst dataItem = createData(data, signer);\n\n// Signs the data-item\nawait dataItem.sign(signer);\n\n')])])]),t("p",[e._v("In this example, the variable "),t("code",[e._v("dataItem")]),e._v(" is what should be sent in your api post request in order to finalize and pay for the upload using Turbo Credits. "),t("code",[e._v("dataItem.sign()")]),e._v(" is a mutating method, so there is no need to create a separate variable to hold the results of signing the data-item.")]),e._v(" "),t("h3",{attrs:{id:"response"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#response"}},[e._v("#")]),e._v(" Response")]),e._v(" "),t("details",[t("summary",[e._v("Headers")]),e._v("\n```\n access-control-allow-methods: PUT,GET,HEAD,POST,DELETE,OPTIONS \n access-control-allow-origin: https://upload.ardrive.io \n content-length: 173 \n content-security-policy: frame-ancestors 'none'; default-src 'self'; img-src data: https:; script-src 'self' 'unsafe-inline' https:; style-src 'unsafe-inline' https:; object-src 'none'; font-src 'self' https:; \n content-type: application/json; charset=utf-8 \n date: Thu,27 Jul 2023 22:06:33 GMT \n strict-transport-security: max-age=3600; includeSubDomains; preload \n vary: Origin \n via: 1.1 d0d53eedec01ac540f737b5fafb16436.cloudfront.net (CloudFront) \n x-amz-cf-id: eypqkKDp-ADDMHmBOp3UQzDK4gZ8iYE8fbmYAyZjfyR3Cj8gevgF6g== \n x-amz-cf-pop: IAD12-P3 \n x-cache: Miss from cloudfront \n x-content-type-options: nosniff \n x-frame-options: SAMEORIGIN \n x-xss-protection: 1; mode=block \n```\n")]),e._v(" "),t("details",[t("summary",[e._v("Body")]),e._v('\n```\n{\n "id": "1wk8nyVTHTHpbmEZ-IGNsGcro4og8XXVbBhHvMFxUgQ",\n "owner": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "dataCaches": [\n "arweave.net"\n ],\n "fastFinalityIndexes": [\n "arweave.net"\n ]\n}\n```\n')]),e._v(" "),t("p",[e._v("* required")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{337:function(e,t,a){"use strict";a.r(t);var n=a(10),s=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"upload-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upload-api"}},[e._v("#")]),e._v(" Upload API")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The Turbo Upload Service supports payment for signed data-items to upload.ardrive.io using Turbo Credits. An API endpoint has been created to facilitate the payments. A signed data-item can be posted to upload.ardrive.io using the below schema.")]),e._v(" "),t("p",[t("strong",[e._v("Note")]),e._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),t("a",{attrs:{href:"https://upload.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", or view the raw json for that documentation "),t("a",{attrs:{href:"https://upload.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"endpoint"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#endpoint"}},[e._v("#")]),e._v(" Endpoint")]),e._v(" "),t("p",[t("code",[e._v("https://upload.ardrive.io/v1/tx")])]),e._v(" "),t("h2",{attrs:{id:"schema"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#schema"}},[e._v("#")]),e._v(" Schema")]),e._v(" "),t("h3",{attrs:{id:"headers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#headers"}},[e._v("#")]),e._v(" Headers")]),e._v(" "),t("p",[t("code",[e._v("content-type")]),e._v('*: "application/octet-stream"')]),e._v(" "),t("p",[t("code",[e._v("accept")]),e._v('*: string - media type, such as "application/json"')]),e._v(" "),t("h3",{attrs:{id:"body"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#body"}},[e._v("#")]),e._v(" Body")]),e._v(" "),t("p",[e._v("The body of your request should contain a signed data-item.")]),e._v(" "),t("p",[e._v("Data-items can be created and signed with the arbundles library, following the below example.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('// Initiates the arbundles Arweave signer with your wallet\nconst signer = new ArweaveSigner(jwk);\n\n// Sets the data you would like to use to create a data-item\nconst data = "Any value can Go here";\n\n// Creates a data-item using your data and the Arweave Signer\nconst dataItem = createData(data, signer);\n\n// Signs the data-item\nawait dataItem.sign(signer);\n\n')])])]),t("p",[e._v("In this example, the variable "),t("code",[e._v("dataItem")]),e._v(" is what should be sent in your api post request in order to finalize and pay for the upload using Turbo Credits. "),t("code",[e._v("dataItem.sign()")]),e._v(" is a mutating method, so there is no need to create a separate variable to hold the results of signing the data-item.")]),e._v(" "),t("h3",{attrs:{id:"response"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#response"}},[e._v("#")]),e._v(" Response")]),e._v(" "),t("details",[t("summary",[e._v("Headers")]),e._v("\n```\n access-control-allow-methods: PUT,GET,HEAD,POST,DELETE,OPTIONS \n access-control-allow-origin: https://upload.ardrive.io \n content-length: 173 \n content-security-policy: frame-ancestors 'none'; default-src 'self'; img-src data: https:; script-src 'self' 'unsafe-inline' https:; style-src 'unsafe-inline' https:; object-src 'none'; font-src 'self' https:; \n content-type: application/json; charset=utf-8 \n date: Thu,27 Jul 2023 22:06:33 GMT \n strict-transport-security: max-age=3600; includeSubDomains; preload \n vary: Origin \n via: 1.1 d0d53eedec01ac540f737b5fafb16436.cloudfront.net (CloudFront) \n x-amz-cf-id: eypqkKDp-ADDMHmBOp3UQzDK4gZ8iYE8fbmYAyZjfyR3Cj8gevgF6g== \n x-amz-cf-pop: IAD12-P3 \n x-cache: Miss from cloudfront \n x-content-type-options: nosniff \n x-frame-options: SAMEORIGIN \n x-xss-protection: 1; mode=block \n```\n")]),e._v(" "),t("details",[t("summary",[e._v("Body")]),e._v('\n```\n{\n "id": "1wk8nyVTHTHpbmEZ-IGNsGcro4og8XXVbBhHvMFxUgQ",\n "owner": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "dataCaches": [\n "arweave.net"\n ],\n "fastFinalityIndexes": [\n "arweave.net"\n ]\n}\n```\n')]),e._v(" "),t("p",[e._v("* required")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/41.112069e8.js b/assets/js/41.feeb8e2b.js similarity index 99% rename from assets/js/41.112069e8.js rename to assets/js/41.feeb8e2b.js index b96e52d..ca2d336 100644 --- a/assets/js/41.112069e8.js +++ b/assets/js/41.feeb8e2b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{334:function(t,s,a){"use strict";a.r(s);var e=a(10),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"migrating-to-turbo-from-irys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#migrating-to-turbo-from-irys"}},[t._v("#")]),t._v(" Migrating to Turbo From Irys")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Irys Version Management")]),t._v(" "),s("p",[t._v("This was tested using Irys SDK v0.1.1 Future versions of the Irys SDK, and by extension the Irys CLI, may introduce breaking changes. It is suggested that developers lock their version.")])]),t._v(" "),s("h2",{attrs:{id:"overview"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),s("p",[t._v("In the interest of maintaining robust and decentralized infrastructure throughout the Arweave community, it is important to provide options and alternatives to single points of potential failure. With this in mind, ArDrive Turbo provides an Irys-compatible API, allowing for simple migrations across services if desired.")]),t._v(" "),s("h2",{attrs:{id:"using-irys-sdk-with-turbo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#using-irys-sdk-with-turbo"}},[t._v("#")]),t._v(" Using Irys SDK with Turbo")]),t._v(" "),s("p",[t._v("ArDrive Turbo can be selected as the upload method for projects that currently use the Irys SDK by setting the "),s("code",[t._v("url")]),t._v(" value to "),s("code",[t._v("https://turbo.ardrive.io")]),t._v(" when instantiating the Irys instance:")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// import Irys as normal")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Irys "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@irys/sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// load Arweave wallet")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n fs\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("readFileSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Keyfile.json"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("init")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" token "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" irys "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Irys")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("url")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://turbo.ardrive.io"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// URL of the node you want to connect to, https://turbo.ardrive.io will facilitate upload using ArDrive Turbo.")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Token used for payment and signing")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("key")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Arweave wallet")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" receipt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" irys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("upload")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file/to/upload"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receipt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"using-irys-cli-with-turbo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#using-irys-cli-with-turbo"}},[t._v("#")]),t._v(" Using Irys CLI with Turbo")]),t._v(" "),s("p",[t._v("Selecting Turbo as the upload method using the Irys CLI is similarly simple. "),s("code",[t._v("https://turbo.ardrive.io")]),t._v(" can be set as the target node when using the "),s("code",[t._v("upload")]),t._v(" or "),s("code",[t._v("upload-dir")]),t._v(" CLI commands with the "),s("code",[t._v("-h")]),t._v(" flag:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("irys upload importantFile.pdf -h https://turbo.ardrive.io --tags superImportant needsPermanence\n")])])]),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("irys upload-dir ./bigFolder -h https://turbo.ardrive.io \n")])])]),s("p",[t._v("Other flags may be used as normal")]),t._v(" "),s("h2",{attrs:{id:"differences"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#differences"}},[t._v("#")]),t._v(" Differences")]),t._v(" "),s("h3",{attrs:{id:"crypto-top-ups-withdrawals"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#crypto-top-ups-withdrawals"}},[t._v("#")]),t._v(" Crypto Top Ups / Withdrawals")]),t._v(" "),s("p",[t._v("Turbo does not natively support block chains other than Arweave. This means that some features dealing with other chains, like topping up your Irys balance with other coins, or withdrawing from your Irys balance are not "),s("em",[t._v("currently")]),t._v(" supported.")]),t._v(" "),s("h2",{attrs:{id:"wallet-extensions-and-providers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wallet-extensions-and-providers"}},[t._v("#")]),t._v(" Wallet Extensions and Providers")]),t._v(" "),s("p",[t._v("Turbo is not "),s("em",[t._v("yet")]),t._v(" designed to interact with wallet extensions and providers that are not a part of the Arweave ecosystem. While the ArDrive Web App does support generating an Arweave wallet from an EVM wallet using Metamask, Turbo cannot facilitate uploading using an EVM wallet directly.")]),t._v(" "),s("h2",{attrs:{id:"graphql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#graphql"}},[t._v("#")]),t._v(" GraphQL")]),t._v(" "),s("p",[t._v("Projects that do claim to allow uploading from non-arweave wallets actually accept payment on their front ends and handle the actual uploading using an Arweave wallet. As such, the "),s("code",[t._v("owner")]),t._v(" of an upload will not match the non-arweave wallet address and the upload cannot be found by searching for it in GraphQL. This value can, however, be added as a tag on the upload and searched in that way.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{335:function(t,s,a){"use strict";a.r(s);var e=a(10),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"migrating-to-turbo-from-irys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#migrating-to-turbo-from-irys"}},[t._v("#")]),t._v(" Migrating to Turbo From Irys")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Irys Version Management")]),t._v(" "),s("p",[t._v("This was tested using Irys SDK v0.1.1 Future versions of the Irys SDK, and by extension the Irys CLI, may introduce breaking changes. It is suggested that developers lock their version.")])]),t._v(" "),s("h2",{attrs:{id:"overview"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),s("p",[t._v("In the interest of maintaining robust and decentralized infrastructure throughout the Arweave community, it is important to provide options and alternatives to single points of potential failure. With this in mind, ArDrive Turbo provides an Irys-compatible API, allowing for simple migrations across services if desired.")]),t._v(" "),s("h2",{attrs:{id:"using-irys-sdk-with-turbo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#using-irys-sdk-with-turbo"}},[t._v("#")]),t._v(" Using Irys SDK with Turbo")]),t._v(" "),s("p",[t._v("ArDrive Turbo can be selected as the upload method for projects that currently use the Irys SDK by setting the "),s("code",[t._v("url")]),t._v(" value to "),s("code",[t._v("https://turbo.ardrive.io")]),t._v(" when instantiating the Irys instance:")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// import Irys as normal")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Irys "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@irys/sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// load Arweave wallet")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n fs\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("readFileSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Keyfile.json"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("init")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" token "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" irys "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Irys")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("url")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://turbo.ardrive.io"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// URL of the node you want to connect to, https://turbo.ardrive.io will facilitate upload using ArDrive Turbo.")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Token used for payment and signing")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("key")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Arweave wallet")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" receipt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" irys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("upload")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file/to/upload"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receipt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"using-irys-cli-with-turbo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#using-irys-cli-with-turbo"}},[t._v("#")]),t._v(" Using Irys CLI with Turbo")]),t._v(" "),s("p",[t._v("Selecting Turbo as the upload method using the Irys CLI is similarly simple. "),s("code",[t._v("https://turbo.ardrive.io")]),t._v(" can be set as the target node when using the "),s("code",[t._v("upload")]),t._v(" or "),s("code",[t._v("upload-dir")]),t._v(" CLI commands with the "),s("code",[t._v("-h")]),t._v(" flag:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("irys upload importantFile.pdf -h https://turbo.ardrive.io --tags superImportant needsPermanence\n")])])]),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("irys upload-dir ./bigFolder -h https://turbo.ardrive.io \n")])])]),s("p",[t._v("Other flags may be used as normal")]),t._v(" "),s("h2",{attrs:{id:"differences"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#differences"}},[t._v("#")]),t._v(" Differences")]),t._v(" "),s("h3",{attrs:{id:"crypto-top-ups-withdrawals"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#crypto-top-ups-withdrawals"}},[t._v("#")]),t._v(" Crypto Top Ups / Withdrawals")]),t._v(" "),s("p",[t._v("Turbo does not natively support block chains other than Arweave. This means that some features dealing with other chains, like topping up your Irys balance with other coins, or withdrawing from your Irys balance are not "),s("em",[t._v("currently")]),t._v(" supported.")]),t._v(" "),s("h2",{attrs:{id:"wallet-extensions-and-providers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wallet-extensions-and-providers"}},[t._v("#")]),t._v(" Wallet Extensions and Providers")]),t._v(" "),s("p",[t._v("Turbo is not "),s("em",[t._v("yet")]),t._v(" designed to interact with wallet extensions and providers that are not a part of the Arweave ecosystem. While the ArDrive Web App does support generating an Arweave wallet from an EVM wallet using Metamask, Turbo cannot facilitate uploading using an EVM wallet directly.")]),t._v(" "),s("h2",{attrs:{id:"graphql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#graphql"}},[t._v("#")]),t._v(" GraphQL")]),t._v(" "),s("p",[t._v("Projects that do claim to allow uploading from non-arweave wallets actually accept payment on their front ends and handle the actual uploading using an Arweave wallet. As such, the "),s("code",[t._v("owner")]),t._v(" of an upload will not match the non-arweave wallet address and the upload cannot be found by searching for it in GraphQL. This value can, however, be added as a tag on the upload and searched in that way.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/42.5c4b580c.js b/assets/js/42.5c4b580c.js new file mode 100644 index 0000000..d72c635 --- /dev/null +++ b/assets/js/42.5c4b580c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{336:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"ardriveapp-turbo-sdk-πŸš€"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ardriveapp-turbo-sdk-πŸš€"}},[t._v("#")]),t._v(" @ardriveapp/turbo-sdk πŸš€")]),t._v(" "),s("p",[t._v("Welcome to the "),s("code",[t._v("@ardrive/turbo-sdk")]),t._v("! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.")]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("h2",{attrs:{id:"quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quick-start"}},[t._v("#")]),t._v(" Quick Start")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// load your JWK from a file or generate a new one")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("readFileSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-jwk.json'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("jwkToAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the wallet balance")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// prep file for upload")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-image.png'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the cost of uploading the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// check if balance greater than upload cost")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add a promo code if you have one")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// open the URL to top-up, continue when done")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n fileStreamFactory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n fileSizeFactory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload complete!")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Successfully upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload failed")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("error")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Failed to upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("finally")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" newBalance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'New balance:'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" newBalance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[t._v("The SDK is provided in both CommonJS and ESM formats, and it's compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriate named exports provided by this SDK's [package.json] based on your project's configuration. Refer to the [examples] directory to see how to use the SDK in various environments.")]),t._v(" "),s("h3",{attrs:{id:"web"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#web"}},[t._v("#")]),t._v(" Web")]),t._v(" "),s("h4",{attrs:{id:"bundlers-webpack-rollup-esbuild-etc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundlers-webpack-rollup-esbuild-etc"}},[t._v("#")]),t._v(" Bundlers (Webpack, Rollup, ESbuild, etc.)")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"browser"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#browser"}},[t._v("#")]),t._v(" Browser")]),t._v(" "),s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("module"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token script"}},[s("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://unpkg.com/@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),s("h3",{attrs:{id:"nodejs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nodejs"}},[t._v("#")]),t._v(" NodeJS")]),t._v(" "),s("h4",{attrs:{id:"commonjs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#commonjs"}},[t._v("#")]),t._v(" CommonJS")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commonjs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ts-node ./index.ts"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"latest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.14.4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"typescript"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^5.4.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^10.9.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CommonJS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"target"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ES2021"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"esModuleInterop"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"include"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./index.ts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exclude"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node_modules"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WinstonToTokenAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Arweave "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Generate a key from the arweave wallet.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arweave "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arweave")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Use the arweave key to create an authenticated turbo client\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turboAuthClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("privateKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the balance for the private key.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Balance:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the estimated amount of winc returned for 10 USD (1000 cents).\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" estimatedWinc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("amount")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10 USD to winc:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" estimatedWinc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Post local files to the Turbo service.\n */")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Posting raw file to Turbo service..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../files/1KB_file"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("signal")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("uploadResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Tops up a wallet with Credits using tokens.\n * Default token is AR, using Winston as the unit.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" topUpResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("tokenAmount")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("topUpResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"esm"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#esm"}},[t._v("#")]),t._v(" ESM")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ts-node ./index.ts"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"latest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.14.4"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^10.9.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"target"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ESNext"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"include"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./index.ts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exclude"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node_modules"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"esm"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or use @ardrive/turbo-sdk/web depending on your environment")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WinstonToTokenAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/node"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Arweave "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Generate a key from the arweave wallet.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arweave "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arweave")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Use the arweave key to create an authenticated turbo client\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turboAuthClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the balance for the private key.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Balance:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the estimated amount of winc returned for 10 USD (1000 cents).\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" estimatedWinc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10 USD to winc:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" estimatedWinc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Post local files to the Turbo service.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Posting raw file to Turbo service..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("URL")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../files/1KB_file"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("meta"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pathname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n signal"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("uploadResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Tops up a wallet with Credits using tokens.\n * Default token is AR, using Winston as the unit.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" topUpResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("topUpResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"typescript"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#typescript"}},[t._v("#")]),t._v(" Typescript")]),t._v(" "),s("p",[t._v("The SDK provides TypeScript types. When you import the SDK in a TypeScript project:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/web"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or '@ardrive/turbo-sdk/node' for Node.js projects")]),t._v("\n")])])]),s("p",[t._v("Types are exported from "),s("code",[t._v("./lib/types/[node/web]/index.d.ts")]),t._v(" and should be automatically recognized, offering benefits such as type-checking and autocompletion.")]),t._v(" "),s("h2",{attrs:{id:"apis"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#apis"}},[t._v("#")]),t._v(" APIs")]),t._v(" "),s("h3",{attrs:{id:"turbofactory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbofactory"}},[t._v("#")]),t._v(" TurboFactory")]),t._v(" "),s("ul",[s("li",[s("p",[s("code",[t._v("unauthenticated()")]),t._v(" - Creates an instance of a client that accesses Turbo's unauthenticated services.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("authenticated()")]),t._v(" - Creates an instance of a client that accesses Turbo's authenticated and unauthenticated services.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("crypto"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateJWK")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"turbounauthenticatedclient"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbounauthenticatedclient"}},[t._v("#")]),t._v(" TurboUnauthenticatedClient")]),t._v(" "),s("ul",[s("li",[s("p",[s("code",[t._v("getSupportedCurrencies()")]),t._v(" - Returns the list of currencies supported by the Turbo Payment Service for topping up a user balance of AR Credits (measured in Winston Credits, or winc).")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" currencies "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCurrencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getSupportedCountries()")]),t._v(" - Returns the list of countries supported by the Turbo Payment Service's top up workflow.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" countries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCountries")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getFiatToAR({ currency })")]),t._v(" - Returns the current raw fiat to AR conversion rate for a specific currency as reported by third-party pricing oracles.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fiatToAR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatToAR")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" currency"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"USD"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getFiatRates()")]),t._v(" - Returns the current fiat rates for 1 GiB of data for supported currencies, including all top-up adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getWincForFiat({ amount })")]),t._v(" - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount. To leverage promo codes, see [TurboAuthenticatedClient].")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getUploadCosts({ bytes })")]),t._v(" - Returns the estimated cost in Winston Credits for the provided file sizes, including all upload adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1024")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("uploadSignedDataItem({ dataItemStreamFactory, dataItemSizeFactory, signal })")]),t._v(" - Uploads a signed data item. The provided "),s("code",[t._v("dataItemStreamFactory")]),t._v(" should produce a NEW signed data item stream each time is it invoked. The "),s("code",[t._v("dataItemSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional [AbortSignal] that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./my-signed-data-item"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" dataItemSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResponse "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadSignedDataItem")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" dataItemSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n signal"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("createCheckoutSession({ amount, owner })")]),t._v(" - Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner. The returned URL can be opened in the browser, all payments are processed by Stripe. To leverage promo codes, see [TurboAuthenticatedClient].")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"darwin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"win32"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("submitFundTransaction({ txId})")]),t._v(" - Submits the transaction ID of a funding transaction to Turbo Payment Service for top up processing. The "),s("code",[t._v("txId")]),t._v(" is the transaction ID of the transaction to be submitted.")]),t._v(" "),s("ul",[s("li",[t._v("Note: use this API if you've already executed your token transfer to the Turbo wallet. Otherwise, consider using "),s("code",[t._v("topUpWithTokens")]),t._v(" to execute a new token transfer to the Turbo wallet and submit its resulting transaction ID for top up processing all in one go.")])]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// defaults to arweave token type")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("submitFundTransaction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n txId"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my-valid-arweave-fund-transaction-id"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("\n### TurboAuthenticatedClient\n\n- `getBalance()` - Issues a signed request to get the credit balance of a wallet measured in AR (measured in Winston Credits, or winc).\n\n ```typescript\n const { winc: balance } = await turbo.getBalance();\n")])])]),s("ul",[s("li",[s("p",[s("code",[t._v("getWincForFiat({ amount, promoCodes })")]),t._v(" - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount, and optional promo codes.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MY_PROMO_CODE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("createCheckoutSession({ amount, owner, promoCodes })")]),t._v(" - Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner, and optional promo codes. The returned URL can be opened in the browser, all payments are processed by Stripe. Promo codes require an authenticated client.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MY_PROMO_CODE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"darwin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"win32"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("uploadFile({ fileStreamFactory, fileSizeFactory, signal })")]),t._v(" - Signs and uploads a raw file. The provided "),s("code",[t._v("fileStreamFactory")]),t._v(" should produce a NEW file data stream each time is it invoked. The "),s("code",[t._v("fileSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional [AbortSignal] that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./my-unsigned-file.txt"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stateSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no timeout or AbortSignal provided")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("topUpWithTokens({ tokenAmount, feeMultiplier })")]),t._v(" - Tops up the connected wallet with Credits by submitting a payment transaction for the token amount to the Turbo wallet and then submitting that transaction ID to Turbo Payment Service for top up processing.")]),t._v(" "),s("ul",[s("li",[t._v("The "),s("code",[t._v("tokenAmount")]),t._v(" is the amount of tokens in the token type's smallest unit value (e.g: Winston for arweave token type) to fund the wallet with.\n"),s("ul",[s("li",[t._v("Note: As of release 1.5.0, only AR tokens are supported with "),s("code",[t._v("topUpWithTokens")]),t._v(".")])])]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("feeMultiplier")]),t._v(" (optional) is the multiplier to apply to the reward for the transaction to modify its chances of being mined. Credits will be added to the wallet balance after the transaction is confirmed on the given blockchain. Defaults to 1.0, meaning no multiplier.")])]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("p",[t._v("const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({\ntokenAmount: WinstonToTokenAmount(100_000_000), // 0.0001 AR\nfeeMultiplier: 1.1, // 10% increase in reward for improved mining chances\n});")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("\n## Contributions\n\nIf you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are both welcome and encouraged.\n\n[package.json]: https://github.com/ardriveapp/turbo-sdk/blob/main/package.json\n[examples]: https://github.com/ardriveapp/turbo-sdk/tree/main/examples\n[TurboAuthenticatedClient]: #turboauthenticatedclient\n[AbortSignal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/42.c47ef325.js b/assets/js/42.c47ef325.js deleted file mode 100644 index 2b958be..0000000 --- a/assets/js/42.c47ef325.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{335:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"ardriveapp-turbo-sdk-πŸš€"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ardriveapp-turbo-sdk-πŸš€"}},[t._v("#")]),t._v(" @ardriveapp/turbo-sdk πŸš€")]),t._v(" "),s("p",[t._v("Welcome to the "),s("code",[t._v("@ardrive/turbo-sdk")]),t._v("! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.")]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("h2",{attrs:{id:"quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quick-start"}},[t._v("#")]),t._v(" Quick Start")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// load your JWK from a file or generate a new one")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("readFileSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-jwk.json'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("jwkToAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the wallet balance")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// prep file for upload")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-image.png'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the cost of uploading the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// check if balance greater than upload cost")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add a promo code if you have one")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// open the URL to top-up, continue when done")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n fileStreamFactory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n fileSizeFactory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload complete!")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Successfully upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload failed")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("error")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Failed to upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("finally")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" newBalance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'New balance:'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" newBalance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[t._v("The SDK is provided in both CommonJS and ESM formats, and it's compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriate named exports provided by this SDK's "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/blob/main/package.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("package.json"),s("OutboundLink")],1),t._v(" based on your project's configuration. Refer to the "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/tree/main/examples",target:"_blank",rel:"noopener noreferrer"}},[t._v("examples"),s("OutboundLink")],1),t._v(" directory to see how to use the SDK in various environments.")]),t._v(" "),s("h3",{attrs:{id:"web"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#web"}},[t._v("#")]),t._v(" Web")]),t._v(" "),s("h4",{attrs:{id:"bundlers-webpack-rollup-esbuild-etc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundlers-webpack-rollup-esbuild-etc"}},[t._v("#")]),t._v(" Bundlers (Webpack, Rollup, ESbuild, etc.)")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"browser"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#browser"}},[t._v("#")]),t._v(" Browser")]),t._v(" "),s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("module"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token script"}},[s("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://unpkg.com/@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),s("h3",{attrs:{id:"nodejs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nodejs"}},[t._v("#")]),t._v(" NodeJS")]),t._v(" "),s("h4",{attrs:{id:"commonjs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#commonjs"}},[t._v("#")]),t._v(" CommonJS")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commonjs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or absent")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CommonJS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Node"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"skipLibCheck"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"esm"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#esm"}},[t._v("#")]),t._v(" ESM")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"module"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"skipLibCheck"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk/node'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"typescript"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#typescript"}},[t._v("#")]),t._v(" Typescript")]),t._v(" "),s("p",[t._v("The SDK provides TypeScript types. When you import the SDK in a TypeScript project:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk/web'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or '@ardrive/turbo-sdk/node' for Node.js projects")]),t._v("\n")])])]),s("p",[t._v("Types are exported from "),s("code",[t._v("./lib/types/[node/web]/index.d.ts")]),t._v(" and should be automatically recognized, offering benefits such as type-checking and autocompletion.")]),t._v(" "),s("h2",{attrs:{id:"apis"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#apis"}},[t._v("#")]),t._v(" APIs")]),t._v(" "),s("h3",{attrs:{id:"turbofactory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbofactory"}},[t._v("#")]),t._v(" TurboFactory")]),t._v(" "),s("ul",[s("li",[s("p",[s("code",[t._v("unauthenticated()")]),t._v(" - Creates an instance of a client that accesses Turbo's unauthenticated services.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("authenticated()")]),t._v(" - Creates an instance of a client that accesses Turbo's authenticated and unauthenticated services.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("crypto"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateJWK")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"turbounauthenticatedclient"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbounauthenticatedclient"}},[t._v("#")]),t._v(" TurboUnauthenticatedClient")]),t._v(" "),s("ul",[s("li",[s("p",[s("code",[t._v("getSupportedCurrencies()")]),t._v(" - Returns the list of currencies supported by the Turbo Payment Service for topping up a user balance of AR Credits (measured in Winston Credits, or winc).")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" currencies "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCurrencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getSupportedCountries()")]),t._v(" - Returns the list of countries supported by the Turbo Payment Service's top up workflow.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" countries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCountries")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getFiatToAR({ currency })")]),t._v(" - Returns the current raw fiat to AR conversion rate for a specific currency as reported by third-party pricing oracles.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fiatToAR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatToAR")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" currency"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'USD'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getFiatRates()")]),t._v(" - Returns the current fiat rates for 1 GiB of data for supported currencies, including all top-up adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getWincForFiat({ amount })")]),t._v(" - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount. To leverage promo codes, see "),s("a",{attrs:{href:"#turboauthenticatedclient"}},[t._v("TurboAuthenticatedClient")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getUploadCosts({ bytes })")]),t._v(" - Returns the estimated cost in Winston Credits for the provided file sizes, including all upload adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1024")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("uploadSignedDataItem({ dataItemStreamFactory, dataItemSizeFactory, signal })")]),t._v(" - Uploads a signed data item. The provided "),s("code",[t._v("dataItemStreamFactory")]),t._v(" should produce a NEW signed data item stream each time is it invoked. The "),s("code",[t._v("dataItemSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-signed-data-item'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" dataItemSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResponse "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadSignedDataItem")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" dataItemSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n signal"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("createCheckoutSession({ amount, owner })")]),t._v(" - Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner. The returned URL can be opened in the browser, all payments are processed by Stripe. To leverage promo codes, see "),s("a",{attrs:{href:"#turboauthenticatedclient"}},[t._v("TurboAuthenticatedClient")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'darwin'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'win32'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"turboauthenticatedclient"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turboauthenticatedclient"}},[t._v("#")]),t._v(" TurboAuthenticatedClient")]),t._v(" "),s("ul",[s("li",[s("p",[s("code",[t._v("getBalance()")]),t._v(" - Issues a signed request to get the credit balance of a wallet measured in AR (measured in Winston Credits, or winc).")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("getWincForFiat({ amount, promoCodes })")]),t._v(" - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount, and optional promo codes.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MY_PROMO_CODE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("createCheckoutSession({ amount, owner, promoCodes })")]),t._v(" - Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner, and optional promo codes. The returned URL can be opened in the browser, all payments are processed by Stripe. Promo codes require an authenticated client.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MY_PROMO_CODE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'darwin'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'win32'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("uploadFile({ fileStreamFactory, fileSizeFactory, signal })")]),t._v(" - Signs and uploads a raw file. The provided "),s("code",[t._v("fileStreamFactory")]),t._v(" should produce a NEW file data stream each time is it invoked. The "),s("code",[t._v("fileSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-unsigned-file.txt'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stateSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no timeout or AbortSignal provided")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h2",{attrs:{id:"contributions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributions"}},[t._v("#")]),t._v(" Contributions")]),t._v(" "),s("p",[t._v("If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are both welcome and encouraged.")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/43.c6f861f4.js b/assets/js/43.c6f861f4.js new file mode 100644 index 0000000..476d57e --- /dev/null +++ b/assets/js/43.c6f861f4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{340:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"turbo-sdk-release-notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#turbo-sdk-release-notes"}},[e._v("#")]),e._v(" Turbo SDK Release Notes")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("Welcome to the documentation page for the Turbo SDK release notes. Here, you will find detailed information about each version of the Turbo SDK, including the enhancements, bug fixes, and any other changes introduced in every release. This page serves as a comprehensive resource to keep you informed about the latest developments and updates in the Turbo SDK. For those interested in exploring the source code, each version's code is readily accessible at our GitHub repository: "),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/releases",target:"_blank",rel:"noopener noreferrer"}},[e._v("Turbo SDK Releases"),t("OutboundLink")],1),e._v(". Stay updated with the continuous improvements and advancements in the Turbo SDK by referring to this page for all release-related information.")]),e._v(" "),t("h2",{attrs:{id:"releases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#releases"}},[e._v("#")]),e._v(" Releases")]),e._v(" "),t("h3",{attrs:{id:"v1-5-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-5-0"}},[e._v("#")]),e._v(" V1.5.0")]),e._v(" "),t("p",[e._v("(2024-04-16)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("fund with AR")]),e._v(": add web esm compatible arweave export")]),e._v(" "),t("li",[e._v("export Arconnect and ArweaveSigner from env specific signers")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("crypto payments")]),e._v(": Init fund methods")]),e._v(" "),t("li",[t("strong",[e._v("crypto payments")]),e._v(": Refactor arweave-js out of signer")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Add ToTokenAmount helper utils")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Catch polling error")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Continue polling on request error")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Throw no wallet found as error")]),e._v(" "),t("li",[t("strong",[e._v("signers")]),e._v(": Exports arbundles ArconnectSigner and ArweaveSigner")])]),e._v(" "),t("h3",{attrs:{id:"v1-4-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-4-2"}},[e._v("#")]),e._v(" V1.4.2")]),e._v(" "),t("p",[e._v("(2024-03-15)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("arbundles")]),e._v(": pin arbundles to v0.9.9 and run tests locally")])]),e._v(" "),t("h3",{attrs:{id:"v1-4-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-4-1"}},[e._v("#")]),e._v(" V1.4.1")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("checkout session")]),e._v(": correct query param, change type, add coverage")])]),e._v(" "),t("h3",{attrs:{id:"v1-4-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-4-0"}},[e._v("#")]),e._v(" V1.4.0")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("ui mode")]),e._v(": support query param for checkout session ui mode")])]),e._v(" "),t("h3",{attrs:{id:"v1-3-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-3-0"}},[e._v("#")]),e._v(" V1.3.0")]),e._v(" "),t("p",[e._v("(2024-01-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("web")]),e._v(": ensure we have the public key for arconnect wallets when signing data")]),e._v(" "),t("li",[t("strong",[e._v("web")]),e._v(": remove reference to "),t("code",[e._v("node:crypto")]),e._v(" in websigner, use signer to signer to sign header")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("signer")]),e._v(": allow an optional signer to be passed instead of JWK for signing data items")])]),e._v(" "),t("h3",{attrs:{id:"v1-2-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-2-0"}},[e._v("#")]),e._v(" V1.2.0")]),e._v(" "),t("p",[e._v("(2023-12-15)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("data item opts")]),e._v(": init tags anchor and target support PE-5035")])]),e._v(" "),t("h3",{attrs:{id:"v1-1-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-1-1"}},[e._v("#")]),e._v(" V1.1.1")]),e._v(" "),t("p",[e._v("(2023-12-14)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("exports")]),e._v(": use bundled export to avoid issue with polyfilled features needed for web")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": web exports reference an invalid build path")]),e._v(" "),t("li",[t("strong",[e._v("polyfills")]),e._v(": update esbuild script to include crypto polyfill")])]),e._v(" "),t("h3",{attrs:{id:"v1-1-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-1-0"}},[e._v("#")]),e._v(" V1.1.0")]),e._v(" "),t("p",[e._v("(2023-11-10)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("axios")]),e._v(": set "),t("code",[e._v("maxRedirects")]),e._v(" to "),t("code",[e._v("0")]),e._v(" on our axios instances")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("logger")]),e._v(": add configurable global logger")])]),e._v(" "),t("h3",{attrs:{id:"v1-0-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-0-2"}},[e._v("#")]),e._v(" V1.0.2")]),e._v(" "),t("p",[e._v("(2023-11-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload")]),e._v(": update the default upload service URL")])]),e._v(" "),t("h3",{attrs:{id:"v1-0-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-0-1"}},[e._v("#")]),e._v(" V1.0.1")]),e._v(" "),t("p",[e._v("(2023-09-27)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("headers")]),e._v(": add default headers for all HTTP requests")]),e._v(" "),t("li",[t("strong",[e._v("release")]),e._v(": use script that updates built version.js files")]),e._v(" "),t("li",[t("strong",[e._v("version")]),e._v(": update version.js to proper version on build and commit it back to git after a release")])]),e._v(" "),t("h3",{attrs:{id:"v1-0-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-0-0"}},[e._v("#")]),e._v(" V1.0.0")]),e._v(" "),t("p",[e._v("(2023-09-26)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add main import and allow wildcard imports")]),e._v(" "),t("li",[e._v("add module to package.json and tweak types")]),e._v(" "),t("li",[e._v("add one more step to make esm useable")]),e._v(" "),t("li",[e._v("add owner to TurboUploadDataItemResponse and remove byteCount")]),e._v(" "),t("li",[e._v("add separate folder for types, use it in named exports")]),e._v(" "),t("li",[e._v("change name of public facing clients.")]),e._v(" "),t("li",[t("strong",[e._v("cjs")]),e._v(": add separate cjs and esm outputs")]),e._v(" "),t("li",[t("strong",[e._v("content-length")]),e._v(": require content length factory for uploads")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": move turbo configurations to turbo.ts so it is available to clients")]),e._v(" "),t("li",[e._v("fix package.json")]),e._v(" "),t("li",[e._v("modify return type of signDataItem function, tweak implementation of ArweaveSigner header")]),e._v(" "),t("li",[e._v("move from getWincPriceForBytes to getUploadCosts")]),e._v(" "),t("li",[t("strong",[e._v("package.json")]),e._v(": add back module to package.json")]),e._v(" "),t("li",[e._v("remove package.json from lib directory")]),e._v(" "),t("li",[e._v("remove postinstall command")]),e._v(" "),t("li",[e._v("replace retry-axios, add additional retry logic")]),e._v(" "),t("li",[t("strong",[e._v("retry-axios")]),e._v(": pin retry-axios to 3.0.0")]),e._v(" "),t("li",[e._v("revert to single file upload/data item upload")]),e._v(" "),t("li",[e._v("swap adding package.json to esm to cjs")]),e._v(" "),t("li",[t("strong",[e._v("top up")]),e._v(": export type PE-4465")]),e._v(" "),t("li",[e._v("type imports for web and node")]),e._v(" "),t("li",[t("strong",[e._v("types")]),e._v(": finalize types, update default payment and upload URLs")]),e._v(" "),t("li",[e._v("update main and types path in package.json")]),e._v(" "),t("li",[e._v("update package.json output for esm")]),e._v(" "),t("li",[e._v("update web signer and cleanup examples")]),e._v(" "),t("li",[e._v("use .cjs as base for types to avoid reference require errors")]),e._v(" "),t("li",[e._v("use declare in sub-classes to overwrite parent class type")]),e._v(" "),t("li",[t("strong",[e._v("wildcard")]),e._v(": allow wildcard exports for older projects")]),e._v(" "),t("li",[e._v("wrong path for types!")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[e._v("abstract axios to TurboHTTPService class")]),e._v(" "),t("li",[e._v("abstract JWKInterface used in AuthenticatedPayment and AuthenticatedUploadService")]),e._v(" "),t("li",[e._v("add remaining unauthenticated apis for payment service, introduce some new types, add tests")]),e._v(" "),t("li",[e._v("add uploadFiles implementation for node and web")]),e._v(" "),t("li",[e._v("break services into auth vs unauth")]),e._v(" "),t("li",[e._v("initial implementation of TurboWebClient and TurboNodeClient")]),e._v(" "),t("li",[e._v("introduce AbortController")]),e._v(" "),t("li",[e._v("introduce uploadSignedDataItem interface, implement for node")]),e._v(" "),t("li",[e._v("remove TurboDataItemVerifier")]),e._v(" "),t("li",[t("strong",[e._v("sdk")]),e._v(": all uphill from here πŸš€ PE-4064")]),e._v(" "),t("li",[t("strong",[e._v("top-up")]),e._v(": init get checkout session PE-4465")]),e._v(" "),t("li",[t("strong",[e._v("winc for fiat")]),e._v(": extend AmountMapper pattern and add promoCode support PE-4465")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/43.daae3200.js b/assets/js/43.daae3200.js deleted file mode 100644 index fdfc6b8..0000000 --- a/assets/js/43.daae3200.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{337:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"turbo-sdk-release-notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#turbo-sdk-release-notes"}},[e._v("#")]),e._v(" Turbo SDK Release Notes")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("Welcome to the documentation page for the Turbo SDK release notes. Here, you will find detailed information about each version of the Turbo SDK, including the enhancements, bug fixes, and any other changes introduced in every release. This page serves as a comprehensive resource to keep you informed about the latest developments and updates in the Turbo SDK. For those interested in exploring the source code, each version's code is readily accessible at our GitHub repository: "),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/releases",target:"_blank",rel:"noopener noreferrer"}},[e._v("Turbo SDK Releases"),t("OutboundLink")],1),e._v(". Stay updated with the continuous improvements and advancements in the Turbo SDK by referring to this page for all release-related information.")]),e._v(" "),t("h2",{attrs:{id:"releases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#releases"}},[e._v("#")]),e._v(" Releases")]),e._v(" "),t("h3",{attrs:{id:"v1-4-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-4-1"}},[e._v("#")]),e._v(" V1.4.1")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("checkout session")]),e._v(": correct query param, change type, add coverage")])]),e._v(" "),t("h3",{attrs:{id:"v1-4-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-4-0"}},[e._v("#")]),e._v(" V1.4.0")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("ui mode")]),e._v(": support query param for checkout session ui mode")])]),e._v(" "),t("h3",{attrs:{id:"v1-3-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-3-0"}},[e._v("#")]),e._v(" V1.3.0")]),e._v(" "),t("p",[e._v("(2024-01-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("web")]),e._v(": ensure we have the public key for arconnect wallets when signing data")]),e._v(" "),t("li",[t("strong",[e._v("web")]),e._v(": remove reference to "),t("code",[e._v("node:crypto")]),e._v(" in websigner, use signer to signer to sign header")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("signer")]),e._v(": allow an optional signer to be passed instead of JWK for signing data items")])]),e._v(" "),t("h3",{attrs:{id:"v1-2-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-2-0"}},[e._v("#")]),e._v(" V1.2.0")]),e._v(" "),t("p",[e._v("(2023-12-15)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("data item opts")]),e._v(": init tags anchor and target support PE-5035")])]),e._v(" "),t("h3",{attrs:{id:"v1-1-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-1-1"}},[e._v("#")]),e._v(" V1.1.1")]),e._v(" "),t("p",[e._v("(2023-12-14)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("exports")]),e._v(": use bundled export to avoid issue with polyfilled features needed for web")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": web exports reference an invalid build path")]),e._v(" "),t("li",[t("strong",[e._v("polyfills")]),e._v(": update esbuild script to include crypto polyfill")])]),e._v(" "),t("h3",{attrs:{id:"v1-1-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-1-0"}},[e._v("#")]),e._v(" V1.1.0")]),e._v(" "),t("p",[e._v("(2023-11-10)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("axios")]),e._v(": set "),t("code",[e._v("maxRedirects")]),e._v(" to "),t("code",[e._v("0")]),e._v(" on our axios instances")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("logger")]),e._v(": add configurable global logger")])]),e._v(" "),t("h3",{attrs:{id:"v1-0-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-0-2"}},[e._v("#")]),e._v(" V1.0.2")]),e._v(" "),t("p",[e._v("(2023-11-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload")]),e._v(": update the default upload service URL")])]),e._v(" "),t("h3",{attrs:{id:"v1-0-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-0-1"}},[e._v("#")]),e._v(" V1.0.1")]),e._v(" "),t("p",[e._v("(2023-09-27)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("headers")]),e._v(": add default headers for all HTTP requests")]),e._v(" "),t("li",[t("strong",[e._v("release")]),e._v(": use script that updates built version.js files")]),e._v(" "),t("li",[t("strong",[e._v("version")]),e._v(": update version.js to proper version on build and commit it back to git after a release")])]),e._v(" "),t("h3",{attrs:{id:"v1-0-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v1-0-0"}},[e._v("#")]),e._v(" V1.0.0")]),e._v(" "),t("p",[e._v("(2023-09-26)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add main import and allow wildcard imports")]),e._v(" "),t("li",[e._v("add module to package.json and tweak types")]),e._v(" "),t("li",[e._v("add one more step to make esm useable")]),e._v(" "),t("li",[e._v("add owner to TurboUploadDataItemResponse and remove byteCount")]),e._v(" "),t("li",[e._v("add separate folder for types, use it in named exports")]),e._v(" "),t("li",[e._v("change name of public facing clients.")]),e._v(" "),t("li",[t("strong",[e._v("cjs")]),e._v(": add separate cjs and esm outputs")]),e._v(" "),t("li",[t("strong",[e._v("content-length")]),e._v(": require content length factory for uploads")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": move turbo configurations to turbo.ts so it is available to clients")]),e._v(" "),t("li",[e._v("fix package.json")]),e._v(" "),t("li",[e._v("modify return type of signDataItem function, tweak implementation of ArweaveSigner header")]),e._v(" "),t("li",[e._v("move from getWincPriceForBytes to getUploadCosts")]),e._v(" "),t("li",[t("strong",[e._v("package.json")]),e._v(": add back module to package.json")]),e._v(" "),t("li",[e._v("remove package.json from lib directory")]),e._v(" "),t("li",[e._v("remove postinstall command")]),e._v(" "),t("li",[e._v("replace retry-axios, add additional retry logic")]),e._v(" "),t("li",[t("strong",[e._v("retry-axios")]),e._v(": pin retry-axios to 3.0.0")]),e._v(" "),t("li",[e._v("revert to single file upload/data item upload")]),e._v(" "),t("li",[e._v("swap adding package.json to esm to cjs")]),e._v(" "),t("li",[t("strong",[e._v("top up")]),e._v(": export type PE-4465")]),e._v(" "),t("li",[e._v("type imports for web and node")]),e._v(" "),t("li",[t("strong",[e._v("types")]),e._v(": finalize types, update default payment and upload URLs")]),e._v(" "),t("li",[e._v("update main and types path in package.json")]),e._v(" "),t("li",[e._v("update package.json output for esm")]),e._v(" "),t("li",[e._v("update web signer and cleanup examples")]),e._v(" "),t("li",[e._v("use .cjs as base for types to avoid reference require errors")]),e._v(" "),t("li",[e._v("use declare in sub-classes to overwrite parent class type")]),e._v(" "),t("li",[t("strong",[e._v("wildcard")]),e._v(": allow wildcard exports for older projects")]),e._v(" "),t("li",[e._v("wrong path for types!")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[e._v("abstract axios to TurboHTTPService class")]),e._v(" "),t("li",[e._v("abstract JWKInterface used in AuthenticatedPayment and AuthenticatedUploadService")]),e._v(" "),t("li",[e._v("add remaining unauthenticated apis for payment service, introduce some new types, add tests")]),e._v(" "),t("li",[e._v("add uploadFiles implementation for node and web")]),e._v(" "),t("li",[e._v("break services into auth vs unauth")]),e._v(" "),t("li",[e._v("initial implementation of TurboWebClient and TurboNodeClient")]),e._v(" "),t("li",[e._v("introduce AbortController")]),e._v(" "),t("li",[e._v("introduce uploadSignedDataItem interface, implement for node")]),e._v(" "),t("li",[e._v("remove TurboDataItemVerifier")]),e._v(" "),t("li",[t("strong",[e._v("sdk")]),e._v(": all uphill from here πŸš€ PE-4064")]),e._v(" "),t("li",[t("strong",[e._v("top-up")]),e._v(": init get checkout session PE-4465")]),e._v(" "),t("li",[t("strong",[e._v("winc for fiat")]),e._v(": extend AmountMapper pattern and add promoCode support PE-4465")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/46.0d5c8a52.js b/assets/js/46.10b5df93.js similarity index 99% rename from assets/js/46.0d5c8a52.js rename to assets/js/46.10b5df93.js index a214b43..2bc8b3b 100644 --- a/assets/js/46.0d5c8a52.js +++ b/assets/js/46.10b5df93.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{340:function(e,t,r){"use strict";r.r(t);var a=r(10),o=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"about-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#about-ardrive"}},[e._v("#")]),e._v(" About ArDrive")]),e._v(" "),t("p",[e._v("ArDrive offers never-ending storage of your most valuable files. Pay once and save your memories forever.")]),e._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("thead",[t("tr",[t("th",[e._v("Feature")]),e._v(" "),t("th",[e._v("ArDrive")]),e._v(" "),t("th",[e._v("Traditional Cloud Storage")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("One time payments for file storage")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("No monthly subscriptions")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("200+ years of file storage")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("Data available even if company disappears")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("Decentralized and open source")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("Inactive accounts never deleted")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])])])])]),e._v(" "),t("h2",{attrs:{id:"control-your-own-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#control-your-own-data"}},[e._v("#")]),e._v(" Control Your Own Data")]),e._v(" "),t("h3",{attrs:{id:"true-data-ownership"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#true-data-ownership"}},[e._v("#")]),e._v(" True Data Ownership")]),e._v(" "),t("p",[e._v("With pay-once pricing you no longer have to add another subscription fee to your monthly budget. Save big when you only have to pay for what you use.")]),e._v(" "),t("h3",{attrs:{id:"no-more-lost-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#no-more-lost-data"}},[e._v("#")]),e._v(" No More Lost Data")]),e._v(" "),t("p",[e._v("Feel safe about the longevity of your files and avoid the horror stories of broken hard drives, deleted accounts, or lost files.")]),e._v(" "),t("h3",{attrs:{id:"decentralized-network"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#decentralized-network"}},[e._v("#")]),e._v(" Decentralized Network")]),e._v(" "),t("p",[e._v("Break free from Big Tech and leverage the power of the decentralized Arweave blockchain network that puts you back in control. Own your data instead of renting it.")]),e._v(" "),t("h3",{attrs:{id:"community-owned"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-owned"}},[e._v("#")]),e._v(" Community Owned")]),e._v(" "),t("p",[t("em",[e._v("You're the boss.")]),e._v(" As a Web3 organization, ArDrive is owned collectively so you can have a say in our governance and share in our rewards.")]),e._v(" "),t("h2",{attrs:{id:"how-can-ardrive-help-you"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-can-ardrive-help-you"}},[e._v("#")]),e._v(" How can Ardrive Help You?")]),e._v(" "),t("h3",{attrs:{id:"store-family-memories-forever"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#store-family-memories-forever"}},[e._v("#")]),e._v(" Store Family Memories Forever")]),e._v(" "),t("p",[e._v("Never lose a cherished photo or video again. Keep and pass along all of your most important photos and documents to the present or future generations. "),t("a",{attrs:{href:"https://ardrive.io/features/family-memories/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"permanence"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#permanence"}},[e._v("#")]),e._v(" Permanence")]),e._v(" "),t("p",[e._v("In a digital world, how do you guarantee information is kept for long-periods of time? Just as the web connects data and people over vast distances, your data can now be kept over vast periods of time. "),t("a",{attrs:{href:"https://ardrive.io/features/permanent/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"totally-private-or-totally-public"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#totally-private-or-totally-public"}},[e._v("#")]),e._v(" Totally Private or Totally Public")]),e._v(" "),t("p",[e._v("It’s your choice in how you want to manage your data. Keep it private, share with select individuals, or make it public to the world. ArDrive is optimized for photography, digital art and NFT storage. "),t("a",{attrs:{href:"https://ardrive.io/features/public-or-private/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"eliminate-subscription-fees"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#eliminate-subscription-fees"}},[e._v("#")]),e._v(" Eliminate Subscription Fees")]),e._v(" "),t("p",[e._v("If you are paying monthly for cloud storage you are renting out your data. Get a digital wallet and move to full ownership of your data with our innovative pay once per file pricing. "),t("a",{attrs:{href:"https://ardrive.io/features/eliminate-subscription-fees/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"control-your-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#control-your-data"}},[e._v("#")]),e._v(" Control Your Data")]),e._v(" "),t("p",[e._v("Break free from the whims of centralized big tech and ever-changing terms of service. Enjoy the benefits of total privacy, security, and extreme data redundancy on a decentralized network. "),t("a",{attrs:{href:"https://ardrive.io/features/control-your-data/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"perfect-record-keeping"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#perfect-record-keeping"}},[e._v("#")]),e._v(" Perfect Record Keeping")]),e._v(" "),t("p",[e._v("Data integrity, accuracy and consistency for your most important files! Achieve regulatory compliance in any industry or your personal life by having an immutable (unchanging) and time-stamped record of all your files. "),t("a",{attrs:{href:"https://ardrive.io/features/perfect-record-keeping/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"durable-nfts"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#durable-nfts"}},[e._v("#")]),e._v(" Durable NFTs")]),e._v(" "),t("p",[e._v("NFTs make the internet ownable. But when you buy an NFT how do you know it is going to be around in 20 years? Who is paying to store it? And what if they stop? "),t("a",{attrs:{href:"https://ardrive.io/nft/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"archive-the-web"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#archive-the-web"}},[e._v("#")]),e._v(" Archive the Web")]),e._v(" "),t("p",[e._v("Save a copy of any webpage you create or find! Each page will be given a unique url and saved on to Arweave’s permaweb (just like the web, but forever!). "),t("a",{attrs:{href:"https://ardrive.io/features/archive/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{341:function(e,t,r){"use strict";r.r(t);var a=r(10),o=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"about-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#about-ardrive"}},[e._v("#")]),e._v(" About ArDrive")]),e._v(" "),t("p",[e._v("ArDrive offers never-ending storage of your most valuable files. Pay once and save your memories forever.")]),e._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("thead",[t("tr",[t("th",[e._v("Feature")]),e._v(" "),t("th",[e._v("ArDrive")]),e._v(" "),t("th",[e._v("Traditional Cloud Storage")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("One time payments for file storage")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("No monthly subscriptions")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("200+ years of file storage")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("Data available even if company disappears")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("Decentralized and open source")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])]),e._v(" "),t("tr",[t("td",[e._v("Inactive accounts never deleted")]),e._v(" "),t("td",{staticStyle:{color:"green"}},[e._v("βœ“")]),e._v(" "),t("td",{staticStyle:{color:"red"}},[e._v("βœ—")])])])])]),e._v(" "),t("h2",{attrs:{id:"control-your-own-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#control-your-own-data"}},[e._v("#")]),e._v(" Control Your Own Data")]),e._v(" "),t("h3",{attrs:{id:"true-data-ownership"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#true-data-ownership"}},[e._v("#")]),e._v(" True Data Ownership")]),e._v(" "),t("p",[e._v("With pay-once pricing you no longer have to add another subscription fee to your monthly budget. Save big when you only have to pay for what you use.")]),e._v(" "),t("h3",{attrs:{id:"no-more-lost-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#no-more-lost-data"}},[e._v("#")]),e._v(" No More Lost Data")]),e._v(" "),t("p",[e._v("Feel safe about the longevity of your files and avoid the horror stories of broken hard drives, deleted accounts, or lost files.")]),e._v(" "),t("h3",{attrs:{id:"decentralized-network"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#decentralized-network"}},[e._v("#")]),e._v(" Decentralized Network")]),e._v(" "),t("p",[e._v("Break free from Big Tech and leverage the power of the decentralized Arweave blockchain network that puts you back in control. Own your data instead of renting it.")]),e._v(" "),t("h3",{attrs:{id:"community-owned"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-owned"}},[e._v("#")]),e._v(" Community Owned")]),e._v(" "),t("p",[t("em",[e._v("You're the boss.")]),e._v(" As a Web3 organization, ArDrive is owned collectively so you can have a say in our governance and share in our rewards.")]),e._v(" "),t("h2",{attrs:{id:"how-can-ardrive-help-you"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-can-ardrive-help-you"}},[e._v("#")]),e._v(" How can Ardrive Help You?")]),e._v(" "),t("h3",{attrs:{id:"store-family-memories-forever"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#store-family-memories-forever"}},[e._v("#")]),e._v(" Store Family Memories Forever")]),e._v(" "),t("p",[e._v("Never lose a cherished photo or video again. Keep and pass along all of your most important photos and documents to the present or future generations. "),t("a",{attrs:{href:"https://ardrive.io/features/family-memories/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"permanence"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#permanence"}},[e._v("#")]),e._v(" Permanence")]),e._v(" "),t("p",[e._v("In a digital world, how do you guarantee information is kept for long-periods of time? Just as the web connects data and people over vast distances, your data can now be kept over vast periods of time. "),t("a",{attrs:{href:"https://ardrive.io/features/permanent/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"totally-private-or-totally-public"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#totally-private-or-totally-public"}},[e._v("#")]),e._v(" Totally Private or Totally Public")]),e._v(" "),t("p",[e._v("It’s your choice in how you want to manage your data. Keep it private, share with select individuals, or make it public to the world. ArDrive is optimized for photography, digital art and NFT storage. "),t("a",{attrs:{href:"https://ardrive.io/features/public-or-private/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"eliminate-subscription-fees"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#eliminate-subscription-fees"}},[e._v("#")]),e._v(" Eliminate Subscription Fees")]),e._v(" "),t("p",[e._v("If you are paying monthly for cloud storage you are renting out your data. Get a digital wallet and move to full ownership of your data with our innovative pay once per file pricing. "),t("a",{attrs:{href:"https://ardrive.io/features/eliminate-subscription-fees/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"control-your-data"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#control-your-data"}},[e._v("#")]),e._v(" Control Your Data")]),e._v(" "),t("p",[e._v("Break free from the whims of centralized big tech and ever-changing terms of service. Enjoy the benefits of total privacy, security, and extreme data redundancy on a decentralized network. "),t("a",{attrs:{href:"https://ardrive.io/features/control-your-data/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"perfect-record-keeping"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#perfect-record-keeping"}},[e._v("#")]),e._v(" Perfect Record Keeping")]),e._v(" "),t("p",[e._v("Data integrity, accuracy and consistency for your most important files! Achieve regulatory compliance in any industry or your personal life by having an immutable (unchanging) and time-stamped record of all your files. "),t("a",{attrs:{href:"https://ardrive.io/features/perfect-record-keeping/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"durable-nfts"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#durable-nfts"}},[e._v("#")]),e._v(" Durable NFTs")]),e._v(" "),t("p",[e._v("NFTs make the internet ownable. But when you buy an NFT how do you know it is going to be around in 20 years? Who is paying to store it? And what if they stop? "),t("a",{attrs:{href:"https://ardrive.io/nft/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"archive-the-web"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#archive-the-web"}},[e._v("#")]),e._v(" Archive the Web")]),e._v(" "),t("p",[e._v("Save a copy of any webpage you create or find! Each page will be given a unique url and saved on to Arweave’s permaweb (just like the web, but forever!). "),t("a",{attrs:{href:"https://ardrive.io/features/archive/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/8.8b24a0bb.js b/assets/js/8.efd149fe.js similarity index 98% rename from assets/js/8.8b24a0bb.js rename to assets/js/8.efd149fe.js index 6f2a033..3106e9a 100644 --- a/assets/js/8.8b24a0bb.js +++ b/assets/js/8.efd149fe.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{304:function(t,e,a){"use strict";a.r(e);var s=a(10),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"content-types"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#content-types"}},[t._v("#")]),t._v(" Content Types")]),t._v(" "),e("p",[t._v("All transaction types in ArFS leverage a specific metadata tag for the Content-Type (also known as mime-type) of the data that is included in the transaction. ArFS clients must determine what the mime-type of the data is, in order for Arweave gateways and browsers to render this content appropriately.")]),t._v(" "),e("p",[t._v("All public drive, folder, and file (metadata only) entity transactions all use a JSON standard, therefore they must have the following content type tag:")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[t._v("Content-Type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ''\n")])])]),e("p",[t._v("However, a file's data transaction must have its mime-type determined. This is stored in the file's corresponding metadata transaction JSON's "),e("code",[t._v("dataContentType")]),t._v(" as well as the content type tag in the data transaction itself.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[t._v("Content-Type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n")])])]),e("p",[t._v("All private drive, folder, and file entity transactions must have the following content type, since they are encrypted:")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[t._v("Content-Type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ''\n")])])]),e("p",[e("mark",{staticStyle:{background:"#d3d3d3","font-size":"200%"}},[t._v("ArDrive-Core includes methods to determine a file's content type")])]),t._v(" "),e("h2",{attrs:{id:"other-tags"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#other-tags"}},[t._v("#")]),t._v(" Other Tags")]),t._v(" "),e("p",[t._v("ArFS enabled clients should include the following tags on their transactions to identify their application")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[t._v("App-Name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'\n")])])]),e("p",[t._v("However, a file's data transaction must have its mime-type determined. This is stored in the file's corresponding metadata transaction JSON's "),e("code",[t._v("dataContentType")]),t._v(" as well as the content type tag in the data transaction itself.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[t._v("Content-Type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n")])])]),e("p",[t._v("All private drive, folder, and file entity transactions must have the following content type, since they are encrypted:")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[t._v("Content-Type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ''\n")])])]),e("p",[e("mark",{staticStyle:{background:"#d3d3d3","font-size":"200%"}},[t._v("ArDrive-Core includes methods to determine a file's content type")])]),t._v(" "),e("h2",{attrs:{id:"other-tags"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#other-tags"}},[t._v("#")]),t._v(" Other Tags")]),t._v(" "),e("p",[t._v("ArFS enabled clients should include the following tags on their transactions to identify their application")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[t._v("App-Name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"
'};function r(e,t,n){return en?n:e}function i(e){return 100*(-1+e)}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(a[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=r(e,a.minimum,1),n.status=1===e?null:e;var l=n.render(!t),d=l.querySelector(a.barSelector),c=a.speed,u=a.easing;return l.offsetWidth,o((function(t){""===a.positionUsing&&(a.positionUsing=n.getPositioningCSS()),s(d,function(e,t,n){var r;return(r="translate3d"===a.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===a.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(e)+"%"}).transition="all "+t+"ms "+n,r}(e,c,u)),1===e?(s(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){s(l,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),a.trickleSpeed)};return a.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*r(Math.random()*t,.1,.95)),t=r(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*a.trickleRate)},e=0,t=0,n.promise=function(a){return a&&"resolved"!==a.state()?(0===t&&n.start(),e++,t++,a.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");d(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=a.template;var r,o=t.querySelector(a.barSelector),l=e?"-100":i(n.status||0),c=document.querySelector(a.parent);return s(o,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),a.showSpinner||(r=t.querySelector(a.spinnerSelector))&&h(r),c!=document.body&&d(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){c(document.documentElement,"nprogress-busy"),c(document.querySelector(a.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&h(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var o=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()})),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var a,r=e.length,i=t.charAt(0).toUpperCase()+t.slice(1);r--;)if((a=e[r]+i)in n)return a;return t}(n))}function a(e,t,a){t=n(t),e.style[t]=a}return function(e,t){var n,r,i=arguments;if(2==i.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,i[1],i[2])}}();function l(e,t){return("string"==typeof e?e:u(e)).indexOf(" "+t+" ")>=0}function d(e,t){var n=u(e),a=n+t;l(n,t)||(e.className=a.substring(1))}function c(e,t){var n,a=u(e);l(e,t)&&(n=a.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function u(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function h(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n})?a.call(t,n,t,e):a)||(e.exports=r)},function(e,t,n){var a=n(8),r=String,i=TypeError;e.exports=function(e){if(a(e))return e;throw i(r(e)+" is not an object")}},function(e,t,n){var a=n(3),r=n(48).f,i=n(13),o=n(109),s=n(35),l=n(62),d=n(122);e.exports=function(e,t){var n,c,u,h,p,f=e.target,m=e.global,v=e.stat;if(n=m?a:v?a[f]||s(f,{}):(a[f]||{}).prototype)for(c in t){if(h=t[c],u=e.dontCallGetSet?(p=r(n,c))&&p.value:n[c],!d(m?c:f+(v?".":"#")+c,e.forced)&&void 0!==u){if(typeof h==typeof u)continue;l(h,u)}(e.sham||u&&u.sham)&&i(h,"sham",!0),o(n,c,h,e)}}},function(e,t,n){var a=n(2);e.exports=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},function(e,t,n){var a=n(45),r=n(49);e.exports=function(e){return a(r(e))}},function(e,t,n){var a=n(3),r=n(0),i=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(a[e]):a[e]&&a[e][t]}},function(e,t,n){var a=n(0),r=n(107),i=TypeError;e.exports=function(e){if(a(e))return e;throw i(r(e)+" is not a function")}},function(e,t,n){var a=n(3),r=n(58),i=n(7),o=n(60),s=n(56),l=n(55),d=a.Symbol,c=r("wks"),u=l?d.for||d:d&&d.withoutSetter||o;e.exports=function(e){return i(c,e)||(c[e]=s&&i(d,e)?d[e]:u("Symbol."+e)),c[e]}},function(e,t,n){var a=n(49),r=Object;e.exports=function(e){return r(a(e))}},function(e,t,n){var a=n(120);e.exports=function(e){return a(e.length)}},function(e,t,n){var a=n(25),r=Function.prototype.call;e.exports=a?r.bind(r):function(){return r.apply(r,arguments)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var a=n(3),r=n(35),i=a["__core-js_shared__"]||r("__core-js_shared__",{});e.exports=i},function(e,t,n){var a=n(3),r=Object.defineProperty;e.exports=function(e,t){try{r(a,e,{value:t,configurable:!0,writable:!0})}catch(n){a[e]=t}return t}},function(e,t,n){var a=n(146),r=n(11),i=Object.prototype,o=i.hasOwnProperty,s=i.propertyIsEnumerable,l=a(function(){return arguments}())?a:function(e){return r(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},function(e,t,n){var a=n(9)(n(6),"Map");e.exports=a},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var a=n(166),r=n(173),i=n(175),o=n(176),s=n(177);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var a=n(5),r=n(43),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(a(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!r(e))||(o.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var a=n(12),r=n(11);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==a(e)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var a=n(1),r=n(2),i=n(16),o=Object,s=a("".split);e.exports=r((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?s(e,""):o(e)}:o},function(e,t){e.exports={}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var a=n(4),r=n(32),i=n(103),o=n(33),s=n(26),l=n(51),d=n(7),c=n(61),u=Object.getOwnPropertyDescriptor;t.f=a?u:function(e,t){if(e=s(e),t=l(t),c)try{return u(e,t)}catch(e){}if(d(e,t))return o(!r(i.f,e,t),e[t])}},function(e,t,n){var a=n(50),r=TypeError;e.exports=function(e){if(a(e))throw r("Can't call method on "+e);return e}},function(e,t){e.exports=function(e){return null==e}},function(e,t,n){var a=n(104),r=n(53);e.exports=function(e){var t=a(e,"string");return r(t)?t:t+""}},function(e,t){var n="object"==typeof document&&document.all,a=void 0===n&&void 0!==n;e.exports={all:n,IS_HTMLDDA:a}},function(e,t,n){var a=n(27),r=n(0),i=n(54),o=n(55),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return r(t)&&i(t.prototype,s(e))}},function(e,t,n){var a=n(1);e.exports=a({}.isPrototypeOf)},function(e,t,n){var a=n(56);e.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var a=n(57),r=n(2);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41}))},function(e,t,n){var a,r,i=n(3),o=n(105),s=i.process,l=i.Deno,d=s&&s.versions||l&&l.version,c=d&&d.v8;c&&(r=(a=c.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!r&&o&&(!(a=o.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=o.match(/Chrome\/(\d+)/))&&(r=+a[1]),e.exports=r},function(e,t,n){var a=n(59),r=n(34);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.1",mode:a?"pure":"global",copyright:"Β© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t){e.exports=!1},function(e,t,n){var a=n(1),r=0,i=Math.random(),o=a(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++r+i,36)}},function(e,t,n){var a=n(4),r=n(2),i=n(93);e.exports=!a&&!r((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var a=n(7),r=n(115),i=n(48),o=n(15);e.exports=function(e,t,n){for(var s=r(t),l=o.f,d=i.f,c=0;cc))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,m=!0,v=2&n?new a:void 0;for(l.set(e,t),l.set(t,e);++f-1&&e%1==0&&e]/;e.exports=function(e){var t,n=""+e,r=a.exec(n);if(!r)return n;var i="",o=0,s=0;for(o=r.index;o=t||n<0||v&&e-d>=i}function x(){var e=p();if(w(e))return k(e);s=setTimeout(x,function(e){var n=t-(e-l);return v?h(n,i-(e-d)):n}(e))}function k(e){return s=void 0,y&&a?g(e):(a=r=void 0,o)}function T(){var e=p(),n=w(e);if(a=arguments,r=this,l=e,n){if(void 0===s)return b(l);if(v)return s=setTimeout(x,t),g(l)}return void 0===s&&(s=setTimeout(x,t)),o}return t=m(t)||0,f(n)&&(c=!!n.leading,i=(v="maxWait"in n)?u(m(n.maxWait)||0,t):i,y="trailing"in n?!!n.trailing:y),T.cancel=function(){void 0!==s&&clearTimeout(s),d=0,a=l=r=s=void 0},T.flush=function(){return void 0===s?o:k(p())},T}},function(e,t,n){"use strict";var a=n(24),r=n(30),i=n(31),o=n(126),s=n(128);a({target:"Array",proto:!0,arity:1,forced:n(2)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=r(this),n=i(t),a=arguments.length;s(n+a);for(var l=0;ld;)r(a,n=t[d++])&&(~o(c,n)||l(c,n));return c}},function(e,t,n){var a=n(83);e.exports=function(e,t,n){var r=null==e?void 0:a(e,t);return void 0===r?n:r}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},,,function(e,t,n){e.exports=n(243)},function(e,t,n){"use strict";var a=n(24),r=n(123).left,i=n(124),o=n(57);a({target:"Array",proto:!0,forced:!n(125)&&o>79&&o<83||!i("reduce")},{reduce:function(e){var t=arguments.length;return r(this,e,t,t>1?arguments[1]:void 0)}})},function(e,t,n){"use strict";var a={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!a.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:a},function(e,t,n){var a=n(32),r=n(8),i=n(53),o=n(106),s=n(108),l=n(29),d=TypeError,c=l("toPrimitive");e.exports=function(e,t){if(!r(e)||i(e))return e;var n,l=o(e,c);if(l){if(void 0===t&&(t="default"),n=a(l,e,t),!r(n)||i(n))return n;throw d("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},function(e,t){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(e,t,n){var a=n(28),r=n(50);e.exports=function(e,t){var n=e[t];return r(n)?void 0:a(n)}},function(e,t){var n=String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},function(e,t,n){var a=n(32),r=n(0),i=n(8),o=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&r(n=e.toString)&&!i(s=a(n,e)))return s;if(r(n=e.valueOf)&&!i(s=a(n,e)))return s;if("string"!==t&&r(n=e.toString)&&!i(s=a(n,e)))return s;throw o("Can't convert object to primitive value")}},function(e,t,n){var a=n(0),r=n(15),i=n(110),o=n(35);e.exports=function(e,t,n,s){s||(s={});var l=s.enumerable,d=void 0!==s.name?s.name:t;if(a(n)&&i(n,d,s),s.global)l?e[t]=n:o(t,n);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=n:r.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},function(e,t,n){var a=n(1),r=n(2),i=n(0),o=n(7),s=n(4),l=n(111).CONFIGURABLE,d=n(112),c=n(113),u=c.enforce,h=c.get,p=String,f=Object.defineProperty,m=a("".slice),v=a("".replace),y=a([].join),g=s&&!r((function(){return 8!==f((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=e.exports=function(e,t,n){"Symbol("===m(p(t),0,7)&&(t="["+v(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||l&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&o(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var a=u(e);return o(a,"source")||(a.source=y(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w((function(){return i(this)&&h(this).source||d(this)}),"toString")},function(e,t,n){var a=n(4),r=n(7),i=Function.prototype,o=a&&Object.getOwnPropertyDescriptor,s=r(i,"name"),l=s&&"something"===function(){}.name,d=s&&(!a||a&&o(i,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:d}},function(e,t,n){var a=n(1),r=n(0),i=n(34),o=a(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),e.exports=i.inspectSource},function(e,t,n){var a,r,i,o=n(114),s=n(3),l=n(8),d=n(13),c=n(7),u=n(34),h=n(95),p=n(46),f=s.TypeError,m=s.WeakMap;if(o||u.state){var v=u.state||(u.state=new m);v.get=v.get,v.has=v.has,v.set=v.set,a=function(e,t){if(v.has(e))throw f("Object already initialized");return t.facade=e,v.set(e,t),t},r=function(e){return v.get(e)||{}},i=function(e){return v.has(e)}}else{var y=h("state");p[y]=!0,a=function(e,t){if(c(e,y))throw f("Object already initialized");return t.facade=e,d(e,y,t),t},r=function(e){return c(e,y)?e[y]:{}},i=function(e){return c(e,y)}}e.exports={set:a,get:r,has:i,enforce:function(e){return i(e)?r(e):a(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=r(t)).type!==e)throw f("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var a=n(3),r=n(0),i=a.WeakMap;e.exports=r(i)&&/native code/.test(String(i))},function(e,t,n){var a=n(27),r=n(1),i=n(116),o=n(121),s=n(23),l=r([].concat);e.exports=a("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=o.f;return n?l(t,n(e)):t}},function(e,t,n){var a=n(96),r=n(92).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,r)}},function(e,t,n){var a=n(26),r=n(118),i=n(31),o=function(e){return function(t,n,o){var s,l=a(t),d=i(l),c=r(o,d);if(e&&n!=n){for(;d>c;)if((s=l[c++])!=s)return!0}else for(;d>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},function(e,t,n){var a=n(63),r=Math.max,i=Math.min;e.exports=function(e,t){var n=a(e);return n<0?r(n+t,0):i(n,t)}},function(e,t){var n=Math.ceil,a=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?a:n)(t)}},function(e,t,n){var a=n(63),r=Math.min;e.exports=function(e){return e>0?r(a(e),9007199254740991):0}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var a=n(2),r=n(0),i=/#|\.prototype\./,o=function(e,t){var n=l[s(e)];return n==c||n!=d&&(r(t)?a(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},l=o.data={},d=o.NATIVE="N",c=o.POLYFILL="P";e.exports=o},function(e,t,n){var a=n(28),r=n(30),i=n(45),o=n(31),s=TypeError,l=function(e){return function(t,n,l,d){a(n);var c=r(t),u=i(c),h=o(c),p=e?h-1:0,f=e?-1:1;if(l<2)for(;;){if(p in u){d=u[p],p+=f;break}if(p+=f,e?p<0:h<=p)throw s("Reduce of empty array with no initial value")}for(;e?p>=0:h>p;p+=f)p in u&&(d=n(d,u[p],p,c));return d}};e.exports={left:l(!1),right:l(!0)}},function(e,t,n){"use strict";var a=n(2);e.exports=function(e,t){var n=[][e];return!!n&&a((function(){n.call(null,t||function(){return 1},1)}))}},function(e,t,n){var a=n(16);e.exports="undefined"!=typeof process&&"process"==a(process)},function(e,t,n){"use strict";var a=n(4),r=n(127),i=TypeError,o=Object.getOwnPropertyDescriptor,s=a&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(r(e)&&!o(e,"length").writable)throw i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},function(e,t,n){var a=n(16);e.exports=Array.isArray||function(e){return"Array"==a(e)}},function(e,t){var n=TypeError;e.exports=function(e){if(e>9007199254740991)throw n("Maximum allowed index exceeded");return e}},function(e,t,n){var a=n(24),r=n(3),i=n(130),o=n(131),s=r.WebAssembly,l=7!==Error("e",{cause:7}).cause,d=function(e,t){var n={};n[e]=o(e,t,l),a({global:!0,constructor:!0,arity:1,forced:l},n)},c=function(e,t){if(s&&s[e]){var n={};n[e]=o("WebAssembly."+e,t,l),a({target:"WebAssembly",stat:!0,constructor:!0,arity:1,forced:l},n)}};d("Error",(function(e){return function(t){return i(e,this,arguments)}})),d("EvalError",(function(e){return function(t){return i(e,this,arguments)}})),d("RangeError",(function(e){return function(t){return i(e,this,arguments)}})),d("ReferenceError",(function(e){return function(t){return i(e,this,arguments)}})),d("SyntaxError",(function(e){return function(t){return i(e,this,arguments)}})),d("TypeError",(function(e){return function(t){return i(e,this,arguments)}})),d("URIError",(function(e){return function(t){return i(e,this,arguments)}})),c("CompileError",(function(e){return function(t){return i(e,this,arguments)}})),c("LinkError",(function(e){return function(t){return i(e,this,arguments)}})),c("RuntimeError",(function(e){return function(t){return i(e,this,arguments)}}))},function(e,t,n){var a=n(25),r=Function.prototype,i=r.apply,o=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(a?o.bind(i):function(){return o.apply(i,arguments)})},function(e,t,n){"use strict";var a=n(27),r=n(7),i=n(13),o=n(54),s=n(64),l=n(62),d=n(134),c=n(135),u=n(136),h=n(140),p=n(141),f=n(4),m=n(59);e.exports=function(e,t,n,v){var y=v?2:1,g=e.split("."),b=g[g.length-1],w=a.apply(null,g);if(w){var x=w.prototype;if(!m&&r(x,"cause")&&delete x.cause,!n)return w;var k=a("Error"),T=t((function(e,t){var n=u(v?t:e,void 0),a=v?new w(e):new w;return void 0!==n&&i(a,"message",n),p(a,T,a.stack,2),this&&o(x,this)&&c(a,this,T),arguments.length>y&&h(a,arguments[y]),a}));if(T.prototype=x,"Error"!==b?s?s(T,k):l(T,k,{name:!0}):f&&"stackTraceLimit"in w&&(d(T,w,"stackTraceLimit"),d(T,w,"prepareStackTrace")),l(T,w),!m)try{x.name!==b&&i(x,"name",b),x.constructor=T}catch(e){}return T}}},function(e,t,n){var a=n(1),r=n(28);e.exports=function(e,t,n){try{return a(r(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},function(e,t,n){var a=n(0),r=String,i=TypeError;e.exports=function(e){if("object"==typeof e||a(e))return e;throw i("Can't set "+r(e)+" as a prototype")}},function(e,t,n){var a=n(15).f;e.exports=function(e,t,n){n in e||a(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},function(e,t,n){var a=n(0),r=n(8),i=n(64);e.exports=function(e,t,n){var o,s;return i&&a(o=t.constructor)&&o!==n&&r(s=o.prototype)&&s!==n.prototype&&i(e,s),e}},function(e,t,n){var a=n(137);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:a(e)}},function(e,t,n){var a=n(138),r=String;e.exports=function(e){if("Symbol"===a(e))throw TypeError("Cannot convert a Symbol value to a string");return r(e)}},function(e,t,n){var a=n(139),r=n(0),i=n(16),o=n(29)("toStringTag"),s=Object,l="Arguments"==i(function(){return arguments}());e.exports=a?i:function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?n:l?i(t):"Object"==(a=i(t))&&r(t.callee)?"Arguments":a}},function(e,t,n){var a={};a[n(29)("toStringTag")]="z",e.exports="[object z]"===String(a)},function(e,t,n){var a=n(8),r=n(13);e.exports=function(e,t){a(t)&&"cause"in t&&r(e,"cause",t.cause)}},function(e,t,n){var a=n(13),r=n(142),i=n(143),o=Error.captureStackTrace;e.exports=function(e,t,n,s){i&&(o?o(e,t):a(e,"stack",r(n,s)))}},function(e,t,n){var a=n(1),r=Error,i=a("".replace),o=String(r("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,l=s.test(o);e.exports=function(e,t){if(l&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=i(e,s,"");return e}},function(e,t,n){var a=n(2),r=n(33);e.exports=!a((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))},function(e,t,n){var a=n(65),r=n(145);e.exports=function e(t,n,i,o,s){var l=-1,d=t.length;for(i||(i=r),s||(s=[]);++l0&&i(c)?n>1?e(c,n-1,i,o,s):a(s,c):o||(s[s.length]=c)}return s}},function(e,t,n){var a=n(14),r=n(36),i=n(5),o=a?a.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||r(e)||!!(o&&e&&e[o])}},function(e,t,n){var a=n(12),r=n(11);e.exports=function(e){return r(e)&&"[object Arguments]"==a(e)}},function(e,t,n){var a=n(14),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,s=a?a.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var a=!0}catch(e){}var r=o.call(e);return a&&(t?e[s]=n:delete e[s]),r}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var a=n(150),r=n(206),i=n(44),o=n(5),s=n(216);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?o(e)?r(e[0],e[1]):a(e):s(e)}},function(e,t,n){var a=n(151),r=n(205),i=n(82);e.exports=function(e){var t=r(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||a(n,e,t)}}},function(e,t,n){var a=n(67),r=n(71);e.exports=function(e,t,n,i){var o=n.length,s=o,l=!i;if(null==e)return!s;for(e=Object(e);o--;){var d=n[o];if(l&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++o-1}},function(e,t,n){var a=n(18);e.exports=function(e,t){var n=this.__data__,r=a(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}},function(e,t,n){var a=n(17);e.exports=function(){this.__data__=new a,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var a=n(17),r=n(37),i=n(39);e.exports=function(e,t){var n=this.__data__;if(n instanceof a){var o=n.__data__;if(!r||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(o)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var a=n(69),r=n(163),i=n(38),o=n(70),s=/^\[object .+?Constructor\]$/,l=Function.prototype,d=Object.prototype,c=l.toString,u=d.hasOwnProperty,h=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||r(e))&&(a(e)?h:s).test(o(e))}},function(e,t,n){var a,r=n(164),i=(a=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var a=n(6)["__core-js_shared__"];e.exports=a},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var a=n(167),r=n(17),i=n(37);e.exports=function(){this.size=0,this.__data__={hash:new a,map:new(i||r),string:new a}}},function(e,t,n){var a=n(168),r=n(169),i=n(170),o=n(171),s=n(172);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var a=n(73),r=n(228),i=n(233),o=n(74),s=n(234),l=n(40);e.exports=function(e,t,n){var d=-1,c=r,u=e.length,h=!0,p=[],f=p;if(n)h=!1,c=i;else if(u>=200){var m=t?null:s(e);if(m)return l(m);h=!1,c=o,f=new a}else f=t?[]:p;e:for(;++d-1}},function(e,t,n){var a=n(230),r=n(231),i=n(232);e.exports=function(e,t,n){return t==t?i(e,t,n):a(e,r,n)}},function(e,t){e.exports=function(e,t,n,a){for(var r=e.length,i=n+(a?1:-1);a?i--:++i=0&&Math.floor(t)===t&&isFinite(e)}function m(e){return o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function v(e){return null==e?"":Array.isArray(e)||h(e)&&e.toString===u?JSON.stringify(e,null,2):String(e)}function y(e){var t=parseFloat(e);return isNaN(t)?e:t}function g(e,t){for(var n=Object.create(null),a=e.split(","),r=0;r-1)return e.splice(a,1)}}var x=Object.prototype.hasOwnProperty;function k(e,t){return x.call(e,t)}function T(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,j=T((function(e){return e.replace(_,(function(e,t){return t?t.toUpperCase():""}))})),A=T((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),S=/\B([A-Z])/g,I=T((function(e){return e.replace(S,"-$1").toLowerCase()}));var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var a=arguments.length;return a?a>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function D(e,t){t=t||0;for(var n=e.length-t,a=new Array(n);n--;)a[n]=e[n+t];return a}function F(e,t){for(var n in t)e[n]=t[n];return e}function E(e){for(var t={},n=0;n0,Z=K&&K.indexOf("edge/")>0;K&&K.indexOf("android");var X=K&&/iphone|ipad|ipod|ios/.test(K);K&&/chrome\/\d+/.test(K),K&&/phantomjs/.test(K);var ee,te=K&&K.match(/firefox\/(\d+)/),ne={}.watch,ae=!1;if(J)try{var re={};Object.defineProperty(re,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,re)}catch(e){}var ie=function(){return void 0===ee&&(ee=!J&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),ee},oe=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var le,de="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);le="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ce=null;function ue(e){void 0===e&&(e=null),e||ce&&ce._scope.off(),ce=e,e&&e._scope.on()}var he=function(){function e(e,t,n,a,r,i,o,s){this.tag=e,this.data=t,this.children=n,this.text=a,this.elm=r,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),pe=function(e){void 0===e&&(e="");var t=new he;return t.text=e,t.isComment=!0,t};function fe(e){return new he(void 0,void 0,void 0,String(e))}function me(e){var t=new he(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ve=0,ye=[],ge=function(){function e(){this._pending=!1,this.id=ve++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ye.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var n=0,a=t.length;n0&&(at((d=e(d,"".concat(n||"","_").concat(a)))[0])&&at(u)&&(h[c]=fe(u.text+d[0].text),d.shift()),h.push.apply(h,d)):l(d)?at(u)?h[c]=fe(u.text+d):""!==d&&h.push(fe(d)):at(d)&&at(u)?h[c]=fe(u.text+d.text):(s(t._isVList)&&o(d.tag)&&i(d.key)&&o(n)&&(d.key="__vlist".concat(n,"_").concat(a,"__")),h.push(d)));return h}(e):void 0}function at(e){return o(e)&&o(e.text)&&!1===e.isComment}function rt(e,t){var n,a,i,s,l=null;if(r(e)||"string"==typeof e)for(l=new Array(e.length),n=0,a=e.length;n0,s=t?!!t.$stable:!o,l=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&r&&r!==a&&l===r.$key&&!o&&!r.$hasNormal)return r;for(var d in i={},t)t[d]&&"$"!==d[0]&&(i[d]=Tt(e,n,d,t[d]))}else i={};for(var c in n)c in i||(i[c]=_t(n,c));return t&&Object.isExtensible(t)&&(t._normalized=i),B(i,"$stable",s),B(i,"$key",l),B(i,"$hasNormal",o),i}function Tt(e,t,n,a){var i=function(){var t=ce;ue(e);var n=arguments.length?a.apply(null,arguments):a({}),i=(n=n&&"object"==typeof n&&!r(n)?[n]:nt(n))&&n[0];return ue(t),n&&(!i||1===n.length&&i.isComment&&!xt(i))?void 0:n};return a.proxy&&Object.defineProperty(t,n,{get:i,enumerable:!0,configurable:!0}),i}function _t(e,t){return function(){return e[t]}}function jt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};B(t,"_v_attr_proxy",!0),At(t,e.$attrs,a,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||At(e._listenersProxy={},e.$listeners,a,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||It(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:C(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Ue(e,t,n)}))}}}function At(e,t,n,a,r){var i=!1;for(var o in t)o in e?t[o]!==n[o]&&(i=!0):(i=!0,St(e,o,a,r));for(var o in e)o in t||(i=!0,delete e[o]);return i}function St(e,t,n,a){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[a][t]}})}function It(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var Ct=null;function Dt(e,t){return(e.__esModule||de&&"Module"===e[Symbol.toStringTag])&&(e=e.default),c(e)?t.extend(e):e}function Ft(e){if(r(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(vn=function(){return yn.now()})}var gn=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function bn(){var e,t;for(mn=vn(),pn=!0,dn.sort(gn),fn=0;fnfn&&dn[n].id>e.id;)n--;dn.splice(n+1,0,e)}else dn.push(e);hn||(hn=!0,Gt(bn))}}function xn(e,t){if(e){for(var n=Object.create(null),a=de?Reflect.ownKeys(e):Object.keys(e),r=0;r-1)if(i&&!k(r,"default"))o=!1;else if(""===o||o===I(e)){var l=Wn(String,r.type);(l<0||s-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!p(e)&&e.test(t)}function ra(e,t){var n=e.cache,a=e.keys,r=e._vnode;for(var i in n){var o=n[i];if(o){var s=o.name;s&&!t(s)&&ia(n,i,a,r)}}}function ia(e,t,n,a){var r=e[t];!r||a&&r.tag===a.tag||r.componentInstance.$destroy(),e[t]=null,w(n,t)}ea.prototype._init=function(e){var t=this;t._uid=Zn++,t._isVue=!0,t.__v_skip=!0,t._scope=new Ke(!0),t._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),a=t._parentVnode;n.parent=t.parent,n._parentVnode=a;var r=a.componentOptions;n.propsData=r.propsData,n._parentListeners=r.listeners,n._renderChildren=r.children,n._componentTag=r.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Mn(Xn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&nn(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=bt(t._renderChildren,r),e.$scopedSlots=n?kt(e.$parent,n.data.scopedSlots,e.$slots):a,e._c=function(t,n,a,r){return Et(e,t,n,a,r,!1)},e.$createElement=function(t,n,a,r){return Et(e,t,n,a,r,!0)};var i=n&&n.data;Fe(e,"$attrs",i&&i.attrs||a,null,!0),Fe(e,"$listeners",t._parentListeners||a,null,!0)}(t),ln(t,"beforeCreate",void 0,!1),function(e){var t=xn(e.$options.inject,e);t&&(Se(!1),Object.keys(t).forEach((function(n){Fe(e,n,t[n])})),Se(!0))}(t),Gn(t),function(e){var t=e.$options.provide;if(t){var n=d(t)?t.call(e):t;if(!c(n))return;for(var a=Ye(e),r=de?Reflect.ownKeys(n):Object.keys(n),i=0;i1?D(n):n;for(var a=D(arguments,1),r='event handler for "'.concat(e,'"'),i=0,o=n.length;iparseInt(this.max)&&ia(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)ia(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){ra(e,(function(e){return aa(t,e)}))})),this.$watch("exclude",(function(t){ra(e,(function(e){return!aa(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Ft(e),n=t&&t.componentOptions;if(n){var a=na(n),r=this.include,i=this.exclude;if(r&&(!a||!aa(r,a))||i&&a&&aa(i,a))return t;var o=this.cache,s=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;o[l]?(t.componentInstance=o[l].componentInstance,w(s,l),s.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return $}};Object.defineProperty(e,"config",t),e.util={warn:Dn,extend:F,mergeOptions:Mn,defineReactive:Fe},e.set=Ee,e.delete=Pe,e.nextTick=Gt,e.observable=function(e){return De(e),e},e.options=Object.create(null),N.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,F(e.options.components,sa),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=D(arguments,1);return n.unshift(this),d(e.install)?e.install.apply(e,n):d(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Mn(this.options,e),this}}(e),ta(e),function(e){N.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&h(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&d(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(ea),Object.defineProperty(ea.prototype,"$isServer",{get:ie}),Object.defineProperty(ea.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(ea,"FunctionalRenderContext",{value:kn}),ea.version="2.7.14";var la=g("style,class"),da=g("input,textarea,option,select,progress"),ca=g("contenteditable,draggable,spellcheck"),ua=g("events,caret,typing,plaintext-only"),ha=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),pa="http://www.w3.org/1999/xlink",fa=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},ma=function(e){return fa(e)?e.slice(6,e.length):""},va=function(e){return null==e||!1===e};function ya(e){for(var t=e.data,n=e,a=e;o(a.componentInstance);)(a=a.componentInstance._vnode)&&a.data&&(t=ga(a.data,t));for(;o(n=n.parent);)n&&n.data&&(t=ga(t,n.data));return function(e,t){if(o(e)||o(t))return ba(e,wa(t));return""}(t.staticClass,t.class)}function ga(e,t){return{staticClass:ba(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function ba(e,t){return e?t?e+" "+t:e:t||""}function wa(e){return Array.isArray(e)?function(e){for(var t,n="",a=0,r=e.length;a-1?Va(e,t,n):ha(t)?va(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):ca(t)?e.setAttribute(t,function(e,t){return va(t)||"false"===t?"false":"contenteditable"===e&&ua(t)?t:"true"}(t,n)):fa(t)?va(n)?e.removeAttributeNS(pa,ma(t)):e.setAttributeNS(pa,t,n):Va(e,t,n)}function Va(e,t,n){if(va(n))e.removeAttribute(t);else{if(Y&&!Q&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var a=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",a)};e.addEventListener("input",a),e.__ieph=!0}e.setAttribute(t,n)}}var Ba={create:$a,update:$a};function Ga(e,t){var n=t.elm,a=t.data,r=e.data;if(!(i(a.staticClass)&&i(a.class)&&(i(r)||i(r.staticClass)&&i(r.class)))){var s=ya(t),l=n._transitionClasses;o(l)&&(s=ba(s,wa(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Ha,Ja={create:Ga,update:Ga};function Ka(e,t,n){var a=Ha;return function r(){var i=t.apply(null,arguments);null!==i&&Za(e,r,n,a)}}var Ya=Rt&&!(te&&Number(te[1])<=53);function Qa(e,t,n,a){if(Ya){var r=mn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=r||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Ha.addEventListener(e,t,ae?{capture:n,passive:a}:n)}function Za(e,t,n,a){(a||Ha).removeEventListener(e,t._wrapper||t,n)}function Xa(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},a=e.data.on||{};Ha=t.elm||e.elm,function(e){if(o(e.__r)){var t=Y?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}o(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),Xe(n,a,Qa,Za,Ka,t.context),Ha=void 0}}var er,tr={create:Xa,update:Xa,destroy:function(e){return Xa(e,Fa)}};function nr(e,t){if(!i(e.data.domProps)||!i(t.data.domProps)){var n,a,r=t.elm,l=e.data.domProps||{},d=t.data.domProps||{};for(n in(o(d.__ob__)||s(d._v_attr_proxy))&&(d=t.data.domProps=F({},d)),l)n in d||(r[n]="");for(n in d){if(a=d[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),a===l[n])continue;1===r.childNodes.length&&r.removeChild(r.childNodes[0])}if("value"===n&&"PROGRESS"!==r.tagName){r._value=a;var c=i(a)?"":String(a);ar(r,c)&&(r.value=c)}else if("innerHTML"===n&&Ta(r.tagName)&&i(r.innerHTML)){(er=er||document.createElement("div")).innerHTML="".concat(a,"");for(var u=er.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;u.firstChild;)r.appendChild(u.firstChild)}else if(a!==l[n])try{r[n]=a}catch(e){}}}}function ar(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,a=e._vModifiers;if(o(a)){if(a.number)return y(n)!==y(t);if(a.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var rr={create:nr,update:nr},ir=T((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var a=e.split(n);a.length>1&&(t[a[0].trim()]=a[1].trim())}})),t}));function or(e){var t=sr(e.style);return e.staticStyle?F(e.staticStyle,t):t}function sr(e){return Array.isArray(e)?E(e):"string"==typeof e?ir(e):e}var lr,dr=/^--/,cr=/\s*!important$/,ur=function(e,t,n){if(dr.test(t))e.style.setProperty(t,n);else if(cr.test(n))e.style.setProperty(I(t),n.replace(cr,""),"important");else{var a=pr(t);if(Array.isArray(n))for(var r=0,i=n.length;r-1?t.split(vr).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function gr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(vr).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),a=" "+t+" ";n.indexOf(a)>=0;)n=n.replace(a," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function br(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&F(t,wr(e.name||"v")),F(t,e),t}return"string"==typeof e?wr(e):void 0}}var wr=T((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),xr=J&&!Q,kr="transition",Tr="transitionend",_r="animation",jr="animationend";xr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(kr="WebkitTransition",Tr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(_r="WebkitAnimation",jr="webkitAnimationEnd"));var Ar=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Sr(e){Ar((function(){Ar(e)}))}function Ir(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),yr(e,t))}function Cr(e,t){e._transitionClasses&&w(e._transitionClasses,t),gr(e,t)}function Dr(e,t,n){var a=Er(e,t),r=a.type,i=a.timeout,o=a.propCount;if(!r)return n();var s="transition"===r?Tr:jr,l=0,d=function(){e.removeEventListener(s,c),n()},c=function(t){t.target===e&&++l>=o&&d()};setTimeout((function(){l0&&(n="transition",c=o,u=i.length):"animation"===t?d>0&&(n="animation",c=d,u=l.length):u=(n=(c=Math.max(o,d))>0?o>d?"transition":"animation":null)?"transition"===n?i.length:l.length:0,{type:n,timeout:c,propCount:u,hasTransform:"transition"===n&&Fr.test(a[kr+"Property"])}}function Pr(e,t){for(;e.length1}function Lr(e,t){!0!==t.data.show&&Or(t)}var Nr=function(e){var t,n,a={},d=e.modules,c=e.nodeOps;for(t=0;tf?w(e,i(n[y+1])?null:n[y+1].elm,n,p,y,a):p>y&&k(t,u,f)}(u,m,y,n,d):o(y)?(o(e.text)&&c.setTextContent(u,""),w(u,null,y,0,y.length-1,n)):o(m)?k(m,0,m.length-1):o(e.text)&&c.setTextContent(u,""):e.text!==t.text&&c.setTextContent(u,t.text),o(f)&&o(p=f.hook)&&o(p=p.postpatch)&&p(e,t)}}}function A(e,t,n){if(s(n)&&o(e.parent))e.parent.data.pendingInsert=t;else for(var a=0;a-1,o.selected!==i&&(o.selected=i);else if(q(Br(o),a))return void(e.selectedIndex!==s&&(e.selectedIndex=s));r||(e.selectedIndex=-1)}}function Vr(e,t){return t.every((function(t){return!q(t,e)}))}function Br(e){return"_value"in e?e._value:e.value}function Gr(e){e.target.composing=!0}function Hr(e){e.target.composing&&(e.target.composing=!1,Jr(e.target,"input"))}function Jr(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Kr(e){return!e.componentInstance||e.data&&e.data.transition?e:Kr(e.componentInstance._vnode)}var Yr={model:Ur,show:{bind:function(e,t,n){var a=t.value,r=(n=Kr(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;a&&r?(n.data.show=!0,Or(n,(function(){e.style.display=i}))):e.style.display=a?i:"none"},update:function(e,t,n){var a=t.value;!a!=!t.oldValue&&((n=Kr(n)).data&&n.data.transition?(n.data.show=!0,a?Or(n,(function(){e.style.display=e.__vOriginalDisplay})):qr(n,(function(){e.style.display="none"}))):e.style.display=a?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,a,r){r||(e.style.display=e.__vOriginalDisplay)}}},Qr={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Zr(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Zr(Ft(t.children)):e}function Xr(e){var t={},n=e.$options;for(var a in n.propsData)t[a]=e[a];var r=n._parentListeners;for(var a in r)t[j(a)]=r[a];return t}function ei(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ti=function(e){return e.tag||xt(e)},ni=function(e){return"show"===e.name},ai={name:"transition",props:Qr,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ti)).length){0;var a=this.mode;0;var r=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return r;var i=Zr(r);if(!i)return r;if(this._leaving)return ei(e,r);var o="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?o+"comment":o+i.tag:l(i.key)?0===String(i.key).indexOf(o)?i.key:o+i.key:i.key;var s=(i.data||(i.data={})).transition=Xr(this),d=this._vnode,c=Zr(d);if(i.data.directives&&i.data.directives.some(ni)&&(i.data.show=!0),c&&c.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,c)&&!xt(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var u=c.data.transition=F({},s);if("out-in"===a)return this._leaving=!0,et(u,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),ei(e,r);if("in-out"===a){if(xt(i))return d;var h,p=function(){h()};et(s,"afterEnter",p),et(s,"enterCancelled",p),et(u,"delayLeave",(function(e){h=e}))}}return r}}},ri=F({tag:String,moveClass:String},Qr);function ii(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function oi(e){e.data.newPos=e.elm.getBoundingClientRect()}function si(e){var t=e.data.pos,n=e.data.newPos,a=t.left-n.left,r=t.top-n.top;if(a||r){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate(".concat(a,"px,").concat(r,"px)"),i.transitionDuration="0s"}}delete ri.mode;var li={Transition:ai,TransitionGroup:{props:ri,beforeMount:function(){var e=this,t=this._update;this._update=function(n,a){var r=rn(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,r(),t.call(e,n,a)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),a=this.prevChildren=this.children,r=this.$slots.default||[],i=this.children=[],o=Xr(this),s=0;s-1?ja[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ja[e]=/HTMLUnknownElement/.test(t.toString())},F(ea.options.directives,Yr),F(ea.options.components,li),ea.prototype.__patch__=J?Nr:P,ea.prototype.$mount=function(e,t){return function(e,t,n){var a;e.$el=t,e.$options.render||(e.$options.render=pe),ln(e,"beforeMount"),a=function(){e._update(e._render(),n)},new Zt(e,a,P,{before:function(){e._isMounted&&!e._isDestroyed&&ln(e,"beforeUpdate")}},!0),n=!1;var r=e._preWatchers;if(r)for(var i=0;i=0&&(t=e.slice(a),e=e.slice(0,a));var r=e.indexOf("?");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{path:e,query:n,hash:t}}(r.path||""),d=t&&t.path||"/",c=l.path?Ci(l.path,d,n||r.append):d,u=function(e,t,n){void 0===t&&(t={});var a,r=n||vi;try{a=r(e||"")}catch(e){a={}}for(var i in t){var o=t[i];a[i]=Array.isArray(o)?o.map(mi):mi(o)}return a}(l.query,r.query,a&&a.options.parseQuery),h=r.hash||l.hash;return h&&"#"!==h.charAt(0)&&(h="#"+h),{_normalized:!0,path:c,query:u,hash:h}}var Yi,Qi=function(){},Zi={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var t=this,n=this.$router,a=this.$route,r=n.resolve(this.to,a,this.append),i=r.location,o=r.route,s=r.href,l={},d=n.options.linkActiveClass,c=n.options.linkExactActiveClass,u=null==d?"router-link-active":d,h=null==c?"router-link-exact-active":c,p=null==this.activeClass?u:this.activeClass,f=null==this.exactActiveClass?h:this.exactActiveClass,m=o.redirectedFrom?bi(null,Ki(o.redirectedFrom),null,n):o;l[f]=_i(a,m,this.exactPath),l[p]=this.exact||this.exactPath?l[f]:function(e,t){return 0===e.path.replace(gi,"/").indexOf(t.path.replace(gi,"/"))&&(!t.hash||e.hash===t.hash)&&function(e,t){for(var n in t)if(!(n in e))return!1;return!0}(e.query,t.query)}(a,m);var v=l[f]?this.ariaCurrentValue:null,y=function(e){Xi(e)&&(t.replace?n.replace(i,Qi):n.push(i,Qi))},g={click:Xi};Array.isArray(this.event)?this.event.forEach((function(e){g[e]=y})):g[this.event]=y;var b={class:l},w=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:o,navigate:y,isActive:l[p],isExactActive:l[f]});if(w){if(1===w.length)return w[0];if(w.length>1||!w.length)return 0===w.length?e():e("span",{},w)}if("a"===this.tag)b.on=g,b.attrs={href:s,"aria-current":v};else{var x=function e(t){var n;if(t)for(var a=0;a-1&&(s.params[h]=n.params[h]);return s.path=Ji(c.path,s.params),l(c,s,o)}if(s.path){s.params={};for(var p=0;p-1}function Fo(e,t){return Do(e)&&e._isRouter&&(null==t||e.type===t)}function Eo(e,t,n){var a=function(r){r>=e.length?n():e[r]?t(e[r],(function(){a(r+1)})):a(r+1)};a(0)}function Po(e){return function(t,n,a){var r=!1,i=0,o=null;zo(e,(function(e,t,n,s){if("function"==typeof e&&void 0===e.cid){r=!0,i++;var l,d=Mo((function(t){var r;((r=t).__esModule||qo&&"Module"===r[Symbol.toStringTag])&&(t=t.default),e.resolved="function"==typeof t?t:Yi.extend(t),n.components[s]=t,--i<=0&&a()})),c=Mo((function(e){var t="Failed to resolve async component "+s+": "+e;o||(o=Do(e)?e:new Error(t),a(o))}));try{l=e(d,c)}catch(e){c(e)}if(l)if("function"==typeof l.then)l.then(d,c);else{var u=l.component;u&&"function"==typeof u.then&&u.then(d,c)}}})),r||a()}}function zo(e,t){return Oo(e.map((function(e){return Object.keys(e.components).map((function(n){return t(e.components[n],e.instances[n],e,n)}))})))}function Oo(e){return Array.prototype.concat.apply([],e)}var qo="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Mo(e){var t=!1;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];if(!t)return t=!0,e.apply(this,n)}}var Ro=function(e,t){this.router=e,this.base=function(e){if(!e)if(eo){var t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else e="/";"/"!==e.charAt(0)&&(e="/"+e);return e.replace(/\/$/,"")}(t),this.current=xi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Lo(e,t,n,a){var r=zo(e,(function(e,a,r,i){var o=function(e,t){"function"!=typeof e&&(e=Yi.extend(e));return e.options[t]}(e,t);if(o)return Array.isArray(o)?o.map((function(e){return n(e,a,r,i)})):n(o,a,r,i)}));return Oo(a?r.reverse():r)}function No(e,t){if(t)return function(){return e.apply(t,arguments)}}Ro.prototype.listen=function(e){this.cb=e},Ro.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))},Ro.prototype.onError=function(e){this.errorCbs.push(e)},Ro.prototype.transitionTo=function(e,t,n){var a,r=this;try{a=this.router.match(e,this.current)}catch(e){throw this.errorCbs.forEach((function(t){t(e)})),e}var i=this.current;this.confirmTransition(a,(function(){r.updateRoute(a),t&&t(a),r.ensureURL(),r.router.afterHooks.forEach((function(e){e&&e(a,i)})),r.ready||(r.ready=!0,r.readyCbs.forEach((function(e){e(a)})))}),(function(e){n&&n(e),e&&!r.ready&&(Fo(e,jo.redirected)&&i===xi||(r.ready=!0,r.readyErrorCbs.forEach((function(t){t(e)}))))}))},Ro.prototype.confirmTransition=function(e,t,n){var a=this,r=this.current;this.pending=e;var i,o,s=function(e){!Fo(e)&&Do(e)&&(a.errorCbs.length?a.errorCbs.forEach((function(t){t(e)})):console.error(e)),n&&n(e)},l=e.matched.length-1,d=r.matched.length-1;if(_i(e,r)&&l===d&&e.matched[l]===r.matched[d])return this.ensureURL(),e.hash&&po(this.router,r,e,!1),s(((o=Io(i=r,e,jo.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",o));var c=function(e,t){var n,a=Math.max(e.length,t.length);for(n=0;n0)){var t=this.router,n=t.options.scrollBehavior,a=ko&&n;a&&this.listeners.push(ho());var r=function(){var n=e.current,r=$o(e.base);e.current===xi&&r===e._startLocation||e.transitionTo(r,(function(e){a&&po(t,e,n,!0)}))};window.addEventListener("popstate",r),this.listeners.push((function(){window.removeEventListener("popstate",r)}))}},t.prototype.go=function(e){window.history.go(e)},t.prototype.push=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){To(Di(a.base+e.fullPath)),po(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){_o(Di(a.base+e.fullPath)),po(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.ensureURL=function(e){if($o(this.base)!==this.current.fullPath){var t=Di(this.base+this.current.fullPath);e?To(t):_o(t)}},t.prototype.getCurrentLocation=function(){return $o(this.base)},t}(Ro);function $o(e){var t=window.location.pathname,n=t.toLowerCase(),a=e.toLowerCase();return!e||n!==a&&0!==n.indexOf(Di(a+"/"))||(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash}var Wo=function(e){function t(t,n,a){e.call(this,t,n),a&&function(e){var t=$o(e);if(!/^\/#/.test(t))return window.location.replace(Di(e+"/#"+t)),!0}(this.base)||Vo()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setupListeners=function(){var e=this;if(!(this.listeners.length>0)){var t=this.router.options.scrollBehavior,n=ko&&t;n&&this.listeners.push(ho());var a=function(){var t=e.current;Vo()&&e.transitionTo(Bo(),(function(a){n&&po(e.router,a,t,!0),ko||Jo(a.fullPath)}))},r=ko?"popstate":"hashchange";window.addEventListener(r,a),this.listeners.push((function(){window.removeEventListener(r,a)}))}},t.prototype.push=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){Ho(e.fullPath),po(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){Jo(e.fullPath),po(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.go=function(e){window.history.go(e)},t.prototype.ensureURL=function(e){var t=this.current.fullPath;Bo()!==t&&(e?Ho(t):Jo(t))},t.prototype.getCurrentLocation=function(){return Bo()},t}(Ro);function Vo(){var e=Bo();return"/"===e.charAt(0)||(Jo("/"+e),!1)}function Bo(){var e=window.location.href,t=e.indexOf("#");return t<0?"":e=e.slice(t+1)}function Go(e){var t=window.location.href,n=t.indexOf("#");return(n>=0?t.slice(0,n):t)+"#"+e}function Ho(e){ko?To(Go(e)):window.location.hash=e}function Jo(e){ko?_o(Go(e)):window.location.replace(Go(e))}var Ko=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var a=this;this.transitionTo(e,(function(e){a.stack=a.stack.slice(0,a.index+1).concat(e),a.index++,t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var a=this;this.transitionTo(e,(function(e){a.stack=a.stack.slice(0,a.index).concat(e),t&&t(e)}),n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var a=this.stack[n];this.confirmTransition(a,(function(){var e=t.current;t.index=n,t.updateRoute(a),t.router.afterHooks.forEach((function(t){t&&t(a,e)}))}),(function(e){Fo(e,jo.duplicated)&&(t.index=n)}))}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(Ro),Yo=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ao(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!ko&&!1!==e.fallback,this.fallback&&(t="hash"),eo||(t="abstract"),this.mode=t,t){case"history":this.history=new Uo(this,e.base);break;case"hash":this.history=new Wo(this,e.base,this.fallback);break;case"abstract":this.history=new Ko(this,e.base);break;default:0}},Qo={currentRoute:{configurable:!0}};Yo.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},Qo.currentRoute.get=function(){return this.history&&this.history.current},Yo.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",(function(){var n=t.apps.indexOf(e);n>-1&&t.apps.splice(n,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()})),!this.app){this.app=e;var n=this.history;if(n instanceof Uo||n instanceof Wo){var a=function(e){n.setupListeners(),function(e){var a=n.current,r=t.options.scrollBehavior;ko&&r&&"fullPath"in e&&po(t,e,a,!1)}(e)};n.transitionTo(n.getCurrentLocation(),a,a)}n.listen((function(e){t.apps.forEach((function(t){t._route=e}))}))}},Yo.prototype.beforeEach=function(e){return Xo(this.beforeHooks,e)},Yo.prototype.beforeResolve=function(e){return Xo(this.resolveHooks,e)},Yo.prototype.afterEach=function(e){return Xo(this.afterHooks,e)},Yo.prototype.onReady=function(e,t){this.history.onReady(e,t)},Yo.prototype.onError=function(e){this.history.onError(e)},Yo.prototype.push=function(e,t,n){var a=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){a.history.push(e,t,n)}));this.history.push(e,t,n)},Yo.prototype.replace=function(e,t,n){var a=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){a.history.replace(e,t,n)}));this.history.replace(e,t,n)},Yo.prototype.go=function(e){this.history.go(e)},Yo.prototype.back=function(){this.go(-1)},Yo.prototype.forward=function(){this.go(1)},Yo.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map((function(e){return Object.keys(e.components).map((function(t){return e.components[t]}))}))):[]},Yo.prototype.resolve=function(e,t,n){var a=Ki(e,t=t||this.history.current,n,this),r=this.match(a,t),i=r.redirectedFrom||r.fullPath;return{location:a,route:r,href:function(e,t,n){var a="hash"===n?"#"+t:t;return e?Di(e+"/"+a):a}(this.history.base,i,this.mode),normalizedTo:a,resolved:r}},Yo.prototype.getRoutes=function(){return this.matcher.getRoutes()},Yo.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==xi&&this.history.transitionTo(this.history.getCurrentLocation())},Yo.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==xi&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Yo.prototype,Qo);var Zo=Yo;function Xo(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}Yo.install=function e(t){if(!e.installed||Yi!==t){e.installed=!0,Yi=t;var n=function(e){return void 0!==e},a=function(e,t){var a=e.$options._parentVnode;n(a)&&n(a=a.data)&&n(a=a.registerRouteInstance)&&a(e,t)};t.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,a(this,this)},destroyed:function(){a(this)}}),Object.defineProperty(t.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this._routerRoot._route}}),t.component("RouterView",Si),t.component("RouterLink",Zi);var r=t.config.optionMergeStrategies;r.beforeRouteEnter=r.beforeRouteLeave=r.beforeRouteUpdate=r.created}},Yo.version="3.6.5",Yo.isNavigationFailure=Fo,Yo.NavigationFailureType=jo,Yo.START_LOCATION=xi,eo&&window.Vue&&window.Vue.use(Yo);n(102);n(91),n(129);var es={NotFound:()=>n.e(7).then(n.bind(null,300)),Layout:()=>Promise.all([n.e(0),n.e(3),n.e(2)]).then(n.bind(null,299))},ts={"v-c97ca880":()=>n.e(9).then(n.bind(null,303)),"v-5e1e685a":()=>n.e(8).then(n.bind(null,304)),"v-4f037d1a":()=>n.e(11).then(n.bind(null,305)),"v-18d0587a":()=>n.e(12).then(n.bind(null,306)),"v-3120da0c":()=>n.e(13).then(n.bind(null,307)),"v-2f7f848c":()=>n.e(14).then(n.bind(null,308)),"v-2eaf1140":()=>n.e(15).then(n.bind(null,309)),"v-18c2b964":()=>n.e(16).then(n.bind(null,310)),"v-09d6f550":()=>n.e(17).then(n.bind(null,311)),"v-9356a30c":()=>n.e(18).then(n.bind(null,312)),"v-7cc0117c":()=>n.e(19).then(n.bind(null,313)),"v-58f7366c":()=>n.e(21).then(n.bind(null,314)),"v-690a4650":()=>n.e(20).then(n.bind(null,315)),"v-0877efcc":()=>n.e(22).then(n.bind(null,316)),"v-950c4d48":()=>n.e(23).then(n.bind(null,317)),"v-47c1f97a":()=>n.e(24).then(n.bind(null,318)),"v-4fad50ba":()=>n.e(25).then(n.bind(null,319)),"v-31657474":()=>n.e(27).then(n.bind(null,320)),"v-e2784654":()=>n.e(28).then(n.bind(null,321)),"v-0c3bd15a":()=>n.e(29).then(n.bind(null,322)),"v-4fc0d1c8":()=>n.e(26).then(n.bind(null,323)),"v-84e0b14c":()=>n.e(30).then(n.bind(null,324)),"v-0d650648":()=>n.e(32).then(n.bind(null,325)),"v-3e6ef1ac":()=>n.e(33).then(n.bind(null,326)),"v-6dd912ec":()=>n.e(34).then(n.bind(null,327)),"v-52bf2fcc":()=>n.e(35).then(n.bind(null,328)),"v-3258450c":()=>n.e(36).then(n.bind(null,329)),"v-a6e64848":()=>n.e(37).then(n.bind(null,330)),"v-35b0f3b1":()=>n.e(38).then(n.bind(null,331)),"v-e65ea9a4":()=>n.e(39).then(n.bind(null,332)),"v-57c590fa":()=>n.e(40).then(n.bind(null,333)),"v-45095440":()=>n.e(41).then(n.bind(null,334)),"v-d297eaa6":()=>n.e(42).then(n.bind(null,335)),"v-0d609624":()=>n.e(10).then(n.bind(null,336)),"v-f81e553c":()=>n.e(43).then(n.bind(null,337)),"v-7cc2c9e4":()=>n.e(44).then(n.bind(null,338)),"v-5d3101c8":()=>n.e(45).then(n.bind(null,339)),"v-501d8193":()=>n.e(46).then(n.bind(null,340)),"v-074d53cc":()=>n.e(31).then(n.bind(null,341))};function ns(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}const as=/-(\w)/g,rs=ns(e=>e.replace(as,(e,t)=>t?t.toUpperCase():"")),is=/\B([A-Z])/g,os=ns(e=>e.replace(is,"-$1").toLowerCase()),ss=ns(e=>e.charAt(0).toUpperCase()+e.slice(1));function ls(e,t){if(!t)return;if(e(t))return e(t);return t.includes("-")?e(ss(rs(t))):e(ss(t))||e(os(t))}const ds=Object.assign({},es,ts),cs=e=>ds[e],us=e=>ts[e],hs=e=>es[e],ps=e=>ea.component(e);function fs(e){return ls(us,e)}function ms(e){return ls(hs,e)}function vs(e){return ls(cs,e)}function ys(e){return ls(ps,e)}function gs(...e){return Promise.all(e.filter(e=>e).map(async e=>{if(!ys(e)&&vs(e)){const t=await vs(e)();ea.component(e,t.default)}}))}function bs(e,t){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[e]=t)}var ws=n(88),xs=n.n(ws),ks=n(89),Ts=n.n(ks),_s={created(){if(this.siteMeta=this.$site.headTags.filter(([e])=>"meta"===e).map(([e,t])=>t),this.$ssrContext){const t=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(e=t)?e.map(e=>{let t="{t+=` ${n}="${Ts()(e[n])}"`}),t+">"}).join("\n "):"",this.$ssrContext.canonicalLink=As(this.$canonicalUrl)}var e},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const e=this.getMergedMetaTags();this.currentMetaTags=Ss(e,this.currentMetaTags)},getMergedMetaTags(){const e=this.$page.frontmatter.meta||[];return xs()([{name:"description",content:this.$description}],e,this.siteMeta,Is)},updateCanonicalLink(){js(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",As(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){Ss(null,this.currentMetaTags),js()}};function js(){const e=document.querySelector("link[rel='canonical']");e&&e.remove()}function As(e=""){return e?``:""}function Ss(e,t){if(t&&[...t].filter(e=>e.parentNode===document.head).forEach(e=>document.head.removeChild(e)),e)return e.map(e=>{const t=document.createElement("meta");return Object.keys(e).forEach(n=>{t.setAttribute(n,e[n])}),document.head.appendChild(t),t})}function Is(e){for(const t of["name","property","itemprop"])if(e.hasOwnProperty(t))return e[t]+t;return JSON.stringify(e)}var Cs=n(90),Ds={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(Cs)()((function(){this.setActiveHash()}),300),setActiveHash(){const e=[].slice.call(document.querySelectorAll(".sidebar-link")),t=[].slice.call(document.querySelectorAll(".header-anchor")).filter(t=>e.some(e=>e.hash===t.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),r=window.innerHeight+n;for(let e=0;e=i.parentElement.offsetTop+10&&(!o||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Fs=n(22),Es=n.n(Fs),Ps={mounted(){Es.a.configure({showSpinner:!1}),this.$router.beforeEach((e,t,n)=>{e.path===t.path||ea.component(e.name)||Es.a.start(),n()}),this.$router.afterEach(()=>{Es.a.done(),this.isSidebarOpen=!1})}},zs={props:{parent:Object,code:String,options:{align:String,color:String,backgroundTransition:Boolean,backgroundColor:String,successText:String,staticIcon:Boolean}},data:()=>({success:!1,originalBackground:null,originalTransition:null}),computed:{alignStyle(){let e={};return e[this.options.align]="7.5px",e},iconClass(){return this.options.staticIcon?"":"hover"}},mounted(){this.originalTransition=this.parent.style.transition,this.originalBackground=this.parent.style.background},beforeDestroy(){this.parent.style.transition=this.originalTransition,this.parent.style.background=this.originalBackground},methods:{hexToRgb(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},copyToClipboard(e){if(navigator.clipboard)navigator.clipboard.writeText(this.code).then(()=>{this.setSuccessTransitions()},()=>{});else{let e=document.createElement("textarea");document.body.appendChild(e),e.value=this.code,e.select(),document.execCommand("Copy"),e.remove(),this.setSuccessTransitions()}},setSuccessTransitions(){if(clearTimeout(this.successTimeout),this.options.backgroundTransition){this.parent.style.transition="background 350ms";let e=this.hexToRgb(this.options.backgroundColor);this.parent.style.background=`rgba(${e.r}, ${e.g}, ${e.b}, 0.1)`}this.success=!0,this.successTimeout=setTimeout(()=>{this.options.backgroundTransition&&(this.parent.style.background=this.originalBackground,this.parent.style.transition=this.originalTransition),this.success=!1},500)}}},Os=(n(237),n(10)),qs=Object(Os.a)(zs,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"code-copy"},[t("svg",{class:e.iconClass,style:e.alignStyle,attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},on:{click:e.copyToClipboard}},[t("path",{attrs:{fill:"none",d:"M0 0h24v24H0z"}}),e._v(" "),t("path",{attrs:{fill:e.options.color,d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}})]),e._v(" "),t("span",{class:e.success?"success":"",style:e.alignStyle},[e._v("\n "+e._s(e.options.successText)+"\n ")])])}),[],!1,null,"49140617",null).exports,Ms=(n(238),[_s,Ds,Ps,{updated(){this.update()},methods:{update(){setTimeout(()=>{document.querySelectorAll('div[class*="language-"] pre').forEach(e=>{if(e.classList.contains("code-copy-added"))return;let t=new(ea.extend(qs));t.options={align:"bottom",color:"#27b1ff",backgroundTransition:!0,backgroundColor:"#0075b8",successText:"Copied!",staticIcon:!1},t.code=e.innerText,t.parent=e,t.$mount(),e.classList.add("code-copy-added"),e.appendChild(t.$el)})},100)}}}]),Rs={name:"GlobalLayout",computed:{layout(){const e=this.getLayout();return bs("layout",e),ea.component(e)}},methods:{getLayout(){if(this.$page.path){const e=this.$page.frontmatter.layout;return e&&(this.$vuepress.getLayoutAsyncComponent(e)||this.$vuepress.getVueComponent(e))?e:"Layout"}return"NotFound"}}},Ls=Object(Os.a)(Rs,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(e,t,n){switch(t){case"components":e[t]||(e[t]={}),Object.assign(e[t],n);break;case"mixins":e[t]||(e[t]=[]),e[t].push(...n);break;default:throw new Error("Unknown option name.")}}(Ls,"mixins",Ms);const Ns=[{name:"v-c97ca880",path:"/docs/arfs/data-model.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-c97ca880").then(n)}},{name:"v-5e1e685a",path:"/docs/arfs/content-types.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-5e1e685a").then(n)}},{name:"v-4f037d1a",path:"/docs/arfs/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-4f037d1a").then(n)}},{path:"/docs/arfs/index.html",redirect:"/docs/arfs/"},{path:"/docs/arfs/overview.html",redirect:"/docs/arfs/"},{name:"v-18d0587a",path:"/docs/arfs/privacy.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-18d0587a").then(n)}},{name:"v-3120da0c",path:"/docs/arfs/schema-diagrams.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-3120da0c").then(n)}},{name:"v-2f7f848c",path:"/docs/arfs/usage/change/drives.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-2f7f848c").then(n)}},{name:"v-2eaf1140",path:"/docs/arfs/usage/change/files.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-2eaf1140").then(n)}},{name:"v-18c2b964",path:"/docs/arfs/usage/change/folders.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-18c2b964").then(n)}},{name:"v-09d6f550",path:"/docs/arfs/usage/change/snapshots.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-09d6f550").then(n)}},{name:"v-9356a30c",path:"/docs/arfs/usage/create/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-9356a30c").then(n)}},{path:"/docs/arfs/usage/create/index.html",redirect:"/docs/arfs/usage/create/"},{path:"/docs/arfs/usage/create/create-drive.html",redirect:"/docs/arfs/usage/create/"},{name:"v-7cc0117c",path:"/docs/arfs/usage/create/create-file.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-7cc0117c").then(n)}},{name:"v-58f7366c",path:"/docs/arfs/usage/create/create-snapshot.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-58f7366c").then(n)}},{name:"v-690a4650",path:"/docs/arfs/usage/create/create-folder.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-690a4650").then(n)}},{name:"v-0877efcc",path:"/docs/arfs/usage/extending-schemas.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-0877efcc").then(n)}},{name:"v-950c4d48",path:"/docs/arfs/usage/read/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-950c4d48").then(n)}},{path:"/docs/arfs/usage/read/index.html",redirect:"/docs/arfs/usage/read/"},{path:"/docs/arfs/usage/read/read-operations.html",redirect:"/docs/arfs/usage/read/"},{name:"v-47c1f97a",path:"/docs/cli/all-commands.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-47c1f97a").then(n)}},{name:"v-4fad50ba",path:"/docs/cli/getting-help.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-4fad50ba").then(n)}},{name:"v-31657474",path:"/docs/cli/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-31657474").then(n)}},{path:"/docs/cli/index.html",redirect:"/docs/cli/"},{path:"/docs/cli/intro.html",redirect:"/docs/cli/"},{name:"v-e2784654",path:"/docs/cli/using-the-cli.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-e2784654").then(n)}},{name:"v-0c3bd15a",path:"/docs/core-sdk.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-0c3bd15a").then(n)}},{name:"v-4fc0d1c8",path:"/docs/cli/getting-started.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-4fc0d1c8").then(n)}},{name:"v-84e0b14c",path:"/docs/misc/deploy/deploy.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-84e0b14c").then(n)}},{name:"v-0d650648",path:"/docs/misc/deploy/paths.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-0d650648").then(n)}},{name:"v-3e6ef1ac",path:"/docs/misc/deploy/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-3e6ef1ac").then(n)}},{path:"/docs/misc/deploy/index.html",redirect:"/docs/misc/deploy/"},{path:"/docs/misc/deploy/prepare.html",redirect:"/docs/misc/deploy/"},{name:"v-6dd912ec",path:"/docs/misc/deploy/routing.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-6dd912ec").then(n)}},{name:"v-52bf2fcc",path:"/docs/misc/ethareum/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-52bf2fcc").then(n)}},{path:"/docs/misc/ethareum/index.html",redirect:"/docs/misc/ethareum/"},{path:"/docs/misc/eth.html",redirect:"/docs/misc/ethareum/"},{name:"v-3258450c",path:"/docs/misc/permasite.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-3258450c").then(n)}},{name:"v-a6e64848",path:"/docs/misc/price-calculator.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-a6e64848").then(n)}},{name:"v-35b0f3b1",path:"/docs/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-35b0f3b1").then(n)}},{path:"/docs/index.html",redirect:"/docs/"},{name:"v-e65ea9a4",path:"/docs/turbo/api/payment.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-e65ea9a4").then(n)}},{name:"v-57c590fa",path:"/docs/turbo/api/upload.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-57c590fa").then(n)}},{name:"v-45095440",path:"/docs/turbo/migrating.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-45095440").then(n)}},{name:"v-d297eaa6",path:"/docs/turbo/turbo-sdk/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-d297eaa6").then(n)}},{path:"/docs/turbo/turbo-sdk/index.html",redirect:"/docs/turbo/turbo-sdk/"},{name:"v-0d609624",path:"/docs/arfs/entity-types.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-0d609624").then(n)}},{name:"v-f81e553c",path:"/docs/turbo/turbo-sdk/release-notes.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-f81e553c").then(n)}},{name:"v-7cc2c9e4",path:"/docs/turbo/turbo-sdk/turbo-web.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-7cc2c9e4").then(n)}},{name:"v-5d3101c8",path:"/docs/turbo/what-is-turbo.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-5d3101c8").then(n)}},{name:"v-501d8193",path:"/",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-501d8193").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-074d53cc",path:"/docs/misc/deploy/examples.html",component:Ls,beforeEnter:(e,t,n)=>{gs("Layout","v-074d53cc").then(n)}},{path:"*",component:Ls}],Us={title:"ArDrive Docs",description:"ArDrive documentation",base:"/",headTags:[["meta",{property:"og:title",content:"ArDrive Docs Portal"}],["meta",{name:"twitter:title",content:"ArDrive Docs Portal"}],["meta",{name:"twitter:card",content:"summary_large_image"}],["meta",{name:"twitter:image",content:"https://docs.ardrive.io/images/card-image.png"}],["meta",{name:"twitter:site",content:"@ardriveapp"}],["meta",{property:"og:image",content:"https://docs.ardrive.io/images/card-image.png"}],["meta",{name:"theme-color",content:"#3eaf7c"}],["meta",{name:"apple-mobile-web-app-capable",content:"yes"}],["meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"}],["script",{src:"https://plausible.io/js/script.js",defer:!0,"data-domain":"docs.ardrive.io"}]],pages:[{title:"Data Model",frontmatter:{},regularPath:"/docs/arfs/data-model.html",relativePath:"docs/arfs/data-model.md",key:"v-c97ca880",path:"/docs/arfs/data-model.html",headers:[{level:2,title:"Entity relationships",slug:"entity-relationships",normalizedTitle:"entity relationships",charIndex:1595},{level:2,title:"Metadata Format",slug:"metadata-format",normalizedTitle:"metadata format",charIndex:2118}],headersStr:"Entity relationships Metadata Format",content:'# Data Model\n\nBecause of Arweave\'s permanent and immutable nature, traditional file structure operations such as renaming and moving files or folders cannot be accomplished by simply updating on-chain data. ArFS works around this by defining an append-only transaction data model based on the metadata tags found in the Arweave Transaction Headers.\n\nThis model uses a bottom-up reference method, which avoids race conditions in file system updates. Each file contains metadata that refers to the parent folder, and each folder contains metadata that refers to its parent drive. A top-down data model would require the parent model (i.e. a folder) to store references to its children.\n\nThese defined entities allow the state of the drive to be constructed by a client to look and feel like a file system\n\n * Drive Entities contain folders and files\n\n * Folder Entities contain other folders or files\n\n * File Entities contain both the file data and metadata\n\n * Snapshot entities contain a state rollups of all files and folder metadata within a drive\n\n * Drive Entities contain folders and files\n\n * Folder Entities contain other folders or files\n\n * File Entities contain both the file data and metadata\n\n * Snapshot entities contain a state rollups of all files and folder metadata within a drive\n\n * Drive Entities contain folders and files\n\n * Folder Entities contain other folders or files\n\n * File Entities are composed by both the file data and metadata\n\n * Snapshot entities contain a state rollups of all entities\' (such as drive, folder, file and snapshot) metadata within a drive\n\n\n# Entity relationships\n\nThe following diagram shows the high level relationships between drive, folder, and file entities, and their associated data. More detailed information about each Entity Type can be found here.\n\nEntity Relationship Diagram\n\nAs you can see, each file and folder contains metadata which points to both the parent folder and the parent drive. The drive entity contains metadata about itself, but not the child contents. So clients must build drive states from the lowest level and work their way up.\n\n\n# Metadata Format\n\nMetadata stored in any Arweave transaction tag will be defined in the following manner:\n\n{ "name": "Example-Tag", "value": "example-data" }\n\n\nMetadata stored in the Transaction Data Payload will follow JSON formatting like below:\n\n{\n "exampleField": "exampleData"\n}\n\n\nfields with a ? suffix are optional.\n\n{\n "name": "My Project",\n "description": "This is a sample project.",\n "version?": "1.0.0",\n "author?": "John Doe"\n}\n\n\nEnumerated field values (those which must adhere to certain values) are defined in the format "value 1 | value 2".\n\nAll UUIDs used for Entity-Ids are based on the Universally Unique Identifier standard.\n\nThere are no requirements to list ArFS tags in any specific order.',normalizedContent:'# data model\n\nbecause of arweave\'s permanent and immutable nature, traditional file structure operations such as renaming and moving files or folders cannot be accomplished by simply updating on-chain data. arfs works around this by defining an append-only transaction data model based on the metadata tags found in the arweave transaction headers.\n\nthis model uses a bottom-up reference method, which avoids race conditions in file system updates. each file contains metadata that refers to the parent folder, and each folder contains metadata that refers to its parent drive. a top-down data model would require the parent model (i.e. a folder) to store references to its children.\n\nthese defined entities allow the state of the drive to be constructed by a client to look and feel like a file system\n\n * drive entities contain folders and files\n\n * folder entities contain other folders or files\n\n * file entities contain both the file data and metadata\n\n * snapshot entities contain a state rollups of all files and folder metadata within a drive\n\n * drive entities contain folders and files\n\n * folder entities contain other folders or files\n\n * file entities contain both the file data and metadata\n\n * snapshot entities contain a state rollups of all files and folder metadata within a drive\n\n * drive entities contain folders and files\n\n * folder entities contain other folders or files\n\n * file entities are composed by both the file data and metadata\n\n * snapshot entities contain a state rollups of all entities\' (such as drive, folder, file and snapshot) metadata within a drive\n\n\n# entity relationships\n\nthe following diagram shows the high level relationships between drive, folder, and file entities, and their associated data. more detailed information about each entity type can be found here.\n\nentity relationship diagram\n\nas you can see, each file and folder contains metadata which points to both the parent folder and the parent drive. the drive entity contains metadata about itself, but not the child contents. so clients must build drive states from the lowest level and work their way up.\n\n\n# metadata format\n\nmetadata stored in any arweave transaction tag will be defined in the following manner:\n\n{ "name": "example-tag", "value": "example-data" }\n\n\nmetadata stored in the transaction data payload will follow json formatting like below:\n\n{\n "examplefield": "exampledata"\n}\n\n\nfields with a ? suffix are optional.\n\n{\n "name": "my project",\n "description": "this is a sample project.",\n "version?": "1.0.0",\n "author?": "john doe"\n}\n\n\nenumerated field values (those which must adhere to certain values) are defined in the format "value 1 | value 2".\n\nall uuids used for entity-ids are based on the universally unique identifier standard.\n\nthere are no requirements to list arfs tags in any specific order.',charsets:{cjk:!0}},{title:"Content Types",frontmatter:{},regularPath:"/docs/arfs/content-types.html",relativePath:"docs/arfs/content-types.md",key:"v-5e1e685a",path:"/docs/arfs/content-types.html",headers:[{level:2,title:"Other Tags",slug:"other-tags",normalizedTitle:"other tags",charIndex:1007}],headersStr:"Other Tags",content:"# Content Types\n\nAll transaction types in ArFS leverage a specific metadata tag for the Content-Type (also known as mime-type) of the data that is included in the transaction. ArFS clients must determine what the mime-type of the data is, in order for Arweave gateways and browsers to render this content appropriately.\n\nAll public drive, folder, and file (metadata only) entity transactions all use a JSON standard, therefore they must have the following content type tag:\n\nContent-Type: ''\n\n\nHowever, a file's data transaction must have its mime-type determined. This is stored in the file's corresponding metadata transaction JSON's dataContentType as well as the content type tag in the data transaction itself.\n\nContent-Type: \"\"\n\n\nAll private drive, folder, and file entity transactions must have the following content type, since they are encrypted:\n\nContent-Type: ''\n\n\nArDrive-Core includes methods to determine a file's content type\n\n\n# Other Tags\n\nArFS enabled clients should include the following tags on their transactions to identify their application\n\nApp-Name: \"'\n\n\nhowever, a file's data transaction must have its mime-type determined. this is stored in the file's corresponding metadata transaction json's datacontenttype as well as the content type tag in the data transaction itself.\n\ncontent-type: \"\"\n\n\nall private drive, folder, and file entity transactions must have the following content type, since they are encrypted:\n\ncontent-type: ''\n\n\nardrive-core includes methods to determine a file's content type\n\n\n# other tags\n\narfs enabled clients should include the following tags on their transactions to identify their application\n\napp-name: \""\n\n\nIf a Drive entity is private, an additional tag Drive-Auth-Mode must also be used to indicate how the Drive Key is derived. ArDrive clients currently leverage a secure password along with the Arweave Wallet private key signature to derive the global Drive Key.\n\nDrive-Auth-Mode?: \'password\'\n\n\nOn every encrypted Drive Entity, a Cipher tag must be specified, along with the public parameters for decrypting the data. This is done by specifying the parameter with a Cipher-* tag. eg. Cipher-IV. If the parameter is byte data, it must be encoded as Base64 in the tag.\n\nArDrive clients currently leverage AES256-GCM for all symmetric encryption, which requires a Cipher Initialization Vector consisting of 12 random bytes.\n\nCipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n\n\nAdditionally, all encrypted transactions must have the Content-Type tag application/octet-stream as opposed to application/json\n\nPrivate Drive Entities and their corresponding Root Folder Entities will both use these keys and ciphers generated to symmetrically encrypt the JSON files that are included in the transaction. This ensures that only the Drive Owner (and whomever the keys have been shared with) can open the drive, discover the root folder, and continue to load the rest of the children in the drive.\n\n\n# Private Files\n\nWhen a file is uploaded to a private drive, it by default also becomes private and leverages the same drive keys used for its parent drive. Each unique file in a drive will get its own set of file keys based off of that file\'s unique FileId. If a single file gets a new version, its File-Id will be reused, effectively leveraging the same File Key for all versions in that file\'s history.\n\nThese file keys can be shared by the drive\'s owner as needed.\n\nPrivate File entities have both its metadata and data transactions encrypted using the same File Key, ensuring all facets of the data is truly private. As such, both the file\'s metadata and data transactions must both have a unique Cipher-IV and Cipher tag:\n\nCipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n\n\nJust like drives, private files must have the Content-Type tag set as application/octet-stream in both its metadata and data transactions:\n\nContent-Type: "application/octet-stream"\n',normalizedContent:'# privacy\n\nthe arweave blockweave is inherently public. but with apps that use arfs, like ardrive, your private data never leaves your computer without using military grade (and quantum resistant) encryption. this privacy layer is applied at the drive level, and users determine whether a drive is public or private when they first create it. private drives must follow the arfs privacy model.\n\nwith ardrive specifically, every file within a private drive is symmetrically encrypted using aes-256-gcm (for small files and metadata transactions) or aes-256-ctr (for large files, over 100mib). every private drive has a master "drive key" which uses a combination of the user\'s arweave wallet signature, a user defined drive password, and a unique drive identifier (uuidv4). each file has its own "file key" derived from the "drive key". this allows for single files to be shared without exposing access to the other files within the drive.\n\nonce a file is encrypted and stored on arweave, it is locked forever and can only be decrypted using its file key.\n\nnote: usable encryption standards are not limited to aes-256-gcm or aes-256-ctr. any encryption method may be used so long as it is clearly indicated in the cipher tag.\n\n\n# deriving keys\n\nprivate drives have a global drive key, d, and multiple file keys f, for encryption. this enables a drive to have as many uniquely encrypted files as needed. one key is used for all versions of a single file (since new file versions use the same file-id)\n\nd is used for encrypting both drive and folder metadata, while f is used for encrypting file metadata and the actual stored data. having these different keys, d and f, allows a user to share specific files without revealing the contents of their entire drive.\n\nd is derived using hkdf-sha256 with an unsalted rsa-pss signature of the drive\'s id and a user provided password.\n\nf is also derived using hkdf-sha256 with the drive key and the file\'s id.\n\nother wallets (like arconnect) integrate with this key derivation protocol just exposing an api to collect a signature from a given arweave wallet in order to get the sha-256 signature needed for the hkdf to derive the drive key.\n\nan example implementation, using dart, is available here, with a typescript implementation here.\n\n\n# private drives\n\ndrives can store either public or private data. this is indicated by the drive-privacy tag in the drive entity metadata.\n\ndrive-privacy: ""\n\n\nif a drive entity is private, an additional tag drive-auth-mode must also be used to indicate how the drive key is derived. ardrive clients currently leverage a secure password along with the arweave wallet private key signature to derive the global drive key.\n\ndrive-auth-mode?: \'password\'\n\n\non every encrypted drive entity, a cipher tag must be specified, along with the public parameters for decrypting the data. this is done by specifying the parameter with a cipher-* tag. eg. cipher-iv. if the parameter is byte data, it must be encoded as base64 in the tag.\n\nardrive clients currently leverage aes256-gcm for all symmetric encryption, which requires a cipher initialization vector consisting of 12 random bytes.\n\ncipher?: "aes256-gcm"\ncipher-iv?: "<12 byte initialization vector as base64>"\n\n\nadditionally, all encrypted transactions must have the content-type tag application/octet-stream as opposed to application/json\n\nprivate drive entities and their corresponding root folder entities will both use these keys and ciphers generated to symmetrically encrypt the json files that are included in the transaction. this ensures that only the drive owner (and whomever the keys have been shared with) can open the drive, discover the root folder, and continue to load the rest of the children in the drive.\n\n\n# private files\n\nwhen a file is uploaded to a private drive, it by default also becomes private and leverages the same drive keys used for its parent drive. each unique file in a drive will get its own set of file keys based off of that file\'s unique fileid. if a single file gets a new version, its file-id will be reused, effectively leveraging the same file key for all versions in that file\'s history.\n\nthese file keys can be shared by the drive\'s owner as needed.\n\nprivate file entities have both its metadata and data transactions encrypted using the same file key, ensuring all facets of the data is truly private. as such, both the file\'s metadata and data transactions must both have a unique cipher-iv and cipher tag:\n\ncipher?: "aes256-gcm"\ncipher-iv?: "<12 byte initialization vector as base64>"\n\n\njust like drives, private files must have the content-type tag set as application/octet-stream in both its metadata and data transactions:\n\ncontent-type: "application/octet-stream"\n',charsets:{cjk:!0}},{title:"Schema Diagrams",frontmatter:{},regularPath:"/docs/arfs/schema-diagrams.html",relativePath:"docs/arfs/schema-diagrams.md",key:"v-3120da0c",path:"/docs/arfs/schema-diagrams.html",headers:[{level:2,title:"Schema Diagrams",slug:"schema-diagrams",normalizedTitle:"schema diagrams",charIndex:2},{level:3,title:"Public Drive",slug:"public-drive",normalizedTitle:"public drive",charIndex:112},{level:3,title:"Private Drive",slug:"private-drive",normalizedTitle:"private drive",charIndex:150}],headersStr:"Schema Diagrams Public Drive Private Drive",content:"# Schema Diagrams\n\nThe following diagrams show complete examples of Drive, Folder, and File entity Schemas.\n\n\n# Public Drive\n\nPublic Drive Schema\n\n\n# Private Drive\n\nPrivate Drive Schema\n\nArweave GQL Tag Byte Limit is restricted to 2048. There is no determined limit on Data JSON custom metadata, though more data results in a higher upload cost.",normalizedContent:"# schema diagrams\n\nthe following diagrams show complete examples of drive, folder, and file entity schemas.\n\n\n# public drive\n\npublic drive schema\n\n\n# private drive\n\nprivate drive schema\n\narweave gql tag byte limit is restricted to 2048. there is no determined limit on data json custom metadata, though more data results in a higher upload cost.",charsets:{}},{title:"Drive Write Operations",frontmatter:{},regularPath:"/docs/arfs/usage/change/drives.html",relativePath:"docs/arfs/usage/change/drives.md",key:"v-2f7f848c",path:"/docs/arfs/usage/change/drives.html",headers:[{level:2,title:"Rename Drives",slug:"rename-drives",normalizedTitle:"rename drives",charIndex:29}],headersStr:"Rename Drives",content:"# Drive Write Operations\n\n\n# Rename Drives\n\n * A new root folder metadata transaction is created when a user wants to rename an existing drive.\n * The new root folder metadata transaction reuses the existing drive's Drive-Id and Folder-Id, and copies all of its old metadata values, except the drive's and folder's name field must be updated in its data JSON to the new drive name.\n * For private drives, new ciphers are generated for this new root folder metadata transaction.\n * The new root folder transaction must not have any Parent-Folder-Id since it is a root folder.",normalizedContent:"# drive write operations\n\n\n# rename drives\n\n * a new root folder metadata transaction is created when a user wants to rename an existing drive.\n * the new root folder metadata transaction reuses the existing drive's drive-id and folder-id, and copies all of its old metadata values, except the drive's and folder's name field must be updated in its data json to the new drive name.\n * for private drives, new ciphers are generated for this new root folder metadata transaction.\n * the new root folder transaction must not have any parent-folder-id since it is a root folder.",charsets:{}},{title:"File Write Operations",frontmatter:{},regularPath:"/docs/arfs/usage/change/files.html",relativePath:"docs/arfs/usage/change/files.md",key:"v-2eaf1140",path:"/docs/arfs/usage/change/files.html",headers:[{level:2,title:"Move File",slug:"move-file",normalizedTitle:"move file",charIndex:28},{level:2,title:"Rename File",slug:"rename-file",normalizedTitle:"rename file",charIndex:602},{level:2,title:"Update File Version",slug:"update-file-version",normalizedTitle:"update file version",charIndex:1171},{level:2,title:"Hide or Unhide File",slug:"hide-or-unhide-file",normalizedTitle:"hide or unhide file",charIndex:2050}],headersStr:"Move File Rename File Update File Version Hide or Unhide File",content:"# File Write Operations\n\n\n# Move File\n\nFiles can be moved from one folder to another within the same Drive.\n\n * A new file metadata transaction is created when a user wants to move a file into a different folder.\n * The new file metadata transaction copies all of the file’s old metadata values, but the file’s Parent-Folder-Id must be updated to the Folder-Id of the folder is was just moved to.\n * For private files, a new Cipher-IV is generated for this new metadata transaction.\n * File’s must not be allowed to be moved into a folder if a file exists in that folder with the same file name.\n\n\n# Rename File\n\nFiles can be renamed from one name to another.\n\n * A new file metadata transaction is created when a user wants to rename an existing file.\n * The new file metadata transaction reuses the existing file’s File-Id and copies all of it’s old metadata values, but the file’s name field in its Data JSON must be updated to the new file name and extension.\n * For private files, a new Cipher-IV is generated for this new metadata transaction.\n * File’s must not be allowed to be renamed to the name of another file with that same name in that same folder.\n\n\n# Update File Version\n\nWhen a user adds a new file to a folder, and there is a file in that folder with the same name, then a new file version is created.\n\n * A new file version uses the same File-Id of the file with the matching name and same Parent-Folder-Id.\n * The file upload process is followed and new File Metadata and Data transactions are created.\n * However a new UUID is not generated and the same File-Id and associated metadata is used for this new version\n * The new File Metadata Transaction points to the new Data transaction.\n * Since the File-Id remains the same, the File Keys for private files can decrypt all versions of that file.\n * For private files, new Cipher-IVs are generated for this new metadata and data transaction\n * ArFS clients can now iterate through the state of this file, since it will have multiple versions using the same File-Id.\n\n\n# Hide or Unhide File\n\nChanging the value of isHidden in a file's metadata will change whether or not a client should display that file.",normalizedContent:"# file write operations\n\n\n# move file\n\nfiles can be moved from one folder to another within the same drive.\n\n * a new file metadata transaction is created when a user wants to move a file into a different folder.\n * the new file metadata transaction copies all of the file’s old metadata values, but the file’s parent-folder-id must be updated to the folder-id of the folder is was just moved to.\n * for private files, a new cipher-iv is generated for this new metadata transaction.\n * file’s must not be allowed to be moved into a folder if a file exists in that folder with the same file name.\n\n\n# rename file\n\nfiles can be renamed from one name to another.\n\n * a new file metadata transaction is created when a user wants to rename an existing file.\n * the new file metadata transaction reuses the existing file’s file-id and copies all of it’s old metadata values, but the file’s name field in its data json must be updated to the new file name and extension.\n * for private files, a new cipher-iv is generated for this new metadata transaction.\n * file’s must not be allowed to be renamed to the name of another file with that same name in that same folder.\n\n\n# update file version\n\nwhen a user adds a new file to a folder, and there is a file in that folder with the same name, then a new file version is created.\n\n * a new file version uses the same file-id of the file with the matching name and same parent-folder-id.\n * the file upload process is followed and new file metadata and data transactions are created.\n * however a new uuid is not generated and the same file-id and associated metadata is used for this new version\n * the new file metadata transaction points to the new data transaction.\n * since the file-id remains the same, the file keys for private files can decrypt all versions of that file.\n * for private files, new cipher-ivs are generated for this new metadata and data transaction\n * arfs clients can now iterate through the state of this file, since it will have multiple versions using the same file-id.\n\n\n# hide or unhide file\n\nchanging the value of ishidden in a file's metadata will change whether or not a client should display that file.",charsets:{}},{title:"Folder Write Operations",frontmatter:{},regularPath:"/docs/arfs/usage/change/folders.html",relativePath:"docs/arfs/usage/change/folders.md",key:"v-18c2b964",path:"/docs/arfs/usage/change/folders.html",headers:[{level:2,title:"Move Folder",slug:"move-folder",normalizedTitle:"move folder",charIndex:30},{level:2,title:"Rename Folder",slug:"rename-folder",normalizedTitle:"rename folder",charIndex:658}],headersStr:"Move Folder Rename Folder",content:"# Folder Write Operations\n\n\n# Move Folder\n\nFolders can be moved from one folder to another within the same Drive.\n\n * A new file metadata transaction is created when a user wants to move a folder into a different folder.\n * The new file metadata transaction reuses the existing folder’s Folder-Id and copies all of it’s old metadata values, but the file’s Parent-Folder-Id must be updated to the Folder-Id of the folder is was just moved to.\n * For private folders, new ciphers are generated for this new metadata transaction.\n * Folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.\n\n\n# Rename Folder\n\nFolders can be renamed from one name to another.\n\n * A new folder metadata transaction is created when a user wants to rename an existing folder.\n * The new folder metadata transaction reuses the existing folder’s Folder-Id and copies all of it’s old metadata values, but the folder’s name field in its Data JSON must be updated to the new folder name.\n * For private folders, new ciphers are generated for this new metadata transaction.\n * Folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.",normalizedContent:"# folder write operations\n\n\n# move folder\n\nfolders can be moved from one folder to another within the same drive.\n\n * a new file metadata transaction is created when a user wants to move a folder into a different folder.\n * the new file metadata transaction reuses the existing folder’s folder-id and copies all of it’s old metadata values, but the file’s parent-folder-id must be updated to the folder-id of the folder is was just moved to.\n * for private folders, new ciphers are generated for this new metadata transaction.\n * folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.\n\n\n# rename folder\n\nfolders can be renamed from one name to another.\n\n * a new folder metadata transaction is created when a user wants to rename an existing folder.\n * the new folder metadata transaction reuses the existing folder’s folder-id and copies all of it’s old metadata values, but the folder’s name field in its data json must be updated to the new folder name.\n * for private folders, new ciphers are generated for this new metadata transaction.\n * folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.",charsets:{}},{frontmatter:{},regularPath:"/docs/arfs/usage/change/snapshots.html",relativePath:"docs/arfs/usage/change/snapshots.md",key:"v-09d6f550",path:"/docs/arfs/usage/change/snapshots.html",headersStr:null,content:"",normalizedContent:"",charsets:{}},{title:"Create Drive",frontmatter:{permalink:"/docs/arfs/usage/create/"},regularPath:"/docs/arfs/usage/create/create-drive.html",relativePath:"docs/arfs/usage/create/create-drive.md",key:"v-9356a30c",path:"/docs/arfs/usage/create/",headers:[{level:2,title:"New Drive Entity",slug:"new-drive-entity",normalizedTitle:"new drive entity",charIndex:175},{level:2,title:"New Root Folder Entity",slug:"new-root-folder-entity",normalizedTitle:"new root folder entity",charIndex:1313}],headersStr:"New Drive Entity New Root Folder Entity",content:"# Create Drive\n\nTo properly create a new drive, two new entities need to be created: a new Drive entity and a new Folder entity to serve as the root folder of that drive.\n\n\n# New Drive Entity\n\n * The user must specify a name of the drive which is stored within the Drive Entity's metadata JSON.\n * ArDrive generates a new unique uuidv4 for the drive entity's Drive-Id.\n * ArDrive also generates a new unique uuidv4 for the drive entity's rootFolderId, which will refer to the Folder-Id of the new folder entity that will be created.\n * This rootFolderId is stored within the Drive Entity's metadata JSON.\n * Drive Entity Metadata transactions must have Entity-Type: \"drive\".\n * ArDrive will that the current local system time as seconds since Unix epoch for the Drive Entity's Unix-Time.\n * The Drive Entity's Drive-Privacy must also be set to public or private in order for its subfolders and files to have the correct security settings.\n * If the drive is private:\n * Its Cipher tag must be filled out with the correct encryption algorithm (currently AES256-GCM).\n * Its Cipher-IV tag must be filled out with the generated Initialization Vector for the private drive.\n * The ArFS client must derive the Drive Key and encrypt the Drive Entity's metadata JSON using the assigned Cipher and Cipher-IV.\n\n\n# New Root Folder Entity\n\n * The name of the drive and folder entities must be the same.\n * This name is stored within the Folder Entity's metadata JSON.\n * The Folder Entity's Folder-Id must match the rootFolderId previously created for the Drive Entity.\n * The Folder Entity's Drive-Id must match the Drive-Id previously created for the Drive Entity.\n * The Folder Entity must not include a Parent-Folder-Id tag.\n * This is how it is determined to be the root folder for a drive.\n * Folder Entity metadata transactions must have Entity-Type: 'folder'.\n * The client gets the user's local time for the Unix-Time tag, represented as seconds since Unix Epoch.\n * Public folders must have the content type Content-Type: \"application/json\".\n * If the folder is private\n * Its Cipher tag must be filled out with the correct encryption algorithm (currently AES256-GCM).\n * Its Cipher-IV tag must be filled out with the generated Initialization Vector for the private folder.\n * Its content type must be Content-Type: \"application/octet-stream\".\n * The ArFS client must encrypt the Drive Entity's metadata JSON using the assigned Cipher and Cipher-IV.",normalizedContent:"# create drive\n\nto properly create a new drive, two new entities need to be created: a new drive entity and a new folder entity to serve as the root folder of that drive.\n\n\n# new drive entity\n\n * the user must specify a name of the drive which is stored within the drive entity's metadata json.\n * ardrive generates a new unique uuidv4 for the drive entity's drive-id.\n * ardrive also generates a new unique uuidv4 for the drive entity's rootfolderid, which will refer to the folder-id of the new folder entity that will be created.\n * this rootfolderid is stored within the drive entity's metadata json.\n * drive entity metadata transactions must have entity-type: \"drive\".\n * ardrive will that the current local system time as seconds since unix epoch for the drive entity's unix-time.\n * the drive entity's drive-privacy must also be set to public or private in order for its subfolders and files to have the correct security settings.\n * if the drive is private:\n * its cipher tag must be filled out with the correct encryption algorithm (currently aes256-gcm).\n * its cipher-iv tag must be filled out with the generated initialization vector for the private drive.\n * the arfs client must derive the drive key and encrypt the drive entity's metadata json using the assigned cipher and cipher-iv.\n\n\n# new root folder entity\n\n * the name of the drive and folder entities must be the same.\n * this name is stored within the folder entity's metadata json.\n * the folder entity's folder-id must match the rootfolderid previously created for the drive entity.\n * the folder entity's drive-id must match the drive-id previously created for the drive entity.\n * the folder entity must not include a parent-folder-id tag.\n * this is how it is determined to be the root folder for a drive.\n * folder entity metadata transactions must have entity-type: 'folder'.\n * the client gets the user's local time for the unix-time tag, represented as seconds since unix epoch.\n * public folders must have the content type content-type: \"application/json\".\n * if the folder is private\n * its cipher tag must be filled out with the correct encryption algorithm (currently aes256-gcm).\n * its cipher-iv tag must be filled out with the generated initialization vector for the private folder.\n * its content type must be content-type: \"application/octet-stream\".\n * the arfs client must encrypt the drive entity's metadata json using the assigned cipher and cipher-iv.",charsets:{}},{title:"Create File",frontmatter:{},regularPath:"/docs/arfs/usage/create/create-file.html",relativePath:"docs/arfs/usage/create/create-file.md",key:"v-7cc0117c",path:"/docs/arfs/usage/create/create-file.html",headers:[{level:2,title:"New File Entity",slug:"new-file-entity",normalizedTitle:"new file entity",charIndex:18}],headersStr:"New File Entity",content:'# Create File\n\n\n# New File Entity\n\n * A new file metadata transaction and a separate data transaction are created when a user wants to create a new file.\n * Files can only be created in existing drives, and must have a valid Drive-Id.\n * Files can only be created in existing parent folders, and must have a valid Parent-Folder-Id.\n * The new File Entity Data transaction must only specify the file’s mime type aka Content-Type.\n * The new file metadata transaction must generate a new UUIDv4 for the File-Id.\n * File metadata transactions must have Entity-Type: "file".\n * The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.\n * The client populates the File Entity Metadata Transaction Data JSON after creating the data transaction.\n * name The name of the file including extension.\n * size The size of the file on disk, in bytes as an integer.\n * lastModifiedDate The file’s last time of modification as reported by the user’s operating system, in milliseconds since Unix epoch.\n * dataTxId The Arweave transaction id of this File Entity’s Data Transaction.\n * dataContentType The mime time of this File Entity’s data must be determined by the client.\n * isHidden A boolean telling clients if they should display the file or not.\n * If the File is private:\n * Its Cipher tag must be filled out with the respective encryption algorithm (currently AES256-GCM) for both the Metadata and Data transactions.\n * Its Cipher-IV tag must be filled out with the generated Initialization Vector for both the Metadata and Data transactions. Each one has its own unique IV.\n * It must have the content type Content-Type: "application/octet-stream" for both the Metadata and Data transactions.\n * The ArFS client must encrypt the File Entity’s Data and Metadata JSON using their assigned Cipher and Cipher-IV',normalizedContent:'# create file\n\n\n# new file entity\n\n * a new file metadata transaction and a separate data transaction are created when a user wants to create a new file.\n * files can only be created in existing drives, and must have a valid drive-id.\n * files can only be created in existing parent folders, and must have a valid parent-folder-id.\n * the new file entity data transaction must only specify the file’s mime type aka content-type.\n * the new file metadata transaction must generate a new uuidv4 for the file-id.\n * file metadata transactions must have entity-type: "file".\n * the client gets the user’s local time for the unix-time tag, represented as seconds since unix epoch.\n * the client populates the file entity metadata transaction data json after creating the data transaction.\n * name the name of the file including extension.\n * size the size of the file on disk, in bytes as an integer.\n * lastmodifieddate the file’s last time of modification as reported by the user’s operating system, in milliseconds since unix epoch.\n * datatxid the arweave transaction id of this file entity’s data transaction.\n * datacontenttype the mime time of this file entity’s data must be determined by the client.\n * ishidden a boolean telling clients if they should display the file or not.\n * if the file is private:\n * its cipher tag must be filled out with the respective encryption algorithm (currently aes256-gcm) for both the metadata and data transactions.\n * its cipher-iv tag must be filled out with the generated initialization vector for both the metadata and data transactions. each one has its own unique iv.\n * it must have the content type content-type: "application/octet-stream" for both the metadata and data transactions.\n * the arfs client must encrypt the file entity’s data and metadata json using their assigned cipher and cipher-iv',charsets:{}},{frontmatter:{},regularPath:"/docs/arfs/usage/create/create-snapshot.html",relativePath:"docs/arfs/usage/create/create-snapshot.md",key:"v-58f7366c",path:"/docs/arfs/usage/create/create-snapshot.html",headersStr:null,content:"",normalizedContent:"",charsets:{}},{title:"Create Folder",frontmatter:{},regularPath:"/docs/arfs/usage/create/create-folder.html",relativePath:"docs/arfs/usage/create/create-folder.md",key:"v-690a4650",path:"/docs/arfs/usage/create/create-folder.html",headers:[{level:2,title:"New Folder Entity",slug:"new-folder-entity",normalizedTitle:"new folder entity",charIndex:20}],headersStr:"New Folder Entity",content:'# Create Folder\n\n\n# New Folder Entity\n\nFolders can be created to organize files.\n\n * A new Folder Entity Metadata is created when a user wants to create a new folder.\n * Folders can only be created in existing drives, and must have a valid Drive-Id.\n * Folders can only be created in existing parent folders, and must have a valid Parent-Folder-Id.\n * The new folder metadata transaction must generate a new UUIDv4 for the Folder-Id.\n * Folder Entity Metadata transactions must have Entity-Type: "folder".\n * The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.\n * The user defined folder name is added to the name property in the folder’s metadata transaction Data JSON.\n * Public folders must have the content type Content-Type: "".\n * If the folder is private:\n * Its Cipher tag must be filled out with the respective encryption algorithm (currently AES256-GCM).\n * Its Cipher-IV tag must be filled out with the generated Initialization Vector for the private folder.\n * It must have the content type Content-Type: "application/octet-stream".\n * The ArFS client must encrypt the Folder entity’s metadata JSON using the assigned Cipher and Cipher-IV.',normalizedContent:'# create folder\n\n\n# new folder entity\n\nfolders can be created to organize files.\n\n * a new folder entity metadata is created when a user wants to create a new folder.\n * folders can only be created in existing drives, and must have a valid drive-id.\n * folders can only be created in existing parent folders, and must have a valid parent-folder-id.\n * the new folder metadata transaction must generate a new uuidv4 for the folder-id.\n * folder entity metadata transactions must have entity-type: "folder".\n * the client gets the user’s local time for the unix-time tag, represented as seconds since unix epoch.\n * the user defined folder name is added to the name property in the folder’s metadata transaction data json.\n * public folders must have the content type content-type: "".\n * if the folder is private:\n * its cipher tag must be filled out with the respective encryption algorithm (currently aes256-gcm).\n * its cipher-iv tag must be filled out with the generated initialization vector for the private folder.\n * it must have the content type content-type: "application/octet-stream".\n * the arfs client must encrypt the folder entity’s metadata json using the assigned cipher and cipher-iv.',charsets:{}},{title:"Extending Schemas",frontmatter:{next:!1},regularPath:"/docs/arfs/usage/extending-schemas.html",relativePath:"docs/arfs/usage/extending-schemas.md",key:"v-0877efcc",path:"/docs/arfs/usage/extending-schemas.html",headers:[{level:2,title:"Extending Schemas",slug:"extending-schemas",normalizedTitle:"extending schemas",charIndex:2}],headersStr:"Extending Schemas",content:'# Extending Schemas\n\nWeb app and clients can extend the ArFS Schema as needed by adding additional tags into the File and Folder MetaData Transaction JSON. This gives Developers additional flexibility to support specific application needs, without breaking the overall data model or impacting privacy.\n\nFor example a Music Sharing App could use the following expanded File Metadata for specific music files.\n\n{\n "name": "",\n "size": ,\n "lastModifiedDate": \n "dataTxId": "",\n "dataContentType": ""\n "bandName": ""\n "bandAlbum": ""\n "albumSong": ""\n}\n\n\nAdditionally, the above extended Metadata fields could be added directly as a transaction tag as well, in order to support GraphQL queries.\n\n\nArweave Transaction Headers can only fit a maximum of 2048 bytes total, so this must be taken into account by clients writing custom GQL tags.',normalizedContent:'# extending schemas\n\nweb app and clients can extend the arfs schema as needed by adding additional tags into the file and folder metadata transaction json. this gives developers additional flexibility to support specific application needs, without breaking the overall data model or impacting privacy.\n\nfor example a music sharing app could use the following expanded file metadata for specific music files.\n\n{\n "name": "",\n "size": ,\n "lastmodifieddate": \n "datatxid": "",\n "datacontenttype": ""\n "bandname": ""\n "bandalbum": ""\n "albumsong": ""\n}\n\n\nadditionally, the above extended metadata fields could be added directly as a transaction tag as well, in order to support graphql queries.\n\n\narweave transaction headers can only fit a maximum of 2048 bytes total, so this must be taken into account by clients writing custom gql tags.',charsets:{}},{title:"Read ArFS Data",frontmatter:{permalink:"/docs/arfs/usage/read/"},regularPath:"/docs/arfs/usage/read/read-operations.html",relativePath:"docs/arfs/usage/read/read-operations.md",key:"v-950c4d48",path:"/docs/arfs/usage/read/",headers:[{level:2,title:"Folder/File Paths",slug:"folder-file-paths",normalizedTitle:"folder/file paths",charIndex:1915},{level:2,title:"Folder View Queries",slug:"folder-view-queries",normalizedTitle:"folder view queries",charIndex:2237}],headersStr:"Folder/File Paths Folder View Queries",content:"# Read ArFS Data\n\nClients can perform read operations to create a timeline of entity write transactions which can then be replayed to construct the Drive state. This is done by querying an Arweave GraphQL index for the user’s respective transactions. Arweave GraphQL Guide can provide more information on how to use Arweave GraphQL. If no GraphQL index is available, drive state can only be generated by downloading and inspecting all transactions made by the user’s wallet\n\nThis timeline of transactions should be grouped by the block number of each transaction. At every step of the timeline, the client can check if the entity was written by an authorized user. This also conveniently enables the client to surface a trusted entity version history to the user.\n\nTo determine the owner of a Drive, clients must check for who created the first Drive Entity transaction using that Drive-Id. Until a trusted permissions or ACL system is put in place, any transaction in a drive created by any wallet other than the one who created the first Drive Entity transaction could be considered spam.\n\nThe Unix-Time defined on each transaction should be reserved for tie-breaking same entity updates in the same block and should not be trusted as the source of truth for entity write ordering. This is unimportant for single owner drives but is crucial for multi-owner drives with updateable permissions (currently undefined in this spec) as a malicious user could fake the Unix-Time to modify the drive timeline for other users.\n\n * Drives that have been updated many times can have a long entity timeline which can be a performance bottleneck. To avoid this, clients can cache the drive state locally and sync updates to the file system by only querying for entities in blocks higher than the last time they checked.\n * Not checking for Drive Ownership could result in seeing incorrect drive state and GraphQL queries.\n\n\n# Folder/File Paths\n\nArweaveFS does not store folder or file paths along with entities as these paths will need to be updated whenever the parent folder name changes which can require many updates for deeply nested file systems. Instead, folder/file paths are left for the client to generate from the folder/file names.\n\n\n# Folder View Queries\n\nClients that want to provide users with a quick view of a single folder can simply query for an entity timeline for a particular folder by its id. Clients with multi-owner permissions will additionally have to query for the folder's parent drive entity for permission based filtering of the timeline.",normalizedContent:"# read arfs data\n\nclients can perform read operations to create a timeline of entity write transactions which can then be replayed to construct the drive state. this is done by querying an arweave graphql index for the user’s respective transactions. arweave graphql guide can provide more information on how to use arweave graphql. if no graphql index is available, drive state can only be generated by downloading and inspecting all transactions made by the user’s wallet\n\nthis timeline of transactions should be grouped by the block number of each transaction. at every step of the timeline, the client can check if the entity was written by an authorized user. this also conveniently enables the client to surface a trusted entity version history to the user.\n\nto determine the owner of a drive, clients must check for who created the first drive entity transaction using that drive-id. until a trusted permissions or acl system is put in place, any transaction in a drive created by any wallet other than the one who created the first drive entity transaction could be considered spam.\n\nthe unix-time defined on each transaction should be reserved for tie-breaking same entity updates in the same block and should not be trusted as the source of truth for entity write ordering. this is unimportant for single owner drives but is crucial for multi-owner drives with updateable permissions (currently undefined in this spec) as a malicious user could fake the unix-time to modify the drive timeline for other users.\n\n * drives that have been updated many times can have a long entity timeline which can be a performance bottleneck. to avoid this, clients can cache the drive state locally and sync updates to the file system by only querying for entities in blocks higher than the last time they checked.\n * not checking for drive ownership could result in seeing incorrect drive state and graphql queries.\n\n\n# folder/file paths\n\narweavefs does not store folder or file paths along with entities as these paths will need to be updated whenever the parent folder name changes which can require many updates for deeply nested file systems. instead, folder/file paths are left for the client to generate from the folder/file names.\n\n\n# folder view queries\n\nclients that want to provide users with a quick view of a single folder can simply query for an entity timeline for a particular folder by its id. clients with multi-owner permissions will additionally have to query for the folder's parent drive entity for permission based filtering of the timeline.",charsets:{}},{title:"All ArDrive CLI Commands",frontmatter:{},regularPath:"/docs/cli/all-commands.html",relativePath:"docs/cli/all-commands.md",key:"v-47c1f97a",path:"/docs/cli/all-commands.html",headersStr:null,content:"# All ArDrive CLI Commands\n\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• β•šβ•β•β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘\n β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•\n\n\nWrite ArFS\n===========\ncreate-drive\ncreate-folder\nupload-file\ncreate-manifest\n\nmove-file\nmove-folder\n\nretry-tx\n\n\nRead ArFS\n===========\nfile-info\nfolder-info\ndrive-info\n\nlist-folder\nlist-drive\nlist-all-drives\n\ndownload-file\ndownload-folder\ndownload-drive\n\nWallet Ops\n===========\ngenerate-seedphrase\ngenerate-wallet\n\nget-address\nget-balance\nsend-ar\n\nget-drive-key\nget-file-key\n\nlast-tx\n\n\nArweave Ops\n===========\nbase-reward\nget-mempool\ncreate-tx\nsend-tx\ntx-status\n\n# Learn more about a command:\nardrive --help\n",normalizedContent:"# all ardrive cli commands\n\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—\n β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• β•šβ•β•β•β•β•β•β•\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘\n β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•\n\n\nwrite arfs\n===========\ncreate-drive\ncreate-folder\nupload-file\ncreate-manifest\n\nmove-file\nmove-folder\n\nretry-tx\n\n\nread arfs\n===========\nfile-info\nfolder-info\ndrive-info\n\nlist-folder\nlist-drive\nlist-all-drives\n\ndownload-file\ndownload-folder\ndownload-drive\n\nwallet ops\n===========\ngenerate-seedphrase\ngenerate-wallet\n\nget-address\nget-balance\nsend-ar\n\nget-drive-key\nget-file-key\n\nlast-tx\n\n\narweave ops\n===========\nbase-reward\nget-mempool\ncreate-tx\nsend-tx\ntx-status\n\n# learn more about a command:\nardrive --help\n",charsets:{}},{title:"Getting Help",frontmatter:{},regularPath:"/docs/cli/getting-help.html",relativePath:"docs/cli/getting-help.md",key:"v-4fad50ba",path:"/docs/cli/getting-help.html",headersStr:null,content:"# Getting Help\n\nArDrive Community Discord",normalizedContent:"# getting help\n\nardrive community discord",charsets:{}},{title:"CLI",frontmatter:{homepage:!0,permalink:"/docs/cli/"},regularPath:"/docs/cli/intro.html",relativePath:"docs/cli/intro.md",key:"v-31657474",path:"/docs/cli/",headers:[{level:2,title:"ArFS",slug:"arfs",normalizedTitle:"arfs",charIndex:2864},{level:2,title:"Data Portability",slug:"data-portability",normalizedTitle:"data portability",charIndex:3130},{level:2,title:"Intended Audience",slug:"intended-audience",normalizedTitle:"intended audience",charIndex:3511}],headersStr:"ArFS Data Portability Intended Audience",content:'# CLI\n\nThe ArDrive Command Line Interface (CLI) is a Node.js application for terminal-based ArDrive workflows. It also offers utility operations for securely interacting with Arweave wallets and inspecting various Arweave blockchain conditions.\n\nCreate your first drive and permanently store your first file on the permaweb with a series of simple CLI commands like so:\n\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "Teenage Love Poetry"\n{\n "created": [\n {\n "type": "drive",\n "metadataTxId": "giv2R8Xj0bbe6l5taBTQJk_38zwIrMH_g1-knSCisjU",\n "entityId": "898687ea-b678-4f86-b4e7-49560b190356",\n "bundledIn": "Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE",\n "entityName": "Teenage Love Poetry"\n },\n {\n "type": "folder",\n "metadataTxId": "VljnttwUxRStnVuPYakF9e2whjhYJVWB0nSxD5dVyJ8",\n "entityId": "f0c58c11-430c-4383-8e54-4d864cc7e927",\n "bundledIn": "Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE",\n "entityName": "Teenage Love Poetry"\n },\n {\n "type": "bundle",\n "bundleTxId": "Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE"\n }\n ],\n "tips": [],\n "fees": {\n "Vj2x4IBEAezBvhj5RgtA247W_q3S10suI6l0E30GPoE": "44579472"\n }\n}\n\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "f0c58c11-430c-4383-8e54-4d864cc7e927" --local-path ./helloworld.txt --dest-file-name "ode_to_ardrive.txt"\n{\n "created": [\n {\n "type": "file",\n "entityName": "ode_to_ardrive.txt",\n "entityId": "bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0",\n "dataTxId": "tSMcfvAQu_tKLUkdvRRbqdX93oAf3h6c9eJsSj8mXL4",\n "metadataTxId": "EvE06MmE9IKeUzFMnxSgY1M5tJX4uHU64-n8Pf_lZfU",\n "bundledIn": "qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE",\n "sourceUri": "file://Users/BestArDriver/Uploads/helloworld.txt"\n },\n {\n "type": "bundle",\n "bundleTxId": "qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE"\n }\n ],\n "tips": [\n {\n "txId": "qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE",\n "recipient": {\n "address": "i325n3L2UvgcavEM8UnFfY0OWBiyf2RrbNsLStPI73o"\n },\n "winston": "10000000"\n }\n ],\n "fees": {\n "qjdHiQoWlSjCvhj5RgtA247W_q3S10suI6l0E30GPoE": 44579472\n }\n}\n\n\nThis project is in a state of active development. Use at your own risk!\n\n\n# ArDrive\n\nArDrive is a permanent storage platform whose applications and core libraries offer hierarchical organization, privacy via complete end-to-end encryption, flexibility, extensibility, and access control over your most valuable data, all made possible by its innovative core technology, the Arweave File System (ArFS) Protocol.\n\n\n# ArFS\n\nArFS is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on Arweave\'s otherwise permanent, immutable data storage blockweave.\n\n\n# Data Portability\n\nData uploaded via the ArDrive CLI, once indexed by Arweave\'s Gateways and sufficiently seeded across enough nodes on the network, can be accessed via all other ArDrive applications including the ArDrive Web application at https://app.ardrive.io.\n\nAll transactions successfully executed by ArDrive can always be inspected in the Viewblock blockchain explorer.\n\n\n# Intended Audience\n\nThis tool is intended for use by:\n\n * ArDrive power users with advanced workflows and resource efficiency in mind: bulk uploaders, those with larger storage demand, game developers, nft creators, storage/db admins, etc.\n * Automation tools\n * Services\n * Terminal aficionados\n * Extant and aspiring cypherpunks\n\nFor deeper integrations with the ArDrive platform, consider using the ArDrive Core (Node) library\'s configurable and intuitive class interfaces directly within your application.',normalizedContent:'# cli\n\nthe ardrive command line interface (cli) is a node.js application for terminal-based ardrive workflows. it also offers utility operations for securely interacting with arweave wallets and inspecting various arweave blockchain conditions.\n\ncreate your first drive and permanently store your first file on the permaweb with a series of simple cli commands like so:\n\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "teenage love poetry"\n{\n "created": [\n {\n "type": "drive",\n "metadatatxid": "giv2r8xj0bbe6l5tabtqjk_38zwirmh_g1-knscisju",\n "entityid": "898687ea-b678-4f86-b4e7-49560b190356",\n "bundledin": "vj2x4ibeaezbvhj5rgta247w_q3s10sui6l0e30gpoe",\n "entityname": "teenage love poetry"\n },\n {\n "type": "folder",\n "metadatatxid": "vljnttwuxrstnvupyakf9e2whjhyjvwb0nsxd5dvyj8",\n "entityid": "f0c58c11-430c-4383-8e54-4d864cc7e927",\n "bundledin": "vj2x4ibeaezbvhj5rgta247w_q3s10sui6l0e30gpoe",\n "entityname": "teenage love poetry"\n },\n {\n "type": "bundle",\n "bundletxid": "vj2x4ibeaezbvhj5rgta247w_q3s10sui6l0e30gpoe"\n }\n ],\n "tips": [],\n "fees": {\n "vj2x4ibeaezbvhj5rgta247w_q3s10sui6l0e30gpoe": "44579472"\n }\n}\n\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "f0c58c11-430c-4383-8e54-4d864cc7e927" --local-path ./helloworld.txt --dest-file-name "ode_to_ardrive.txt"\n{\n "created": [\n {\n "type": "file",\n "entityname": "ode_to_ardrive.txt",\n "entityid": "bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0",\n "datatxid": "tsmcfvaqu_tklukdvrrbqdx93oaf3h6c9ejssj8mxl4",\n "metadatatxid": "eve06mme9ikeuzfmnxsgy1m5tjx4uhu64-n8pf_lzfu",\n "bundledin": "qjdhiqowlsjcvhj5rgta247w_q3s10sui6l0e30gpoe",\n "sourceuri": "file://users/bestardriver/uploads/helloworld.txt"\n },\n {\n "type": "bundle",\n "bundletxid": "qjdhiqowlsjcvhj5rgta247w_q3s10sui6l0e30gpoe"\n }\n ],\n "tips": [\n {\n "txid": "qjdhiqowlsjcvhj5rgta247w_q3s10sui6l0e30gpoe",\n "recipient": {\n "address": "i325n3l2uvgcavem8unffy0owbiyf2rrbnslstpi73o"\n },\n "winston": "10000000"\n }\n ],\n "fees": {\n "qjdhiqowlsjcvhj5rgta247w_q3s10sui6l0e30gpoe": 44579472\n }\n}\n\n\nthis project is in a state of active development. use at your own risk!\n\n\n# ardrive\n\nardrive is a permanent storage platform whose applications and core libraries offer hierarchical organization, privacy via complete end-to-end encryption, flexibility, extensibility, and access control over your most valuable data, all made possible by its innovative core technology, the arweave file system (arfs) protocol.\n\n\n# arfs\n\narfs is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on arweave\'s otherwise permanent, immutable data storage blockweave.\n\n\n# data portability\n\ndata uploaded via the ardrive cli, once indexed by arweave\'s gateways and sufficiently seeded across enough nodes on the network, can be accessed via all other ardrive applications including the ardrive web application at https://app.ardrive.io.\n\nall transactions successfully executed by ardrive can always be inspected in the viewblock blockchain explorer.\n\n\n# intended audience\n\nthis tool is intended for use by:\n\n * ardrive power users with advanced workflows and resource efficiency in mind: bulk uploaders, those with larger storage demand, game developers, nft creators, storage/db admins, etc.\n * automation tools\n * services\n * terminal aficionados\n * extant and aspiring cypherpunks\n\nfor deeper integrations with the ardrive platform, consider using the ardrive core (node) library\'s configurable and intuitive class interfaces directly within your application.',charsets:{}},{title:"Using the CLI",frontmatter:{sidebarDepth:1},regularPath:"/docs/cli/using-the-cli.html",relativePath:"docs/cli/using-the-cli.md",key:"v-e2784654",path:"/docs/cli/using-the-cli.html",headers:[{level:2,title:"CLI Help",slug:"cli-help",normalizedTitle:"cli help",charIndex:20},{level:2,title:"CLI Version",slug:"cli-version",normalizedTitle:"cli version",charIndex:77},{level:2,title:"Wallet Operations",slug:"wallet-operations",normalizedTitle:"wallet operations",charIndex:174},{level:2,title:"Working With Entities",slug:"working-with-entities",normalizedTitle:"working with entities",charIndex:2351},{level:3,title:"Dry Run",slug:"dry-run",normalizedTitle:"dry run",charIndex:3310},{level:3,title:"Uploading to Turbo (BETA)",slug:"uploading-to-turbo-beta",normalizedTitle:"uploading to turbo (beta)",charIndex:3807},{level:2,title:"Working With Drives",slug:"working-with-drives",normalizedTitle:"working with drives",charIndex:4412},{level:3,title:"Understanding Drive Hierarchies",slug:"understanding-drive-hierarchies",normalizedTitle:"understanding drive hierarchies",charIndex:4436},{level:3,title:"Understanding Drive and File Keys",slug:"understanding-drive-and-file-keys",normalizedTitle:"understanding drive and file keys",charIndex:3257},{level:3,title:"Managing Drive Passwords",slug:"managing-drive-passwords",normalizedTitle:"managing drive passwords",charIndex:7051},{level:3,title:"Creating Drives",slug:"creating-drives",normalizedTitle:"creating drives",charIndex:8438},{level:3,title:"Listing Drives for an Address",slug:"listing-drives-for-an-address",normalizedTitle:"listing drives for an address",charIndex:8681},{level:3,title:"Listing Every Entity in a Drive",slug:"listing-every-entity-in-a-drive",normalizedTitle:"listing every entity in a drive",charIndex:9095},{level:3,title:"List Drive Pipeline Examples",slug:"list-drive-pipeline-examples",normalizedTitle:"list drive pipeline examples",charIndex:9937},{level:2,title:"Working With Folders",slug:"working-with-folders",normalizedTitle:"working with folders",charIndex:11260},{level:3,title:"Creating Folders",slug:"creating-folders",normalizedTitle:"creating folders",charIndex:11503},{level:3,title:"Moving Folders",slug:"moving-folders",normalizedTitle:"moving folders",charIndex:12394},{level:3,title:"Renaming Folders",slug:"renaming-folders",normalizedTitle:"renaming folders",charIndex:12711},{level:3,title:"Viewing Folder Metadata",slug:"viewing-folder-metadata",normalizedTitle:"viewing folder metadata",charIndex:13017},{level:3,title:"Listing Contents of a Folder",slug:"listing-contents-of-a-folder",normalizedTitle:"listing contents of a folder",charIndex:13192},{level:2,title:"Working With Files",slug:"working-with-files",normalizedTitle:"working with files",charIndex:17699},{level:3,title:"Uploading a Single File",slug:"uploading-a-single-file",normalizedTitle:"uploading a single file",charIndex:18490},{level:3,title:"IPFS CID Tagging",slug:"ipfs-cid-tagging",normalizedTitle:"ipfs cid tagging",charIndex:19976},{level:3,title:"Progress Logging of Transaction Uploads",slug:"progress-logging-of-transaction-uploads",normalizedTitle:"progress logging of transaction uploads",charIndex:20528},{level:3,title:"Download a Single file (BETA)",slug:"download-a-single-file-beta",normalizedTitle:"download a single file (beta)",charIndex:21739},{level:3,title:"Rename a Single File",slug:"rename-a-single-file",normalizedTitle:"rename a single file",charIndex:22353},{level:3,title:"Uploading a Folder with Files (Bulk Upload)",slug:"uploading-a-folder-with-files-bulk-upload",normalizedTitle:"uploading a folder with files (bulk upload)",charIndex:22690},{level:3,title:"Downloading a Folder with Files",slug:"downloading-a-folder-with-files",normalizedTitle:"downloading a folder with files",charIndex:23108},{level:3,title:"Downloading a Drive",slug:"downloading-a-drive",normalizedTitle:"downloading a drive",charIndex:25070},{level:3,title:"Uploading Multiple Files",slug:"uploading-multiple-files",normalizedTitle:"uploading multiple files",charIndex:25327},{level:3,title:"Name Conflict Resolution on Upload",slug:"name-conflict-resolution-on-upload",normalizedTitle:"name conflict resolution on upload",charIndex:25829},{level:3,title:"Understanding Bundled Transactions",slug:"understanding-bundled-transactions",normalizedTitle:"understanding bundled transactions",charIndex:28281},{level:3,title:"Uploading a Non-Bundled Transaction (NOT RECOMMENDED)",slug:"uploading-a-non-bundled-transaction-not-recommended",normalizedTitle:"uploading a non-bundled transaction (not recommended)",charIndex:29726},{level:3,title:"Fetching the Metadata of a File Entity",slug:"fetching-the-metadata-of-a-file-entity",normalizedTitle:"fetching the metadata of a file entity",charIndex:30178},{level:3,title:"Retrying a Failed File Data Transaction (Public Unbundled Files Only)",slug:"retrying-a-failed-file-data-transaction-public-unbundled-files-only",normalizedTitle:"retrying a failed file data transaction (public unbundled files only)",charIndex:31026},{level:3,title:"Moving Files",slug:"moving-files",normalizedTitle:"moving files",charIndex:33172},{level:3,title:"Uploading Manifests",slug:"uploading-manifests",normalizedTitle:"uploading manifests",charIndex:33643},{level:3,title:"Uploading With a Custom Content Type",slug:"uploading-with-a-custom-content-type",normalizedTitle:"uploading with a custom content type",charIndex:38417},{level:3,title:"Uploading From a Remote URL",slug:"uploading-from-a-remote-url",normalizedTitle:"uploading from a remote url",charIndex:39648},{level:3,title:"Uploading a Custom Manifest",slug:"uploading-a-custom-manifest",normalizedTitle:"uploading a custom manifest",charIndex:40151},{level:3,title:"Uploading Files with Custom MetaData",slug:"uploading-files-with-custom-metadata",normalizedTitle:"uploading files with custom metadata",charIndex:41476},{level:2,title:"Other Utility Operations",slug:"other-utility-operations",normalizedTitle:"other utility operations",charIndex:45503},{level:3,title:"Monitoring Transactions",slug:"monitoring-transactions",normalizedTitle:"monitoring transactions",charIndex:45532},{level:3,title:"Dealing With Network Congestion",slug:"dealing-with-network-congestion",normalizedTitle:"dealing with network congestion",charIndex:46815},{level:3,title:"Using a Custom Arweave Gateway",slug:"using-a-custom-arweave-gateway",normalizedTitle:"using a custom arweave gateway",charIndex:50374},{level:3,title:"Persistent Caching of ArFS Entity Metadata",slug:"persistent-caching-of-arfs-entity-metadata",normalizedTitle:"persistent caching of arfs entity metadata",charIndex:51621}],headersStr:"CLI Help CLI Version Wallet Operations Working With Entities Dry Run Uploading to Turbo (BETA) Working With Drives Understanding Drive Hierarchies Understanding Drive and File Keys Managing Drive Passwords Creating Drives Listing Drives for an Address Listing Every Entity in a Drive List Drive Pipeline Examples Working With Folders Creating Folders Moving Folders Renaming Folders Viewing Folder Metadata Listing Contents of a Folder Working With Files Uploading a Single File IPFS CID Tagging Progress Logging of Transaction Uploads Download a Single file (BETA) Rename a Single File Uploading a Folder with Files (Bulk Upload) Downloading a Folder with Files Downloading a Drive Uploading Multiple Files Name Conflict Resolution on Upload Understanding Bundled Transactions Uploading a Non-Bundled Transaction (NOT RECOMMENDED) Fetching the Metadata of a File Entity Retrying a Failed File Data Transaction (Public Unbundled Files Only) Moving Files Uploading Manifests Uploading With a Custom Content Type Uploading From a Remote URL Uploading a Custom Manifest Uploading Files with Custom MetaData Other Utility Operations Monitoring Transactions Dealing With Network Congestion Using a Custom Arweave Gateway Persistent Caching of ArFS Entity Metadata",content:'# Using the CLI\n\n\n# CLI Help\n\nLearn to use any command:\n\nardrive --help\n\n\n\n# CLI Version\n\nYou can print out the version by running any of:\n\nardrive --version\nardrive -V\n\n\n\n# Wallet Operations\n\nBrowsing of ArDrive public data is possible without the need for an Arweave wallet. However, for all write operations, or read operations without encryption/decryption keys, you\'ll need a wallet.\n\nAs you utilize the CLI, you can use either your wallet file or your seed phrase interchangeably. Consider the security implications of each approach for your particular use case carefully. If at any time you\'d like to generate a new wallet altogether, start by generating a new seed phase. And if you\'d like to use that seed phrase in the form of a wallet file, or if you\'d like to recover an existing wallet via its seed phrase, use either or both of the following commands:\n\n# Generate seed-phrase\nardrive generate-seedphrase\n"this is an example twelve word seed phrase that you could use"\n\n# Generate/recover wallet file (with example output file path)\nardrive generate-wallet -s "this is an example twelve word seed phrase that you could use" > /path/to/wallet/file.json\n\n\nPublic attributes of Arweave wallets can be retrieved via their 43-character Arweave wallet address. You can retrieve the wallet address associated with your wallet file or 12-word seed phrase (e.g. wallets generated by ArConnect) like so:\n\n# Wallet file\nardrive get-address -w /path/to/wallet/file.json\n\n# Seed Phrase (with sample output)\nardrive get-address -s "this is an example twelve word seed phrase that you could use"\nHTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k\n\n\nYou\'ll need AR in your wallet for any write operations you perform in ArDrive. You can always check your wallet balance (in both AR and Winston units) by performing:\n\n# Getting the balance for your own wallet\nardrive get-balance -w /path/to/wallet/file.json\n\n# Getting the balance for ANY wallet (with sample output)\nardrive get-balance -a "HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"\n1500000000000 Winston\n1.5 AR\n\n\nIf, at any time, you need to send AR out of your wallet to another wallet address, you may perform:\n\n# Using our previously generated wallet as the destination...\nardrive send-ar -w /path/to/wallet/file.json --dest-address "HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k" --ar-amount 2.12345\n\n\n\n# Working With Entities\n\nArDrive\'s ArFS integration provides for hierarchical organization of your file and folder data on Arweave.\n\nThe fundamental entity types specified by ArFS are:\n\n * Drives\n * Folders\n * Files\n\nEach instance of these entities have a Version 4 UUID entity ID that is commonly referred to by its entity type, i.e. drive ID, folder ID, and file ID.\n\nWhen you execute write functions with the CLI, the JSON output will contain information about the Arweave Transaction IDs that were registered when writing your entities to the blockweave, any miner rewards or ArDrive Community tips that were disbursed from your wallet, and any new entity IDs and, when applicable, encryption keys that were generated in the process of creating the entities. Typically, you\'ll want to keep track of those and get proficient with retrieving them in order to build your drive hierarchy to your liking. See Understanding Drive and File Keys for more info.\n\n\n# Dry Run\n\nAn important feature of the ArDrive CLI is the --dry-run flag. On each command that would write an ArFS entity, there is the option to run it as a "dry run". This will run all of the steps and print the outputs of a regular ArFS write, but will skip sending the actual transaction:\n\nardrive --dry-run\n\n\nThis can be very useful for gathering price estimations or to confirm that you\'ve copy-pasted your entity IDs correctly before committing to an upload.\n\n\n# Uploading to Turbo (BETA)\n\nUsers can optionally choose to send each ArFS entities created to ArDrive Turbo using the --turbo flag. Instead of using AR from an Arweave wallet, you can use Turbo Credits or take advantage of free/discounted upload promotions.\n\nardrive --turbo\n\n\nThis flag will skip any balance check on the CLI side. Turbo will check a user\'s balance and accept/reject a data item at the time of upload. The --turbo flag by default will send your files to upload.ardrive.io to be bundled. To change the Turbo destination, users can use the --turbo-url flag.\n\n\n# Working With Drives\n\n\n# Understanding Drive Hierarchies\n\nAt the root of every data tree is a "Drive" entity. When a drive is created, a Root Folder is also created for it. The entity IDs for both are generated and returned when you create a new drive:\n\n# Use `tee` to keep a receipt of the full set of transactions info and `jq` to focus on the data of interest\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "Teenage Love Poetry" |\ntee created_drive.json |\njq \'[.created[] | del(.metadataTxId, .entityName, .bundledIn)]\'\n[\n {\n "type": "drive",\n "entityId": "6939b9e0-cc98-42cb-bae0-5888eca78885"\n }\n {\n "type": "folder",\n "entityId": "d1535126-fded-4990-809f-83a06f2a1118"\n }\n]\n\n\nThe relationship between the drive and its root folder is clearly visible when retrieving the drive\'s info:\n\nardrive drive-info -d "6939b9e0-cc98-42cb-bae0-5888eca78885"\n| jq \'{driveId, rootFolderId}\'\n{\n "driveId": "6939b9e0-cc98-42cb-bae0-5888eca78885",\n "rootFolderId": "d1535126-fded-4990-809f-83a06f2a1118"\n}\n\n\n\nAll file and folder entities in the drive will be anchored to it by a "Drive-ID" GQL Tag. And they\'ll each be anchored to a parent folder ID, tracked via the "Parent-Folder-ID" GQL tag, forming a tree structure whose base terminates at the Root Folder.\n\n\n# Understanding Drive and File Keys\n\nPrivate Drives achieve privacy via end-to-end encryption facilitated by hash-derived "Keys". Drive Keys encrypt/decrypt Drive and Folder data, and File Keys encrypt/decrypt File Data.\n\nThe relationships among your data and their keys is as follows:\n\n * Drive Key = functionOf(Wallet Signature, Randomly Generated Drive ID, User-specified Drive Password)\n * File Key = functionOf(Randomly Generated File ID, Drive Key)\n\nWhen you create private entities, the returned JSON data from the ArDrive CLI will contain the keys needed to decrypt the encrypted representation of your entity that is now securely and permanently stored on the blockweave.\n\nTo derive the drive key again for a drive, perform the following:\n\n# Will throw an error if the wallet or password specified can\'t be used to decrypt the on-chain drive\nardrive get-drive-key -w /path/to/my/wallet.json -d "6939b9e0-cc98-42cb-bae0-5888eca78885" -P\n\n\nTo derive the file key again for a file, perform the following:\n\n# Will throw an error if the drive key or drive-key-derivation data specified can\'t be used to decrypt the on-chain file\nardrive get-file-key --file-id "bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0" --drive-id "6939b9e0-cc98-42cb-bae0-5888eca78885" --drive-key "yHdCjpCK3EcuhQcKNx2d/NN5ReEjoKfZVqKunlCnPEo"\n\n\n\n# Managing Drive Passwords\n\nThe ArDrive CLI\'s private drive and folder functions all require either a drive password OR a drive key. Private file functions require either the drive password or the file key. Keys and passwords are sensitive data, so manage the entry, display, storage, and transmission of them very carefully.\n\nDrive passwords are the most portable, and fundamental, encryption facet, so a few options are available during private drive operations for supplying them:\n\n * Environment Variable\n * STDIN\n * Secure Prompt\n\n# Supplying Your Password: Environment Variable\n\n# Securely type your password into a read prompt, store it to TMP_ARDRIVE_PW, and export it for the shell session\nread -rs TMP_ARDRIVE_PW\nexport ARDRIVE_DRIVE_PW=$(TMP_ARDRIVE_PW)\nardrive -w /path/to/wallet.json -P\n\n\n# Supplying Your Password: STDIN\n\n# Pipe your drive password to the ArDrive CLI\ncat /path/to/my/drive/password.txt | ardrive -w /path/to/wallet.json -P\n\n# Redirect your drive password to the ArDrive CLI\nardrive -w /path/to/wallet.json -P < /path/to/my/drive/password.txt\n\n\n# Supplying Your Password: Prompt\n\n# When all other options fail, the CLI will prompt for your password (NOT COMPATIBLE WITH PIPES AND REDIRECTS!)\nardrive -w /path/to/wallet.json -P\n? Enter drive password: β€Ί ********\n\n\n\n# Creating Drives\n\n# Public drive\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "My Public Archive"\n\n# Private drive\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "Teenage Love Poetry" -P\n\n\n\n# Listing Drives for an Address\n\nYou can list all the drives associated with any Arweave wallet address, though the details of private drives will be obfuscated from you unless you provide the necessary decryption data.\n\n# List all your own drives\nardrive list-all-drives -w /path/to/my/wallet.json -P\n\n# List any address\'s drives\nardrive list-all-drives --address "HTTn8F92tR32N8wuo-NIDkjmqPknrbl10JWo5MZ9x2k"\n\n\n\n# Listing Every Entity in a Drive\n\nUseful notes on listing the contents of drives:\n\n * Listing a drive is effectively the same as listing its root folder.\n * You can control the tree depth of the data returned.\n * path, txPath, and entityIdPath properties on entities can provide useful handholds for other forms of data navigation\n\n# List everything in a private drive\nardrive list-drive -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" -w /path/to/my/wallet.json -P\n\n# List a private drive including the `fileKey` and/or `driveKey` of all listed entitites\nardrive list-drive -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" -w /path/to/my/wallet.json -P --with-keys\n\n# List the contents of a public drive up to and including those in the grandchild folders of the root folder\nardrive list-drive -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" --max-depth 2\n\n\n\n# List Drive Pipeline Examples\n\nYou can utilize jq and the list commands to reshape the commands\' output data into useful forms and stats for many use cases. Here are a few examples:\n\n\n\n# Get share links for a PUBLIC drive\nardrive list-drive -d a44482fd-592e-45fa-a08a-e526c31b87f1 | jq \'.[] | select(.entityType == "file") | "https://app.ardrive.io/#/file/" + .entityId + "/view"\'\n\n\nExample output:\n\n"https://app.ardrive.io/#/file/1337babe-f000-dead-beef-ffffffffffff/view"\n"https://app.ardrive.io/#/file/cdbc9ddd-1cab-41d9-acbd-fd4328929de3/view"\n"https://app.ardrive.io/#/file/f19bc712-b57a-4e0d-8e5c-b7f1786b34a1/view"\n"https://app.ardrive.io/#/file/4f8e081b-42f2-442d-be41-57f6f906e1c8/view"\n"https://app.ardrive.io/#/file/0e02d254-c853-4ff0-9b6e-c4d23d2a95f5/view"\n"https://app.ardrive.io/#/file/c098b869-29d1-4a86-960f-a9e10433f0b0/view"\n"https://app.ardrive.io/#/file/4afc8cdf-4d27-408a-bfb9-0a2ec21eebf8/view"\n"https://app.ardrive.io/#/file/85fe488d-fcf7-48ca-9df8-2b39958bbf15/view"\n...\n\n\n\n\n# Get total size of all files within drive\nardrive list-drive -d 13c3c232-6687-4d11-8ac1-35284102c7db | jq \' map(select(.entityType == "file") | .size) | add\'\n\n\n\n\n# Get total number of files within drive\nardrive list-drive -d 01ea6ba3-9e58-42e7-899d-622fd110211c | jq \'[ .[] | select(.entityType == "file") ] | length\'\n\n\n\n# Working With Folders\n\nAs discussed previously, all folders in a drive are linked by way of parent folder references back to the root folder of a drive. Folders can be moved into any folder in the hierarchy that\'s not in their own subtree.\n\n\n# Creating Folders\n\nCreating folders manually is straightforward:\n\nardrive create-folder --parent-folder-id "63153bb3-2ca9-4d42-9106-0ce82e793321" --folder-name "My Awesome Folder" -w /path/to/wallet.json\n\n\nExample output:\n\n{\n "created": [\n {\n "type": "folder",\n "metadataTxId": "AYFMBVmwqhbg9y5Fbj3Iasy5oxUqhauOW7PcS1sl4Dk",\n "entityId": "d1b7c514-fb12-4603-aad8-002cf63015d3",\n "key": "yHdCjpCKD2cuhQcKNx2d/XF5ReEjoKfZVqKunlCnPEk",\n "entityName": "My Awesome Folder"\n }\n ],\n "tips": [],\n "fees": {\n "AYFMBVmwqhbg9y5Fbj3Iasy5oxUqhauOW7PcS1sl4Dk": 1378052\n }\n}\n\n\nNote: Folders can also be created by supplying a folder as the --local-path of an upload-file command. In this case, the folder hierarchy on the local disk will be reconstructed on chain during the course of the recursive bulk upload.\n\n\n# Moving Folders\n\nMoving a folder is as simple as supplying a new parent folder ID. Note that naming collisions among entities within a folder are not allowed.\n\nardrive move-folder --folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" --parent-folder-id "29850ab7-56d4-4e1f-a5be-cb86d5513921" -w /path/to/wallet.json\n\n\n\n# Renaming Folders\n\nIn order to rename a folder you must provide a name different from its current one, and it must not create naming conflicts with its sibling entities.\n\nardrive rename-folder --folder-id "568d5eba-dbf3-4a49-8129-1c58f7fd35bc" --folder-name "Folder with cool stuff" -w "./wallet.json"\n\n\n\n# Viewing Folder Metadata\n\nTo view the metadata of a folder, users can use the folder-info command:\n\nardrive folder-info --folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0"\n\n\n\n# Listing Contents of a Folder\n\nSimilar to drives, the list-folder command can be used to fetch the metadata of each entity within a folder. But by default, the command will fetch only the immediate children of that folder (--max-depth 0):\n\n# List immediate children of folder "My Public Folder"\nardrive list-folder --parent-folder-id "29850ab7-56d4-4e1f-a5be-cb86d5513940"\n\n\nExample output:\n\n[\n {\n "appName": "ArDrive-CLI",\n "appVersion": "2.0",\n "arFS": "0.11",\n "contentType": "application/json",\n "driveId": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entityType": "folder",\n "name": "mytestfolder",\n "txId": "HYiKyfLwY7PT9NleTQoTiM_-qPVUwf4ClDhx1sjUAEU",\n "unixTime": 1635102772,\n "parentFolderId": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityId": "03df2929-1440-4ab4-bbf0-9dc776e1ed96",\n "path": "/My Public Folder/mytestfolder",\n "txIdPath": "/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/HYiKyfLwY7PT9NleTQoTiM_-qPVUwf4ClDhx1sjUAEU",\n "entityIdPath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/03df2929-1440-4ab4-bbf0-9dc776e1ed96"\n },\n {\n "appName": "ArDrive-CLI",\n "appVersion": "2.0",\n "arFS": "0.11",\n "contentType": "application/json",\n "driveId": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entityType": "folder",\n "name": "Super sonic public folder",\n "txId": "VUk1B_vo1va2-EHLtqjsotzy0Rdn6lU4hQo3RD2xoTI",\n "unixTime": 1631283259,\n "parentFolderId": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityId": "452c6aec-43dc-4015-9abd-20083068d432",\n "path": "/My Public Folder/Super sonic sub folder",\n "txIdPath": "/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/VUk1B_vo1va2-EHLtqjsotzy0Rdn6lU4hQo3RD2xoTI",\n "entityIdPath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/452c6aec-43dc-4015-9abd-20083068d432"\n },\n {\n "appName": "ArDrive-CLI",\n "appVersion": "2.0",\n "arFS": "0.11",\n "contentType": "application/json",\n "driveId": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entityType": "file",\n "name": "test-number-twelve.txt",\n "txId": "429zBqnd7ZBNzgukaix26RYz3g5SeXCCo_oIY6CPZLg",\n "unixTime": 1631722234,\n "size": 47,\n "lastModifiedDate": 1631722217028,\n "dataTxId": "vA-BxAS7I6n90cH4Fzsk4cWS3EOPb1KOhj8yeI88dj0",\n "dataContentType": "text/plain",\n "parentFolderId": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityId": "e5948327-d6de-4acf-a6fe-e091ecf78d71",\n "path": "/My Public Folder/test-number-twelve.txt",\n "txIdPath": "/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/429zBqnd7ZBNzgukaix26RYz3g5SeXCCo_oIY6CPZLg",\n "entityIdPath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/e5948327-d6de-4acf-a6fe-e091ecf78d71"\n },\n {\n "appName": "ArDrive-CLI",\n "appVersion": "2.0",\n "arFS": "0.11",\n "contentType": "application/json",\n "driveId": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entityType": "file",\n "name": "wonderful-test-file.txt",\n "txId": "6CokwlzB81Fx7dq-lB654VM0XQykdU6eYohDmEJ2gk4",\n "unixTime": 1631671275,\n "size": 23,\n "lastModifiedDate": 1631283389232,\n "dataTxId": "UP8THwA_1gvyRqNRqYmTpWvU4-UzNWBN7SiX_AIihg4",\n "dataContentType": "text/plain",\n "parentFolderId": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityId": "3274dae9-3487-41eb-94d5-8d5d3d8bc343",\n "path": "/My Public Folder/wonderful-test-file.txt",\n "txIdPath": "/09_x0X2eZ3flXXLS72WdTDq6uaa5g2LjsT-QH1m0zhU/6CokwlzB81Fx7dq-lB654VM0XQykdU6eYohDmEJ2gk4",\n "entityIdPath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/3274dae9-3487-41eb-94d5-8d5d3d8bc343"\n }\n]\n\n\nTo list further than the immediate children, you can make use of the flags: --all and --max-depth.\n\n# List all contents of a public folder\nardrive list-folder --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" --all\n\n# List the contents of a public folder with custom depth\nardrive list-folder --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" --max-depth 2\n\n\nIn the case of private entitites, the --with-keys flag will make the command to include the keys in the output.\n\n# List all contents of a private folder including the `fileKey` and/or `driveKey` of all listed entitites\nardrive list-folder --parent-folder-id "1b027047-4cfc-4eee-88a8-9af694f660c0" -w /my/wallet.json --with-keys\n\n\n\n# Working With Files\n\nSimilar to folders, files are linked to a parent folder which ultimately chains the file back to the root folder of its parent drive. As such, a parent folder ID is required in order to upload files. Files can be freely moved to other folders within their original drive.\n\nThe important difference for file entities is that they also hold a reference to their data transaction ID, which is the dataTxId as returned by the file-info command. This is where your uploaded data lives on the permaweb.\n\nNOTE: The CLI currently (v1.0.0) has progress logging on uploads DISABLED for producing clean JSON outputs that can be piped in the terminal. On larger uploads, remember to be patient. You can check your system\'s node process to confirm the process is still uploading.\n\n\n# Uploading a Single File\n\nTo upload a file, you\'ll need a parent folder id, the file to upload\'s file path, and the path to your wallet:\n\n# Supply the parent folder ID to upload-file\nardrive upload-file --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nExample output:\n\n{\n "created": [\n {\n "type": "file",\n "entityName": "file.txt"\n "entityId": "6613395a-cf19-4420-846a-f88b7b765c05"\n "dataTxId": "l4iNWyBapfAIj7OU-nB8z9XrBhawyqzs5O9qhk-3EnI",\n "metadataTxId": "YfdDXUyerPCpBbGTm_gv_x5hR3tu5fnz8bM-jPL__JE",\n "bundledIn": "1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8",\n "sourceUri": "file:///path/to/file.txt"\n },\n {\n "type": "bundle",\n "bundleTxId": "1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8"\n }\n ],\n "tips": [\n {\n "txId": "1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8",\n "recipient": {\n "address": "3mxGJ4xLcQQNv6_TiKx0F0d5XVE0mNvONQI5GZXJXkt"\n },\n "winston": "10000000"\n }\n ],\n "fees": {\n "1zwdfZAIV8E26YjBs2ZQ4xjjP_1ewalvRgD_GyYw7f8": 42819829\n }\n}\n\n\nNOTE: To upload to the root of a drive, specify its root folder ID as the parent folder ID for the upload destination. You can retrieve it like so:\n\nardrive drive-info -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" | jq -r \'.rootFolderId\'\n\n\n\n# IPFS CID Tagging\n\nCertain nodes on the Arweave network may be running the IPFS+Arweave bridge. Tagging your file upload transaction with its IPFS v1 CID value in the \'IPFS-Add\' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your PUBLIC file uploads, you may use the \'--add-ipfs-tag\' flag:\n\nardrive upload-file --add-ipfs-tag --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\n\n# Progress Logging of Transaction Uploads\n\nProgress logging of transaction uploads to stderr can be enabled by setting the ARDRIVE_PROGRESS_LOG environment variable to 1:\n\nUploading file transaction 1 of total 2 transactions...\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 0%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 35%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 66%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 100%\nUploading file transaction 2 of total 2 transactions...\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 0%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 13%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 28%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 42%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 60%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 76%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 91%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 100%\n\n\n\n# Download a Single file (BETA)\n\nBy using the download-file command you can download a file on chain to a folder in your local storage specified by --local-path (or to your current working directory if not specified):\n\nardrive download-file -w /path/to/wallet.json --file-id "ff450770-a9cb-46a5-9234-89cbd9796610" --local-path /my_ardrive_downloads/\n\n\nSpecify a filename in the --local-path if you\'d like to use a different name than the one that\'s used in your drive:\n\nardrive download-file -w /path/to/wallet.json --file-id "ff450770-a9cb-46a5-9234-89cbd9796610" --local-path /my_ardrive_downloads/my_pic.png\n\n\n\n# Rename a Single File\n\nTo rename an on-chain file you can make use of the rename-file command. The required parameters are the file ID and the new name, as well as the owner wallet or seed phrase.\n\nardrive rename-file --file-id "290a3f9a-37b2-4f0f-a899-6fac983833b3" --file-name "My custom file name.txt" --wallet-file "wallet.json"\n\n\n\n# Uploading a Folder with Files (Bulk Upload)\n\nUsers can perform a bulk upload by using the upload-file command on a target folder. The command will reconstruct the folder hierarchy on local disk as ArFS folders on the permaweb and upload each file into their corresponding folders:\n\nardrive upload-file --local-path /path/to/folder --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\n\n# Downloading a Folder with Files\n\nYou can download a folder from ArDrive to your local machine with the download-folder command. In the following examples, assume that a folder with ID "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" exists in your drive and is named "MyArDriveFolder".\n\n# Downloads "MyArDriveFolder" into the current working directory, i.e. ./MyArDriveFolder/\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6"\n\n\nBy specifying the --local-path option, you can choose the local parent folder into which the on-chain folder will be downloaded. When the parameter is omitted, its value defaults to the current working directory (i.e. ./).\n\n# Downloads "MyArDriveFolder" into /my_ardrive_downloads/MyArDriveFolder\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path /my_ardrive_downloads/\n\n\nThe --max-depth parameter lets you to choose a custom folder depth to download. When omitted, the entire subtree of the folder will be downloaded. In the following example, only the immediate children of the folder will be downloaded:\n\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --max-depth 0\n\n\nThe behaviors of --local-path are similar to those of cp and mv in Unix systems, e.g.:\n\n# folder downloaded to "/existing_folder/MyArDriveFolder"\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/existing_folder"\n\n# folder downloaded to "/existing_folder/MyArDriveFolder/MyArDriveFolder" as "/existing_folder/MyArDriveFolder" already exists\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/existing_folder/MyArDriveFolder"\n\n# folder downloaded to "/existing_folder/non_existent_folder"\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/existing_folder/non_existent_folder"\n\n# ERROR!\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/non_existent_folder_1/non_existent_folder_2"\n\n\n\n# Downloading a Drive\n\nTo download the whole drive you can use the download-drive command.\n\nardrive download-drive -d "c0c8ba1c-efc5-420d-a07c-a755dc67f6b2"\n\n\nThis is equivalent to running the download-folder command against the root folder of the drive.\n\n\n# Uploading Multiple Files\n\nTo upload an arbitrary number of files or folders, pass a space-separated list of paths to --local-paths:\n\n# Specifying a mixed set of file and folder paths\nardrive upload-file -w wallet.json -F "6939b9e0-cc98-42cb-bae0-5888eca78885" --local-paths ./image.png ~/backups/ ../another_file.txt\n\n# Example using glob expansion to upload all .json files in the current folder\nardrive upload-file -w wallet.json -F "6939b9e0-cc98-42cb-bae0-5888eca78885" --local-paths ./*.json\n\n\n\n# Name Conflict Resolution on Upload\n\nBy default, the upload-file command will use the upsert behavior if existing entities are encountered in the destination folder tree that would cause naming conflicts.\n\nExpect the behaviors from the following table for each of these resolution settings:\n\nSOURCE TYPE CONFLICT AT DEST `SKIP` `REPLACE` `UPSERT` (DEFAULT)\nFile None Insert Insert Insert\nFile Matching File Skip Update Skip\nFile Different File Skip Update Update\nFile Folder Skip Fail Fail\nFolder None Insert Insert Insert\nFolder File Skip Fail Fail\nFolder Folder Re-use Re-use Re-use\n\nThe default upsert behavior will check the destination folder for a file with a conflicting name. If no conflicts are found, it will insert (upload) the file.\n\nIn the case that there is a FILE to FILE name conflict found, it will only update it if necessary. To determine if an update is necessary, upsert will compare the last modified dates of conflicting file and the file being uploaded. When they are matching, the upload will be skipped. Otherwise the file will be updated as a new revision.\n\nTo override the upsert behavior, use the --replace option to always make new revisions of a file or the --skip option to always skip the upload on name conflicts:\n\nardrive upload-file --replace --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nardrive upload-file --skip --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nAlternatively, the upload-file commands now also supports the --ask conflict resolution option. This setting will always provide an interactive prompt on name conflicts that allows users to decide how to resolve each conflict found:\n\nardrive upload-file --ask --local-file-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\nDestination folder has a file to file name conflict!\n\nFile name: 2.png\nFile ID: efbc0370-b69f-44d9-812c-0d272b019027\nThis file has a DIFFERENT last modified date\n\nPlease select how to proceed:\n β€Ί - Use arrow-keys. Return to submit.\n❯ Replace as new file revision\n Upload with a different file name\n Skip this file upload\n\n\n\n# Understanding Bundled Transactions\n\nThe ArDrive CLI currently uses two different methods for uploading transactions to the Arweave network: standard transactions and Direct to Network (D2N) bundled transactions. By default, the CLI will send a D2N bundled transaction for any action that would result in multiple transactions. This bundling functionality is currently used on the upload-file and create-drive commands.\n\nD2N bundled transactions come with several benefits and implications:\n\n * Bundling saves AR and enhances ArFS reliability by sending associated ArFS transactions up as one atomic bundle.\n * Bundled transactions are treated as a single data transaction by the Arweave network, but can be presented as separate transactions by the Arweave Gateway once they have been "unbundled".\n * Un-bundling can take anywhere from a few minutes up to an hour. During that time, the files in the bundle will neither appear in list- commands nor be downloadable. Similarly, they will not appear in the web app after syncs until un-bundling is complete. This can negatively affect the accuracy of upsert operations, so it\'s best to wait before retrying bulk uploads.\n * Bundling reliability on the gateway side degrades once bundles reach either 500 data items (or ~250 files) or 500 MiB, so the CLI will create and upload multiple bundles as necessary, or will send files that are simply too large for reliable bundling as unbundled txs.\n\n\n# Uploading a Non-Bundled Transaction (NOT RECOMMENDED)\n\nWhile not recommended, the CLI does provide the option to forcibly send all transactions as standard transactions rather than attempting to bundle them together. To do this, simply add the --no-bundle flag to the upload-file or create-drive command:\n\nardrive upload-file --no-bundle --local-path /path/to/file --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\n\n# Fetching the Metadata of a File Entity\n\nSimply perform the file-info command to retrieve the metadata of a file:\n\nardrive file-info --file-id "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"\n\n\nExample output:\n\n{\n "appName": "ArDrive-Web",\n "appVersion": "0.1.0",\n "arFS": "0.11",\n "contentType": "application/json",\n "driveId": "51062487-2e8b-4af7-bd81-4345dc28ea5d",\n "entityType": "file",\n "name": "2_depth.png",\n "txId": "CZKdjqwnmxbWchGA1hjSO5ZH--4OYodIGWzI-FmX28U",\n "unixTime": 1633625081,\n "size": 41946,\n "lastModifiedDate": 1605157729000,\n "parentFolderId": "a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63",\n "entityId": "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f",\n "fileId": "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f",\n "dataTxId": "Jz0WsWyAGVc0aE3UzACo-YJqG8OPrN3UucmDdt8Fbjc",\n "dataContentType": "image/png"\n}\n\n\n\n# Retrying a Failed File Data Transaction (Public Unbundled Files Only)\n\nArweave data upload transactions are split into two phases: transaction posting and chunks uploading. Once the transaction post phase has been completed, you\'ve effectively "paid" the network for storage of the data chunks that you\'ll send in the next stage.\n\nIf your system encounters an error while posting the transaction, you can retry posting the transaction for as long as your tx_anchor is valid (learn more about tx_anchors here). You may retry and/or resume posting chunks at any time after your transaction has posted. The ArDrive CLI allows you to take advantage of this Arweave protocol capability.\n\nUsing the CLI, when the transaction post has succeeded but the chunk upload step fails, the data transaction\'s ID could be lost. There are a few options to recover this ID. If the failed transaction is the most recent one sent from a wallet, the transaction ID can be recovered with the ardrive last-tx -w /path/to/wallet command AFTER the transaction\'s headers have been mined (It can take 5-10 minutes for the tx-id to become available with the last-tx approach). Other options for finding the partially uploaded transaction\'s ID include:\n\n * Using an Arweave gateway GQL http endpoint to search for transactions that belong to the wallet. See this Arweave GQL Guide for more info.\n * Browse the recent transactions associated with the wallet via a block explorer tool like ViewBlock.\n\nIn order to re-seed the chunks for an unbundled ArFS data transaction, a user must have the data transaction ID, the original file data, and either a destination folder ID or a valid file ID for the file. Supply that information to the retry-tx command like so:\n\nardrive retry-tx --tx-id { Data Transaction ID } --parent-folder-id { Destination Folder ID } --local-path /path/to/file --wallet-file /path/to/wallet\n\n\nNote: Retry feature is currently only available for PUBLIC unbundled file transactions. It is also perfectly safe to mistakenly re-seed the chunks of a healthy transaction, the transaction will remain stable and the wallet balance will not be affected.\n\n\n# Moving Files\n\nFiles can be moved from one folder to another within the same drive. Moving a file is simply the process of uploading a new file metadata revision with an updated File ID <> Parent Folder ID relationship. The following command will move a file from its current location in a public drive to a new parent folder in that drive:\n\nardrive move-file --file-id "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f" --parent-folder-id "a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63"\n\n\n\n# Uploading Manifests\n\nArweave Path Manifests are are special .json files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. So if, for example, your manifest file had an arweave.net URL like:\n\nhttps://arweave.net/{manifest tx id}\n\n\nThen, all the mapped transactions and paths in the manifest file would be addressable at URLs like:\n\nhttps://arweave.net/{manifest tx id}/foo.txt\nhttps://arweave.net/{manifest tx id}/bar/baz.png\n\n\nArDrive supports the creation of these Arweave manifests using any of your PUBLIC folders. The generated manifest paths will be links to each of the file entities within the specified folder. The manifest file entity will be created at the root of the folder.\n\nTo create a manifest of an entire public drive, specify the root folder of that drive:\n\nardrive create-manifest -f "bc9af866-6421-40f1-ac89-202bddb5c487" -w "/path/to/wallet"\n\n\nYou can also create a manifest of a folder\'s file entities at a custom depth by using the --max-depth option:\n\n# Create manifest of a folder\'s local file contents, excluding all sub-folders\nardrive create-manifest --max-depth 0 -f "867228d8-4413-4c0e-a499-e1decbf2ea38" -w "/path/to/wallet"\n\n\nCreating a .json file of your manifest links output can be accomplished here with some jq parsing and piping to a file:\n\nardrive create-manifest -w /path/to/wallet -f "6c312b3e-4778-4a18-8243-f2b346f5e7cb" | jq \'{links}\' > links.json\n\n\nIf you\'d like to preview the contents of your manifest before uploading, you can perform a dry run and do some lightweight post processing to isolate the data:\n\nardrive create-manifest -w /path/to/wallet -f "6c312b3e-4778-4a18-8243-f2b346f5e7cb" --dry-run | jq \'{manifest}.manifest\'\n\n\n\n\n{\n "manifest": "arweave/paths",\n "version": "0.1.0",\n "index": {\n "path": "index.html"\n },\n "paths": {\n "hello_world.txt": {\n "id": "Y7GFF8r9y0MEU_oi1aZeD87vrmai97JdRQ2L0cbGJ68"\n },\n "index.html": {\n "id": "pELonjVebHyBsdxVymvxbGTmHD96v9PuuUXj8GUHGoY"\n }\n }\n}\n\n\nThe manifest data transaction is tagged with a unique content-type, application/x.arweave-manifest+json, which tells the gateway to treat this file as a manifest. The manifest file itself is a .json file that holds the paths (the data transaction ids) to each file within the specified folder.\n\nWhen your folder is later changed by adding files or updating them with new revisions, the original manifest will NOT be updated on its own. A manifest is a permanent record of your files in their current state.\n\nHowever, creating a subsequent manifest with the same manifest name will create a new revision of that manifest in its new current state. Manifests follow the same name conflict resolution as outlined for files above (upsert by default).\n\n# Hosting a Webpage with Manifest\n\nWhen creating a manifest, it is possible to host a webpage or web app. You can do this by creating a manifest on a folder that has an index.html file in its root.\n\nUsing generated build folders from popular frameworks works as well. One requirement here to note is that the href= paths from your generated index.html file must not have leading a /. This means that the manifest will not resolve a path of /dist/index.js but it will resolve dist/index.js or ./dist/index.js.\n\nAs an example, here is a flow of creating a React app and hosting it with an ArDrive Manifest. First, generate a React app:\n\nyarn create react-app my-app\n\n\nNext, add this field to the generated package.json so that the paths will resolve correctly:\n\n"homepage": ".",\n\n\nThen, create an optimized production build from within the app\'s directory:\n\nyarn build\n\n\nNow, we can create and upload that produced build folder on ArDrive to any of your existing ArFS folder entities:\n\nardrive upload-file -l "/build" -w "/path/to/wallet" --parent-folder-id "bc9af866-6421-40f1-ac89-202bddb5c487"\n\n\nAnd finally, create the manifest using the generated Folder ID from the build folder creation:\n\n# Create manifest using the Folder ID of the `/build` folder\nardrive create-manifest -f "41759f05-614d-45ad-846b-63f3767504a4" -w "/path/to/wallet"\n\n\nIn the return output, the top link will be a link to the deployed web app:\n\n "links": [\n "https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg",\n "https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/asset-manifest.json",\n "https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/favicon.ico",\n "https://arweave.net/0MK68J8TqGhaaOpPe713Zn0jdpczMt2NGS2CtRYiuAg/index.html",\n # ...\n\n\nThis is effectively hosting a web app with ArDrive. Check out the ArDrive Price Calculator React App hosted as an ArDrive Manifest.\n\n\n# Uploading With a Custom Content Type\n\nEach file uploaded to the Arweave network receives a "Content-Type" GraphQL tag that contains the MIME type for the file. The gateway will use this content type to determine how to serve that file\'s data transaction at the arweave.net/{data tx id} endpoint.\n\nBy default, the CLI will attempt to derive this content type from the file extension of the provided file. In most cases, the content type that is derived will be correct and the gateway will properly serve the file.\n\nThe CLI also provides the option for users to upload files with a custom content type using the --content-type flag:\n\nardrive upload-file --content-type "application/json" --local-path /path/to/file --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nIt is currently possible to set this value to any given string, but the gateway will still only serve valid content types. Check out this list of commonly used MIME types to ensure you\'re providing a valid content type: Common MIME types.\n\nNote: In the case of multi-file uploads or recursive folder uploads, setting this --content-type flag will set the provided custom content type on EVERY file entity within a given upload.\n\n\n# Uploading From a Remote URL\n\nYou can upload a file from an existing url using the --remote-path flag. This must be used in conjunction with --dest-file-name.\n\nYou can use a custom content type using the --content-type flag, but if this isn\'t used the app will use the content type from the response header of the request for the remote data.\n\nardrive upload-file --remote-path "https://url/to/file" --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -d "example.jpg" -w /path/to/wallet.json\n\n\n\n# Uploading a Custom Manifest\n\nUsing the custom content type feature, it is possible for users to upload their own custom manifests. The Arweave gateways use this special content type in order to identify an uploaded file as a manifest:\n\napplication/x.arweave-manifest+json\n\n\nIn addition to this content type, the manifest must also adhere to the correct JSON structure of an Arweave manifest. A user can create their own manifest from scratch, or start by piping a generated manifest to a JSON file and editing it to their specifications:\n\nardrive create-manifest -w /path/to/wallet -f "6c312b3e-4778-4a18-8243-f2b346f5e7cb" --dry-run | jq \'{manifest}.manifest\' > my-custom-manifest.json\n\n\nAfter editing the generated manifest, simply perform an upload-file command with the custom Arweave manifest content type to any PUBLIC folder:\n\nardrive upload-file --content-type "application/x.arweave-manifest+json" --local-path my-custom-manifest.json --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nThe returned dataTxId field on the created file entity will be the endpoint that the manifest can be found on Arweave, just as explained in the manifest sections above:\n\nhttps://arweave.net/{dataTxId}\nhttps://arweave.net/{dataTxId}/custom-file-1\nhttps://arweave.net/{dataTxId}/custom-file-2\n\n\n\n# Uploading Files with Custom MetaData\n\nArDrive CLI has the capability of attaching custom metadata to ArFS File and Folder MetaData Transactions during the upload-file command. This metadata can be applied to either the GQL tags on the MetaData Transaction and/or into the MetaData Transaction\'s Data JSON.\n\nAll custom metadata applied must ultimately adhere to the following JSON shapes:\n\n// GQL Tags\ntype CustomMetaDataGqlTags = Record;\n\n// Data JSON Fields\ntype CustomMetaDataJsonFields = Record;\n\nexport type JsonSerializable =\n | string\n | number\n | boolean\n | null\n | { [member: string]: JsonSerializable }\n | JsonSerializable[];\n\n\ne.g:\n\n{ IPFS-Add: \'MY_HASH\' }\n# or\n{ \'Custom Name\': [\'Val 1\', \'Val 2\'] }\n\n\nWhen the custom metadata is attached to the MetaData Transaction\'s GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.\n\nWhen these tags are added to the MetaData Transaction\'s Data JSON they can be read by downloading the JSON data directly from https://arweave.net/METADATA_TX_ID.\n\nTo add this custom metadata to your file metadata transactions, CLI users can pass custom metadata these parameters:\n\n * --metadata-file path/to/json/schema\n * --metadata-json \'{"key": "val", "key-2": true, "key-3": 420, "key-4": ["more", 1337]}\'\n * --metadata-gql-tags "Tag-Name" "Tag Val"\n\nThe --metadata-file will accept a file path to JSON file containing custom metadata:\n\nardrive upload-file --metadata-file path/to/metadata/json # ...\n\n\nThis JSON schema object must contain instructions on where to put this metadata with the metaDataJson and metaDataGqlTags keys. e.g:\n\n{\n "metaDataJson": {\n "Tag-Name": ["Value-1", "Value-2"]\n },\n "metaDataGqlTags": {\n "GQL Tag Name": "Tag Value"\n }\n}\n\n\nThe --metadata-gql-tags parameter accepts an array of string values to be applied to the MetaData Tx GQL Tags. This method of CLI input does not support multiple tag values for a given tag name and the input must be an EVEN number of string values. (Known bug: String values starting with the "-" character are currently not supported. Use --metadata-file parameter instead.) e.g:\n\nupload-file --metadata-gql-tags "Custom Tag Name" "Custom Value" # ...\n\n\nAnd the --metadata-json parameter will accept a stringified JSON input. It will apply all declared JSON fields directly to the MetaData Tx\'s Data JSON. e.g:\n\n upload-file --metadata-json \' { "json field": "value", "another fields": false } \' # ...\n\n\nCustom metadata applied to files and/or folders during the upload-file command will be read back through all existing read commands. e.g:\n\nardrive file-info -f 067c4008-9cbe-422e-b697-05442f73da2b\n{\n "appName": "ArDrive-CLI",\n "appVersion": "1.17.0",\n "arFS": "0.11",\n "contentType": "application/json",\n "driveId": "967215ca-a489-494b-97ec-0dd428d7be34",\n "entityType": "file",\n "name": "unique-name-9718",\n "txId": "sxg8bNu6_bbaHkJTxAINVVoz_F-LiFe6s7OnxzoJJk4",\n "unixTime": 1657655070,\n "size": 262148,\n "lastModifiedDate": 1655409872705,\n "dataTxId": "ublZcIff77ejl3m0uEA8lXEfnTWmSBOFoz-HibqKeyk",\n "dataContentType": "text/plain",\n "parentFolderId": "97bc4fb5-aca4-4ffe-938f-1285153d98ca",\n "entityId": "067c4008-9cbe-422e-b697-05442f73da2b",\n "fileId": "067c4008-9cbe-422e-b697-05442f73da2b",\n "IPFS-Add": "MY_HASH",\n "Tag-1": "Val",\n "Tag-2": "Val",\n "Tag-3": "Val",\n "Boost": "1.05"\n}\n\n\n# Applying Unique Custom MetaData During Bulk Workflows\n\nWith some custom scripting and the --metadata-file parameter, the ArDrive CLI can be used to apply custom metadata to each file individually in a bulk workflow. For example, if you choose a numbered file naming pattern you can make use of a for loop:\n\nfor i in {1..5}\ndo\nardrive upload-file -F f0c58c11-430c-4383-8e54-4d864cc7e927 --local-path "../uploads/test-file-$i.txt" -w "/path/to/wallet.json" --metadata-file "../custom/metadata-$i.json" --dry-run > "file-result-$i.json"\ndone\n\n\n\n# Other Utility Operations\n\n\n# Monitoring Transactions\n\nBlock time on Arweave is typically between 2-3 minutes in duration, so transactions can be mined within that time frame when network congestion is low. Transactions, in the general case, proceed through the following set of states:\n\n * Pending: the transaction is waiting the "mempool" to be mined\n * Confirming: the transaction was mined on an Arweave Node, but has not yet been confirmed by at least 15 total nodes on the network\n * Confirmed: the transaction was mined on an Arweave Node and confirmed by at least 15 total nodes on the network\n * Not Found: the transaction is not available for any of the following reasons:\n * Insufficient reward to join the mempool\n * Insufficient reward to be mined within 50 blocks during a period of network congestion\n * Transaction is transitioning between states\n * Transaction ID is invalid\n\nMonitor any Arweave transaction\'s status via its transaction ID by performing:\n\n# Peek at the status:\nardrive tx-status -t "ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs"\n\n\nExample output:\n\nekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs: Mined at block height 775810 with 22439 confirmations\n\n\n# Reprint the status every 10 seconds:\nwatch -n 10 ardrive tx-status -t "ekSMckikdRJ8RGIkFa-X3xq3427tvM7J9adv8HP3Bzs"\n\n\n\n# Dealing With Network Congestion\n\nCurrently, Arweave blocks hold up to 1000 transactions per block. The "mempool", where pending transactions reside until they\'ve been included into a block, will only hold a transaction for 50 blocks (~100-150 minutes) before it\'s discarded by the network resulting in no fees or data being transacted. During periods of network congestion (i.e. those where the mempool contains 1000 or more pending transactions), it may make sense to either:\n\na) wait for congestion to dissipate before attempting your transactions.\n\nb) apply the fee boost multiplier to your transactions rewards with the --boost parameter during write operations in order to front-run some of the congestion.\n\n# Check for network congestion before uploading\n\n# See all the transactions in the mempool\nardrive get-mempool\n\n# Return the count of the transactions in the mempool\nardrive get-mempool | jq \'length\'\n\n\n# Front-run Congestion By Boosting Miner Rewards\n\n# Increase the miner reward on your transactions by 50%\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "f0c58c11-430c-4383-8e54-4d864cc7e927" --local-path ./helloworld.txt --boost 1.5\n\n\n# Send AR Transactions From a Cold Wallet\n\nThe best cold wallet storage never exposes your seed phrase and/or private keys to the Internet or a compromised system interface. You can use the ArDrive CLI to facilitate cold storage and transfer of AR.\n\nIf you need a new cold AR wallet, generate one from an air-gapped machine capable of running the ArDrive CLI by following the instructions in the Wallet Operations section. Fund your cold wallet from whatever external sources you\'d like. NOTE: Your cold wallet won\'t appear on chain until it has received AR.\n\nThe workflow to send the AR out from your cold wallet requires you to generate a signed transaction with your cold wallet on your air-gapped machine via the ArDrive CLI, and then to transfer the signed transaction (e.g. by a file on a clean thumb drive) to an Internet-connected machine and send the transaction to the network via the ArDrive CLI. You\'ll need two inputs from the Internet-connected machine:\n\n * the last transaction sent OUT from the cold wallet (or an empty string if none has ever been sent out)\n * the base fee for an Arweave transaction (i.e. a zero bye transaction). Note that this value could change if a sufficient amount of time passes between the time you fetch this value, create the transaction, and send the transaction.\n\nTo get the last transaction sent from your cold wallet, use the last-tx command and specify your wallet address e.g.:\n\nardrive last-tx -a \n\n\nTo get the base transaction reward required for an AR transaction, use the base-reward function, optionally applying a reward boost multiple if you\'re looking to front-run network congestion:\n\nardrive base-reward --boost 1.5\n\n\nWrite down or securely copy the values you derived from the Internet-connected machine and run the following commands on the airgapped machine, piping the outputted signed transaction data to a file in the process, e.g. sendme.json (if that\'s your signed transaction transfer medium preference):\n\nardrive create-tx -w /path/to/wallet/file.json -d -a --last-tx --reward "" > sendme.json\n\n\nTransport your signed transaction to the Internet-connected machine and run the following command to send your transaction to the Arweave network:\n\nardrive send-tx -x /path/to/sendme.json\n\n\n\n# Using a Custom Arweave Gateway\n\nOn each command that uses a gateway, it is possible to supply your own custom Arweave gateway using the flag --gateway or by setting an environment variable named ARWEAVE_GATEWAY.\n\nFor example, you could test out that your ArFS transactions are working as expected on a local test network such as ArLocal with this flow:\n\n# Setup ArLocal instance on port 1984\nnpx arlocal\n\n# In another terminal, fund your wallet with AR\ncurl http://localhost:1984/mint/{ your public wallet address }/99999999999999\n\n# Create drive and root folder on ArLocal using `--gateway` flag\nardrive create-drive --gateway http://127.0.0.1:1984 -w /path/to/wallet -n \'my-test-drive\'\n\n# Setup ARWEAVE_GATEWAY as ENV variable\nexport ARWEAVE_GATEWAY="http://localhost:1984"\n\n# Mine block with drive + root folder transactions\ncurl "$ARWEAVE_GATEWAY/mine"\n\n# Upload file to ArLocal with ENV var\nardrive upload-file -F { root folder id from create drive } -l /path/to/file -w /path/to/wallet\n\n# Mine block with file transaction\ncurl "$ARWEAVE_GATEWAY/mine"\n\n# Inspect meta data of created entities\nardrive list-drive -d { drive id from create drive }\n\n# Download file to verify integrity\nardrive download-file -f { file id from upload file }\n\n\n\n# Persistent Caching of ArFS Entity Metadata\n\nTo avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:\n\nWindows: /ardrive-caches/metadata\nNon-Windows: /.ardrive/caches/metadata\n\n\nThe XDG_CACHE_HOME environment variable is honored, where applicable, and will be used in place of os.homedir() in the scenarios described above.\n\nMetadata cache logging to stderr can be enabled by setting the ARDRIVE_CACHE_LOG environment variable to 1.\n\nCache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.\n\nThe cache can be manually cleared safely at any time that any integrating app is not in operation.',normalizedContent:'# using the cli\n\n\n# cli help\n\nlearn to use any command:\n\nardrive --help\n\n\n\n# cli version\n\nyou can print out the version by running any of:\n\nardrive --version\nardrive -v\n\n\n\n# wallet operations\n\nbrowsing of ardrive public data is possible without the need for an arweave wallet. however, for all write operations, or read operations without encryption/decryption keys, you\'ll need a wallet.\n\nas you utilize the cli, you can use either your wallet file or your seed phrase interchangeably. consider the security implications of each approach for your particular use case carefully. if at any time you\'d like to generate a new wallet altogether, start by generating a new seed phase. and if you\'d like to use that seed phrase in the form of a wallet file, or if you\'d like to recover an existing wallet via its seed phrase, use either or both of the following commands:\n\n# generate seed-phrase\nardrive generate-seedphrase\n"this is an example twelve word seed phrase that you could use"\n\n# generate/recover wallet file (with example output file path)\nardrive generate-wallet -s "this is an example twelve word seed phrase that you could use" > /path/to/wallet/file.json\n\n\npublic attributes of arweave wallets can be retrieved via their 43-character arweave wallet address. you can retrieve the wallet address associated with your wallet file or 12-word seed phrase (e.g. wallets generated by arconnect) like so:\n\n# wallet file\nardrive get-address -w /path/to/wallet/file.json\n\n# seed phrase (with sample output)\nardrive get-address -s "this is an example twelve word seed phrase that you could use"\nhttn8f92tr32n8wuo-nidkjmqpknrbl10jwo5mz9x2k\n\n\nyou\'ll need ar in your wallet for any write operations you perform in ardrive. you can always check your wallet balance (in both ar and winston units) by performing:\n\n# getting the balance for your own wallet\nardrive get-balance -w /path/to/wallet/file.json\n\n# getting the balance for any wallet (with sample output)\nardrive get-balance -a "httn8f92tr32n8wuo-nidkjmqpknrbl10jwo5mz9x2k"\n1500000000000 winston\n1.5 ar\n\n\nif, at any time, you need to send ar out of your wallet to another wallet address, you may perform:\n\n# using our previously generated wallet as the destination...\nardrive send-ar -w /path/to/wallet/file.json --dest-address "httn8f92tr32n8wuo-nidkjmqpknrbl10jwo5mz9x2k" --ar-amount 2.12345\n\n\n\n# working with entities\n\nardrive\'s arfs integration provides for hierarchical organization of your file and folder data on arweave.\n\nthe fundamental entity types specified by arfs are:\n\n * drives\n * folders\n * files\n\neach instance of these entities have a version 4 uuid entity id that is commonly referred to by its entity type, i.e. drive id, folder id, and file id.\n\nwhen you execute write functions with the cli, the json output will contain information about the arweave transaction ids that were registered when writing your entities to the blockweave, any miner rewards or ardrive community tips that were disbursed from your wallet, and any new entity ids and, when applicable, encryption keys that were generated in the process of creating the entities. typically, you\'ll want to keep track of those and get proficient with retrieving them in order to build your drive hierarchy to your liking. see understanding drive and file keys for more info.\n\n\n# dry run\n\nan important feature of the ardrive cli is the --dry-run flag. on each command that would write an arfs entity, there is the option to run it as a "dry run". this will run all of the steps and print the outputs of a regular arfs write, but will skip sending the actual transaction:\n\nardrive --dry-run\n\n\nthis can be very useful for gathering price estimations or to confirm that you\'ve copy-pasted your entity ids correctly before committing to an upload.\n\n\n# uploading to turbo (beta)\n\nusers can optionally choose to send each arfs entities created to ardrive turbo using the --turbo flag. instead of using ar from an arweave wallet, you can use turbo credits or take advantage of free/discounted upload promotions.\n\nardrive --turbo\n\n\nthis flag will skip any balance check on the cli side. turbo will check a user\'s balance and accept/reject a data item at the time of upload. the --turbo flag by default will send your files to upload.ardrive.io to be bundled. to change the turbo destination, users can use the --turbo-url flag.\n\n\n# working with drives\n\n\n# understanding drive hierarchies\n\nat the root of every data tree is a "drive" entity. when a drive is created, a root folder is also created for it. the entity ids for both are generated and returned when you create a new drive:\n\n# use `tee` to keep a receipt of the full set of transactions info and `jq` to focus on the data of interest\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "teenage love poetry" |\ntee created_drive.json |\njq \'[.created[] | del(.metadatatxid, .entityname, .bundledin)]\'\n[\n {\n "type": "drive",\n "entityid": "6939b9e0-cc98-42cb-bae0-5888eca78885"\n }\n {\n "type": "folder",\n "entityid": "d1535126-fded-4990-809f-83a06f2a1118"\n }\n]\n\n\nthe relationship between the drive and its root folder is clearly visible when retrieving the drive\'s info:\n\nardrive drive-info -d "6939b9e0-cc98-42cb-bae0-5888eca78885"\n| jq \'{driveid, rootfolderid}\'\n{\n "driveid": "6939b9e0-cc98-42cb-bae0-5888eca78885",\n "rootfolderid": "d1535126-fded-4990-809f-83a06f2a1118"\n}\n\n\n\nall file and folder entities in the drive will be anchored to it by a "drive-id" gql tag. and they\'ll each be anchored to a parent folder id, tracked via the "parent-folder-id" gql tag, forming a tree structure whose base terminates at the root folder.\n\n\n# understanding drive and file keys\n\nprivate drives achieve privacy via end-to-end encryption facilitated by hash-derived "keys". drive keys encrypt/decrypt drive and folder data, and file keys encrypt/decrypt file data.\n\nthe relationships among your data and their keys is as follows:\n\n * drive key = functionof(wallet signature, randomly generated drive id, user-specified drive password)\n * file key = functionof(randomly generated file id, drive key)\n\nwhen you create private entities, the returned json data from the ardrive cli will contain the keys needed to decrypt the encrypted representation of your entity that is now securely and permanently stored on the blockweave.\n\nto derive the drive key again for a drive, perform the following:\n\n# will throw an error if the wallet or password specified can\'t be used to decrypt the on-chain drive\nardrive get-drive-key -w /path/to/my/wallet.json -d "6939b9e0-cc98-42cb-bae0-5888eca78885" -p\n\n\nto derive the file key again for a file, perform the following:\n\n# will throw an error if the drive key or drive-key-derivation data specified can\'t be used to decrypt the on-chain file\nardrive get-file-key --file-id "bd2ce978-6ede-4b0d-8f79-2d7bc235a0e0" --drive-id "6939b9e0-cc98-42cb-bae0-5888eca78885" --drive-key "yhdcjpck3ecuhqcknx2d/nn5reejokfzvqkunlcnpeo"\n\n\n\n# managing drive passwords\n\nthe ardrive cli\'s private drive and folder functions all require either a drive password or a drive key. private file functions require either the drive password or the file key. keys and passwords are sensitive data, so manage the entry, display, storage, and transmission of them very carefully.\n\ndrive passwords are the most portable, and fundamental, encryption facet, so a few options are available during private drive operations for supplying them:\n\n * environment variable\n * stdin\n * secure prompt\n\n# supplying your password: environment variable\n\n# securely type your password into a read prompt, store it to tmp_ardrive_pw, and export it for the shell session\nread -rs tmp_ardrive_pw\nexport ardrive_drive_pw=$(tmp_ardrive_pw)\nardrive -w /path/to/wallet.json -p\n\n\n# supplying your password: stdin\n\n# pipe your drive password to the ardrive cli\ncat /path/to/my/drive/password.txt | ardrive -w /path/to/wallet.json -p\n\n# redirect your drive password to the ardrive cli\nardrive -w /path/to/wallet.json -p < /path/to/my/drive/password.txt\n\n\n# supplying your password: prompt\n\n# when all other options fail, the cli will prompt for your password (not compatible with pipes and redirects!)\nardrive -w /path/to/wallet.json -p\n? enter drive password: β€Ί ********\n\n\n\n# creating drives\n\n# public drive\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "my public archive"\n\n# private drive\nardrive create-drive --wallet-file /path/to/my/wallet.json --drive-name "teenage love poetry" -p\n\n\n\n# listing drives for an address\n\nyou can list all the drives associated with any arweave wallet address, though the details of private drives will be obfuscated from you unless you provide the necessary decryption data.\n\n# list all your own drives\nardrive list-all-drives -w /path/to/my/wallet.json -p\n\n# list any address\'s drives\nardrive list-all-drives --address "httn8f92tr32n8wuo-nidkjmqpknrbl10jwo5mz9x2k"\n\n\n\n# listing every entity in a drive\n\nuseful notes on listing the contents of drives:\n\n * listing a drive is effectively the same as listing its root folder.\n * you can control the tree depth of the data returned.\n * path, txpath, and entityidpath properties on entities can provide useful handholds for other forms of data navigation\n\n# list everything in a private drive\nardrive list-drive -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" -w /path/to/my/wallet.json -p\n\n# list a private drive including the `filekey` and/or `drivekey` of all listed entitites\nardrive list-drive -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" -w /path/to/my/wallet.json -p --with-keys\n\n# list the contents of a public drive up to and including those in the grandchild folders of the root folder\nardrive list-drive -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" --max-depth 2\n\n\n\n# list drive pipeline examples\n\nyou can utilize jq and the list commands to reshape the commands\' output data into useful forms and stats for many use cases. here are a few examples:\n\n\n\n# get share links for a public drive\nardrive list-drive -d a44482fd-592e-45fa-a08a-e526c31b87f1 | jq \'.[] | select(.entitytype == "file") | "https://app.ardrive.io/#/file/" + .entityid + "/view"\'\n\n\nexample output:\n\n"https://app.ardrive.io/#/file/1337babe-f000-dead-beef-ffffffffffff/view"\n"https://app.ardrive.io/#/file/cdbc9ddd-1cab-41d9-acbd-fd4328929de3/view"\n"https://app.ardrive.io/#/file/f19bc712-b57a-4e0d-8e5c-b7f1786b34a1/view"\n"https://app.ardrive.io/#/file/4f8e081b-42f2-442d-be41-57f6f906e1c8/view"\n"https://app.ardrive.io/#/file/0e02d254-c853-4ff0-9b6e-c4d23d2a95f5/view"\n"https://app.ardrive.io/#/file/c098b869-29d1-4a86-960f-a9e10433f0b0/view"\n"https://app.ardrive.io/#/file/4afc8cdf-4d27-408a-bfb9-0a2ec21eebf8/view"\n"https://app.ardrive.io/#/file/85fe488d-fcf7-48ca-9df8-2b39958bbf15/view"\n...\n\n\n\n\n# get total size of all files within drive\nardrive list-drive -d 13c3c232-6687-4d11-8ac1-35284102c7db | jq \' map(select(.entitytype == "file") | .size) | add\'\n\n\n\n\n# get total number of files within drive\nardrive list-drive -d 01ea6ba3-9e58-42e7-899d-622fd110211c | jq \'[ .[] | select(.entitytype == "file") ] | length\'\n\n\n\n# working with folders\n\nas discussed previously, all folders in a drive are linked by way of parent folder references back to the root folder of a drive. folders can be moved into any folder in the hierarchy that\'s not in their own subtree.\n\n\n# creating folders\n\ncreating folders manually is straightforward:\n\nardrive create-folder --parent-folder-id "63153bb3-2ca9-4d42-9106-0ce82e793321" --folder-name "my awesome folder" -w /path/to/wallet.json\n\n\nexample output:\n\n{\n "created": [\n {\n "type": "folder",\n "metadatatxid": "ayfmbvmwqhbg9y5fbj3iasy5oxuqhauow7pcs1sl4dk",\n "entityid": "d1b7c514-fb12-4603-aad8-002cf63015d3",\n "key": "yhdcjpckd2cuhqcknx2d/xf5reejokfzvqkunlcnpek",\n "entityname": "my awesome folder"\n }\n ],\n "tips": [],\n "fees": {\n "ayfmbvmwqhbg9y5fbj3iasy5oxuqhauow7pcs1sl4dk": 1378052\n }\n}\n\n\nnote: folders can also be created by supplying a folder as the --local-path of an upload-file command. in this case, the folder hierarchy on the local disk will be reconstructed on chain during the course of the recursive bulk upload.\n\n\n# moving folders\n\nmoving a folder is as simple as supplying a new parent folder id. note that naming collisions among entities within a folder are not allowed.\n\nardrive move-folder --folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" --parent-folder-id "29850ab7-56d4-4e1f-a5be-cb86d5513921" -w /path/to/wallet.json\n\n\n\n# renaming folders\n\nin order to rename a folder you must provide a name different from its current one, and it must not create naming conflicts with its sibling entities.\n\nardrive rename-folder --folder-id "568d5eba-dbf3-4a49-8129-1c58f7fd35bc" --folder-name "folder with cool stuff" -w "./wallet.json"\n\n\n\n# viewing folder metadata\n\nto view the metadata of a folder, users can use the folder-info command:\n\nardrive folder-info --folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0"\n\n\n\n# listing contents of a folder\n\nsimilar to drives, the list-folder command can be used to fetch the metadata of each entity within a folder. but by default, the command will fetch only the immediate children of that folder (--max-depth 0):\n\n# list immediate children of folder "my public folder"\nardrive list-folder --parent-folder-id "29850ab7-56d4-4e1f-a5be-cb86d5513940"\n\n\nexample output:\n\n[\n {\n "appname": "ardrive-cli",\n "appversion": "2.0",\n "arfs": "0.11",\n "contenttype": "application/json",\n "driveid": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entitytype": "folder",\n "name": "mytestfolder",\n "txid": "hyikyflwy7pt9nletqotim_-qpvuwf4cldhx1sjuaeu",\n "unixtime": 1635102772,\n "parentfolderid": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityid": "03df2929-1440-4ab4-bbf0-9dc776e1ed96",\n "path": "/my public folder/mytestfolder",\n "txidpath": "/09_x0x2ez3flxxls72wdtdq6uaa5g2ljst-qh1m0zhu/hyikyflwy7pt9nletqotim_-qpvuwf4cldhx1sjuaeu",\n "entityidpath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/03df2929-1440-4ab4-bbf0-9dc776e1ed96"\n },\n {\n "appname": "ardrive-cli",\n "appversion": "2.0",\n "arfs": "0.11",\n "contenttype": "application/json",\n "driveid": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entitytype": "folder",\n "name": "super sonic public folder",\n "txid": "vuk1b_vo1va2-ehltqjsotzy0rdn6lu4hqo3rd2xoti",\n "unixtime": 1631283259,\n "parentfolderid": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityid": "452c6aec-43dc-4015-9abd-20083068d432",\n "path": "/my public folder/super sonic sub folder",\n "txidpath": "/09_x0x2ez3flxxls72wdtdq6uaa5g2ljst-qh1m0zhu/vuk1b_vo1va2-ehltqjsotzy0rdn6lu4hqo3rd2xoti",\n "entityidpath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/452c6aec-43dc-4015-9abd-20083068d432"\n },\n {\n "appname": "ardrive-cli",\n "appversion": "2.0",\n "arfs": "0.11",\n "contenttype": "application/json",\n "driveid": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entitytype": "file",\n "name": "test-number-twelve.txt",\n "txid": "429zbqnd7zbnzgukaix26ryz3g5sexcco_oiy6cpzlg",\n "unixtime": 1631722234,\n "size": 47,\n "lastmodifieddate": 1631722217028,\n "datatxid": "va-bxas7i6n90ch4fzsk4cws3eopb1kohj8yei88dj0",\n "datacontenttype": "text/plain",\n "parentfolderid": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityid": "e5948327-d6de-4acf-a6fe-e091ecf78d71",\n "path": "/my public folder/test-number-twelve.txt",\n "txidpath": "/09_x0x2ez3flxxls72wdtdq6uaa5g2ljst-qh1m0zhu/429zbqnd7zbnzgukaix26ryz3g5sexcco_oiy6cpzlg",\n "entityidpath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/e5948327-d6de-4acf-a6fe-e091ecf78d71"\n },\n {\n "appname": "ardrive-cli",\n "appversion": "2.0",\n "arfs": "0.11",\n "contenttype": "application/json",\n "driveid": "01ea6ba3-9e58-42e7-899d-622fd110211a",\n "entitytype": "file",\n "name": "wonderful-test-file.txt",\n "txid": "6cokwlzb81fx7dq-lb654vm0xqykdu6eyohdmej2gk4",\n "unixtime": 1631671275,\n "size": 23,\n "lastmodifieddate": 1631283389232,\n "datatxid": "up8thwa_1gvyrqnrqymtpwvu4-uznwbn7six_aiihg4",\n "datacontenttype": "text/plain",\n "parentfolderid": "29850ab7-56d4-4e1f-a5be-cb86d5513940",\n "entityid": "3274dae9-3487-41eb-94d5-8d5d3d8bc343",\n "path": "/my public folder/wonderful-test-file.txt",\n "txidpath": "/09_x0x2ez3flxxls72wdtdq6uaa5g2ljst-qh1m0zhu/6cokwlzb81fx7dq-lb654vm0xqykdu6eyohdmej2gk4",\n "entityidpath": "/29850ab7-56d4-4e1f-a5be-cb86d5513940/3274dae9-3487-41eb-94d5-8d5d3d8bc343"\n }\n]\n\n\nto list further than the immediate children, you can make use of the flags: --all and --max-depth.\n\n# list all contents of a public folder\nardrive list-folder --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" --all\n\n# list the contents of a public folder with custom depth\nardrive list-folder --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" --max-depth 2\n\n\nin the case of private entitites, the --with-keys flag will make the command to include the keys in the output.\n\n# list all contents of a private folder including the `filekey` and/or `drivekey` of all listed entitites\nardrive list-folder --parent-folder-id "1b027047-4cfc-4eee-88a8-9af694f660c0" -w /my/wallet.json --with-keys\n\n\n\n# working with files\n\nsimilar to folders, files are linked to a parent folder which ultimately chains the file back to the root folder of its parent drive. as such, a parent folder id is required in order to upload files. files can be freely moved to other folders within their original drive.\n\nthe important difference for file entities is that they also hold a reference to their data transaction id, which is the datatxid as returned by the file-info command. this is where your uploaded data lives on the permaweb.\n\nnote: the cli currently (v1.0.0) has progress logging on uploads disabled for producing clean json outputs that can be piped in the terminal. on larger uploads, remember to be patient. you can check your system\'s node process to confirm the process is still uploading.\n\n\n# uploading a single file\n\nto upload a file, you\'ll need a parent folder id, the file to upload\'s file path, and the path to your wallet:\n\n# supply the parent folder id to upload-file\nardrive upload-file --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nexample output:\n\n{\n "created": [\n {\n "type": "file",\n "entityname": "file.txt"\n "entityid": "6613395a-cf19-4420-846a-f88b7b765c05"\n "datatxid": "l4inwybapfaij7ou-nb8z9xrbhawyqzs5o9qhk-3eni",\n "metadatatxid": "yfddxuyerpcpbbgtm_gv_x5hr3tu5fnz8bm-jpl__je",\n "bundledin": "1zwdfzaiv8e26yjbs2zq4xjjp_1ewalvrgd_gyyw7f8",\n "sourceuri": "file:///path/to/file.txt"\n },\n {\n "type": "bundle",\n "bundletxid": "1zwdfzaiv8e26yjbs2zq4xjjp_1ewalvrgd_gyyw7f8"\n }\n ],\n "tips": [\n {\n "txid": "1zwdfzaiv8e26yjbs2zq4xjjp_1ewalvrgd_gyyw7f8",\n "recipient": {\n "address": "3mxgj4xlcqqnv6_tikx0f0d5xve0mnvonqi5gzxjxkt"\n },\n "winston": "10000000"\n }\n ],\n "fees": {\n "1zwdfzaiv8e26yjbs2zq4xjjp_1ewalvrgd_gyyw7f8": 42819829\n }\n}\n\n\nnote: to upload to the root of a drive, specify its root folder id as the parent folder id for the upload destination. you can retrieve it like so:\n\nardrive drive-info -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" | jq -r \'.rootfolderid\'\n\n\n\n# ipfs cid tagging\n\ncertain nodes on the arweave network may be running the ipfs+arweave bridge. tagging your file upload transaction with its ipfs v1 cid value in the \'ipfs-add\' tag may allow you to take advantage of this system. it can also be helpful for finding data on arweave via gql based on its cid. to include the cid tag on your public file uploads, you may use the \'--add-ipfs-tag\' flag:\n\nardrive upload-file --add-ipfs-tag --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\n\n# progress logging of transaction uploads\n\nprogress logging of transaction uploads to stderr can be enabled by setting the ardrive_progress_log environment variable to 1:\n\nuploading file transaction 1 of total 2 transactions...\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 0%\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 35%\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 66%\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 100%\nuploading file transaction 2 of total 2 transactions...\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 0%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 13%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 28%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 42%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 60%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 76%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 91%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 100%\n\n\n\n# download a single file (beta)\n\nby using the download-file command you can download a file on chain to a folder in your local storage specified by --local-path (or to your current working directory if not specified):\n\nardrive download-file -w /path/to/wallet.json --file-id "ff450770-a9cb-46a5-9234-89cbd9796610" --local-path /my_ardrive_downloads/\n\n\nspecify a filename in the --local-path if you\'d like to use a different name than the one that\'s used in your drive:\n\nardrive download-file -w /path/to/wallet.json --file-id "ff450770-a9cb-46a5-9234-89cbd9796610" --local-path /my_ardrive_downloads/my_pic.png\n\n\n\n# rename a single file\n\nto rename an on-chain file you can make use of the rename-file command. the required parameters are the file id and the new name, as well as the owner wallet or seed phrase.\n\nardrive rename-file --file-id "290a3f9a-37b2-4f0f-a899-6fac983833b3" --file-name "my custom file name.txt" --wallet-file "wallet.json"\n\n\n\n# uploading a folder with files (bulk upload)\n\nusers can perform a bulk upload by using the upload-file command on a target folder. the command will reconstruct the folder hierarchy on local disk as arfs folders on the permaweb and upload each file into their corresponding folders:\n\nardrive upload-file --local-path /path/to/folder --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\n\n# downloading a folder with files\n\nyou can download a folder from ardrive to your local machine with the download-folder command. in the following examples, assume that a folder with id "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" exists in your drive and is named "myardrivefolder".\n\n# downloads "myardrivefolder" into the current working directory, i.e. ./myardrivefolder/\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6"\n\n\nby specifying the --local-path option, you can choose the local parent folder into which the on-chain folder will be downloaded. when the parameter is omitted, its value defaults to the current working directory (i.e. ./).\n\n# downloads "myardrivefolder" into /my_ardrive_downloads/myardrivefolder\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path /my_ardrive_downloads/\n\n\nthe --max-depth parameter lets you to choose a custom folder depth to download. when omitted, the entire subtree of the folder will be downloaded. in the following example, only the immediate children of the folder will be downloaded:\n\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --max-depth 0\n\n\nthe behaviors of --local-path are similar to those of cp and mv in unix systems, e.g.:\n\n# folder downloaded to "/existing_folder/myardrivefolder"\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/existing_folder"\n\n# folder downloaded to "/existing_folder/myardrivefolder/myardrivefolder" as "/existing_folder/myardrivefolder" already exists\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/existing_folder/myardrivefolder"\n\n# folder downloaded to "/existing_folder/non_existent_folder"\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/existing_folder/non_existent_folder"\n\n# error!\nardrive download-folder -f "47f5bde9-61ba-49c7-b409-1aa4a9e250f6" --local-path "/non_existent_folder_1/non_existent_folder_2"\n\n\n\n# downloading a drive\n\nto download the whole drive you can use the download-drive command.\n\nardrive download-drive -d "c0c8ba1c-efc5-420d-a07c-a755dc67f6b2"\n\n\nthis is equivalent to running the download-folder command against the root folder of the drive.\n\n\n# uploading multiple files\n\nto upload an arbitrary number of files or folders, pass a space-separated list of paths to --local-paths:\n\n# specifying a mixed set of file and folder paths\nardrive upload-file -w wallet.json -f "6939b9e0-cc98-42cb-bae0-5888eca78885" --local-paths ./image.png ~/backups/ ../another_file.txt\n\n# example using glob expansion to upload all .json files in the current folder\nardrive upload-file -w wallet.json -f "6939b9e0-cc98-42cb-bae0-5888eca78885" --local-paths ./*.json\n\n\n\n# name conflict resolution on upload\n\nby default, the upload-file command will use the upsert behavior if existing entities are encountered in the destination folder tree that would cause naming conflicts.\n\nexpect the behaviors from the following table for each of these resolution settings:\n\nsource type conflict at dest `skip` `replace` `upsert` (default)\nfile none insert insert insert\nfile matching file skip update skip\nfile different file skip update update\nfile folder skip fail fail\nfolder none insert insert insert\nfolder file skip fail fail\nfolder folder re-use re-use re-use\n\nthe default upsert behavior will check the destination folder for a file with a conflicting name. if no conflicts are found, it will insert (upload) the file.\n\nin the case that there is a file to file name conflict found, it will only update it if necessary. to determine if an update is necessary, upsert will compare the last modified dates of conflicting file and the file being uploaded. when they are matching, the upload will be skipped. otherwise the file will be updated as a new revision.\n\nto override the upsert behavior, use the --replace option to always make new revisions of a file or the --skip option to always skip the upload on name conflicts:\n\nardrive upload-file --replace --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nardrive upload-file --skip --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nalternatively, the upload-file commands now also supports the --ask conflict resolution option. this setting will always provide an interactive prompt on name conflicts that allows users to decide how to resolve each conflict found:\n\nardrive upload-file --ask --local-file-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\ndestination folder has a file to file name conflict!\n\nfile name: 2.png\nfile id: efbc0370-b69f-44d9-812c-0d272b019027\nthis file has a different last modified date\n\nplease select how to proceed:\n β€Ί - use arrow-keys. return to submit.\n❯ replace as new file revision\n upload with a different file name\n skip this file upload\n\n\n\n# understanding bundled transactions\n\nthe ardrive cli currently uses two different methods for uploading transactions to the arweave network: standard transactions and direct to network (d2n) bundled transactions. by default, the cli will send a d2n bundled transaction for any action that would result in multiple transactions. this bundling functionality is currently used on the upload-file and create-drive commands.\n\nd2n bundled transactions come with several benefits and implications:\n\n * bundling saves ar and enhances arfs reliability by sending associated arfs transactions up as one atomic bundle.\n * bundled transactions are treated as a single data transaction by the arweave network, but can be presented as separate transactions by the arweave gateway once they have been "unbundled".\n * un-bundling can take anywhere from a few minutes up to an hour. during that time, the files in the bundle will neither appear in list- commands nor be downloadable. similarly, they will not appear in the web app after syncs until un-bundling is complete. this can negatively affect the accuracy of upsert operations, so it\'s best to wait before retrying bulk uploads.\n * bundling reliability on the gateway side degrades once bundles reach either 500 data items (or ~250 files) or 500 mib, so the cli will create and upload multiple bundles as necessary, or will send files that are simply too large for reliable bundling as unbundled txs.\n\n\n# uploading a non-bundled transaction (not recommended)\n\nwhile not recommended, the cli does provide the option to forcibly send all transactions as standard transactions rather than attempting to bundle them together. to do this, simply add the --no-bundle flag to the upload-file or create-drive command:\n\nardrive upload-file --no-bundle --local-path /path/to/file --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\n\n# fetching the metadata of a file entity\n\nsimply perform the file-info command to retrieve the metadata of a file:\n\nardrive file-info --file-id "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f"\n\n\nexample output:\n\n{\n "appname": "ardrive-web",\n "appversion": "0.1.0",\n "arfs": "0.11",\n "contenttype": "application/json",\n "driveid": "51062487-2e8b-4af7-bd81-4345dc28ea5d",\n "entitytype": "file",\n "name": "2_depth.png",\n "txid": "czkdjqwnmxbwchga1hjso5zh--4oyodigwzi-fmx28u",\n "unixtime": 1633625081,\n "size": 41946,\n "lastmodifieddate": 1605157729000,\n "parentfolderid": "a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63",\n "entityid": "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f",\n "fileid": "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f",\n "datatxid": "jz0wswyagvc0ae3uzaco-yjqg8oprn3uucmddt8fbjc",\n "datacontenttype": "image/png"\n}\n\n\n\n# retrying a failed file data transaction (public unbundled files only)\n\narweave data upload transactions are split into two phases: transaction posting and chunks uploading. once the transaction post phase has been completed, you\'ve effectively "paid" the network for storage of the data chunks that you\'ll send in the next stage.\n\nif your system encounters an error while posting the transaction, you can retry posting the transaction for as long as your tx_anchor is valid (learn more about tx_anchors here). you may retry and/or resume posting chunks at any time after your transaction has posted. the ardrive cli allows you to take advantage of this arweave protocol capability.\n\nusing the cli, when the transaction post has succeeded but the chunk upload step fails, the data transaction\'s id could be lost. there are a few options to recover this id. if the failed transaction is the most recent one sent from a wallet, the transaction id can be recovered with the ardrive last-tx -w /path/to/wallet command after the transaction\'s headers have been mined (it can take 5-10 minutes for the tx-id to become available with the last-tx approach). other options for finding the partially uploaded transaction\'s id include:\n\n * using an arweave gateway gql http endpoint to search for transactions that belong to the wallet. see this arweave gql guide for more info.\n * browse the recent transactions associated with the wallet via a block explorer tool like viewblock.\n\nin order to re-seed the chunks for an unbundled arfs data transaction, a user must have the data transaction id, the original file data, and either a destination folder id or a valid file id for the file. supply that information to the retry-tx command like so:\n\nardrive retry-tx --tx-id { data transaction id } --parent-folder-id { destination folder id } --local-path /path/to/file --wallet-file /path/to/wallet\n\n\nnote: retry feature is currently only available for public unbundled file transactions. it is also perfectly safe to mistakenly re-seed the chunks of a healthy transaction, the transaction will remain stable and the wallet balance will not be affected.\n\n\n# moving files\n\nfiles can be moved from one folder to another within the same drive. moving a file is simply the process of uploading a new file metadata revision with an updated file id <> parent folder id relationship. the following command will move a file from its current location in a public drive to a new parent folder in that drive:\n\nardrive move-file --file-id "e5ebc14c-5b2d-4462-8f59-7f4a62e7770f" --parent-folder-id "a2c8a0cb-0ca7-4dbb-8bf8-93f75f308e63"\n\n\n\n# uploading manifests\n\narweave path manifests are are special .json files that instruct arweave gateways to map file data associated with specific, unique transaction ids to customized, hosted paths relative to that of the manifest file itself. so if, for example, your manifest file had an arweave.net url like:\n\nhttps://arweave.net/{manifest tx id}\n\n\nthen, all the mapped transactions and paths in the manifest file would be addressable at urls like:\n\nhttps://arweave.net/{manifest tx id}/foo.txt\nhttps://arweave.net/{manifest tx id}/bar/baz.png\n\n\nardrive supports the creation of these arweave manifests using any of your public folders. the generated manifest paths will be links to each of the file entities within the specified folder. the manifest file entity will be created at the root of the folder.\n\nto create a manifest of an entire public drive, specify the root folder of that drive:\n\nardrive create-manifest -f "bc9af866-6421-40f1-ac89-202bddb5c487" -w "/path/to/wallet"\n\n\nyou can also create a manifest of a folder\'s file entities at a custom depth by using the --max-depth option:\n\n# create manifest of a folder\'s local file contents, excluding all sub-folders\nardrive create-manifest --max-depth 0 -f "867228d8-4413-4c0e-a499-e1decbf2ea38" -w "/path/to/wallet"\n\n\ncreating a .json file of your manifest links output can be accomplished here with some jq parsing and piping to a file:\n\nardrive create-manifest -w /path/to/wallet -f "6c312b3e-4778-4a18-8243-f2b346f5e7cb" | jq \'{links}\' > links.json\n\n\nif you\'d like to preview the contents of your manifest before uploading, you can perform a dry run and do some lightweight post processing to isolate the data:\n\nardrive create-manifest -w /path/to/wallet -f "6c312b3e-4778-4a18-8243-f2b346f5e7cb" --dry-run | jq \'{manifest}.manifest\'\n\n\n\n\n{\n "manifest": "arweave/paths",\n "version": "0.1.0",\n "index": {\n "path": "index.html"\n },\n "paths": {\n "hello_world.txt": {\n "id": "y7gff8r9y0meu_oi1azed87vrmai97jdrq2l0cbgj68"\n },\n "index.html": {\n "id": "pelonjvebhybsdxvymvxbgtmhd96v9puuuxj8guhgoy"\n }\n }\n}\n\n\nthe manifest data transaction is tagged with a unique content-type, application/x.arweave-manifest+json, which tells the gateway to treat this file as a manifest. the manifest file itself is a .json file that holds the paths (the data transaction ids) to each file within the specified folder.\n\nwhen your folder is later changed by adding files or updating them with new revisions, the original manifest will not be updated on its own. a manifest is a permanent record of your files in their current state.\n\nhowever, creating a subsequent manifest with the same manifest name will create a new revision of that manifest in its new current state. manifests follow the same name conflict resolution as outlined for files above (upsert by default).\n\n# hosting a webpage with manifest\n\nwhen creating a manifest, it is possible to host a webpage or web app. you can do this by creating a manifest on a folder that has an index.html file in its root.\n\nusing generated build folders from popular frameworks works as well. one requirement here to note is that the href= paths from your generated index.html file must not have leading a /. this means that the manifest will not resolve a path of /dist/index.js but it will resolve dist/index.js or ./dist/index.js.\n\nas an example, here is a flow of creating a react app and hosting it with an ardrive manifest. first, generate a react app:\n\nyarn create react-app my-app\n\n\nnext, add this field to the generated package.json so that the paths will resolve correctly:\n\n"homepage": ".",\n\n\nthen, create an optimized production build from within the app\'s directory:\n\nyarn build\n\n\nnow, we can create and upload that produced build folder on ardrive to any of your existing arfs folder entities:\n\nardrive upload-file -l "/build" -w "/path/to/wallet" --parent-folder-id "bc9af866-6421-40f1-ac89-202bddb5c487"\n\n\nand finally, create the manifest using the generated folder id from the build folder creation:\n\n# create manifest using the folder id of the `/build` folder\nardrive create-manifest -f "41759f05-614d-45ad-846b-63f3767504a4" -w "/path/to/wallet"\n\n\nin the return output, the top link will be a link to the deployed web app:\n\n "links": [\n "https://arweave.net/0mk68j8tqghaaoppe713zn0jdpczmt2ngs2ctryiuag",\n "https://arweave.net/0mk68j8tqghaaoppe713zn0jdpczmt2ngs2ctryiuag/asset-manifest.json",\n "https://arweave.net/0mk68j8tqghaaoppe713zn0jdpczmt2ngs2ctryiuag/favicon.ico",\n "https://arweave.net/0mk68j8tqghaaoppe713zn0jdpczmt2ngs2ctryiuag/index.html",\n # ...\n\n\nthis is effectively hosting a web app with ardrive. check out the ardrive price calculator react app hosted as an ardrive manifest.\n\n\n# uploading with a custom content type\n\neach file uploaded to the arweave network receives a "content-type" graphql tag that contains the mime type for the file. the gateway will use this content type to determine how to serve that file\'s data transaction at the arweave.net/{data tx id} endpoint.\n\nby default, the cli will attempt to derive this content type from the file extension of the provided file. in most cases, the content type that is derived will be correct and the gateway will properly serve the file.\n\nthe cli also provides the option for users to upload files with a custom content type using the --content-type flag:\n\nardrive upload-file --content-type "application/json" --local-path /path/to/file --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nit is currently possible to set this value to any given string, but the gateway will still only serve valid content types. check out this list of commonly used mime types to ensure you\'re providing a valid content type: common mime types.\n\nnote: in the case of multi-file uploads or recursive folder uploads, setting this --content-type flag will set the provided custom content type on every file entity within a given upload.\n\n\n# uploading from a remote url\n\nyou can upload a file from an existing url using the --remote-path flag. this must be used in conjunction with --dest-file-name.\n\nyou can use a custom content type using the --content-type flag, but if this isn\'t used the app will use the content type from the response header of the request for the remote data.\n\nardrive upload-file --remote-path "https://url/to/file" --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -d "example.jpg" -w /path/to/wallet.json\n\n\n\n# uploading a custom manifest\n\nusing the custom content type feature, it is possible for users to upload their own custom manifests. the arweave gateways use this special content type in order to identify an uploaded file as a manifest:\n\napplication/x.arweave-manifest+json\n\n\nin addition to this content type, the manifest must also adhere to the correct json structure of an arweave manifest. a user can create their own manifest from scratch, or start by piping a generated manifest to a json file and editing it to their specifications:\n\nardrive create-manifest -w /path/to/wallet -f "6c312b3e-4778-4a18-8243-f2b346f5e7cb" --dry-run | jq \'{manifest}.manifest\' > my-custom-manifest.json\n\n\nafter editing the generated manifest, simply perform an upload-file command with the custom arweave manifest content type to any public folder:\n\nardrive upload-file --content-type "application/x.arweave-manifest+json" --local-path my-custom-manifest.json --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json\n\n\nthe returned datatxid field on the created file entity will be the endpoint that the manifest can be found on arweave, just as explained in the manifest sections above:\n\nhttps://arweave.net/{datatxid}\nhttps://arweave.net/{datatxid}/custom-file-1\nhttps://arweave.net/{datatxid}/custom-file-2\n\n\n\n# uploading files with custom metadata\n\nardrive cli has the capability of attaching custom metadata to arfs file and folder metadata transactions during the upload-file command. this metadata can be applied to either the gql tags on the metadata transaction and/or into the metadata transaction\'s data json.\n\nall custom metadata applied must ultimately adhere to the following json shapes:\n\n// gql tags\ntype custommetadatagqltags = record;\n\n// data json fields\ntype custommetadatajsonfields = record;\n\nexport type jsonserializable =\n | string\n | number\n | boolean\n | null\n | { [member: string]: jsonserializable }\n | jsonserializable[];\n\n\ne.g:\n\n{ ipfs-add: \'my_hash\' }\n# or\n{ \'custom name\': [\'val 1\', \'val 2\'] }\n\n\nwhen the custom metadata is attached to the metadata transaction\'s gql tags, they will become visible on any arweave gql gateway and also third party tools that read gql data.\n\nwhen these tags are added to the metadata transaction\'s data json they can be read by downloading the json data directly from https://arweave.net/metadata_tx_id.\n\nto add this custom metadata to your file metadata transactions, cli users can pass custom metadata these parameters:\n\n * --metadata-file path/to/json/schema\n * --metadata-json \'{"key": "val", "key-2": true, "key-3": 420, "key-4": ["more", 1337]}\'\n * --metadata-gql-tags "tag-name" "tag val"\n\nthe --metadata-file will accept a file path to json file containing custom metadata:\n\nardrive upload-file --metadata-file path/to/metadata/json # ...\n\n\nthis json schema object must contain instructions on where to put this metadata with the metadatajson and metadatagqltags keys. e.g:\n\n{\n "metadatajson": {\n "tag-name": ["value-1", "value-2"]\n },\n "metadatagqltags": {\n "gql tag name": "tag value"\n }\n}\n\n\nthe --metadata-gql-tags parameter accepts an array of string values to be applied to the metadata tx gql tags. this method of cli input does not support multiple tag values for a given tag name and the input must be an even number of string values. (known bug: string values starting with the "-" character are currently not supported. use --metadata-file parameter instead.) e.g:\n\nupload-file --metadata-gql-tags "custom tag name" "custom value" # ...\n\n\nand the --metadata-json parameter will accept a stringified json input. it will apply all declared json fields directly to the metadata tx\'s data json. e.g:\n\n upload-file --metadata-json \' { "json field": "value", "another fields": false } \' # ...\n\n\ncustom metadata applied to files and/or folders during the upload-file command will be read back through all existing read commands. e.g:\n\nardrive file-info -f 067c4008-9cbe-422e-b697-05442f73da2b\n{\n "appname": "ardrive-cli",\n "appversion": "1.17.0",\n "arfs": "0.11",\n "contenttype": "application/json",\n "driveid": "967215ca-a489-494b-97ec-0dd428d7be34",\n "entitytype": "file",\n "name": "unique-name-9718",\n "txid": "sxg8bnu6_bbahkjtxainvvoz_f-life6s7onxzojjk4",\n "unixtime": 1657655070,\n "size": 262148,\n "lastmodifieddate": 1655409872705,\n "datatxid": "ublzciff77ejl3m0uea8lxefntwmsbofoz-hibqkeyk",\n "datacontenttype": "text/plain",\n "parentfolderid": "97bc4fb5-aca4-4ffe-938f-1285153d98ca",\n "entityid": "067c4008-9cbe-422e-b697-05442f73da2b",\n "fileid": "067c4008-9cbe-422e-b697-05442f73da2b",\n "ipfs-add": "my_hash",\n "tag-1": "val",\n "tag-2": "val",\n "tag-3": "val",\n "boost": "1.05"\n}\n\n\n# applying unique custom metadata during bulk workflows\n\nwith some custom scripting and the --metadata-file parameter, the ardrive cli can be used to apply custom metadata to each file individually in a bulk workflow. for example, if you choose a numbered file naming pattern you can make use of a for loop:\n\nfor i in {1..5}\ndo\nardrive upload-file -f f0c58c11-430c-4383-8e54-4d864cc7e927 --local-path "../uploads/test-file-$i.txt" -w "/path/to/wallet.json" --metadata-file "../custom/metadata-$i.json" --dry-run > "file-result-$i.json"\ndone\n\n\n\n# other utility operations\n\n\n# monitoring transactions\n\nblock time on arweave is typically between 2-3 minutes in duration, so transactions can be mined within that time frame when network congestion is low. transactions, in the general case, proceed through the following set of states:\n\n * pending: the transaction is waiting the "mempool" to be mined\n * confirming: the transaction was mined on an arweave node, but has not yet been confirmed by at least 15 total nodes on the network\n * confirmed: the transaction was mined on an arweave node and confirmed by at least 15 total nodes on the network\n * not found: the transaction is not available for any of the following reasons:\n * insufficient reward to join the mempool\n * insufficient reward to be mined within 50 blocks during a period of network congestion\n * transaction is transitioning between states\n * transaction id is invalid\n\nmonitor any arweave transaction\'s status via its transaction id by performing:\n\n# peek at the status:\nardrive tx-status -t "eksmckikdrj8rgikfa-x3xq3427tvm7j9adv8hp3bzs"\n\n\nexample output:\n\neksmckikdrj8rgikfa-x3xq3427tvm7j9adv8hp3bzs: mined at block height 775810 with 22439 confirmations\n\n\n# reprint the status every 10 seconds:\nwatch -n 10 ardrive tx-status -t "eksmckikdrj8rgikfa-x3xq3427tvm7j9adv8hp3bzs"\n\n\n\n# dealing with network congestion\n\ncurrently, arweave blocks hold up to 1000 transactions per block. the "mempool", where pending transactions reside until they\'ve been included into a block, will only hold a transaction for 50 blocks (~100-150 minutes) before it\'s discarded by the network resulting in no fees or data being transacted. during periods of network congestion (i.e. those where the mempool contains 1000 or more pending transactions), it may make sense to either:\n\na) wait for congestion to dissipate before attempting your transactions.\n\nb) apply the fee boost multiplier to your transactions rewards with the --boost parameter during write operations in order to front-run some of the congestion.\n\n# check for network congestion before uploading\n\n# see all the transactions in the mempool\nardrive get-mempool\n\n# return the count of the transactions in the mempool\nardrive get-mempool | jq \'length\'\n\n\n# front-run congestion by boosting miner rewards\n\n# increase the miner reward on your transactions by 50%\nardrive upload-file --wallet-file /path/to/my/wallet.json --parent-folder-id "f0c58c11-430c-4383-8e54-4d864cc7e927" --local-path ./helloworld.txt --boost 1.5\n\n\n# send ar transactions from a cold wallet\n\nthe best cold wallet storage never exposes your seed phrase and/or private keys to the internet or a compromised system interface. you can use the ardrive cli to facilitate cold storage and transfer of ar.\n\nif you need a new cold ar wallet, generate one from an air-gapped machine capable of running the ardrive cli by following the instructions in the wallet operations section. fund your cold wallet from whatever external sources you\'d like. note: your cold wallet won\'t appear on chain until it has received ar.\n\nthe workflow to send the ar out from your cold wallet requires you to generate a signed transaction with your cold wallet on your air-gapped machine via the ardrive cli, and then to transfer the signed transaction (e.g. by a file on a clean thumb drive) to an internet-connected machine and send the transaction to the network via the ardrive cli. you\'ll need two inputs from the internet-connected machine:\n\n * the last transaction sent out from the cold wallet (or an empty string if none has ever been sent out)\n * the base fee for an arweave transaction (i.e. a zero bye transaction). note that this value could change if a sufficient amount of time passes between the time you fetch this value, create the transaction, and send the transaction.\n\nto get the last transaction sent from your cold wallet, use the last-tx command and specify your wallet address e.g.:\n\nardrive last-tx -a \n\n\nto get the base transaction reward required for an ar transaction, use the base-reward function, optionally applying a reward boost multiple if you\'re looking to front-run network congestion:\n\nardrive base-reward --boost 1.5\n\n\nwrite down or securely copy the values you derived from the internet-connected machine and run the following commands on the airgapped machine, piping the outputted signed transaction data to a file in the process, e.g. sendme.json (if that\'s your signed transaction transfer medium preference):\n\nardrive create-tx -w /path/to/wallet/file.json -d -a --last-tx --reward "" > sendme.json\n\n\ntransport your signed transaction to the internet-connected machine and run the following command to send your transaction to the arweave network:\n\nardrive send-tx -x /path/to/sendme.json\n\n\n\n# using a custom arweave gateway\n\non each command that uses a gateway, it is possible to supply your own custom arweave gateway using the flag --gateway or by setting an environment variable named arweave_gateway.\n\nfor example, you could test out that your arfs transactions are working as expected on a local test network such as arlocal with this flow:\n\n# setup arlocal instance on port 1984\nnpx arlocal\n\n# in another terminal, fund your wallet with ar\ncurl http://localhost:1984/mint/{ your public wallet address }/99999999999999\n\n# create drive and root folder on arlocal using `--gateway` flag\nardrive create-drive --gateway http://127.0.0.1:1984 -w /path/to/wallet -n \'my-test-drive\'\n\n# setup arweave_gateway as env variable\nexport arweave_gateway="http://localhost:1984"\n\n# mine block with drive + root folder transactions\ncurl "$arweave_gateway/mine"\n\n# upload file to arlocal with env var\nardrive upload-file -f { root folder id from create drive } -l /path/to/file -w /path/to/wallet\n\n# mine block with file transaction\ncurl "$arweave_gateway/mine"\n\n# inspect meta data of created entities\nardrive list-drive -d { drive id from create drive }\n\n# download file to verify integrity\nardrive download-file -f { file id from upload file }\n\n\n\n# persistent caching of arfs entity metadata\n\nto avoid redundant requests to the arweave network for immutable arfs entity metadata, a persistent file cache is created and maintained at:\n\nwindows: /ardrive-caches/metadata\nnon-windows: /.ardrive/caches/metadata\n\n\nthe xdg_cache_home environment variable is honored, where applicable, and will be used in place of os.homedir() in the scenarios described above.\n\nmetadata cache logging to stderr can be enabled by setting the ardrive_cache_log environment variable to 1.\n\ncache performance is undefined for multi-process scenarios, but is presumed to be generally usable.\n\nthe cache can be manually cleared safely at any time that any integrating app is not in operation.',charsets:{cjk:!0}},{title:"Overview",frontmatter:{},regularPath:"/docs/core-sdk.html",relativePath:"docs/core-sdk.md",key:"v-0c3bd15a",path:"/docs/core-sdk.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:2},{level:2,title:"Integrating with ArDrive Core",slug:"integrating-with-ardrive-core",normalizedTitle:"integrating with ardrive core",charIndex:314},{level:2,title:"Development Environment Setup",slug:"development-environment-setup",normalizedTitle:"development environment setup",charIndex:3188},{level:3,title:"Recommended Visual Studio Code extensions",slug:"recommended-visual-studio-code-extensions",normalizedTitle:"recommended visual studio code extensions",charIndex:4072},{level:2,title:"Building the Library",slug:"building-the-library",normalizedTitle:"building the library",charIndex:4262},{level:2,title:"Testing the Library",slug:"testing-the-library",normalizedTitle:"testing the library",charIndex:4375},{level:3,title:"Coverage",slug:"coverage",normalizedTitle:"coverage",charIndex:5005},{level:3,title:"Adding tests",slug:"adding-tests",normalizedTitle:"adding tests",charIndex:5485},{level:3,title:"Using Sinon",slug:"using-sinon",normalizedTitle:"using sinon",charIndex:6113},{level:3,title:"Debugging with Power-Assert",slug:"debugging-with-power-assert",normalizedTitle:"debugging with power-assert",charIndex:6373},{level:3,title:"Progress Logging of Transaction Uploads",slug:"progress-logging-of-transaction-uploads",normalizedTitle:"progress logging of transaction uploads",charIndex:7004},{level:3,title:"Persistent Caching of ArFS Entity Metadata",slug:"persistent-caching-of-arfs-entity-metadata",normalizedTitle:"persistent caching of arfs entity metadata",charIndex:8215},{level:3,title:"Applying Custom MetaData to ArFS File Transactions",slug:"applying-custom-metadata-to-arfs-file-transactions",normalizedTitle:"applying custom metadata to arfs file transactions",charIndex:8964}],headersStr:"Overview Integrating with ArDrive Core Development Environment Setup Recommended Visual Studio Code extensions Building the Library Testing the Library Coverage Adding tests Using Sinon Debugging with Power-Assert Progress Logging of Transaction Uploads Persistent Caching of ArFS Entity Metadata Applying Custom MetaData to ArFS File Transactions",content:"# Overview\n\nArDrive Core is a TypeScript library that contains the essential back end application features to support the ArDrive CLI and Desktop apps, such as file management, Permaweb upload/download, wallet management, and other common functions.\n\nEngage with the community in Discord for more information.\n\n\n# Integrating with ArDrive Core\n\nTo add the ArDrive Core library to your project, simply add it as a dependency:\n\nyarn add ardrive-core-js\n\n\nThe recommended approach for integrating with ArDrive Core as a dependency in your project is to construct and use the methods provided on the ArDrive class. Developers can use the convenience function arDriveFactory to construct the ArDrive class.\n\nBelow are a few common examples of interacting with Core:\n\nimport { readJWKFile, arDriveFactory } from 'ardrive-core-js';\n\n// Read wallet from file\nconst myWallet = readJWKFile('/path/to/wallet');\n\n// Construct ArDrive class\nconst arDrive = arDriveFactory({ wallet: myWallet });\n\n// Create a public drive and its root folder\nconst createDriveResult = await arDrive.createPublicDrive({ driveName: 'My-Drive' });\n\n\nimport { wrapFileOrFolder, EID } from 'ardrive-core-js';\n\n// Wrap file for upload\nconst wrappedEntity = wrapFileOrFolder('path/to/file');\n\n// Construct a safe Entity ID Type\nconst destFolderId = EID('10108b54a-eb5e-4134-8ae2-a3946a428ec7');\n\n// Upload a public file to destination folder\nconst uploadFileResult = await arDrive.uploadAllEntities({\n entitiesToUpload: [{ wrappedEntity, destFolderId }]\n});\n\n\nimport { deriveDriveKey } from 'ardrive-core-js';\n\n// Derive a private drive key from password, wallet, and drive ID\nconst driveKey = await deriveDriveKey(\n 'mySecretPassWord',\n '12345674a-eb5e-4134-8ae2-a3946a428ec7',\n JSON.stringify((myWallet as JWKWallet).getPrivateKey())\n);\n\n// Create a private folder\nconst createFolderResult = await arDrive.createPrivateFolder({\n folderName: 'My New Private Folder',\n driveKey,\n parentFolderId: EID('47162534a-eb5e-4134-8ae2-a3946a428ec7')\n});\n\n\nimport { wrapFileOrFolder, EntityKey, EID } from 'ardrive-core-js';\n\n// Derive a private drive key from raw drive key string\nconst driveKey = new EntityKey(Buffer.from('MyAwesomeDriveKeyZZZZZZZZZZZZZZZZZZZZFAKE/s', 'base64'));\n\n// Wrap folder and all of its contents for upload\nconst wrappedFolder = wrapFileOrFolder('path/to/folder');\n\n// Upload a private folder and all its contents\nconst uploadFileResult = await arDrive.uploadAllEntities({\n entitiesToUpload: [\n {\n wrappedEntity: wrappedFolder,\n destFolderId: EID('76543214a-eb5e-4134-8ae2-a3946a428ec7'),\n driveKey\n },\n // And some other public file to a different destination 🀯\n {\n wrappedEntity: someOtherWrappedFile\n destFolderId: EID('675489321-eb5e-4134-8ae2-a3946a428ec7')\n }\n ]\n});\n\n\n// Upload ArFS Entities To Turbo (BETA)\n// The presence of `turboSettings` in `arDriveFactory` enables sending to Turbo\nconst arDrive = arDriveFactory({ wallet: myWallet, turboSettings: {} });\n\nconst uploadFileResult = await arDrive.uploadAllEntities({\n entitiesToUpload: [{ wrappedEntity, destFolderId }],\n});\n\n\n\n# Development Environment Setup\n\nWe use nvm to manage our Node engine version and, if necessary, to install an npm version that we can then use to install Yarn.\n\nNote for Windows: We recommend using WSL for setting up NVM on Windows using the instructions described here then continue the steps below.\n\n 1. Install nvm using their instructions.\n\n 2. We use Node 18.x -- ensure that the correct Node version is installed and activated by performing nvm install and then nvm use\n\n 3. We use Yarn 3.x please follow the installation guidelines here\n\n 4. We use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run: yarn husky install to enable git hooks for this local repository. Without doing so, you risk committing non-compliant code to the repository.\n\n 5. Install all node package dependencies by running yarn install --check-cache\n\n\n# Recommended Visual Studio Code extensions\n\nTo ensure your environment is compatible, we also recommend the following VSCode extensions:\n\n * ES-Lint\n * Editor-Config\n * Prettier\n * ZipFS\n\n\n# Building the Library\n\nSimply run yarn build. This will clean the project and compile the TypeScript library.\n\n\n# Testing the Library\n\nThis library is setup for Mocha testing with Chai and Sinon. Configuration for Mocha can be found in .mocharc.js\n\nTo run all of the tests use:\n\nyarn test\n\n\nTo run a specific test, use Mocha's grep command. This will cause Mocha to only run the tests that contain the provided RegExp.\n\nThe -g command will only match the characters used in the describe() and it() title arguments. It will not match files names or folders.\n\nFor example:\n\nyarn test -g 'My specific unit test'\n\n\nWill run this test:\n\ndescribe('My specific unit test', () => {\n it('functions correctly', () => {\n // ...\n });\n});\n\n\n\n# Coverage\n\nIstanbul.js (nyc) has been added for code coverage reporting. Configuration for the nyc package can be found in nyc.config.js\n\nOn each yarn test command, nyc will output a code coverage summary in the terminal. In addition, a more detailed HTML version will output to the /coverage directory. Simply run /coverage/index.html in your browser to view the HTML version.\n\nAlternatively, you can view a verbose coverage output in the terminal by running:\n\nyarn coverage\n\n\n\n# Adding tests\n\nThere are many different syntax options available with the Chai library, which can be found in their documentation. For examples on unit testing, visit src/example.test.ts, and for integration testing: tests/example.test.ts.\n\nUnit tests should be located adjacent (or right next to) the file they are referencing. They should also be named the same with the .test.ts extension. In contrast, integration tests will live in the /tests directory.\n\nFor example:\n\nardrive-core-js/\nβ”œβ”€β”€ src\nβ”‚ β”œβ”€β”€ fileToTest.ts\nβ”‚ └── fileToTest.test.ts <-- Unit test\n└── tests\n └── bestApi.test.ts <----- Integration test\n\n\n\n# Using Sinon\n\nSinon can be used to create spies, mocks, fakes, stubs, and more. There are some basic examples of using the library shown in the example test files shared above.\n\nFor more information on what you can do with Sinon, visit their documentation.\n\n\n# Debugging with Power-Assert\n\nPower-Assert is setup as another testing tool. The library can be used to provide a very detailed output of your failing test cases. This can become super useful while debugging a test.\n\nTo use this tool, it must be imported using this syntax:\n\nimport assert = require('assert');\n\n\nThen use assert in your error throwing test case. Commenting out the Chai assertion will produce a cleaner output:\n\n// expect(failingOutput).to.equal(expectedOutput);\nassert(failingOutput === expectedOutput);\n\n\nAnd finally, to view the detailed error messages in your terminal:\n\nyarn power-assert -g 'My test case'\n\n\n\n# Progress Logging of Transaction Uploads\n\nProgress logging of transaction uploads to stderr can be enabled by setting the ARDRIVE_PROGRESS_LOG environment variable to 1:\n\nUploading file transaction 1 of total 2 transactions...\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 0%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 35%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 66%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 100%\nUploading file transaction 2 of total 2 transactions...\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 0%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 13%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 28%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 42%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 60%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 76%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 91%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: 100%\n\n\n\n# Persistent Caching of ArFS Entity Metadata\n\nTo avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:\n\nWindows: /ardrive-caches/metadata\nNon-Windows: /.ardrive/caches/metadata\n\n\nThe XDG_CACHE_HOME environment variable is honored, where applicable, and will be used in place of os.homedir() in the scenarios described above.\n\nMetadata cache logging to stderr can be enabled by setting the ARDRIVE_CACHE_LOG environment variable to 1.\n\nCache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.\n\nThe cache can be manually cleared safely at any time that any integrating app is not in operation.\n\n\n# Applying Custom MetaData to ArFS File Transactions\n\nCustom metadata can be attached to ArFS File Transactions. Metadata can be applied to either the GQL tags on the MetaData Transaction, the MetaData Transaction's Data JSON, or both.\n\nAll custom tags can be accessed by using by using ArDrive class read methods such as getPublicFile, getPrivateFile, listPrivateFolder, etc.\n\nconst arDrive = arDriveAnonymousFactory({});\nconst fileInfo = await arDrive.getPublicFile({ fileId });\nconst myMetaDataGqlTags = fileInfo.customMetaDataGqlTags;\nconst myMetaDataJsonFields = fileInfo.customMetaDataJson;\n\n\nWhen the custom metadata is attached to the MetaData Transaction's GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.\n\nWhen these tags are added to the MetaData Transaction's Data JSON they can be read by downloading the JSON data directly from https://arweave.net/.\n\nTo add this custom metadata to your file metadata transactions, users can pass an object containing custom tags when wrapping content to upload:\n\nconst fileToUpload = wrapFileOrFolder(\n 'path/to/file/on/system', // File or Folder Path\n 'application/custom-content-type', // Custom Content Type\n customMetaData: { // Custom MetaData\n metaDataJson: { ['My-Custom-Tag-Name']: 'Single-Custom-Value' },\n metaDataGqlTags: {\n ['Another-Custom-Tag']: ['First-Custom-Value', 'Second-Custom-Value', 'Third-Custom-Value']\n }\n }\n);\n",normalizedContent:"# overview\n\nardrive core is a typescript library that contains the essential back end application features to support the ardrive cli and desktop apps, such as file management, permaweb upload/download, wallet management, and other common functions.\n\nengage with the community in discord for more information.\n\n\n# integrating with ardrive core\n\nto add the ardrive core library to your project, simply add it as a dependency:\n\nyarn add ardrive-core-js\n\n\nthe recommended approach for integrating with ardrive core as a dependency in your project is to construct and use the methods provided on the ardrive class. developers can use the convenience function ardrivefactory to construct the ardrive class.\n\nbelow are a few common examples of interacting with core:\n\nimport { readjwkfile, ardrivefactory } from 'ardrive-core-js';\n\n// read wallet from file\nconst mywallet = readjwkfile('/path/to/wallet');\n\n// construct ardrive class\nconst ardrive = ardrivefactory({ wallet: mywallet });\n\n// create a public drive and its root folder\nconst createdriveresult = await ardrive.createpublicdrive({ drivename: 'my-drive' });\n\n\nimport { wrapfileorfolder, eid } from 'ardrive-core-js';\n\n// wrap file for upload\nconst wrappedentity = wrapfileorfolder('path/to/file');\n\n// construct a safe entity id type\nconst destfolderid = eid('10108b54a-eb5e-4134-8ae2-a3946a428ec7');\n\n// upload a public file to destination folder\nconst uploadfileresult = await ardrive.uploadallentities({\n entitiestoupload: [{ wrappedentity, destfolderid }]\n});\n\n\nimport { derivedrivekey } from 'ardrive-core-js';\n\n// derive a private drive key from password, wallet, and drive id\nconst drivekey = await derivedrivekey(\n 'mysecretpassword',\n '12345674a-eb5e-4134-8ae2-a3946a428ec7',\n json.stringify((mywallet as jwkwallet).getprivatekey())\n);\n\n// create a private folder\nconst createfolderresult = await ardrive.createprivatefolder({\n foldername: 'my new private folder',\n drivekey,\n parentfolderid: eid('47162534a-eb5e-4134-8ae2-a3946a428ec7')\n});\n\n\nimport { wrapfileorfolder, entitykey, eid } from 'ardrive-core-js';\n\n// derive a private drive key from raw drive key string\nconst drivekey = new entitykey(buffer.from('myawesomedrivekeyzzzzzzzzzzzzzzzzzzzzfake/s', 'base64'));\n\n// wrap folder and all of its contents for upload\nconst wrappedfolder = wrapfileorfolder('path/to/folder');\n\n// upload a private folder and all its contents\nconst uploadfileresult = await ardrive.uploadallentities({\n entitiestoupload: [\n {\n wrappedentity: wrappedfolder,\n destfolderid: eid('76543214a-eb5e-4134-8ae2-a3946a428ec7'),\n drivekey\n },\n // and some other public file to a different destination 🀯\n {\n wrappedentity: someotherwrappedfile\n destfolderid: eid('675489321-eb5e-4134-8ae2-a3946a428ec7')\n }\n ]\n});\n\n\n// upload arfs entities to turbo (beta)\n// the presence of `turbosettings` in `ardrivefactory` enables sending to turbo\nconst ardrive = ardrivefactory({ wallet: mywallet, turbosettings: {} });\n\nconst uploadfileresult = await ardrive.uploadallentities({\n entitiestoupload: [{ wrappedentity, destfolderid }],\n});\n\n\n\n# development environment setup\n\nwe use nvm to manage our node engine version and, if necessary, to install an npm version that we can then use to install yarn.\n\nnote for windows: we recommend using wsl for setting up nvm on windows using the instructions described here then continue the steps below.\n\n 1. install nvm using their instructions.\n\n 2. we use node 18.x -- ensure that the correct node version is installed and activated by performing nvm install and then nvm use\n\n 3. we use yarn 3.x please follow the installation guidelines here\n\n 4. we use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. please run: yarn husky install to enable git hooks for this local repository. without doing so, you risk committing non-compliant code to the repository.\n\n 5. install all node package dependencies by running yarn install --check-cache\n\n\n# recommended visual studio code extensions\n\nto ensure your environment is compatible, we also recommend the following vscode extensions:\n\n * es-lint\n * editor-config\n * prettier\n * zipfs\n\n\n# building the library\n\nsimply run yarn build. this will clean the project and compile the typescript library.\n\n\n# testing the library\n\nthis library is setup for mocha testing with chai and sinon. configuration for mocha can be found in .mocharc.js\n\nto run all of the tests use:\n\nyarn test\n\n\nto run a specific test, use mocha's grep command. this will cause mocha to only run the tests that contain the provided regexp.\n\nthe -g command will only match the characters used in the describe() and it() title arguments. it will not match files names or folders.\n\nfor example:\n\nyarn test -g 'my specific unit test'\n\n\nwill run this test:\n\ndescribe('my specific unit test', () => {\n it('functions correctly', () => {\n // ...\n });\n});\n\n\n\n# coverage\n\nistanbul.js (nyc) has been added for code coverage reporting. configuration for the nyc package can be found in nyc.config.js\n\non each yarn test command, nyc will output a code coverage summary in the terminal. in addition, a more detailed html version will output to the /coverage directory. simply run /coverage/index.html in your browser to view the html version.\n\nalternatively, you can view a verbose coverage output in the terminal by running:\n\nyarn coverage\n\n\n\n# adding tests\n\nthere are many different syntax options available with the chai library, which can be found in their documentation. for examples on unit testing, visit src/example.test.ts, and for integration testing: tests/example.test.ts.\n\nunit tests should be located adjacent (or right next to) the file they are referencing. they should also be named the same with the .test.ts extension. in contrast, integration tests will live in the /tests directory.\n\nfor example:\n\nardrive-core-js/\nβ”œβ”€β”€ src\nβ”‚ β”œβ”€β”€ filetotest.ts\nβ”‚ └── filetotest.test.ts <-- unit test\n└── tests\n └── bestapi.test.ts <----- integration test\n\n\n\n# using sinon\n\nsinon can be used to create spies, mocks, fakes, stubs, and more. there are some basic examples of using the library shown in the example test files shared above.\n\nfor more information on what you can do with sinon, visit their documentation.\n\n\n# debugging with power-assert\n\npower-assert is setup as another testing tool. the library can be used to provide a very detailed output of your failing test cases. this can become super useful while debugging a test.\n\nto use this tool, it must be imported using this syntax:\n\nimport assert = require('assert');\n\n\nthen use assert in your error throwing test case. commenting out the chai assertion will produce a cleaner output:\n\n// expect(failingoutput).to.equal(expectedoutput);\nassert(failingoutput === expectedoutput);\n\n\nand finally, to view the detailed error messages in your terminal:\n\nyarn power-assert -g 'my test case'\n\n\n\n# progress logging of transaction uploads\n\nprogress logging of transaction uploads to stderr can be enabled by setting the ardrive_progress_log environment variable to 1:\n\nuploading file transaction 1 of total 2 transactions...\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 0%\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 35%\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 66%\ntransaction _gkqasqx194a364hph8oe-oku1adfhwxwow9_jc1yjc upload progress: 100%\nuploading file transaction 2 of total 2 transactions...\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 0%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 13%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 28%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 42%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 60%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 76%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 91%\ntransaction na1stcdtkuf290k0qsqvmj78isec0bwgrai3d8cl1lu upload progress: 100%\n\n\n\n# persistent caching of arfs entity metadata\n\nto avoid redundant requests to the arweave network for immutable arfs entity metadata, a persistent file cache is created and maintained at:\n\nwindows: /ardrive-caches/metadata\nnon-windows: /.ardrive/caches/metadata\n\n\nthe xdg_cache_home environment variable is honored, where applicable, and will be used in place of os.homedir() in the scenarios described above.\n\nmetadata cache logging to stderr can be enabled by setting the ardrive_cache_log environment variable to 1.\n\ncache performance is undefined for multi-process scenarios, but is presumed to be generally usable.\n\nthe cache can be manually cleared safely at any time that any integrating app is not in operation.\n\n\n# applying custom metadata to arfs file transactions\n\ncustom metadata can be attached to arfs file transactions. metadata can be applied to either the gql tags on the metadata transaction, the metadata transaction's data json, or both.\n\nall custom tags can be accessed by using by using ardrive class read methods such as getpublicfile, getprivatefile, listprivatefolder, etc.\n\nconst ardrive = ardriveanonymousfactory({});\nconst fileinfo = await ardrive.getpublicfile({ fileid });\nconst mymetadatagqltags = fileinfo.custommetadatagqltags;\nconst mymetadatajsonfields = fileinfo.custommetadatajson;\n\n\nwhen the custom metadata is attached to the metadata transaction's gql tags, they will become visible on any arweave gql gateway and also third party tools that read gql data.\n\nwhen these tags are added to the metadata transaction's data json they can be read by downloading the json data directly from https://arweave.net/.\n\nto add this custom metadata to your file metadata transactions, users can pass an object containing custom tags when wrapping content to upload:\n\nconst filetoupload = wrapfileorfolder(\n 'path/to/file/on/system', // file or folder path\n 'application/custom-content-type', // custom content type\n custommetadata: { // custom metadata\n metadatajson: { ['my-custom-tag-name']: 'single-custom-value' },\n metadatagqltags: {\n ['another-custom-tag']: ['first-custom-value', 'second-custom-value', 'third-custom-value']\n }\n }\n);\n",charsets:{}},{title:"Getting Started",frontmatter:{},regularPath:"/docs/cli/getting-started.html",relativePath:"docs/cli/getting-started.md",key:"v-4fc0d1c8",path:"/docs/cli/getting-started.html",headers:[{level:2,title:"Prerequisites",slug:"prerequisites",normalizedTitle:"prerequisites",charIndex:297},{level:3,title:"Git",slug:"git",normalizedTitle:"git",charIndex:439},{level:3,title:"NVM (Optional - Recommended)",slug:"nvm-optional-recommended",normalizedTitle:"nvm (optional - recommended)",charIndex:620},{level:2,title:"Quick Start",slug:"quick-start",normalizedTitle:"quick start",charIndex:116},{level:3,title:"Installing and Starting the CLI From NPM Package",slug:"installing-and-starting-the-cli-from-npm-package",normalizedTitle:"installing and starting the cli from npm package",charIndex:1575},{level:3,title:"Upgrading to the Latest Version",slug:"upgrading-to-the-latest-version",normalizedTitle:"upgrading to the latest version",charIndex:1718},{level:2,title:"Build and Run from Source",slug:"build-and-run-from-source",normalizedTitle:"build and run from source",charIndex:198},{level:3,title:"Install Yarn 3",slug:"install-yarn-3",normalizedTitle:"install yarn 3",charIndex:1913},{level:3,title:"Husky (Developers Only)",slug:"husky-developers-only",normalizedTitle:"husky (developers only)",charIndex:2224},{level:3,title:"Using a custom ArDrive-Core-JS (Optional)",slug:"using-a-custom-ardrive-core-js-optional",normalizedTitle:"using a custom ardrive-core-js (optional)",charIndex:2505},{level:3,title:"Installing and Starting the CLI From Source",slug:"installing-and-starting-the-cli-from-source",normalizedTitle:"installing and starting the cli from source",charIndex:2809},{level:3,title:"Recommended Visual Studio Code extensions (Developers Only)",slug:"recommended-visual-studio-code-extensions-developers-only",normalizedTitle:"recommended visual studio code extensions (developers only)",charIndex:3359},{level:2,title:"Limitations",slug:"limitations",normalizedTitle:"limitations",charIndex:3567}],headersStr:"Prerequisites Git NVM (Optional - Recommended) Quick Start Installing and Starting the CLI From NPM Package Upgrading to the Latest Version Build and Run from Source Install Yarn 3 Husky (Developers Only) Using a custom ArDrive-Core-JS (Optional) Installing and Starting the CLI From Source Recommended Visual Studio Code extensions (Developers Only) Limitations",content:'# Getting Started\n\nTo simply install the latest version of the CLI to your local system and get started, follow the Quick Start instructions. To build and/or develop the CLI from source, follow the Build and Run from Source instructions. In either case, be sure to satisfy the requirements in the Prerequisites section.\n\n\n# Prerequisites\n\nThe following tools must be installed whether performing a Quick Start or Building from Source:\n\n\n# Git\n\nSome of ArDrive\'s dependencies are transitively installed via Git. Install it, if necessary, and ensure that it\'s available within your terminal environment:\n\nDownload Git\n\n\n# NVM (Optional - Recommended)\n\nThis project uses the Node Version Manager (NVM) and an .nvmrc file to lock the recommended Node version used by the latest version of ardrive-core-js.\n\nNote for Windows: We recommend using WSL for setting up NVM on Windows using the instructions described here\n\nFollow these steps to get NVM up and running on your system:\n\n 1. Install NVM using these installation instructions.\n 2. Navigate to this project\'s root directory\n 3. Ensure that the correct version of Node is installed by performing: nvm install\n 4. Use the correct version of Node, by performing: nvm use\n\nIT IS STRONGLY RECOMMENDED THAT YOU AVOID GENERATING WALLETS VIA SEED PHRASE WITH THE CLI USING ANY NODE VERSION OTHER THAN THE ONE SPECIFIED IN .nvmrc.\n\n\n# Quick Start\n\nOnce you\'ve satisfied any necessary prerequisites, the fastest way to get up and running is to globally install the latest version of the ArDrive CLI to your local system via NPM:\n\n\n# Installing and Starting the CLI From NPM Package\n\nnpm install -g ardrive-cli\n\n# then invoke the CLI from anywhere on your system:\nardrive\n\n\n\n# Upgrading to the Latest Version\n\nIf you globally installed the CLI via NPM, then upgrade to the latest version by simply performing:\n\nnpm update -g ardrive-cli\n\n\n\n# Build and Run from Source\n\n\n# Install Yarn 3\n\nBoth the ArDrive CLI and ArDrive Core JS use Yarn 3 to manage dependencies and initiate workflows, so follow the yarn installation instructions in order to get the latest version. In most cases:\n\n# Brew (OSX):\nbrew install yarn\n\n# Or with NPM (all supported platforms):\nnpm install -g yarn\n\n\n\n# Husky (Developers Only)\n\nWe use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run:\n\nyarn husky install\n\n\nto enable git hooks for your local checkout. Without doing so, you risk committing non-compliant code to the repository.\n\n\n# Using a custom ArDrive-Core-JS (Optional)\n\nTo test a with a custom version of the ardrive-core-js library on your local system, change the "ardrive-core-js" line in package.json to the root of your local ardrive-core-js repo:\n\n- "ardrive-core-js": "1.0.0"\n+ "ardrive-core-js": "../ardrive-core-js/"\n\n\n\n# Installing and Starting the CLI From Source\n\nNow that your runtime and/or development environment is set up, to install the package simply run:\n\nyarn && yarn build\n\n\nAnd then start the CLI (always from the root of this repository):\n\nyarn ardrive\n\n\nFor convenience in the non-developer case, you can install the CLI globally on your system by performing the following step:\n\nyarn pack\n\n# then using the path generated by yarn from the step above:\nnpm install i -g /path/to/package.tgz\n\n# then invoke the CLI from anywhere on your system:\nardrive\n\n\n\n# Recommended Visual Studio Code extensions (Developers Only)\n\nTo ensure your environment is compatible, we also recommend the following VSCode extensions:\n\n * ES-Lint\n * Editor-Config\n * Prettier\n * ZipFS\n\n\n# Limitations\n\nNumber of files in a bulk upload: Theoretically unlimited\nMax individual file size: 2GB (Node.js limitation)\nMax file name length: 255 bytes\nMax ANS-104 bundled transaction size: 500 MiB per bundle. App will handle creating multiple bundles.\nMax ANS-104 data item counts per bundled transaction: 250 Files per bundle (500 Data Items).',normalizedContent:'# getting started\n\nto simply install the latest version of the cli to your local system and get started, follow the quick start instructions. to build and/or develop the cli from source, follow the build and run from source instructions. in either case, be sure to satisfy the requirements in the prerequisites section.\n\n\n# prerequisites\n\nthe following tools must be installed whether performing a quick start or building from source:\n\n\n# git\n\nsome of ardrive\'s dependencies are transitively installed via git. install it, if necessary, and ensure that it\'s available within your terminal environment:\n\ndownload git\n\n\n# nvm (optional - recommended)\n\nthis project uses the node version manager (nvm) and an .nvmrc file to lock the recommended node version used by the latest version of ardrive-core-js.\n\nnote for windows: we recommend using wsl for setting up nvm on windows using the instructions described here\n\nfollow these steps to get nvm up and running on your system:\n\n 1. install nvm using these installation instructions.\n 2. navigate to this project\'s root directory\n 3. ensure that the correct version of node is installed by performing: nvm install\n 4. use the correct version of node, by performing: nvm use\n\nit is strongly recommended that you avoid generating wallets via seed phrase with the cli using any node version other than the one specified in .nvmrc.\n\n\n# quick start\n\nonce you\'ve satisfied any necessary prerequisites, the fastest way to get up and running is to globally install the latest version of the ardrive cli to your local system via npm:\n\n\n# installing and starting the cli from npm package\n\nnpm install -g ardrive-cli\n\n# then invoke the cli from anywhere on your system:\nardrive\n\n\n\n# upgrading to the latest version\n\nif you globally installed the cli via npm, then upgrade to the latest version by simply performing:\n\nnpm update -g ardrive-cli\n\n\n\n# build and run from source\n\n\n# install yarn 3\n\nboth the ardrive cli and ardrive core js use yarn 3 to manage dependencies and initiate workflows, so follow the yarn installation instructions in order to get the latest version. in most cases:\n\n# brew (osx):\nbrew install yarn\n\n# or with npm (all supported platforms):\nnpm install -g yarn\n\n\n\n# husky (developers only)\n\nwe use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. please run:\n\nyarn husky install\n\n\nto enable git hooks for your local checkout. without doing so, you risk committing non-compliant code to the repository.\n\n\n# using a custom ardrive-core-js (optional)\n\nto test a with a custom version of the ardrive-core-js library on your local system, change the "ardrive-core-js" line in package.json to the root of your local ardrive-core-js repo:\n\n- "ardrive-core-js": "1.0.0"\n+ "ardrive-core-js": "../ardrive-core-js/"\n\n\n\n# installing and starting the cli from source\n\nnow that your runtime and/or development environment is set up, to install the package simply run:\n\nyarn && yarn build\n\n\nand then start the cli (always from the root of this repository):\n\nyarn ardrive\n\n\nfor convenience in the non-developer case, you can install the cli globally on your system by performing the following step:\n\nyarn pack\n\n# then using the path generated by yarn from the step above:\nnpm install i -g /path/to/package.tgz\n\n# then invoke the cli from anywhere on your system:\nardrive\n\n\n\n# recommended visual studio code extensions (developers only)\n\nto ensure your environment is compatible, we also recommend the following vscode extensions:\n\n * es-lint\n * editor-config\n * prettier\n * zipfs\n\n\n# limitations\n\nnumber of files in a bulk upload: theoretically unlimited\nmax individual file size: 2gb (node.js limitation)\nmax file name length: 255 bytes\nmax ans-104 bundled transaction size: 500 mib per bundle. app will handle creating multiple bundles.\nmax ans-104 data item counts per bundled transaction: 250 files per bundle (500 data items).',charsets:{}},{title:"Deploying your dApp",frontmatter:{},regularPath:"/docs/misc/deploy/deploy.html",relativePath:"docs/misc/deploy/deploy.md",key:"v-84e0b14c",path:"/docs/misc/deploy/deploy.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:26},{level:2,title:"Deploying",slug:"deploying",normalizedTitle:"deploying",charIndex:2},{level:3,title:"Step 1: Log into ArDrive",slug:"step-1-log-into-ardrive",normalizedTitle:"step 1: log into ardrive",charIndex:356},{level:3,title:"Step 2: Select or Create a Drive",slug:"step-2-select-or-create-a-drive",normalizedTitle:"step 2: select or create a drive",charIndex:552},{level:3,title:"Step 3: Upload your project",slug:"step-3-upload-your-project",normalizedTitle:"step 3: upload your project",charIndex:921},{level:3,title:"Step 4: Confirm Upload",slug:"step-4-confirm-upload",normalizedTitle:"step 4: confirm upload",charIndex:1233},{level:3,title:"Step 5: Create the Manifest",slug:"step-5-create-the-manifest",normalizedTitle:"step 5: create the manifest",charIndex:1531},{level:3,title:"Step 6: Get the Data TX ID",slug:"step-6-get-the-data-tx-id",normalizedTitle:"step 6: get the data tx id",charIndex:2092},{level:3,title:"Step 7: View and Share your dApp",slug:"step-7-view-and-share-your-dapp",normalizedTitle:"step 7: view and share your dapp",charIndex:2329},{level:2,title:"Updating your dApp",slug:"updating-your-dapp",normalizedTitle:"updating your dapp",charIndex:2696}],headersStr:"Overview Deploying Step 1: Log into ArDrive Step 2: Select or Create a Drive Step 3: Upload your project Step 4: Confirm Upload Step 5: Create the Manifest Step 6: Get the Data TX ID Step 7: View and Share your dApp Updating your dApp",content:'# Deploying your dApp\n\n\n# Overview\n\nThis guide will outline the steps needed to deploy your dApp onto the Arweave blockchain using the ArDrive web app. It assumes you have already prepared your dApp to use hash routing and relative file paths, and built static files for any dApp in a language or framework that requires it (like React).\n\n\n# Deploying\n\n\n# Step 1: Log into ArDrive\n\nGo to the ArDrive web app and log in using the method of your choosing. If you don\'t already have an account, you will need to follow the instructions to set one up.\n\n\n# Step 2: Select or Create a Drive\n\nOnce logged in, navigate to the drive where you want your project to be hosted. If you haven\'t created a drive yet, or if you want a new one specifically for this project, click the big red "New" button at the top left and create a new drive. Remember, the drive needs to be set to public for your dApp to be accessible to others.\n\n\n# Step 3: Upload your project\n\nWith your drive selected, click the big red "New" button again, but this time, select "Upload Folder". Navigate to your project\'s root directory, or the built directory if required, and select it. This will upload the entire directory, maintaining your project\'s file structure.\n\n\n# Step 4: Confirm Upload\n\nYou\'ll be given a chance to review the upload and the associated cost. If everything looks right, click "Confirm". Remember, uploading to Arweave isnt free, but the cost is usually quite small and the benefits of having your dApp hosted on the permaweb are significant.\n\n\n# Step 5: Create the Manifest\n\nWhile ArDrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on Arweave. The manifest acts as a map to all the files your dApp needs to function. After you confirm your upload, navigate into your newly created folder by double clicking on it. Click the big red "New" button again and select "Create manifest". You\'ll be prompted to name the manifest and choose where to save it. Be sure to save it inside the folder you just created.\n\n\n# Step 6: Get the Data TX ID\n\nOnce the manifest is created, click on it to expand its details. On the bottom right, there\'s a line labeled "Data TX ID". This is the unique identifier for your uploaded dApp on Arweave. Copy this value.\n\n\n# Step 7: View and Share your dApp\n\nYour dApp is now available on the permaweb forever! Append the Data TX ID you just copied to the end of an Arweave gateway URL, like https://arweave.net/ . It might take a few minutes for all of your files to finish propagating through the network, but once they do your dApp will be accessible to anyone, anywhere, at any time.\n\n\n# Updating your dApp\n\nFiles uploaded to Arweave are permanent and immutable. They cannot be changed. However, the Arweave File System (ArFS) protocol used (and created) by ArDrive lets you "replace" them with new versions while still being able to access the old ones. You can do this with entire dApps as well. The old files won\'t be displayed in the ArDrive web app unless you click on a file to view its history.\n\nOnce you have made changes to your dApp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. Follow all the same steps listed above for uploading your dApp. You will need to create a new manifest to correctly point to the updated files. Give it the same name as the old manifest in order to "replace" it. Creating the new manifest will generate a new TX ID used to view the updated dApp.\n\nThe old version of the dApp will always be available to anyone who has the correct TX ID',normalizedContent:'# deploying your dapp\n\n\n# overview\n\nthis guide will outline the steps needed to deploy your dapp onto the arweave blockchain using the ardrive web app. it assumes you have already prepared your dapp to use hash routing and relative file paths, and built static files for any dapp in a language or framework that requires it (like react).\n\n\n# deploying\n\n\n# step 1: log into ardrive\n\ngo to the ardrive web app and log in using the method of your choosing. if you don\'t already have an account, you will need to follow the instructions to set one up.\n\n\n# step 2: select or create a drive\n\nonce logged in, navigate to the drive where you want your project to be hosted. if you haven\'t created a drive yet, or if you want a new one specifically for this project, click the big red "new" button at the top left and create a new drive. remember, the drive needs to be set to public for your dapp to be accessible to others.\n\n\n# step 3: upload your project\n\nwith your drive selected, click the big red "new" button again, but this time, select "upload folder". navigate to your project\'s root directory, or the built directory if required, and select it. this will upload the entire directory, maintaining your project\'s file structure.\n\n\n# step 4: confirm upload\n\nyou\'ll be given a chance to review the upload and the associated cost. if everything looks right, click "confirm". remember, uploading to arweave isnt free, but the cost is usually quite small and the benefits of having your dapp hosted on the permaweb are significant.\n\n\n# step 5: create the manifest\n\nwhile ardrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on arweave. the manifest acts as a map to all the files your dapp needs to function. after you confirm your upload, navigate into your newly created folder by double clicking on it. click the big red "new" button again and select "create manifest". you\'ll be prompted to name the manifest and choose where to save it. be sure to save it inside the folder you just created.\n\n\n# step 6: get the data tx id\n\nonce the manifest is created, click on it to expand its details. on the bottom right, there\'s a line labeled "data tx id". this is the unique identifier for your uploaded dapp on arweave. copy this value.\n\n\n# step 7: view and share your dapp\n\nyour dapp is now available on the permaweb forever! append the data tx id you just copied to the end of an arweave gateway url, like https://arweave.net/ . it might take a few minutes for all of your files to finish propagating through the network, but once they do your dapp will be accessible to anyone, anywhere, at any time.\n\n\n# updating your dapp\n\nfiles uploaded to arweave are permanent and immutable. they cannot be changed. however, the arweave file system (arfs) protocol used (and created) by ardrive lets you "replace" them with new versions while still being able to access the old ones. you can do this with entire dapps as well. the old files won\'t be displayed in the ardrive web app unless you click on a file to view its history.\n\nonce you have made changes to your dapp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. follow all the same steps listed above for uploading your dapp. you will need to create a new manifest to correctly point to the updated files. give it the same name as the old manifest in order to "replace" it. creating the new manifest will generate a new tx id used to view the updated dapp.\n\nthe old version of the dapp will always be available to anyone who has the correct tx id',charsets:{}},{title:"File Paths",frontmatter:{},regularPath:"/docs/misc/deploy/paths.html",relativePath:"docs/misc/deploy/paths.md",key:"v-0d650648",path:"/docs/misc/deploy/paths.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:17},{level:2,title:"Absolute Vs. Relative",slug:"absolute-vs-relative",normalizedTitle:"absolute vs. relative",charIndex:306},{level:2,title:"Why Relative Paths",slug:"why-relative-paths",normalizedTitle:"why relative paths",charIndex:805},{level:2,title:"Identifying Relative and Absolute Paths",slug:"identifying-relative-and-absolute-paths",normalizedTitle:"identifying relative and absolute paths",charIndex:1286},{level:2,title:"Navigating with Relative Paths",slug:"navigating-with-relative-paths",normalizedTitle:"navigating with relative paths",charIndex:1773}],headersStr:"Overview Absolute Vs. Relative Why Relative Paths Identifying Relative and Absolute Paths Navigating with Relative Paths",content:"# File Paths\n\n\n# Overview\n\nFile paths are needed to locate resources in your file system or on a server. There are two types of file paths: absolute and relative. Because there is no way to know exactly from where a user will access a dApp deployed on Arweave, all file paths used need to be relative.\n\n\n# Absolute Vs. Relative\n\nAn absolute path is the full URL to a resource, starting from the root. For example, http://www.example.com/images/myImage.jpg is an absolute path. It points directly to the image no matter where the code referencing it is located.\n\nA relative path is a path relative to the current location. If you have an HTML file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path images/myImage.jpg to reference the image.\n\n\n# Why Relative Paths\n\nWhen deploying dApps on Arweave, relative paths are essential because:\n\n * Domain agnostic: Arweave permaweb dApps can be accessed from various gateways, not just one domain. Absolute paths tied to a specific domain will not work.\n * Decentralized: Arweave is a decentralized network. There is no root directory or server configuration to reference. All file paths must be relative to the file trying to find an asset, or your dApp wont be able to find it.\n\n\n# Identifying Relative and Absolute Paths\n\nThe key difference between relative and absolute file paths is where they start from:\n\n * Absolute Paths start with a slash (/) or a full URL (including the protocol, such as http://). For example, /images/myImage.jpg or http://www.example.com/images/myImage.jpg are absolute paths.\n * Relative Paths do not start with a slash. They are relative to the current directory. For example, images/myImage.jpg or ../myImage.jpg are relative paths.\n\n\n# Navigating with Relative Paths\n\nYou can navigate around the files of your project with relative paths by following these principles:\n\n * Same Directory: If the file you're trying to reference is in the same directory as the current file, you can just use the filename. For example, if index.html and about.html are in the same directory, you can link to about.html just using about.html.\n\n * Subdirectory: If the file is in a subdirectory, you can use the directory name followed by the filename. For example, images/myImage.jpg will point to the myImage.jpg file in the images subdirectory.\n\n * Parent Directory: If the file is in a parent directory, you can use ../ to go up one level. For example, ../index.html will point to index.html in the parent directory. You can use multiple ../ to go up multiple levels, like ../../index.html.",normalizedContent:"# file paths\n\n\n# overview\n\nfile paths are needed to locate resources in your file system or on a server. there are two types of file paths: absolute and relative. because there is no way to know exactly from where a user will access a dapp deployed on arweave, all file paths used need to be relative.\n\n\n# absolute vs. relative\n\nan absolute path is the full url to a resource, starting from the root. for example, http://www.example.com/images/myimage.jpg is an absolute path. it points directly to the image no matter where the code referencing it is located.\n\na relative path is a path relative to the current location. if you have an html file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path images/myimage.jpg to reference the image.\n\n\n# why relative paths\n\nwhen deploying dapps on arweave, relative paths are essential because:\n\n * domain agnostic: arweave permaweb dapps can be accessed from various gateways, not just one domain. absolute paths tied to a specific domain will not work.\n * decentralized: arweave is a decentralized network. there is no root directory or server configuration to reference. all file paths must be relative to the file trying to find an asset, or your dapp wont be able to find it.\n\n\n# identifying relative and absolute paths\n\nthe key difference between relative and absolute file paths is where they start from:\n\n * absolute paths start with a slash (/) or a full url (including the protocol, such as http://). for example, /images/myimage.jpg or http://www.example.com/images/myimage.jpg are absolute paths.\n * relative paths do not start with a slash. they are relative to the current directory. for example, images/myimage.jpg or ../myimage.jpg are relative paths.\n\n\n# navigating with relative paths\n\nyou can navigate around the files of your project with relative paths by following these principles:\n\n * same directory: if the file you're trying to reference is in the same directory as the current file, you can just use the filename. for example, if index.html and about.html are in the same directory, you can link to about.html just using about.html.\n\n * subdirectory: if the file is in a subdirectory, you can use the directory name followed by the filename. for example, images/myimage.jpg will point to the myimage.jpg file in the images subdirectory.\n\n * parent directory: if the file is in a parent directory, you can use ../ to go up one level. for example, ../index.html will point to index.html in the parent directory. you can use multiple ../ to go up multiple levels, like ../../index.html.",charsets:{}},{title:"Preparing Your dApp",frontmatter:{prev:!1,permalink:"/docs/misc/deploy/"},regularPath:"/docs/misc/deploy/prepare.html",relativePath:"docs/misc/deploy/prepare.md",key:"v-3e6ef1ac",path:"/docs/misc/deploy/",headersStr:null,content:"# Preparing Your dApp\n\nTo make sure dApps work correctly on the Arweave blockchain, they need to be set up in a specific manner. This is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. Your dApp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. This is done by ensuring the following:\n\n * Your dApp must use hash routing\n * All internal links in your dApp must use relative file paths.\n\nFailure to properly implement either will result in your dApp not working the way it should once it is deployed onto Arweave.",normalizedContent:"# preparing your dapp\n\nto make sure dapps work correctly on the arweave blockchain, they need to be set up in a specific manner. this is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. your dapp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. this is done by ensuring the following:\n\n * your dapp must use hash routing\n * all internal links in your dapp must use relative file paths.\n\nfailure to properly implement either will result in your dapp not working the way it should once it is deployed onto arweave.",charsets:{}},{title:"Hash Routing",frontmatter:{},regularPath:"/docs/misc/deploy/routing.html",relativePath:"docs/misc/deploy/routing.md",key:"v-6dd912ec",path:"/docs/misc/deploy/routing.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:19},{level:2,title:"Hash Routing Vs. History Routing",slug:"hash-routing-vs-history-routing",normalizedTitle:"hash routing vs. history routing",charIndex:463},{level:2,title:"Why Hash Routing for dApps",slug:"why-hash-routing-for-dapps",normalizedTitle:"why hash routing for dapps",charIndex:986}],headersStr:"Overview Hash Routing Vs. History Routing Why Hash Routing for dApps",content:'# Hash Routing\n\n\n# Overview\n\nHash routing is a popular technique in single page applications (SPAs) where the site navigation is handled using JavaScript. The "hash" in hash routing refers to the hash symbol (#) inserted into the URL. The part of the URL after the hash symbol is used to determine which "page" to show.\n\nFor example, if your URL is "http://www.example.com/#about", the part after the hash (about) would be used to show an app\'s "about" page.\n\n\n# Hash Routing Vs. History Routing\n\nTraditional web apps use history routing, where each unique URL represents a different source or asset contained in a server. The URL "http://www.example.com/about" would fetch the "about" page from the app\'s server and display it for a user. History routing requires a server be available to provide the correct files every time a user navigates around an app.\n\nIn contrast, with hash routing, all navigation is handled by the client\'s browser, so no server is needed for navigation.\n\n\n# Why Hash Routing for dApps\n\nHash routing is particularly useful for apps deployed on Arweave for several reasons:\n\n * Serverless: Arweave is a decentralized storage network. There\'s no server to process requests, so routing cannot be handled by a server.\n * Persistence: Once data is stored on Arweave, it can\'t be changed. Hash routing allows you to have "dynamic" content within this immutable structure.\n * Performance: With hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.',normalizedContent:'# hash routing\n\n\n# overview\n\nhash routing is a popular technique in single page applications (spas) where the site navigation is handled using javascript. the "hash" in hash routing refers to the hash symbol (#) inserted into the url. the part of the url after the hash symbol is used to determine which "page" to show.\n\nfor example, if your url is "http://www.example.com/#about", the part after the hash (about) would be used to show an app\'s "about" page.\n\n\n# hash routing vs. history routing\n\ntraditional web apps use history routing, where each unique url represents a different source or asset contained in a server. the url "http://www.example.com/about" would fetch the "about" page from the app\'s server and display it for a user. history routing requires a server be available to provide the correct files every time a user navigates around an app.\n\nin contrast, with hash routing, all navigation is handled by the client\'s browser, so no server is needed for navigation.\n\n\n# why hash routing for dapps\n\nhash routing is particularly useful for apps deployed on arweave for several reasons:\n\n * serverless: arweave is a decentralized storage network. there\'s no server to process requests, so routing cannot be handled by a server.\n * persistence: once data is stored on arweave, it can\'t be changed. hash routing allows you to have "dynamic" content within this immutable structure.\n * performance: with hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.',charsets:{}},{title:"EthAReum",frontmatter:{permalink:"docs/misc/ethareum/",prev:!1,next:!1},regularPath:"/docs/misc/eth.html",relativePath:"docs/misc/eth.md",key:"v-52bf2fcc",path:"/docs/misc/ethareum/",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:15},{level:2,title:"Password",slug:"password",normalizedTitle:"password",charIndex:764},{level:2,title:"Public Address",slug:"public-address",normalizedTitle:"public address",charIndex:1657},{level:2,title:"Keyfile and Seed Phrase",slug:"keyfile-and-seed-phrase",normalizedTitle:"keyfile and seed phrase",charIndex:2219},{level:2,title:"Security",slug:"security",normalizedTitle:"security",charIndex:3350}],headersStr:"Overview Password Public Address Keyfile and Seed Phrase Security",content:"# EthAReum\n\n\n# Overview\n\nEthAReum is a new key derivation protocol that enables the generation of private keys for an Arweave wallet using a signature from an Ethereum wallet. This allows users to create an Arweave wallet directly through an Ethereum wallet provider like MetaMask.\n\nThese generated private keys provide a fully functional Arweave wallet, equipped to perform all standard operations, including holding AR tokens and Turbo Credits, and uploading data to the Arweave network.\n\nRecommended Browser\n\nFor optimal performance, it is recommended MetaMask users access ArDrive using the Chrome browser. While EthAReum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.\n\n\n# Password\n\nThe EthAReum protocol incorporates a user-generated password in the process of deriving an Arweave wallet from an Ethereum wallet. This password provides an extra layer of security by contributing additional entropy to the wallet's derivation. It also serves as a critical verification step for wallet access.\n\nFor instance, when creating a new account with ArDrive, users are required to set a password for their wallet. This password is then used for subsequent logins and for encrypting private uploads. The password established during the wallet derivation process on ArDrive will be the same password used for future logins.\n\nNOTE: The password used during the derivation of private keys is permanent and CAN NOT be changed or recovered by an administrator (ArDrive is a decentralized platform and has no account administration). It is crucial to keep this password secure.\n\n\n# Public Address\n\nThe Public address of the generated Arweave wallet is derived from its public key. The public address of the generated wallet will be different from the public address of the Ethereum wallet used to generate it.\n\nThe exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dApp you use for interacting with the protocol. With ArDrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.\n\n\n# Keyfile and Seed Phrase\n\nThe primary method used in the Arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in Ethereum wallet providers. Seed phrases are supported though, so you will be able to obtain a seed phrase for your generated Arweave wallet and use it to import the wallet into other dApps or wallet providers in the Arweave ecosystem. Just be aware that not every dApp in the ecosystem has an interface that can facilitate this.\n\nA keyfile is a json file that contains a Json Web Key (JWK) which act as the private keys for a wallet. Always be sure to treat your keyfile with the same care as you would the private keys for an Ethereum wallet. Find out more about keyfiles from the Arweave Cookbook.\n\nSimilar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dApp you used to generate your wallet. With ArDrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.\n\n\n# Security\n\nEthAReum generates the private keys of an Arweave wallet using a signature from your Ethereum wallet, ensuring that control only extends in one direction. The EthAReum protocol does not access or control the Ethereum wallet used for generation, thereby safeguarding your Ethereum assets.\n\nHowever, it's important to be vigilant as some malicious dApps or websites may disguise a high-risk authorization transaction as a simple signature request. Always ensure that you only provide signatures to reputable and trusted dApps like ArDrive.",normalizedContent:"# ethareum\n\n\n# overview\n\nethareum is a new key derivation protocol that enables the generation of private keys for an arweave wallet using a signature from an ethereum wallet. this allows users to create an arweave wallet directly through an ethereum wallet provider like metamask.\n\nthese generated private keys provide a fully functional arweave wallet, equipped to perform all standard operations, including holding ar tokens and turbo credits, and uploading data to the arweave network.\n\nrecommended browser\n\nfor optimal performance, it is recommended metamask users access ardrive using the chrome browser. while ethareum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.\n\n\n# password\n\nthe ethareum protocol incorporates a user-generated password in the process of deriving an arweave wallet from an ethereum wallet. this password provides an extra layer of security by contributing additional entropy to the wallet's derivation. it also serves as a critical verification step for wallet access.\n\nfor instance, when creating a new account with ardrive, users are required to set a password for their wallet. this password is then used for subsequent logins and for encrypting private uploads. the password established during the wallet derivation process on ardrive will be the same password used for future logins.\n\nnote: the password used during the derivation of private keys is permanent and can not be changed or recovered by an administrator (ardrive is a decentralized platform and has no account administration). it is crucial to keep this password secure.\n\n\n# public address\n\nthe public address of the generated arweave wallet is derived from its public key. the public address of the generated wallet will be different from the public address of the ethereum wallet used to generate it.\n\nthe exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dapp you use for interacting with the protocol. with ardrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.\n\n\n# keyfile and seed phrase\n\nthe primary method used in the arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in ethereum wallet providers. seed phrases are supported though, so you will be able to obtain a seed phrase for your generated arweave wallet and use it to import the wallet into other dapps or wallet providers in the arweave ecosystem. just be aware that not every dapp in the ecosystem has an interface that can facilitate this.\n\na keyfile is a json file that contains a json web key (jwk) which act as the private keys for a wallet. always be sure to treat your keyfile with the same care as you would the private keys for an ethereum wallet. find out more about keyfiles from the arweave cookbook.\n\nsimilar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dapp you used to generate your wallet. with ardrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.\n\n\n# security\n\nethareum generates the private keys of an arweave wallet using a signature from your ethereum wallet, ensuring that control only extends in one direction. the ethareum protocol does not access or control the ethereum wallet used for generation, thereby safeguarding your ethereum assets.\n\nhowever, it's important to be vigilant as some malicious dapps or websites may disguise a high-risk authorization transaction as a simple signature request. always ensure that you only provide signatures to reputable and trusted dapps like ardrive.",charsets:{}},{title:"How to Save a Website Permanently",frontmatter:{},regularPath:"/docs/misc/permasite.html",relativePath:"docs/misc/permasite.md",key:"v-3258450c",path:"/docs/misc/permasite.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:40},{level:2,title:"1. Download Static Site Files",slug:"_1-download-static-site-files",normalizedTitle:"1. download static site files",charIndex:946},{level:3,title:"Windows Users",slug:"windows-users",normalizedTitle:"windows users",charIndex:1396},{level:3,title:"Mac Users",slug:"mac-users",normalizedTitle:"mac users",charIndex:1502},{level:3,title:"Command Line Utility",slug:"command-line-utility",normalizedTitle:"command line utility",charIndex:1770},{level:3,title:"WordPress",slug:"wordpress",normalizedTitle:"wordpress",charIndex:176},{level:2,title:"2. Create an Account on ArDrive",slug:"_2-create-an-account-on-ardrive",normalizedTitle:"2. create an account on ardrive",charIndex:2327},{level:2,title:"3. Create a New Public Drive",slug:"_3-create-a-new-public-drive",normalizedTitle:"3. create a new public drive",charIndex:2670},{level:2,title:"4. Top Up",slug:"_4-top-up",normalizedTitle:"4. top up",charIndex:2916},{level:2,title:"5. Upload Static Files",slug:"_5-upload-static-files",normalizedTitle:"5. upload static files",charIndex:3225},{level:2,title:"6. Wait",slug:"_6-wait",normalizedTitle:"6. wait",charIndex:3602},{level:2,title:"7. Create a Manifest",slug:"_7-create-a-manifest",normalizedTitle:"7. create a manifest",charIndex:4223},{level:2,title:"8. Wait Again",slug:"_8-wait-again",normalizedTitle:"8. wait again",charIndex:4810},{level:2,title:"9. Preview the Manifest",slug:"_9-preview-the-manifest",normalizedTitle:"9. preview the manifest",charIndex:5108},{level:2,title:"10. Add a Redirect or Domain Masking",slug:"_10-add-a-redirect-or-domain-masking",normalizedTitle:"10. add a redirect or domain masking",charIndex:5668},{level:2,title:"Notes",slug:"notes",normalizedTitle:"notes",charIndex:5650},{level:2,title:"Other Use Cases",slug:"other-use-cases",normalizedTitle:"other use cases",charIndex:6812},{level:2,title:"Example",slug:"example",normalizedTitle:"example",charIndex:7299}],headersStr:"Overview 1. Download Static Site Files Windows Users Mac Users Command Line Utility WordPress 2. Create an Account on ArDrive 3. Create a New Public Drive 4. Top Up 5. Upload Static Files 6. Wait 7. Create a Manifest 8. Wait Again 9. Preview the Manifest 10. Add a Redirect or Domain Masking Notes Other Use Cases Example",content:"# How to Save a Website Permanently\n\n\n# Overview\n\nArDrive offers the ability to save working copies of static websites permanently on Arweave. This means that websites made on WordPress, Wix, SquareSpace and other CMS platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.\n\nResources like the Wayback Machine are useful to research the past life of old websites. But the Wayback Machine’s archives are not comprehensive and often only capture partial copies of historic sites. By leveraging the utility of Arweave manifests, ArDrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.\n\nThe process to make a β€˜permasite’ takes 10 steps which are outlined below. Advanced users can accomplish similar results by using manifests within the ArDrive CLI.\n\nYou can view a permasite version of this information at permasite.arweave.dev\n\n\n# 1. Download Static Site Files\n\nArDrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:\n\n * Permanent sites will not enable backend interaction with your website’s CMS,\n * nor allow you to make further changes to the content of your site,\n * nor support dynamic functionality like contact forms and eCommerce.\n\nTo generate your static site files, we recommend:\n\n\n# Windows Users\n\nWebCopy and HtTrack enable Windows users to download static copies of entire websites.\n\n\n# Mac Users\n\nOffline Pages Pro (Mac users only), which creates files that work well with this process. After saving your site with Offline Pages Pro, go to File > Export > Local Website to download the local static files.\nSiteSucker is another option for Mac users.\n\n\n# Command Line Utility\n\nWget is a free tool that helps capture static versions of websites. While Wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. It offers a simple way to save your site's current look and feel as static files at no cost.\n\n\n# WordPress\n\nSimply Static is a plugin that generates static files for WordPress websites. Some users note that Simply Static fails to properly associate CSS and JS files with your static site, but others have had success with this free WordPress plugin.\n\n\n# 2. Create an Account on ArDrive\n\nAccount creation is free as are uploads of small files (currently up to 500 KB). Remember that ArDrive empowers you to be in control of your data; no one else has your password but you. Therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.\n\n\n# 3. Create a New Public Drive\n\nClick on the red +New button and create a Drive. Name your Drive and set it as β€œPublic”. ArDrive also offers β€œPrivate” file storage; however, permanent websites must be public in order to maintain functionality.\n\n\n# 4. Top Up\n\nTo pay for permanent storage on the Arweave network you must either purchase ArDrive Turbo credits with a credit card or (or the advanced option) ensure your wallet has $AR, the native token of the Arweave ecosystem. Most websites will cost less than $1 to save permanently. See current prices\n\n\n# 5. Upload Static Files\n\nUpload the static files to your new Public Drive. Offline Pages Pro will generate an index.html file that is separate from a large folder of assets (images, css, fonts, etc). Simply Static will add the index.html file to the rest of your assets. Either way, upload all the files you receive from your static site generator to your new Public Drive.\n\n\n# 6. Wait\n\nPermanence takes patience. Once static files have been uploaded, they need to be sent to the Arweave network before being assembled together. This process can take as little as 5 seconds (when using Turbo credits) or up to 30 minutes or more (when using $AR). Make sure to keep your browser tab open and do not refresh your browser while you wait.\n\nTo check on the status of your files, you can click the refresh icon in the top right of ArDrive. You’ll know your file is ready when the light on the icon turns from yellow to green. (Pro Tip: some files uploaded with Turbo are ready before they are green.)\n\n\n# 7. Create a Manifest\n\nManifests are specialΒ .jsonΒ files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. In other words, they are the secret sauce that brings a permasite together.\n\nClick on the red +New button and select Advanced > New Manifest. Select the location for your manifest, ensuring it is in the same place as your index.html file.\n\nGive your Manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ArDrive.\n\n\n# 8. Wait Again\n\nNow the manifest needs to be sent to the Arweave network. Again, this process can take just a few seconds or up to 30 minutes or more.\n\nAfter a bit, you can refresh your Drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.\n\n\n# 9. Preview the Manifest\n\nGot a green light? You’re ready to go. Click on your manifest file and you will see a panel of options appear on the right side of your screen. Click on the Preview icon in the top right and it will open a new tab with your permasite.\n\nIf a website appears with a long, random-looking URL in the browser bar, then congrats, you made a permasite!\n\nTry clicking around and make sure all your pages are preserved. If they are not it could be a limitation of your static site generator or an issue with the manifest (see Notes below).\n\n\n# 10. Add a Redirect or Domain Masking\n\nYou’ll notice that your permasite has a long, random-looking URL generated by Arweave. These long URLs are designed to remain for decades, but they also are not very memorable.\n\nTry redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. You can also acquire an ArNS name that enables you to create a custom, permanent name for your permasite.\n\n\n# Notes\n\n * There’s no delete button with Arweave. Once your permasite is up, it’s up forever. Make sure your content is something you want future humanity to have.\n\n * Only static sites can become permasites through the ArDrive web app. Advanced functionality is available for developers who use the ArDrive CLI.\n\n * Links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.\n\n * Non-English characters in the URLs of your permasite can be problematic for ArDrive manifests, but non-English characters should work well on the permasite itself.\n\n\n# Other Use Cases\n\nPermasites can be used to archive web content before it disappears from the internet. Or they can be used to create working copies of websites before it a particular site is replaced by new versions.\n\nManifests can also be used to make reliable perma-backups. Many web hosts offer good daily backups and some offer reliable offsite backups as well. Permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.\n\n\n# Example\n\nYou can view a permasite version of this information at permasite.arweave.dev",normalizedContent:"# how to save a website permanently\n\n\n# overview\n\nardrive offers the ability to save working copies of static websites permanently on arweave. this means that websites made on wordpress, wix, squarespace and other cms platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.\n\nresources like the wayback machine are useful to research the past life of old websites. but the wayback machine’s archives are not comprehensive and often only capture partial copies of historic sites. by leveraging the utility of arweave manifests, ardrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.\n\nthe process to make a β€˜permasite’ takes 10 steps which are outlined below. advanced users can accomplish similar results by using manifests within the ardrive cli.\n\nyou can view a permasite version of this information at permasite.arweave.dev\n\n\n# 1. download static site files\n\nardrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:\n\n * permanent sites will not enable backend interaction with your website’s cms,\n * nor allow you to make further changes to the content of your site,\n * nor support dynamic functionality like contact forms and ecommerce.\n\nto generate your static site files, we recommend:\n\n\n# windows users\n\nwebcopy and httrack enable windows users to download static copies of entire websites.\n\n\n# mac users\n\noffline pages pro (mac users only), which creates files that work well with this process. after saving your site with offline pages pro, go to file > export > local website to download the local static files.\nsitesucker is another option for mac users.\n\n\n# command line utility\n\nwget is a free tool that helps capture static versions of websites. while wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. it offers a simple way to save your site's current look and feel as static files at no cost.\n\n\n# wordpress\n\nsimply static is a plugin that generates static files for wordpress websites. some users note that simply static fails to properly associate css and js files with your static site, but others have had success with this free wordpress plugin.\n\n\n# 2. create an account on ardrive\n\naccount creation is free as are uploads of small files (currently up to 500 kb). remember that ardrive empowers you to be in control of your data; no one else has your password but you. therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.\n\n\n# 3. create a new public drive\n\nclick on the red +new button and create a drive. name your drive and set it as β€œpublic”. ardrive also offers β€œprivate” file storage; however, permanent websites must be public in order to maintain functionality.\n\n\n# 4. top up\n\nto pay for permanent storage on the arweave network you must either purchase ardrive turbo credits with a credit card or (or the advanced option) ensure your wallet has $ar, the native token of the arweave ecosystem. most websites will cost less than $1 to save permanently. see current prices\n\n\n# 5. upload static files\n\nupload the static files to your new public drive. offline pages pro will generate an index.html file that is separate from a large folder of assets (images, css, fonts, etc). simply static will add the index.html file to the rest of your assets. either way, upload all the files you receive from your static site generator to your new public drive.\n\n\n# 6. wait\n\npermanence takes patience. once static files have been uploaded, they need to be sent to the arweave network before being assembled together. this process can take as little as 5 seconds (when using turbo credits) or up to 30 minutes or more (when using $ar). make sure to keep your browser tab open and do not refresh your browser while you wait.\n\nto check on the status of your files, you can click the refresh icon in the top right of ardrive. you’ll know your file is ready when the light on the icon turns from yellow to green. (pro tip: some files uploaded with turbo are ready before they are green.)\n\n\n# 7. create a manifest\n\nmanifests are specialΒ .jsonΒ files that instruct arweave gateways to map file data associated with specific, unique transaction ids to customized, hosted paths relative to that of the manifest file itself. in other words, they are the secret sauce that brings a permasite together.\n\nclick on the red +new button and select advanced > new manifest. select the location for your manifest, ensuring it is in the same place as your index.html file.\n\ngive your manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ardrive.\n\n\n# 8. wait again\n\nnow the manifest needs to be sent to the arweave network. again, this process can take just a few seconds or up to 30 minutes or more.\n\nafter a bit, you can refresh your drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.\n\n\n# 9. preview the manifest\n\ngot a green light? you’re ready to go. click on your manifest file and you will see a panel of options appear on the right side of your screen. click on the preview icon in the top right and it will open a new tab with your permasite.\n\nif a website appears with a long, random-looking url in the browser bar, then congrats, you made a permasite!\n\ntry clicking around and make sure all your pages are preserved. if they are not it could be a limitation of your static site generator or an issue with the manifest (see notes below).\n\n\n# 10. add a redirect or domain masking\n\nyou’ll notice that your permasite has a long, random-looking url generated by arweave. these long urls are designed to remain for decades, but they also are not very memorable.\n\ntry redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. you can also acquire an arns name that enables you to create a custom, permanent name for your permasite.\n\n\n# notes\n\n * there’s no delete button with arweave. once your permasite is up, it’s up forever. make sure your content is something you want future humanity to have.\n\n * only static sites can become permasites through the ardrive web app. advanced functionality is available for developers who use the ardrive cli.\n\n * links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.\n\n * non-english characters in the urls of your permasite can be problematic for ardrive manifests, but non-english characters should work well on the permasite itself.\n\n\n# other use cases\n\npermasites can be used to archive web content before it disappears from the internet. or they can be used to create working copies of websites before it a particular site is replaced by new versions.\n\nmanifests can also be used to make reliable perma-backups. many web hosts offer good daily backups and some offer reliable offsite backups as well. permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.\n\n\n# example\n\nyou can view a permasite version of this information at permasite.arweave.dev",charsets:{}},{title:"ArDrive Price Calculator",frontmatter:{prev:!1,next:!1},regularPath:"/docs/misc/price-calculator.html",relativePath:"docs/misc/price-calculator.md",key:"v-a6e64848",path:"/docs/misc/price-calculator.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:31},{level:2,title:"Developer Setup",slug:"developer-setup",normalizedTitle:"developer setup",charIndex:358},{level:3,title:"Install Yarn 2",slug:"install-yarn-2",normalizedTitle:"install yarn 2",charIndex:447},{level:3,title:"NVM",slug:"nvm",normalizedTitle:"nvm",charIndex:1243},{level:3,title:"Recommended Visual Studio Code extensions",slug:"recommended-visual-studio-code-extensions",normalizedTitle:"recommended visual studio code extensions",charIndex:1890},{level:2,title:"Available Scripts",slug:"available-scripts",normalizedTitle:"available scripts",charIndex:2080},{level:3,title:"yarn start",slug:"yarn-start",normalizedTitle:"yarn start",charIndex:2102},{level:3,title:"yarn build",slug:"yarn-build",normalizedTitle:"yarn build",charIndex:2301},{level:3,title:"yarn test",slug:"yarn-test",normalizedTitle:"yarn test",charIndex:2407},{level:3,title:"yarn run:prod",slug:"yarn-run-prod",normalizedTitle:"yarn run:prod",charIndex:2543}],headersStr:"Overview Developer Setup Install Yarn 2 NVM Recommended Visual Studio Code extensions Available Scripts yarn start yarn build yarn test yarn run:prod",content:"# ArDrive Price Calculator\n\n\n# Overview\n\nThe ArDrive Price Calculator website is open source, and its code can be viewed here\n\nThis website is intended to calculate the cost, in a wide variety of denominations and cryptocurrencies, of uploading data to Arweave. You can spin up your own version by cloning the code from Github and following these steps.\n\n\n# Developer Setup\n\nFollow these steps to get the developer environment up and running:\n\n\n# Install Yarn 2\n\nThe ArDrive Price Calculator uses Yarn 2, so install the latest version with the yarn installation instructions. In most cases:\n\n# Brew:\nbrew install yarn\n\n# Or with NPM:\nnpm install -g yarn\n\n\nWe also use husky to manage the git commit hooks that help to improve the quality of our commits. Without installing husky, you risk committing non-compliant code to the repository.\n\nUsing husky triggers two pre-commit hooks. The first will run lint-staged on each staged file, which includes running prettier to format, eslint for linting, and also tsc-files for quickly checking that TypeScript can compile the code. The second hook will test the codebase prior to committing, ensuring that all tests must pass.\n\nTo enable hooks locally, you will need to run:\n\nyarn husky install\n\n\n\n# NVM\n\nThis repository uses NVM and an .nvmrc file to lock the Node version to the current version used by ardrive-core-js.\n\nNote for Windows: We recommend using WSL for setting up NVM on Windows using the instructions described here\n\nFollow these steps to get NVM up and running on your system:\n\n 1. Install NVM using these installation instructions.\n 2. Navigate to this project's root directory\n 3. Ensure that the correct version of Node is installed by performing: nvm install\n 4. Every time you start a new terminal session or switch to this project from another NPM project, you should set the correct version of Node by running: nvm use\n\n\n# Recommended Visual Studio Code extensions\n\nTo ensure your environment is compatible, we also recommend the following VSCode extensions:\n\n * ES-Lint\n * Editor-Config\n * Prettier\n * ZipFS\n\n\n# Available Scripts\n\n\n# yarn start\n\nRuns the app in the development mode. Open http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits. You will also see any lint errors in the console.\n\n\n# yarn build\n\nBuilds a static copy of your site to the build/ folder. Your app is ready to be deployed!\n\n\n# yarn test\n\nLaunches the application test runner. Run with the --watch flag (yarn test -- --watch) to run in interactive watch mode.\n\n\n# yarn run:prod\n\nBuilds a fresh snowpack production build to the build/ folder Then launches that copy with http-server-spa for local testing The build will be available for preview at: http://localhost:8080",normalizedContent:"# ardrive price calculator\n\n\n# overview\n\nthe ardrive price calculator website is open source, and its code can be viewed here\n\nthis website is intended to calculate the cost, in a wide variety of denominations and cryptocurrencies, of uploading data to arweave. you can spin up your own version by cloning the code from github and following these steps.\n\n\n# developer setup\n\nfollow these steps to get the developer environment up and running:\n\n\n# install yarn 2\n\nthe ardrive price calculator uses yarn 2, so install the latest version with the yarn installation instructions. in most cases:\n\n# brew:\nbrew install yarn\n\n# or with npm:\nnpm install -g yarn\n\n\nwe also use husky to manage the git commit hooks that help to improve the quality of our commits. without installing husky, you risk committing non-compliant code to the repository.\n\nusing husky triggers two pre-commit hooks. the first will run lint-staged on each staged file, which includes running prettier to format, eslint for linting, and also tsc-files for quickly checking that typescript can compile the code. the second hook will test the codebase prior to committing, ensuring that all tests must pass.\n\nto enable hooks locally, you will need to run:\n\nyarn husky install\n\n\n\n# nvm\n\nthis repository uses nvm and an .nvmrc file to lock the node version to the current version used by ardrive-core-js.\n\nnote for windows: we recommend using wsl for setting up nvm on windows using the instructions described here\n\nfollow these steps to get nvm up and running on your system:\n\n 1. install nvm using these installation instructions.\n 2. navigate to this project's root directory\n 3. ensure that the correct version of node is installed by performing: nvm install\n 4. every time you start a new terminal session or switch to this project from another npm project, you should set the correct version of node by running: nvm use\n\n\n# recommended visual studio code extensions\n\nto ensure your environment is compatible, we also recommend the following vscode extensions:\n\n * es-lint\n * editor-config\n * prettier\n * zipfs\n\n\n# available scripts\n\n\n# yarn start\n\nruns the app in the development mode. open http://localhost:8080 to view it in the browser.\n\nthe page will reload if you make edits. you will also see any lint errors in the console.\n\n\n# yarn build\n\nbuilds a static copy of your site to the build/ folder. your app is ready to be deployed!\n\n\n# yarn test\n\nlaunches the application test runner. run with the --watch flag (yarn test -- --watch) to run in interactive watch mode.\n\n\n# yarn run:prod\n\nbuilds a fresh snowpack production build to the build/ folder then launches that copy with http-server-spa for local testing the build will be available for preview at: http://localhost:8080",charsets:{}},{title:"placeholder",frontmatter:{},regularPath:"/docs/",relativePath:"docs/readme.md",key:"v-35b0f3b1",path:"/docs/",headersStr:null,content:"# placeholder\n\nExercitation proident duis qui est veniam duis ullamco proident et veniam.",normalizedContent:"# placeholder\n\nexercitation proident duis qui est veniam duis ullamco proident et veniam.",charsets:{}},{title:"Payment API",frontmatter:{},regularPath:"/docs/turbo/api/payment.html",relativePath:"docs/turbo/api/payment.md",key:"v-e65ea9a4",path:"/docs/turbo/api/payment.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:18},{level:2,title:"Endpoints",slug:"endpoints",normalizedTitle:"endpoints",charIndex:596},{level:3,title:"Get Amount of Credits for Byte Count",slug:"get-amount-of-credits-for-byte-count",normalizedTitle:"get amount of credits for byte count",charIndex:724},{level:3,title:"Get winc for Payment Type and Amount",slug:"get-winc-for-payment-type-and-amount",normalizedTitle:"get winc for payment type and amount",charIndex:1282},{level:3,title:"Get Current Balance of winc",slug:"get-current-balance-of-winc",normalizedTitle:"get current balance of winc",charIndex:1663},{level:3,title:"Get Quote for Credits",slug:"get-quote-for-credits",normalizedTitle:"get quote for credits",charIndex:1927},{level:3,title:"Get Supported Currencies",slug:"get-supported-currencies",normalizedTitle:"get supported currencies",charIndex:5246},{level:3,title:"Get Supported Countries",slug:"get-supported-countries",normalizedTitle:"get supported countries",charIndex:7768},{level:3,title:"Get Conversion Rates",slug:"get-conversion-rates",normalizedTitle:"get conversion rates",charIndex:10758}],headersStr:"Overview Endpoints Get Amount of Credits for Byte Count Get winc for Payment Type and Amount Get Current Balance of winc Get Quote for Credits Get Supported Currencies Get Supported Countries Get Conversion Rates",content:'# Payment API\n\n\n# Overview\n\nArDrive offers several API endpoints to help manage and determine costs associated with converting currencies into Turbo credits. The below endpoints offer access to useful information that can help stay in control when uploading data to Arweave using Turbo. "winc" refers to "winston credits", the smallest denomination of a Turbo credit.\n\nNote: This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints here, or view the raw json for that documentation here.\n\n\n# Endpoints\n\nThe host url for all below endpoints is:\n\nhttps://payment.ardrive.io/v1\n\nAll of these endpoints use GET requests\n\n\n# Get Amount of Credits for Byte Count\n\nReturns the current amount of winc it will cost to upload a provided byte count worth of data.\n\n/price/bytes/{byteCount}\n\n# Parameters\n\nbyteCount*: integer - (path)\n\n# Example\n\nhttps://payment.ardrive.io/v1/price/bytes/5242880\n\n\nResponse Body (JSON)\n\n{\n "winc": "1676650364",\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-2514975546"\n }\n ]\n}\n\n\n\n# Get winc for Payment Type and Amount\n\nReturns the current amount of winc Turbo will quote for a given payment type and amount.\n\n/price/{type}/{amount}\n\n# Parameters\n\ntype*: string - must match a supported currency, such as "usd" - (path)\n\namount*: integer - (path)\n\n# Example\n\nhttps://payment.ardrive.io/v1/price/usd/1000\n\n\nResponse Body (JSON)\n\n{\n "winc": "1365248226950"\n}\n\n\n\n# Get Current Balance of winc\n\nuse a signed request of a previously obtained JWT to get the signing wallet\'s current service balance in winc.\n\n/balance\n\n# Parameters\n\nx-signature*: string - (header)\n\nx-nonce*: string - (header)\n\nx-public-key*: string - (header)\n\n\n# Get Quote for Credits\n\nGets a quote and payment session for a given payment method, destination address, currency type, and payment amount\n\n/top-up/{method}/{address}/{currency}/{amount}\n\n# Parameters\n\nmethod*: string - payment-intent | checkout-session - (path)\n\naddress*: string - public address of wallet - (path)\n\ncurrency*: string - must match supported currency, such as usd - (path)\n\namount*: integer - amount of the currency to convert to winc, usd has a minimum transaction amount of 1000 ($10.00) - (path)\n\n# Example\n\nhttps://payment.ardrive.io/v1/top-up/checkout-session/cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q/usd/1000\n\n\nResponse Body (JSON)\n\n{\n "topUpQuote": {\n "topUpQuoteId": "54f57b67-4fcf-47fb-85e6-85d4a8c96f25",\n "destinationAddressType": "arweave",\n "paymentAmount": 1000,\n "winstonCreditAmount": "1360424028269",\n "destinationAddress": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "currencyType": "usd",\n "quoteExpirationDate": "2023-07-27T01:56:26.436Z",\n "paymentProvider": "stripe"\n },\n "paymentSession": {\n "id": "cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51",\n "object": "checkout.session",\n "after_expiration": null,\n "allow_promotion_codes": null,\n "amount_subtotal": 1000,\n "amount_total": 1000,\n "automatic_tax": {\n "enabled": false,\n "status": null\n },\n "billing_address_collection": null,\n "cancel_url": "https://app.ardrive.io",\n "client_reference_id": null,\n "consent": null,\n "consent_collection": null,\n "created": 1690422686,\n "currency": "usd",\n "currency_conversion": null,\n "custom_fields": [],\n "custom_text": {\n "shipping_address": null,\n "submit": null\n },\n "customer": null,\n "customer_creation": "if_required",\n "customer_details": null,\n "customer_email": null,\n "expires_at": 1690509086,\n "invoice": null,\n "invoice_creation": {\n "enabled": false,\n "invoice_data": {\n "account_tax_ids": null,\n "custom_fields": null,\n "description": null,\n "footer": null,\n "metadata": {},\n "rendering_options": null\n }\n },\n "livemode": true,\n "locale": null,\n "metadata": {},\n "mode": "payment",\n "payment_intent": null,\n "payment_link": null,\n "payment_method_collection": "always",\n "payment_method_options": {},\n "payment_method_types": [\n "card"\n ],\n "payment_status": "unpaid",\n "phone_number_collection": {\n "enabled": false\n },\n "recovered_from": null,\n "setup_intent": null,\n "shipping_address_collection": null,\n "shipping_cost": null,\n "shipping_details": null,\n "shipping_options": [],\n "status": "open",\n "submit_type": null,\n "subscription": null,\n "success_url": "https://app.ardrive.io",\n "total_details": {\n "amount_discount": 0,\n "amount_shipping": 0,\n "amount_tax": 0\n },\n "url": "https://checkout.stripe.com/c/pay/cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51#fidkdWxOYHwnPyd1blppbHNgWjA0T1BEcXJGPWR1VUpSbkFJSFR0S0M8dlV1Y2tgS1ZVa3JdPVxfPXw0Q0tBaTNzPDFtX0xyf2JDVlxpNzJnUkAxSmp2PUZJdHBwa1B2ck53TmZkQW1BSjNoNTU3XG88RGBObycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"\n }\n}\n\n\n\n# Get Supported Currencies\n\nReturns a list of currency types supported by Turbo\n\n/currencies\n\n# Parameters\n\nNone\n\n# Example\n\nhttps://payment.ardrive.io/v1/currencies\n\n\nResponse Body (JSON)\n\n{\n "supportedCurrencies": [\n "aud",\n "brl",\n "cad",\n "eur",\n "gbp",\n "hkd",\n "inr",\n "jpy",\n "sgd",\n "usd"\n ],\n "limits": {\n "aud": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "brl": {\n "maximumPaymentAmount": 5000000,\n "minimumPaymentAmount": 5000,\n "suggestedPaymentAmounts": [\n 12500,\n 25000,\n 50000\n ],\n "zeroDecimalCurrency": false\n },\n "cad": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1400,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "eur": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "gbp": {\n "maximumPaymentAmount": 770000,\n "minimumPaymentAmount": 780,\n "suggestedPaymentAmounts": [\n 2000,\n 4000,\n 8000\n ],\n "zeroDecimalCurrency": false\n },\n "hkd": {\n "maximumPaymentAmount": 7800000,\n "minimumPaymentAmount": 7900,\n "suggestedPaymentAmounts": [\n 20000,\n 40000,\n 80000\n ],\n "zeroDecimalCurrency": false\n },\n "inr": {\n "maximumPaymentAmount": 90000000,\n "minimumPaymentAmount": 83000,\n "suggestedPaymentAmounts": [\n 200000,\n 400000,\n 800000\n ],\n "zeroDecimalCurrency": false\n },\n "jpy": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 3500,\n 6500,\n 15000\n ],\n "zeroDecimalCurrency": true\n },\n "sgd": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "usd": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n }\n }\n}\n\n\n\n# Get Supported Countries\n\nReturns a list of countries where Turbo is available\n\n/countries\n\n# Parameters\n\nNone\n\n# Example\n\nhttps://payment.ardrive.io/v1/countries\n\n\nResponse Body (JSON)\n\n[\n "United States",\n "United Kingdom",\n "Afghanistan",\n "Albania",\n "Algeria",\n "Andorra",\n "Angola",\n "Antigua and Barbuda",\n "Argentina",\n "Armenia",\n "Australia",\n "Austria",\n "Azerbaijan",\n "Bahamas",\n "Bahrain",\n "Bangladesh",\n "Barbados",\n "Belarus",\n "Belgium",\n "Belize",\n "Benin",\n "Bhutan",\n "Bolivia",\n "Bosnia and Herzegovina",\n "Botswana",\n "Brazil",\n "Brunei",\n "Bulgaria",\n "Burkina Faso",\n "Burundi",\n "Cabo Verde",\n "Cambodia",\n "Cameroon",\n "Canada",\n "Central African Republic",\n "Chad",\n "Chile",\n "China",\n "Colombia",\n "Comoros",\n "Congo",\n "Costa Rica",\n "Cote d\'Ivoire",\n "Croatia",\n "Cyprus",\n "Czech Republic",\n "Democratic Republic of the Congo",\n "Denmark",\n "Djibouti",\n "Dominica",\n "Dominican Republic",\n "East Timor",\n "Ecuador",\n "Egypt",\n "El Salvador",\n "Equatorial Guinea",\n "Eritrea",\n "Estonia",\n "Eswatini",\n "Ethiopia",\n "Fiji",\n "Finland",\n "France",\n "Gabon",\n "Gambia",\n "Georgia",\n "Germany",\n "Ghana",\n "Greece",\n "Grenada",\n "Guatemala",\n "Guinea",\n "Guinea-Bissau",\n "Guyana",\n "Haiti",\n "Honduras",\n "Hungary",\n "Iceland",\n "India",\n "Indonesia",\n "Iraq",\n "Ireland",\n "Israel",\n "Italy",\n "Jamaica",\n "Japan",\n "Jordan",\n "Kazakhstan",\n "Kenya",\n "Kiribati",\n "Kuwait",\n "Kyrgyzstan",\n "Laos",\n "Latvia",\n "Lebanon",\n "Lesotho",\n "Liberia",\n "Libya",\n "Liechtenstein",\n "Lithuania",\n "Luxembourg",\n "Madagascar",\n "Malawi",\n "Malaysia",\n "Maldives",\n "Mali",\n "Malta",\n "Marshall Islands",\n "Mauritania",\n "Mauritius",\n "Mexico",\n "Micronesia",\n "Moldova",\n "Monaco",\n "Mongolia",\n "Montenegro",\n "Morocco",\n "Mozambique",\n "Myanmar",\n "Namibia",\n "Nauru",\n "Nepal",\n "Netherlands",\n "New Zealand",\n "Nicaragua",\n "Niger",\n "Nigeria",\n "North Macedonia",\n "Norway",\n "Oman",\n "Pakistan",\n "Palau",\n "Palestine",\n "Panama",\n "Papua New Guinea",\n "Paraguay",\n "Peru",\n "Philippines",\n "Poland",\n "Portugal",\n "Qatar",\n "Romania",\n "Russia",\n "Rwanda",\n "Saint Kitts and Nevis",\n "Saint Lucia",\n "Saint Vincent and the Grenadines",\n "Samoa",\n "San Marino",\n "Sao Tome and Principe",\n "Saudi Arabia",\n "Senegal",\n "Serbia",\n "Seychelles",\n "Sierra Leone",\n "Singapore",\n "Slovakia",\n "Slovenia",\n "Solomon Islands",\n "Somalia",\n "South Africa",\n "South Korea",\n "South Sudan",\n "Spain",\n "Sri Lanka",\n "Sudan",\n "Suriname",\n "Sweden",\n "Switzerland",\n "Taiwan",\n "Tajikistan",\n "Tanzania",\n "Thailand",\n "Togo",\n "Tonga",\n "Trinidad and Tobago",\n "Tunisia",\n "Turkey",\n "Turkmenistan",\n "Tuvalu",\n "Uganda",\n "Ukraine",\n "United Arab Emirates",\n "Uruguay",\n "Uzbekistan",\n "Vanuatu",\n "Vatican City",\n "Venezuela",\n "Vietnam",\n "Yemen",\n "Zambia",\n "Zimbabwe"\n]\n\n\n\n# Get Conversion Rates\n\nReturns supported fiat conversion rates for 1GB of storage based on current market prices\n\n/rates\n\n# Parameters\n\nNone\n\n# Example\n\nhttps://payment.ardrive.io/v1/rates\n\n\nResponse Body (JSON)\n\n{\n "winc": "343168912867",\n "fiat": {\n "aud": 3.52873729722864,\n "brl": 11.34598786477272,\n "cad": 3.15729126594135,\n "eur": 2.1569195680425,\n "gbp": 1.8487882011791101,\n "hkd": 18.66938404981161,\n "inr": 196.24591287088242,\n "jpy": 334.744630809484,\n "sgd": 3.16995419882613,\n "usd": 2.39329431522465\n },\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-514753369299"\n }\n ]\n}\n\n\n* required',normalizedContent:'# payment api\n\n\n# overview\n\nardrive offers several api endpoints to help manage and determine costs associated with converting currencies into turbo credits. the below endpoints offer access to useful information that can help stay in control when uploading data to arweave using turbo. "winc" refers to "winston credits", the smallest denomination of a turbo credit.\n\nnote: this service is still evolving and the information provided below may be out of date. you can view the most up to date information about the available endpoints here, or view the raw json for that documentation here.\n\n\n# endpoints\n\nthe host url for all below endpoints is:\n\nhttps://payment.ardrive.io/v1\n\nall of these endpoints use get requests\n\n\n# get amount of credits for byte count\n\nreturns the current amount of winc it will cost to upload a provided byte count worth of data.\n\n/price/bytes/{bytecount}\n\n# parameters\n\nbytecount*: integer - (path)\n\n# example\n\nhttps://payment.ardrive.io/v1/price/bytes/5242880\n\n\nresponse body (json)\n\n{\n "winc": "1676650364",\n "adjustments": [\n {\n "name": "fwd research july 2023 subsidy",\n "description": "a 60% discount for uploads over 500kib",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentamount": "-2514975546"\n }\n ]\n}\n\n\n\n# get winc for payment type and amount\n\nreturns the current amount of winc turbo will quote for a given payment type and amount.\n\n/price/{type}/{amount}\n\n# parameters\n\ntype*: string - must match a supported currency, such as "usd" - (path)\n\namount*: integer - (path)\n\n# example\n\nhttps://payment.ardrive.io/v1/price/usd/1000\n\n\nresponse body (json)\n\n{\n "winc": "1365248226950"\n}\n\n\n\n# get current balance of winc\n\nuse a signed request of a previously obtained jwt to get the signing wallet\'s current service balance in winc.\n\n/balance\n\n# parameters\n\nx-signature*: string - (header)\n\nx-nonce*: string - (header)\n\nx-public-key*: string - (header)\n\n\n# get quote for credits\n\ngets a quote and payment session for a given payment method, destination address, currency type, and payment amount\n\n/top-up/{method}/{address}/{currency}/{amount}\n\n# parameters\n\nmethod*: string - payment-intent | checkout-session - (path)\n\naddress*: string - public address of wallet - (path)\n\ncurrency*: string - must match supported currency, such as usd - (path)\n\namount*: integer - amount of the currency to convert to winc, usd has a minimum transaction amount of 1000 ($10.00) - (path)\n\n# example\n\nhttps://payment.ardrive.io/v1/top-up/checkout-session/cf0h0skdnadtqwky9ijkbkttpdewgb3gnlnde7abv0q/usd/1000\n\n\nresponse body (json)\n\n{\n "topupquote": {\n "topupquoteid": "54f57b67-4fcf-47fb-85e6-85d4a8c96f25",\n "destinationaddresstype": "arweave",\n "paymentamount": 1000,\n "winstoncreditamount": "1360424028269",\n "destinationaddress": "cf0h0skdnadtqwky9ijkbkttpdewgb3gnlnde7abv0q",\n "currencytype": "usd",\n "quoteexpirationdate": "2023-07-27t01:56:26.436z",\n "paymentprovider": "stripe"\n },\n "paymentsession": {\n "id": "cs_live_a1p47upvijhge7si8ai1ksczdd5qkzdyahuwraeufvvvvdhxeuck68pf51",\n "object": "checkout.session",\n "after_expiration": null,\n "allow_promotion_codes": null,\n "amount_subtotal": 1000,\n "amount_total": 1000,\n "automatic_tax": {\n "enabled": false,\n "status": null\n },\n "billing_address_collection": null,\n "cancel_url": "https://app.ardrive.io",\n "client_reference_id": null,\n "consent": null,\n "consent_collection": null,\n "created": 1690422686,\n "currency": "usd",\n "currency_conversion": null,\n "custom_fields": [],\n "custom_text": {\n "shipping_address": null,\n "submit": null\n },\n "customer": null,\n "customer_creation": "if_required",\n "customer_details": null,\n "customer_email": null,\n "expires_at": 1690509086,\n "invoice": null,\n "invoice_creation": {\n "enabled": false,\n "invoice_data": {\n "account_tax_ids": null,\n "custom_fields": null,\n "description": null,\n "footer": null,\n "metadata": {},\n "rendering_options": null\n }\n },\n "livemode": true,\n "locale": null,\n "metadata": {},\n "mode": "payment",\n "payment_intent": null,\n "payment_link": null,\n "payment_method_collection": "always",\n "payment_method_options": {},\n "payment_method_types": [\n "card"\n ],\n "payment_status": "unpaid",\n "phone_number_collection": {\n "enabled": false\n },\n "recovered_from": null,\n "setup_intent": null,\n "shipping_address_collection": null,\n "shipping_cost": null,\n "shipping_details": null,\n "shipping_options": [],\n "status": "open",\n "submit_type": null,\n "subscription": null,\n "success_url": "https://app.ardrive.io",\n "total_details": {\n "amount_discount": 0,\n "amount_shipping": 0,\n "amount_tax": 0\n },\n "url": "https://checkout.stripe.com/c/pay/cs_live_a1p47upvijhge7si8ai1ksczdd5qkzdyahuwraeufvvvvdhxeuck68pf51#fidkdwxoyhwnpyd1blppbhngwja0t1becxjgpwr1vupsbkfjsfr0s0m8dlv1y2tgs1zva3jdpvxfpxw0q0tbatnzpdftx0xyf2jdvlxpnzjnukaxsmp2puzjdhbwa1b2ck53tmzkqw1bsjnontu3xg88rgbobycpj2n3amhwyhdzyhcnp3f3cgapj2lkfgpwcvf8dwanpyd2bgtiawbabhfgaccpj2brzgdpyfvpzgzgbwppywb3dic%2fcxdwyhgl"\n }\n}\n\n\n\n# get supported currencies\n\nreturns a list of currency types supported by turbo\n\n/currencies\n\n# parameters\n\nnone\n\n# example\n\nhttps://payment.ardrive.io/v1/currencies\n\n\nresponse body (json)\n\n{\n "supportedcurrencies": [\n "aud",\n "brl",\n "cad",\n "eur",\n "gbp",\n "hkd",\n "inr",\n "jpy",\n "sgd",\n "usd"\n ],\n "limits": {\n "aud": {\n "maximumpaymentamount": 1500000,\n "minimumpaymentamount": 1500,\n "suggestedpaymentamounts": [\n 2500,\n 7500,\n 15000\n ],\n "zerodecimalcurrency": false\n },\n "brl": {\n "maximumpaymentamount": 5000000,\n "minimumpaymentamount": 5000,\n "suggestedpaymentamounts": [\n 12500,\n 25000,\n 50000\n ],\n "zerodecimalcurrency": false\n },\n "cad": {\n "maximumpaymentamount": 1300000,\n "minimumpaymentamount": 1400,\n "suggestedpaymentamounts": [\n 2500,\n 5000,\n 10000\n ],\n "zerodecimalcurrency": false\n },\n "eur": {\n "maximumpaymentamount": 1000000,\n "minimumpaymentamount": 1000,\n "suggestedpaymentamounts": [\n 2500,\n 5000,\n 10000\n ],\n "zerodecimalcurrency": false\n },\n "gbp": {\n "maximumpaymentamount": 770000,\n "minimumpaymentamount": 780,\n "suggestedpaymentamounts": [\n 2000,\n 4000,\n 8000\n ],\n "zerodecimalcurrency": false\n },\n "hkd": {\n "maximumpaymentamount": 7800000,\n "minimumpaymentamount": 7900,\n "suggestedpaymentamounts": [\n 20000,\n 40000,\n 80000\n ],\n "zerodecimalcurrency": false\n },\n "inr": {\n "maximumpaymentamount": 90000000,\n "minimumpaymentamount": 83000,\n "suggestedpaymentamounts": [\n 200000,\n 400000,\n 800000\n ],\n "zerodecimalcurrency": false\n },\n "jpy": {\n "maximumpaymentamount": 1500000,\n "minimumpaymentamount": 1500,\n "suggestedpaymentamounts": [\n 3500,\n 6500,\n 15000\n ],\n "zerodecimalcurrency": true\n },\n "sgd": {\n "maximumpaymentamount": 1300000,\n "minimumpaymentamount": 1500,\n "suggestedpaymentamounts": [\n 2500,\n 7500,\n 15000\n ],\n "zerodecimalcurrency": false\n },\n "usd": {\n "maximumpaymentamount": 1000000,\n "minimumpaymentamount": 1000,\n "suggestedpaymentamounts": [\n 2500,\n 5000,\n 10000\n ],\n "zerodecimalcurrency": false\n }\n }\n}\n\n\n\n# get supported countries\n\nreturns a list of countries where turbo is available\n\n/countries\n\n# parameters\n\nnone\n\n# example\n\nhttps://payment.ardrive.io/v1/countries\n\n\nresponse body (json)\n\n[\n "united states",\n "united kingdom",\n "afghanistan",\n "albania",\n "algeria",\n "andorra",\n "angola",\n "antigua and barbuda",\n "argentina",\n "armenia",\n "australia",\n "austria",\n "azerbaijan",\n "bahamas",\n "bahrain",\n "bangladesh",\n "barbados",\n "belarus",\n "belgium",\n "belize",\n "benin",\n "bhutan",\n "bolivia",\n "bosnia and herzegovina",\n "botswana",\n "brazil",\n "brunei",\n "bulgaria",\n "burkina faso",\n "burundi",\n "cabo verde",\n "cambodia",\n "cameroon",\n "canada",\n "central african republic",\n "chad",\n "chile",\n "china",\n "colombia",\n "comoros",\n "congo",\n "costa rica",\n "cote d\'ivoire",\n "croatia",\n "cyprus",\n "czech republic",\n "democratic republic of the congo",\n "denmark",\n "djibouti",\n "dominica",\n "dominican republic",\n "east timor",\n "ecuador",\n "egypt",\n "el salvador",\n "equatorial guinea",\n "eritrea",\n "estonia",\n "eswatini",\n "ethiopia",\n "fiji",\n "finland",\n "france",\n "gabon",\n "gambia",\n "georgia",\n "germany",\n "ghana",\n "greece",\n "grenada",\n "guatemala",\n "guinea",\n "guinea-bissau",\n "guyana",\n "haiti",\n "honduras",\n "hungary",\n "iceland",\n "india",\n "indonesia",\n "iraq",\n "ireland",\n "israel",\n "italy",\n "jamaica",\n "japan",\n "jordan",\n "kazakhstan",\n "kenya",\n "kiribati",\n "kuwait",\n "kyrgyzstan",\n "laos",\n "latvia",\n "lebanon",\n "lesotho",\n "liberia",\n "libya",\n "liechtenstein",\n "lithuania",\n "luxembourg",\n "madagascar",\n "malawi",\n "malaysia",\n "maldives",\n "mali",\n "malta",\n "marshall islands",\n "mauritania",\n "mauritius",\n "mexico",\n "micronesia",\n "moldova",\n "monaco",\n "mongolia",\n "montenegro",\n "morocco",\n "mozambique",\n "myanmar",\n "namibia",\n "nauru",\n "nepal",\n "netherlands",\n "new zealand",\n "nicaragua",\n "niger",\n "nigeria",\n "north macedonia",\n "norway",\n "oman",\n "pakistan",\n "palau",\n "palestine",\n "panama",\n "papua new guinea",\n "paraguay",\n "peru",\n "philippines",\n "poland",\n "portugal",\n "qatar",\n "romania",\n "russia",\n "rwanda",\n "saint kitts and nevis",\n "saint lucia",\n "saint vincent and the grenadines",\n "samoa",\n "san marino",\n "sao tome and principe",\n "saudi arabia",\n "senegal",\n "serbia",\n "seychelles",\n "sierra leone",\n "singapore",\n "slovakia",\n "slovenia",\n "solomon islands",\n "somalia",\n "south africa",\n "south korea",\n "south sudan",\n "spain",\n "sri lanka",\n "sudan",\n "suriname",\n "sweden",\n "switzerland",\n "taiwan",\n "tajikistan",\n "tanzania",\n "thailand",\n "togo",\n "tonga",\n "trinidad and tobago",\n "tunisia",\n "turkey",\n "turkmenistan",\n "tuvalu",\n "uganda",\n "ukraine",\n "united arab emirates",\n "uruguay",\n "uzbekistan",\n "vanuatu",\n "vatican city",\n "venezuela",\n "vietnam",\n "yemen",\n "zambia",\n "zimbabwe"\n]\n\n\n\n# get conversion rates\n\nreturns supported fiat conversion rates for 1gb of storage based on current market prices\n\n/rates\n\n# parameters\n\nnone\n\n# example\n\nhttps://payment.ardrive.io/v1/rates\n\n\nresponse body (json)\n\n{\n "winc": "343168912867",\n "fiat": {\n "aud": 3.52873729722864,\n "brl": 11.34598786477272,\n "cad": 3.15729126594135,\n "eur": 2.1569195680425,\n "gbp": 1.8487882011791101,\n "hkd": 18.66938404981161,\n "inr": 196.24591287088242,\n "jpy": 334.744630809484,\n "sgd": 3.16995419882613,\n "usd": 2.39329431522465\n },\n "adjustments": [\n {\n "name": "fwd research july 2023 subsidy",\n "description": "a 60% discount for uploads over 500kib",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentamount": "-514753369299"\n }\n ]\n}\n\n\n* required',charsets:{cjk:!0}},{title:"Upload API",frontmatter:{next:!1},regularPath:"/docs/turbo/api/upload.html",relativePath:"docs/turbo/api/upload.md",key:"v-57c590fa",path:"/docs/turbo/api/upload.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:17},{level:2,title:"Endpoint",slug:"endpoint",normalizedTitle:"endpoint",charIndex:500},{level:2,title:"Schema",slug:"schema",normalizedTitle:"schema",charIndex:546},{level:3,title:"Headers",slug:"headers",normalizedTitle:"headers",charIndex:557},{level:3,title:"Body",slug:"body",normalizedTitle:"body",charIndex:670},{level:3,title:"Response",slug:"response",normalizedTitle:"response",charIndex:1482}],headersStr:"Overview Endpoint Schema Headers Body Response",content:'# Upload API\n\n\n# Overview\n\nThe Turbo Upload Service supports payment for signed data-items to upload.ardrive.io using Turbo Credits. An API endpoint has been created to facilitate the payments. A signed data-item can be posted to upload.ardrive.io using the below schema.\n\nNote: This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints here, or view the raw json for that documentation here.\n\n\n# Endpoint\n\nhttps://upload.ardrive.io/v1/tx\n\n\n# Schema\n\n\n# Headers\n\ncontent-type*: "application/octet-stream"\n\naccept*: string - media type, such as "application/json"\n\n\n# Body\n\nThe body of your request should contain a signed data-item.\n\nData-items can be created and signed with the arbundles library, following the below example.\n\n// Initiates the arbundles Arweave signer with your wallet\nconst signer = new ArweaveSigner(jwk);\n\n// Sets the data you would like to use to create a data-item\nconst data = "Any value can Go here";\n\n// Creates a data-item using your data and the Arweave Signer\nconst dataItem = createData(data, signer);\n\n// Signs the data-item\nawait dataItem.sign(signer);\n\n\n\nIn this example, the variable dataItem is what should be sent in your api post request in order to finalize and pay for the upload using Turbo Credits. dataItem.sign() is a mutating method, so there is no need to create a separate variable to hold the results of signing the data-item.\n\n\n# Response\n\nHeaders ``` access-control-allow-methods: PUT,GET,HEAD,POST,DELETE,OPTIONS access-control-allow-origin: https://upload.ardrive.io content-length: 173 content-security-policy: frame-ancestors \'none\'; default-src \'self\'; img-src data: https:; script-src \'self\' \'unsafe-inline\' https:; style-src \'unsafe-inline\' https:; object-src \'none\'; font-src \'self\' https:; content-type: application/json; charset=utf-8 date: Thu,27 Jul 2023 22:06:33 GMT strict-transport-security: max-age=3600; includeSubDomains; preload vary: Origin via: 1.1 d0d53eedec01ac540f737b5fafb16436.cloudfront.net (CloudFront) x-amz-cf-id: eypqkKDp-ADDMHmBOp3UQzDK4gZ8iYE8fbmYAyZjfyR3Cj8gevgF6g== x-amz-cf-pop: IAD12-P3 x-cache: Miss from cloudfront x-content-type-options: nosniff x-frame-options: SAMEORIGIN x-xss-protection: 1; mode=block ``` Body ``` { "id": "1wk8nyVTHTHpbmEZ-IGNsGcro4og8XXVbBhHvMFxUgQ", "owner": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q", "dataCaches": [ "arweave.net" ], "fastFinalityIndexes": [ "arweave.net" ] } ```\n\n* required',normalizedContent:'# upload api\n\n\n# overview\n\nthe turbo upload service supports payment for signed data-items to upload.ardrive.io using turbo credits. an api endpoint has been created to facilitate the payments. a signed data-item can be posted to upload.ardrive.io using the below schema.\n\nnote: this service is still evolving and the information provided below may be out of date. you can view the most up to date information about the available endpoints here, or view the raw json for that documentation here.\n\n\n# endpoint\n\nhttps://upload.ardrive.io/v1/tx\n\n\n# schema\n\n\n# headers\n\ncontent-type*: "application/octet-stream"\n\naccept*: string - media type, such as "application/json"\n\n\n# body\n\nthe body of your request should contain a signed data-item.\n\ndata-items can be created and signed with the arbundles library, following the below example.\n\n// initiates the arbundles arweave signer with your wallet\nconst signer = new arweavesigner(jwk);\n\n// sets the data you would like to use to create a data-item\nconst data = "any value can go here";\n\n// creates a data-item using your data and the arweave signer\nconst dataitem = createdata(data, signer);\n\n// signs the data-item\nawait dataitem.sign(signer);\n\n\n\nin this example, the variable dataitem is what should be sent in your api post request in order to finalize and pay for the upload using turbo credits. dataitem.sign() is a mutating method, so there is no need to create a separate variable to hold the results of signing the data-item.\n\n\n# response\n\nheaders ``` access-control-allow-methods: put,get,head,post,delete,options access-control-allow-origin: https://upload.ardrive.io content-length: 173 content-security-policy: frame-ancestors \'none\'; default-src \'self\'; img-src data: https:; script-src \'self\' \'unsafe-inline\' https:; style-src \'unsafe-inline\' https:; object-src \'none\'; font-src \'self\' https:; content-type: application/json; charset=utf-8 date: thu,27 jul 2023 22:06:33 gmt strict-transport-security: max-age=3600; includesubdomains; preload vary: origin via: 1.1 d0d53eedec01ac540f737b5fafb16436.cloudfront.net (cloudfront) x-amz-cf-id: eypqkkdp-addmhmbop3uqzdk4gz8iye8fbmyayzjfyr3cj8gevgf6g== x-amz-cf-pop: iad12-p3 x-cache: miss from cloudfront x-content-type-options: nosniff x-frame-options: sameorigin x-xss-protection: 1; mode=block ``` body ``` { "id": "1wk8nyvththpbmez-ignsgcro4og8xxvbbhhvmfxugq", "owner": "cf0h0skdnadtqwky9ijkbkttpdewgb3gnlnde7abv0q", "datacaches": [ "arweave.net" ], "fastfinalityindexes": [ "arweave.net" ] } ```\n\n* required',charsets:{}},{title:"Migrating to Turbo From Irys",frontmatter:{next:!1},regularPath:"/docs/turbo/migrating.html",relativePath:"docs/turbo/migrating.md",key:"v-45095440",path:"/docs/turbo/migrating.html",headers:[{level:2,title:"Overview",slug:"overview",normalizedTitle:"overview",charIndex:247},{level:2,title:"Using Irys SDK with Turbo",slug:"using-irys-sdk-with-turbo",normalizedTitle:"using irys sdk with turbo",charIndex:582},{level:2,title:"Using Irys CLI with Turbo",slug:"using-irys-cli-with-turbo",normalizedTitle:"using irys cli with turbo",charIndex:1403},{level:2,title:"Differences",slug:"differences",normalizedTitle:"differences",charIndex:1825},{level:3,title:"Crypto Top Ups / Withdrawals",slug:"crypto-top-ups-withdrawals",normalizedTitle:"crypto top ups / withdrawals",charIndex:1841},{level:2,title:"Wallet Extensions and Providers",slug:"wallet-extensions-and-providers",normalizedTitle:"wallet extensions and providers",charIndex:2116},{level:2,title:"GraphQL",slug:"graphql",normalizedTitle:"graphql",charIndex:2441}],headersStr:"Overview Using Irys SDK with Turbo Using Irys CLI with Turbo Differences Crypto Top Ups / Withdrawals Wallet Extensions and Providers GraphQL",content:'# Migrating to Turbo From Irys\n\nIrys Version Management\n\nThis was tested using Irys SDK v0.1.1 Future versions of the Irys SDK, and by extension the Irys CLI, may introduce breaking changes. It is suggested that developers lock their version.\n\n\n# Overview\n\nIn the interest of maintaining robust and decentralized infrastructure throughout the Arweave community, it is important to provide options and alternatives to single points of potential failure. With this in mind, ArDrive Turbo provides an Irys-compatible API, allowing for simple migrations across services if desired.\n\n\n# Using Irys SDK with Turbo\n\nArDrive Turbo can be selected as the upload method for projects that currently use the Irys SDK by setting the url value to https://turbo.ardrive.io when instantiating the Irys instance:\n\n// import Irys as normal\nimport Irys from "@irys/sdk";\nimport fs from "fs";\n\n// load Arweave wallet\nconst wallet = JSON.parse(\n fs\n .readFileSync(\n "Keyfile.json",\n )\n .toString(),\n);\n\nconst init = async () => {\n const token = "arweave";\n const irys = new Irys({\n url: "https://turbo.ardrive.io", // URL of the node you want to connect to, https://turbo.ardrive.io will facilitate upload using ArDrive Turbo.\n token, // Token used for payment and signing\n key: wallet, // Arweave wallet\n });\n\n const receipt = await irys.upload("file/to/upload");\n console.log(receipt);\n}\n\n\n\n# Using Irys CLI with Turbo\n\nSelecting Turbo as the upload method using the Irys CLI is similarly simple. https://turbo.ardrive.io can be set as the target node when using the upload or upload-dir CLI commands with the -h flag:\n\nirys upload importantFile.pdf -h https://turbo.ardrive.io --tags superImportant needsPermanence\n\n\nirys upload-dir ./bigFolder -h https://turbo.ardrive.io \n\n\nOther flags may be used as normal\n\n\n# Differences\n\n\n# Crypto Top Ups / Withdrawals\n\nTurbo does not natively support block chains other than Arweave. This means that some features dealing with other chains, like topping up your Irys balance with other coins, or withdrawing from your Irys balance are not currently supported.\n\n\n# Wallet Extensions and Providers\n\nTurbo is not yet designed to interact with wallet extensions and providers that are not a part of the Arweave ecosystem. While the ArDrive Web App does support generating an Arweave wallet from an EVM wallet using Metamask, Turbo cannot facilitate uploading using an EVM wallet directly.\n\n\n# GraphQL\n\nProjects that do claim to allow uploading from non-arweave wallets actually accept payment on their front ends and handle the actual uploading using an Arweave wallet. As such, the owner of an upload will not match the non-arweave wallet address and the upload cannot be found by searching for it in GraphQL. This value can, however, be added as a tag on the upload and searched in that way.',normalizedContent:'# migrating to turbo from irys\n\nirys version management\n\nthis was tested using irys sdk v0.1.1 future versions of the irys sdk, and by extension the irys cli, may introduce breaking changes. it is suggested that developers lock their version.\n\n\n# overview\n\nin the interest of maintaining robust and decentralized infrastructure throughout the arweave community, it is important to provide options and alternatives to single points of potential failure. with this in mind, ardrive turbo provides an irys-compatible api, allowing for simple migrations across services if desired.\n\n\n# using irys sdk with turbo\n\nardrive turbo can be selected as the upload method for projects that currently use the irys sdk by setting the url value to https://turbo.ardrive.io when instantiating the irys instance:\n\n// import irys as normal\nimport irys from "@irys/sdk";\nimport fs from "fs";\n\n// load arweave wallet\nconst wallet = json.parse(\n fs\n .readfilesync(\n "keyfile.json",\n )\n .tostring(),\n);\n\nconst init = async () => {\n const token = "arweave";\n const irys = new irys({\n url: "https://turbo.ardrive.io", // url of the node you want to connect to, https://turbo.ardrive.io will facilitate upload using ardrive turbo.\n token, // token used for payment and signing\n key: wallet, // arweave wallet\n });\n\n const receipt = await irys.upload("file/to/upload");\n console.log(receipt);\n}\n\n\n\n# using irys cli with turbo\n\nselecting turbo as the upload method using the irys cli is similarly simple. https://turbo.ardrive.io can be set as the target node when using the upload or upload-dir cli commands with the -h flag:\n\nirys upload importantfile.pdf -h https://turbo.ardrive.io --tags superimportant needspermanence\n\n\nirys upload-dir ./bigfolder -h https://turbo.ardrive.io \n\n\nother flags may be used as normal\n\n\n# differences\n\n\n# crypto top ups / withdrawals\n\nturbo does not natively support block chains other than arweave. this means that some features dealing with other chains, like topping up your irys balance with other coins, or withdrawing from your irys balance are not currently supported.\n\n\n# wallet extensions and providers\n\nturbo is not yet designed to interact with wallet extensions and providers that are not a part of the arweave ecosystem. while the ardrive web app does support generating an arweave wallet from an evm wallet using metamask, turbo cannot facilitate uploading using an evm wallet directly.\n\n\n# graphql\n\nprojects that do claim to allow uploading from non-arweave wallets actually accept payment on their front ends and handle the actual uploading using an arweave wallet. as such, the owner of an upload will not match the non-arweave wallet address and the upload cannot be found by searching for it in graphql. this value can, however, be added as a tag on the upload and searched in that way.',charsets:{}},{title:"@ardriveapp/turbo-sdk πŸš€",frontmatter:{},regularPath:"/docs/turbo/turbo-sdk/",relativePath:"docs/turbo/turbo-sdk/index.md",key:"v-d297eaa6",path:"/docs/turbo/turbo-sdk/",headers:[{level:2,title:"Installation",slug:"installation",normalizedTitle:"installation",charIndex:213},{level:2,title:"Quick Start",slug:"quick-start",normalizedTitle:"quick start",charIndex:297},{level:2,title:"Usage",slug:"usage",normalizedTitle:"usage",charIndex:1751},{level:3,title:"Web",slug:"web",normalizedTitle:"web",charIndex:191},{level:3,title:"NodeJS",slug:"nodejs",normalizedTitle:"nodejs",charIndex:180},{level:3,title:"Typescript",slug:"typescript",normalizedTitle:"typescript",charIndex:3234},{level:2,title:"APIs",slug:"apis",normalizedTitle:"apis",charIndex:3604},{level:3,title:"TurboFactory",slug:"turbofactory",normalizedTitle:"turbofactory",charIndex:319},{level:3,title:"TurboUnauthenticatedClient",slug:"turbounauthenticatedclient",normalizedTitle:"turbounauthenticatedclient",charIndex:4036},{level:3,title:"TurboAuthenticatedClient",slug:"turboauthenticatedclient",normalizedTitle:"turboauthenticatedclient",charIndex:5091},{level:2,title:"Contributions",slug:"contributions",normalizedTitle:"contributions",charIndex:9430}],headersStr:"Installation Quick Start Usage Web NodeJS Typescript APIs TurboFactory TurboUnauthenticatedClient TurboAuthenticatedClient Contributions",content:"# @ardriveapp/turbo-sdk πŸš€\n\nWelcome to the @ardrive/turbo-sdk! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.\n\n\n# Installation\n\nnpm install @ardrive/turbo-sdk\n\n\nor\n\nyarn add @ardrive/turbo-sdk\n\n\n\n# Quick Start\n\nimport { TurboFactory } from '@ardrive/turbo-sdk';\n\n// load your JWK from a file or generate a new one\nconst jwk = fs.readFileSync('./my-jwk.json');\nconst address = arweave.wallets.jwkToAddress(jwk);\nconst turbo = TurboFactory.authenticated({ privateKey: jwk });\n\n// get the wallet balance\nconst { winc: balance } = await turbo.getBalance();\n\n// prep file for upload\nconst filePath = path.join(__dirname, './my-image.png');\nconst fileSize = fs.statSync(filePath).size;\n\n// get the cost of uploading the file\nconst [{ winc: fileSizeCost }] = await turbo.getUploadCosts({\n bytes: [fileSize],\n});\n\n// check if balance greater than upload cost\nif (balance < fileSizeCost) {\n const { url } = await turbo.createCheckoutSession({\n amount: fileSizeCost,\n owner: address,\n // add a promo code if you have one\n });\n // open the URL to top-up, continue when done\n open(url);\n return;\n}\n\n// upload the file\ntry {\n const { id, owner, dataCaches, fastFinalityIndexes } = await turbo.uploadFile(() => {\n fileStreamFactory => () => fs.createReadStream(filePath),\n fileSizeFactory => () => fileSize,\n });\n // upload complete!\n console.log('Successfully upload data item!', { id, owner, dataCaches, fastFinalityIndexes });\n} catch (error) {\n // upload failed\n console.error('Failed to upload data item!', error);\n} finally {\n const { winc: newBalance } = await turbo.getBalance();\n console.log('New balance:', newBalance);\n}\n\n\n\n# Usage\n\nThe SDK is provided in both CommonJS and ESM formats, and it's compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriate named exports provided by this SDK's package.json based on your project's configuration. Refer to the examples directory to see how to use the SDK in various environments.\n\n\n# Web\n\n# Bundlers (Webpack, Rollup, ESbuild, etc.)\n\nimport { TurboFactory } from '@ardrive/turbo-sdk';\n\nconst turbo = TurboFactory.unauthenticated();\nconst rates = await turbo.getFiatRates();\n\n\n# Browser\n\n\n + diff --git a/docs/arfs/data-model.html b/docs/arfs/data-model.html index a3612ad..dc38429 100644 --- a/docs/arfs/data-model.html +++ b/docs/arfs/data-model.html @@ -17,7 +17,7 @@ - + @@ -32,6 +32,6 @@ "author?": "John Doe" }

Enumerated field values (those which must adhere to certain values) are defined in the format "value 1 | value 2".

All UUIDs used for Entity-Ids are based on the Universally Unique Identifier (opens new window) standard.

There are no requirements to list ArFS tags in any specific order.

- + diff --git a/docs/arfs/entity-types.html b/docs/arfs/entity-types.html index e26140e..43f8ed4 100644 --- a/docs/arfs/entity-types.html +++ b/docs/arfs/entity-types.html @@ -17,7 +17,7 @@ - + @@ -152,6 +152,6 @@ ] }
Snapshot Transaction JSON data example

# Schema Diagrams

The following diagrams show complete examples of Drive, Folder, and File entity Schemas.

# Public Drive

Public Drive Schema

# Private Drive

Private Drive Schema
- + diff --git a/docs/arfs/index.html b/docs/arfs/index.html index 8b3bdc1..d95280a 100644 --- a/docs/arfs/index.html +++ b/docs/arfs/index.html @@ -17,11 +17,11 @@ - +

# ArFS Protocol: A Decentralized File System on Arweave

Arweave File System, or β€œArFS” is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on Arweave (opens new window)'s otherwise permanent, immutable data storage blockweave.

Due to Arweave's permanent, immutable and public nature traditional file system operations such as permissions, file/folder renaming and moving, and file updates cannot be done by simply updating the on-chain data model.

ArFS works around this by implementing a privacy and encryption pattern and defining an append-only transaction data model using tags within Arweave Transaction headers (opens new window).

# Key Features

# File Structure

ArFS organizes files and folders using a hierarchical structure. Files are stored as individual transactions on the Arweave blockchain, while folders are metadata that reference these file transactions.

# Metadata

Each file and folder has associated metadata, such as the name, type, size, and modification timestamp. ArFS leverages Arweave's tagging system to store this metadata in a standardized format, which allows for easy querying and organization.

# File Permissions

ArFS supports public and private file permissions. Public files can be accessed by anyone on the network, while private files are encrypted using the owner's private key, ensuring only they can decrypt and access the content.

# File Versioning

ArFS supports versioning of files, allowing users to store multiple versions of a file and access previous versions at any time. This is achieved by linking new file transactions to previous versions through the use of metadata tags.

# Data Deduplication

To minimize storage redundancy and costs, ArFS employs data deduplication techniques. If a user tries to store a file that already exists on the network, the protocol will simply create a new reference to the existing file instead of storing a duplicate copy.

# Search and Discovery

ArFS enables users to search and discover files based on their metadata, such as file names, types, and tags. This is made possible by indexing the metadata stored within the Arweave blockchain.

# Interoperability

ArFS is designed to be interoperable with other decentralized applications and services built on the Arweave network. This allows for seamless integration and collaboration between different applications and users.

# Getting Started

To start using ArFS, you'll need to familiarize yourself with the Arweave ecosystem, acquire AR tokens to cover storage costs, and choose a compatible client or library to interact with the ArFS protocol.

# ArFS Version History

Version Date Release Notes
0.10 August 2020 The brief, beta version that was in use during initial testing of ArDrive across Web (Dart) and legacy CLI (Typescript).
0.11 September 2020 Includes all of the major functionality supporting file systems on Arweave including new drives, folders, files, renames, moves and privacy.
0.12 December 2022 Added Snapshot entities to support quick synchronization of drive state.
0.13 August 2023 Added pins
0.14 January 2024 Added isHidden property to file and folder metadata to enable clients to "hide" content from end users.

# Resources

For more information, documentation, and community support, refer to the following resources:

- + diff --git a/docs/arfs/privacy.html b/docs/arfs/privacy.html index 7bdb92c..734343d 100644 --- a/docs/arfs/privacy.html +++ b/docs/arfs/privacy.html @@ -17,7 +17,7 @@ - + @@ -29,6 +29,6 @@ Cipher-IV?: "<12 byte initialization vector as Base64>"

Just like drives, private files must have the Content-Type tag set as application/octet-stream in both its metadata and data transactions:

Content-Type: "application/octet-stream"
 
- + diff --git a/docs/arfs/schema-diagrams.html b/docs/arfs/schema-diagrams.html index f14a37d..4b44901 100644 --- a/docs/arfs/schema-diagrams.html +++ b/docs/arfs/schema-diagrams.html @@ -17,11 +17,11 @@ - +

# Schema Diagrams

The following diagrams show complete examples of Drive, Folder, and File entity Schemas.

# Public Drive

Public Drive Schema

# Private Drive

Private Drive Schema

Arweave GQL Tag Byte Limit is restricted to 2048. There is no determined limit on Data JSON custom metadata, though more data results in a higher upload cost.

- + diff --git a/docs/arfs/usage/change/drives.html b/docs/arfs/usage/change/drives.html index 9a66590..23d341d 100644 --- a/docs/arfs/usage/change/drives.html +++ b/docs/arfs/usage/change/drives.html @@ -17,12 +17,12 @@ - +

# Drive Write Operations

# Rename Drives

  • A new root folder metadata transaction is created when a user wants to rename an existing drive.
  • The new root folder metadata transaction reuses the existing drive's Drive-Id and Folder-Id, and copies all of its old metadata values, except the drive's and folder's name field must be updated in its data JSON to the new drive name.
    • For private drives, new ciphers are generated for this new root folder metadata transaction.
  • The new root folder transaction must not have any Parent-Folder-Id since it is a root folder.
- + diff --git a/docs/arfs/usage/change/files.html b/docs/arfs/usage/change/files.html index fb8acd0..36068cf 100644 --- a/docs/arfs/usage/change/files.html +++ b/docs/arfs/usage/change/files.html @@ -17,7 +17,7 @@ - + @@ -25,6 +25,6 @@
  • File’s must not be allowed to be moved into a folder if a file exists in that folder with the same file name.
  • # Rename File

    Files can be renamed from one name to another.

    # Update File Version

    When a user adds a new file to a folder, and there is a file in that folder with the same name, then a new file version is created.

    # Hide or Unhide File

    Changing the value of isHidden in a file's metadata will change whether or not a client should display that file.

    - + diff --git a/docs/arfs/usage/change/folders.html b/docs/arfs/usage/change/folders.html index 30cda93..b6335b7 100644 --- a/docs/arfs/usage/change/folders.html +++ b/docs/arfs/usage/change/folders.html @@ -17,13 +17,13 @@ - +

    # Folder Write Operations

    # Move Folder

    Folders can be moved from one folder to another within the same Drive.

    • A new file metadata transaction is created when a user wants to move a folder into a different folder.
    • The new file metadata transaction reuses the existing folder’s Folder-Id and copies all of it’s old metadata values, but the file’s Parent-Folder-Id must be updated to the Folder-Id of the folder is was just moved to.
      • For private folders, new ciphers are generated for this new metadata transaction.
    • Folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.

    # Rename Folder

    Folders can be renamed from one name to another.

    • A new folder metadata transaction is created when a user wants to rename an existing folder.
    • The new folder metadata transaction reuses the existing folder’s Folder-Id and copies all of it’s old metadata values, but the folder’s name field in its Data JSON must be updated to the new folder name.
      • For private folders, new ciphers are generated for this new metadata transaction.
    • Folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.
    - + diff --git a/docs/arfs/usage/change/snapshots.html b/docs/arfs/usage/change/snapshots.html index 7d86851..af037a5 100644 --- a/docs/arfs/usage/change/snapshots.html +++ b/docs/arfs/usage/change/snapshots.html @@ -17,11 +17,11 @@ - +
    - + diff --git a/docs/arfs/usage/create/create-file.html b/docs/arfs/usage/create/create-file.html index 8c920e5..7ed4ff4 100644 --- a/docs/arfs/usage/create/create-file.html +++ b/docs/arfs/usage/create/create-file.html @@ -17,13 +17,13 @@ - +

    # Create File

    # New File Entity

    • A new file metadata transaction and a separate data transaction are created when a user wants to create a new file.
    • Files can only be created in existing drives, and must have a valid Drive-Id.
    • Files can only be created in existing parent folders, and must have a valid Parent-Folder-Id.
    • The new File Entity Data transaction must only specify the file’s mime type aka Content-Type.
    • The new file metadata transaction must generate a new UUIDv4 for the File-Id.
    • File metadata transactions must have Entity-Type: "file".
    • The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.
      • The client populates the File Entity Metadata Transaction Data JSON after creating the data transaction.
      • name The name of the file including extension.
      • size The size of the file on disk, in bytes as an integer.
      • lastModifiedDate The file’s last time of modification as reported by the user’s operating system, in milliseconds since Unix epoch.
      • dataTxId The Arweave transaction id of this File Entity’s Data Transaction.
      • dataContentType The mime time of this File Entity’s data must be determined by the client.
      • isHidden A boolean telling clients if they should display the file or not.
    • If the File is private:
      • Its Cipher tag must be filled out with the respective encryption algorithm (currently AES256-GCM) for both the Metadata and Data transactions.
      • Its Cipher-IV tag must be filled out with the generated Initialization Vector for both the Metadata and Data transactions. Each one has its own unique IV.
      • It must have the content type Content-Type: "application/octet-stream" for both the Metadata and Data transactions.
      • The ArFS client must encrypt the File Entity’s Data and Metadata JSON using their assigned Cipher and Cipher-IV
    - + diff --git a/docs/arfs/usage/create/create-folder.html b/docs/arfs/usage/create/create-folder.html index a6eb53d..d4e451c 100644 --- a/docs/arfs/usage/create/create-folder.html +++ b/docs/arfs/usage/create/create-folder.html @@ -17,12 +17,12 @@ - +

    # Create Folder

    # New Folder Entity

    Folders can be created to organize files.

    • A new Folder Entity Metadata is created when a user wants to create a new folder.
    • Folders can only be created in existing drives, and must have a valid Drive-Id.
    • Folders can only be created in existing parent folders, and must have a valid Parent-Folder-Id.
    • The new folder metadata transaction must generate a new UUIDv4 for the Folder-Id.
    • Folder Entity Metadata transactions must have Entity-Type: "folder".
    • The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.
    • The user defined folder name is added to the name property in the folder’s metadata transaction Data JSON.
    • Public folders must have the content type Content-Type: "<application/json>".
    • If the folder is private:
      • Its Cipher tag must be filled out with the respective encryption algorithm (currently AES256-GCM).
      • Its Cipher-IV tag must be filled out with the generated Initialization Vector for the private folder.
      • It must have the content type Content-Type: "application/octet-stream".
      • The ArFS client must encrypt the Folder entity’s metadata JSON using the assigned Cipher and Cipher-IV.
    - + diff --git a/docs/arfs/usage/create/create-snapshot.html b/docs/arfs/usage/create/create-snapshot.html index 926ee78..84f09ab 100644 --- a/docs/arfs/usage/create/create-snapshot.html +++ b/docs/arfs/usage/create/create-snapshot.html @@ -17,11 +17,11 @@ - +
    - + diff --git a/docs/arfs/usage/create/index.html b/docs/arfs/usage/create/index.html index b50946e..fe12a4d 100644 --- a/docs/arfs/usage/create/index.html +++ b/docs/arfs/usage/create/index.html @@ -17,7 +17,7 @@ - + @@ -27,6 +27,6 @@
  • The Folder Entity's Folder-Id must match the rootFolderId previously created for the Drive Entity.
  • The Folder Entity's Drive-Id must match the Drive-Id previously created for the Drive Entity.
  • The Folder Entity must not include a Parent-Folder-Id tag.
  • Folder Entity metadata transactions must have Entity-Type: 'folder'.
  • The client gets the user's local time for the Unix-Time tag, represented as seconds since Unix Epoch.
  • Public folders must have the content type Content-Type: "application/json".
  • If the folder is private
  • - + diff --git a/docs/arfs/usage/extending-schemas.html b/docs/arfs/usage/extending-schemas.html index 062a96d..65bc05a 100644 --- a/docs/arfs/usage/extending-schemas.html +++ b/docs/arfs/usage/extending-schemas.html @@ -17,7 +17,7 @@ - + @@ -32,6 +32,6 @@ "albumSong": "<the title of the song>" }

    Additionally, the above extended Metadata fields could be added directly as a transaction tag as well, in order to support GraphQL queries.

    Arweave Transaction Headers can only fit a maximum of 2048 bytes total, so this must be taken into account by clients writing custom GQL tags.

    - + diff --git a/docs/arfs/usage/read/index.html b/docs/arfs/usage/read/index.html index 7206226..4d28c35 100644 --- a/docs/arfs/usage/read/index.html +++ b/docs/arfs/usage/read/index.html @@ -17,11 +17,11 @@ - +

    # Read ArFS Data

    Clients can perform read operations to create a timeline of entity write transactions which can then be replayed to construct the Drive state. This is done by querying an Arweave GraphQL index for the user’s respective transactions. Arweave GraphQL Guide (opens new window) can provide more information on how to use Arweave GraphQL. If no GraphQL index is available, drive state can only be generated by downloading and inspecting all transactions made by the user’s wallet

    This timeline of transactions should be grouped by the block number of each transaction. At every step of the timeline, the client can check if the entity was written by an authorized user. This also conveniently enables the client to surface a trusted entity version history to the user.

    To determine the owner of a Drive, clients must check for who created the first Drive Entity transaction using that Drive-Id. Until a trusted permissions or ACL system is put in place, any transaction in a drive created by any wallet other than the one who created the first Drive Entity transaction could be considered spam.

    The Unix-Time defined on each transaction should be reserved for tie-breaking same entity updates in the same block and should not be trusted as the source of truth for entity write ordering. This is unimportant for single owner drives but is crucial for multi-owner drives with updateable permissions (currently undefined in this spec) as a malicious user could fake the Unix-Time to modify the drive timeline for other users.

    • Drives that have been updated many times can have a long entity timeline which can be a performance bottleneck. To avoid this, clients can cache the drive state locally and sync updates to the file system by only querying for entities in blocks higher than the last time they checked.
    • Not checking for Drive Ownership could result in seeing incorrect drive state and GraphQL queries.

    # Folder/File Paths

    ArweaveFS does not store folder or file paths along with entities as these paths will need to be updated whenever the parent folder name changes which can require many updates for deeply nested file systems. Instead, folder/file paths are left for the client to generate from the folder/file names.

    # Folder View Queries

    Clients that want to provide users with a quick view of a single folder can simply query for an entity timeline for a particular folder by its id. Clients with multi-owner permissions will additionally have to query for the folder's parent drive entity for permission based filtering of the timeline.

    - + diff --git a/docs/cli/all-commands.html b/docs/cli/all-commands.html index 779fa07..710b6d8 100644 --- a/docs/cli/all-commands.html +++ b/docs/cli/all-commands.html @@ -17,7 +17,7 @@ - + @@ -88,6 +88,6 @@ # Learn more about a command: ardrive <command> --help
    - + diff --git a/docs/cli/getting-help.html b/docs/cli/getting-help.html index bfa1803..b3eb6bd 100644 --- a/docs/cli/getting-help.html +++ b/docs/cli/getting-help.html @@ -17,11 +17,11 @@ - +
    - + diff --git a/docs/cli/getting-started.html b/docs/cli/getting-started.html index d61ca98..1a6ea90 100644 --- a/docs/cli/getting-started.html +++ b/docs/cli/getting-started.html @@ -17,7 +17,7 @@ - + @@ -44,6 +44,6 @@ # then invoke the CLI from anywhere on your system: ardrive

    To ensure your environment is compatible, we also recommend the following VSCode extensions:

    # Limitations

    Number of files in a bulk upload: Theoretically unlimited
    Max individual file size: 2GB (Node.js limitation)
    Max file name length: 255 bytes
    Max ANS-104 bundled transaction size: 500 MiB per bundle. App will handle creating multiple bundles.
    Max ANS-104 data item counts per bundled transaction: 250 Files per bundle (500 Data Items).

    - + diff --git a/docs/cli/index.html b/docs/cli/index.html index 9d96017..e9b1627 100644 --- a/docs/cli/index.html +++ b/docs/cli/index.html @@ -17,7 +17,7 @@ - + @@ -80,6 +80,6 @@ } }

    This project is in a state of active development. Use at your own risk!

    # ArDrive

    ArDrive (opens new window) is a permanent storage platform whose applications and core libraries (opens new window) offer hierarchical organization, privacy via complete end-to-end encryption, flexibility, extensibility, and access control over your most valuable data, all made possible by its innovative core technology, the Arweave File System (ArFS) Protocol (opens new window).

    # ArFS

    ArFS (opens new window) is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on Arweave (opens new window)'s otherwise permanent, immutable data storage blockweave.

    # Data Portability

    Data uploaded via the ArDrive CLI, once indexed by Arweave's Gateways and sufficiently seeded across enough nodes on the network, can be accessed via all other ArDrive applications including the ArDrive Web application (opens new window) at https://app.ardrive.io.

    All transactions successfully executed by ArDrive can always be inspected in the Viewblock blockchain explorer (opens new window).

    # Intended Audience

    This tool is intended for use by:

    For deeper integrations with the ArDrive (opens new window) platform, consider using the ArDrive Core (opens new window) (Node) library's configurable and intuitive class interfaces directly within your application.

    - + diff --git a/docs/cli/using-the-cli.html b/docs/cli/using-the-cli.html index 453fc68..7ac2779 100644 --- a/docs/cli/using-the-cli.html +++ b/docs/cli/using-the-cli.html @@ -17,7 +17,7 @@ - + @@ -473,6 +473,6 @@

    # Persistent Caching of ArFS Entity Metadata

    To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:

    Windows: <os.homedir()>/ardrive-caches/metadata
     Non-Windows: <os.homedir()>/.ardrive/caches/metadata
     

    The XDG_CACHE_HOME environment variable is honored, where applicable, and will be used in place of os.homedir() in the scenarios described above.

    Metadata cache logging to stderr can be enabled by setting the ARDRIVE_CACHE_LOG environment variable to 1.

    Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.

    The cache can be manually cleared safely at any time that any integrating app is not in operation.

    - + diff --git a/docs/core-sdk.html b/docs/core-sdk.html index aa30962..5849a67 100644 --- a/docs/core-sdk.html +++ b/docs/core-sdk.html @@ -17,7 +17,7 @@ - + @@ -140,6 +140,6 @@ } );
    - + diff --git a/docs/index.html b/docs/index.html index c1aed44..0d52eed 100644 --- a/docs/index.html +++ b/docs/index.html @@ -17,11 +17,11 @@ - +

    # placeholder

    Exercitation proident duis qui est veniam duis ullamco proident et veniam.

    - + diff --git a/docs/misc/deploy/deploy.html b/docs/misc/deploy/deploy.html index 58f833c..0f5abdb 100644 --- a/docs/misc/deploy/deploy.html +++ b/docs/misc/deploy/deploy.html @@ -17,11 +17,11 @@ - +

    # Deploying your dApp

    # Overview

    This guide will outline the steps needed to deploy your dApp onto the Arweave blockchain using the ArDrive web app. It assumes you have already prepared your dApp to use hash routing and relative file paths, and built static files for any dApp in a language or framework that requires it (like React).

    # Deploying

    # Step 1: Log into ArDrive

    Go to the ArDrive web app (opens new window) and log in using the method of your choosing. If you don't already have an account, you will need to follow the instructions to set one up.

    # Step 2: Select or Create a Drive

    Once logged in, navigate to the drive where you want your project to be hosted. If you haven't created a drive yet, or if you want a new one specifically for this project, click the big red "New" button at the top left and create a new drive. Remember, the drive needs to be set to public for your dApp to be accessible to others.

    # Step 3: Upload your project

    With your drive selected, click the big red "New" button again, but this time, select "Upload Folder". Navigate to your project's root directory, or the built directory if required, and select it. This will upload the entire directory, maintaining your project's file structure.

    # Step 4: Confirm Upload

    You'll be given a chance to review the upload and the associated cost. If everything looks right, click "Confirm". Remember, uploading to Arweave isnt free, but the cost is usually quite small and the benefits of having your dApp hosted on the permaweb are significant.

    # Step 5: Create the Manifest

    While ArDrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on Arweave. The manifest acts as a map to all the files your dApp needs to function. After you confirm your upload, navigate into your newly created folder by double clicking on it. Click the big red "New" button again and select "Create manifest". You'll be prompted to name the manifest and choose where to save it. Be sure to save it inside the folder you just created.

    # Step 6: Get the Data TX ID

    Once the manifest is created, click on it to expand its details. On the bottom right, there's a line labeled "Data TX ID". This is the unique identifier for your uploaded dApp on Arweave. Copy this value.

    # Step 7: View and Share your dApp

    Your dApp is now available on the permaweb forever! Append the Data TX ID you just copied to the end of an Arweave gateway URL, like https://arweave.net/ . It might take a few minutes for all of your files to finish propagating through the network, but once they do your dApp will be accessible to anyone, anywhere, at any time.

    # Updating your dApp

    Files uploaded to Arweave are permanent and immutable. They cannot be changed. However, the Arweave File System (ArFS) protocol used (and created) by ArDrive lets you "replace" them with new versions while still being able to access the old ones. You can do this with entire dApps as well. The old files won't be displayed in the ArDrive web app unless you click on a file to view its history.

    Once you have made changes to your dApp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. Follow all the same steps listed above for uploading your dApp. You will need to create a new manifest to correctly point to the updated files. Give it the same name as the old manifest in order to "replace" it. Creating the new manifest will generate a new TX ID used to view the updated dApp.

    The old version of the dApp will always be available to anyone who has the correct TX ID

    - + diff --git a/docs/misc/deploy/examples.html b/docs/misc/deploy/examples.html index 3ed2c28..5909d92 100644 --- a/docs/misc/deploy/examples.html +++ b/docs/misc/deploy/examples.html @@ -17,11 +17,11 @@ - +

    # Examples

    Below are some basic websites built with different languages or frameworks that provide more detailed information on how to configure your dApp for that framework. Each one has been deployed to Arweave itself to show that it functions correctly, and can be accessed through any Arweave gateway by using its TX ID. These are all very basic examples, but if you follow the principles explained, your dApp will function correctly when deployed to the permaweb no matter how big or complex it becomes.

    # Basic HTML

    A basic HTML website with a javascript script to facilitate hash routing:

    GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50 (opens new window)

    # React

    A React dApp created using Create-React-App:

    BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0 (opens new window)

    # Next

    A Nextjs dApp created using Create-Next-App:

    01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s (opens new window)

    # WordPress

    ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU (opens new window)

    - + diff --git a/docs/misc/deploy/index.html b/docs/misc/deploy/index.html index b608f94..310df97 100644 --- a/docs/misc/deploy/index.html +++ b/docs/misc/deploy/index.html @@ -17,11 +17,11 @@ - +

    # Preparing Your dApp

    To make sure dApps work correctly on the Arweave blockchain, they need to be set up in a specific manner. This is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. Your dApp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. This is done by ensuring the following:

    Failure to properly implement either will result in your dApp not working the way it should once it is deployed onto Arweave.

    - + diff --git a/docs/misc/deploy/paths.html b/docs/misc/deploy/paths.html index bc4a39c..98a9e0a 100644 --- a/docs/misc/deploy/paths.html +++ b/docs/misc/deploy/paths.html @@ -17,11 +17,11 @@ - +

    # File Paths

    # Overview

    File paths are needed to locate resources in your file system or on a server. There are two types of file paths: absolute and relative. Because there is no way to know exactly from where a user will access a dApp deployed on Arweave, all file paths used need to be relative.

    # Absolute Vs. Relative

    An absolute path is the full URL to a resource, starting from the root. For example, http://www.example.com/images/myImage.jpg is an absolute path. It points directly to the image no matter where the code referencing it is located.

    A relative path is a path relative to the current location. If you have an HTML file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path images/myImage.jpg to reference the image.

    # Why Relative Paths

    When deploying dApps on Arweave, relative paths are essential because:

    • Domain agnostic: Arweave permaweb dApps can be accessed from various gateways, not just one domain. Absolute paths tied to a specific domain will not work.
    • Decentralized: Arweave is a decentralized network. There is no root directory or server configuration to reference. All file paths must be relative to the file trying to find an asset, or your dApp wont be able to find it.

    # Identifying Relative and Absolute Paths

    The key difference between relative and absolute file paths is where they start from:

    • Absolute Paths start with a slash (/) or a full URL (including the protocol, such as http://). For example, /images/myImage.jpg or http://www.example.com/images/myImage.jpg are absolute paths.
    • Relative Paths do not start with a slash. They are relative to the current directory. For example, images/myImage.jpg or ../myImage.jpg are relative paths.

    You can navigate around the files of your project with relative paths by following these principles:

    • Same Directory: If the file you're trying to reference is in the same directory as the current file, you can just use the filename. For example, if index.html and about.html are in the same directory, you can link to about.html just using about.html.

    • Subdirectory: If the file is in a subdirectory, you can use the directory name followed by the filename. For example, images/myImage.jpg will point to the myImage.jpg file in the images subdirectory.

    • Parent Directory: If the file is in a parent directory, you can use ../ to go up one level. For example, ../index.html will point to index.html in the parent directory. You can use multiple ../ to go up multiple levels, like ../../index.html.

    - + diff --git a/docs/misc/deploy/routing.html b/docs/misc/deploy/routing.html index 44df84d..e29afc6 100644 --- a/docs/misc/deploy/routing.html +++ b/docs/misc/deploy/routing.html @@ -17,11 +17,11 @@ - +

    # Hash Routing

    # Overview

    Hash routing is a popular technique in single page applications (SPAs) where the site navigation is handled using JavaScript. The "hash" in hash routing refers to the hash symbol (#) inserted into the URL. The part of the URL after the hash symbol is used to determine which "page" to show.

    For example, if your URL is "http://www.example.com/#about", the part after the hash (about) would be used to show an app's "about" page.

    # Hash Routing Vs. History Routing

    Traditional web apps use history routing, where each unique URL represents a different source or asset contained in a server. The URL "http://www.example.com/about" would fetch the "about" page from the app's server and display it for a user. History routing requires a server be available to provide the correct files every time a user navigates around an app.

    In contrast, with hash routing, all navigation is handled by the client's browser, so no server is needed for navigation.

    # Why Hash Routing for dApps

    Hash routing is particularly useful for apps deployed on Arweave for several reasons:

    • Serverless: Arweave is a decentralized storage network. There's no server to process requests, so routing cannot be handled by a server.
    • Persistence: Once data is stored on Arweave, it can't be changed. Hash routing allows you to have "dynamic" content within this immutable structure.
    • Performance: With hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.
    - + diff --git a/docs/misc/ethareum/index.html b/docs/misc/ethareum/index.html index 6aafe80..95e25ee 100644 --- a/docs/misc/ethareum/index.html +++ b/docs/misc/ethareum/index.html @@ -17,11 +17,11 @@ - +

    # EthAReum

    # Overview

    EthAReum is a new key derivation protocol that enables the generation of private keys for an Arweave wallet using a signature from an Ethereum wallet. This allows users to create an Arweave wallet directly through an Ethereum wallet provider like MetaMask (opens new window).

    These generated private keys provide a fully functional Arweave wallet, equipped to perform all standard operations, including holding AR tokens and Turbo Credits, and uploading data to the Arweave network.

    Recommended Browser

    For optimal performance, it is recommended MetaMask users access ArDrive using the Chrome browser. While EthAReum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.

    # Password

    The EthAReum protocol incorporates a user-generated password in the process of deriving an Arweave wallet from an Ethereum wallet. This password provides an extra layer of security by contributing additional entropy to the wallet's derivation. It also serves as a critical verification step for wallet access.

    For instance, when creating a new account with ArDrive, users are required to set a password for their wallet. This password is then used for subsequent logins and for encrypting private uploads. The password established during the wallet derivation process on ArDrive will be the same password used for future logins.

    NOTE: The password used during the derivation of private keys is permanent and CAN NOT be changed or recovered by an administrator (ArDrive is a decentralized platform and has no account administration). It is crucial to keep this password secure.

    # Public Address

    The Public address of the generated Arweave wallet is derived from its public key. The public address of the generated wallet will be different from the public address of the Ethereum wallet used to generate it.

    The exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dApp you use for interacting with the protocol. With ArDrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.

    # Keyfile and Seed Phrase

    The primary method used in the Arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in Ethereum wallet providers. Seed phrases are supported though, so you will be able to obtain a seed phrase for your generated Arweave wallet and use it to import the wallet into other dApps or wallet providers in the Arweave ecosystem. Just be aware that not every dApp in the ecosystem has an interface that can facilitate this.

    A keyfile is a json file that contains a Json Web Key (JWK) which act as the private keys for a wallet. Always be sure to treat your keyfile with the same care as you would the private keys for an Ethereum wallet. Find out more about keyfiles from the Arweave Cookbook (opens new window).

    Similar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dApp you used to generate your wallet. With ArDrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.

    # Security

    EthAReum generates the private keys of an Arweave wallet using a signature from your Ethereum wallet, ensuring that control only extends in one direction. The EthAReum protocol does not access or control the Ethereum wallet used for generation, thereby safeguarding your Ethereum assets.

    However, it's important to be vigilant as some malicious dApps or websites may disguise a high-risk authorization transaction as a simple signature request. Always ensure that you only provide signatures to reputable and trusted dApps like ArDrive (opens new window).

    - + diff --git a/docs/misc/permasite.html b/docs/misc/permasite.html index be14beb..ab53942 100644 --- a/docs/misc/permasite.html +++ b/docs/misc/permasite.html @@ -17,11 +17,11 @@ - +

    # How to Save a Website Permanently

    # Overview

    ArDrive offers the ability to save working copies of static websites permanently on Arweave (opens new window). This means that websites made on WordPress, Wix, SquareSpace and other CMS platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.

    Resources like the Wayback Machine (opens new window) are useful to research the past life of old websites. But the Wayback Machine’s archives are not comprehensive and often only capture partial copies of historic sites. By leveraging the utility of Arweave manifests, ArDrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.

    The process to make a β€˜permasite’ takes 10 steps which are outlined below. Advanced users can accomplish similar results by using manifests within the ArDrive CLI.

    You can view a permasite version of this information at permasite.arweave.dev (opens new window)

    # 1. Download Static Site Files

    ArDrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:

    • Permanent sites will not enable backend interaction with your website’s CMS,
    • nor allow you to make further changes to the content of your site,
    • nor support dynamic functionality like contact forms and eCommerce.

    To generate your static site files, we recommend:

    # Windows Users

    WebCopy (opens new window) and HtTrack (opens new window) enable Windows users to download static copies of entire websites.

    # Mac Users

    Offline Pages Pro (opens new window) (Mac users only), which creates files that work well with this process. After saving your site with Offline Pages Pro, go to File > Export > Local Website to download the local static files.
    SiteSucker (opens new window) is another option for Mac users.

    # Command Line Utility

    Wget (opens new window) is a free tool that helps capture static versions of websites. While Wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. It offers a simple way to save your site's current look and feel as static files at no cost.

    # WordPress

    Simply Static (opens new window) is a plugin that generates static files for WordPress websites. Some users note that Simply Static fails to properly associate CSS and JS files with your static site, but others have had success with this free WordPress plugin.

    # 2. Create an Account on ArDrive

    Account creation is free as are uploads of small files (currently up to 500 KB). Remember that ArDrive empowers you to be in control of your data; no one else has your password but you. Therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.

    # 3. Create a New Public Drive

    Click on the red +New button and create a Drive. Name your Drive and set it as β€œPublic”. ArDrive also offers β€œPrivate” file storage; however, permanent websites must be public in order to maintain functionality.

    # 4. Top Up

    To pay for permanent storage on the Arweave network you must either purchase ArDrive Turbo credits with a credit card or (or the advanced option) ensure your wallet has $AR, the native token of the Arweave ecosystem. Most websites will cost less than $1 to save permanently. See current prices (opens new window)

    # 5. Upload Static Files

    Upload the static files to your new Public Drive. Offline Pages Pro will generate an index.html file that is separate from a large folder of assets (images, css, fonts, etc). Simply Static will add the index.html file to the rest of your assets. Either way, upload all the files you receive from your static site generator to your new Public Drive.

    # 6. Wait

    Permanence takes patience. Once static files have been uploaded, they need to be sent to the Arweave network before being assembled together. This process can take as little as 5 seconds (when using Turbo credits) or up to 30 minutes or more (when using $AR). Make sure to keep your browser tab open and do not refresh your browser while you wait.

    To check on the status of your files, you can click the refresh icon in the top right of ArDrive. You’ll know your file is ready when the light on the icon turns from yellow to green. (Pro Tip: some files uploaded with Turbo are ready before they are green.)

    # 7. Create a Manifest

    Manifests (opens new window) are specialΒ .jsonΒ files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. In other words, they are the secret sauce that brings a permasite together.

    Click on the red +New button and select Advanced > New Manifest. Select the location for your manifest, ensuring it is in the same place as your index.html file.

    Give your Manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ArDrive.

    # 8. Wait Again

    Now the manifest needs to be sent to the Arweave network. Again, this process can take just a few seconds or up to 30 minutes or more.

    After a bit, you can refresh your Drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.

    # 9. Preview the Manifest

    Got a green light? You’re ready to go. Click on your manifest file and you will see a panel of options appear on the right side of your screen. Click on the Preview icon in the top right and it will open a new tab with your permasite.

    If a website appears with a long, random-looking URL in the browser bar, then congrats, you made a permasite!

    Try clicking around and make sure all your pages are preserved. If they are not it could be a limitation of your static site generator or an issue with the manifest (see Notes below).

    # 10. Add a Redirect or Domain Masking

    You’ll notice that your permasite has a long, random-looking URL generated by Arweave. These long URLs are designed to remain for decades, but they also are not very memorable.

    Try redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. You can also acquire an ArNS name (opens new window) that enables you to create a custom, permanent name for your permasite.

    # Notes

    • There’s no delete button with Arweave. Once your permasite is up, it’s up forever. Make sure your content is something you want future humanity to have.

    • Only static sites can become permasites through the ArDrive web app. Advanced functionality is available for developers who use the ArDrive CLI (opens new window).

    • Links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.

    • Non-English characters in the URLs of your permasite can be problematic for ArDrive manifests, but non-English characters should work well on the permasite itself.

    # Other Use Cases

    Permasites can be used to archive web content before it disappears from the internet. Or they can be used to create working copies of websites before it a particular site is replaced by new versions.

    Manifests can also be used to make reliable perma-backups. Many web hosts offer good daily backups and some offer reliable offsite backups as well. Permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.

    # Example

    You can view a permasite version of this information at permasite.arweave.dev (opens new window)

    - + diff --git a/docs/misc/price-calculator.html b/docs/misc/price-calculator.html index 40acb6b..9b63e1f 100644 --- a/docs/misc/price-calculator.html +++ b/docs/misc/price-calculator.html @@ -17,7 +17,7 @@ - + @@ -34,6 +34,6 @@ Run with the --watch flag (yarn test -- --watch) to run in interactive watch mode.

    # yarn run:prod

    Builds a fresh snowpack production build to the build/ folder Then launches that copy with http-server-spa for local testing The build will be available for preview at: http://localhost:8080 (opens new window)

    - + diff --git a/docs/turbo/api/payment.html b/docs/turbo/api/payment.html index 6fe80ca..fdde23d 100644 --- a/docs/turbo/api/payment.html +++ b/docs/turbo/api/payment.html @@ -17,7 +17,7 @@ - + @@ -462,6 +462,6 @@ ] }

    * required

    - + diff --git a/docs/turbo/api/upload.html b/docs/turbo/api/upload.html index 8508cc9..11e85dd 100644 --- a/docs/turbo/api/upload.html +++ b/docs/turbo/api/upload.html @@ -17,7 +17,7 @@ - + @@ -65,6 +65,6 @@ } ```

    * required

    - + diff --git a/docs/turbo/migrating.html b/docs/turbo/migrating.html index 01b2647..7d00cad 100644 --- a/docs/turbo/migrating.html +++ b/docs/turbo/migrating.html @@ -17,7 +17,7 @@ - + @@ -48,6 +48,6 @@

    # Using Irys CLI with Turbo

    Selecting Turbo as the upload method using the Irys CLI is similarly simple. https://turbo.ardrive.io can be set as the target node when using the upload or upload-dir CLI commands with the -h flag:

    irys upload importantFile.pdf -h https://turbo.ardrive.io --tags superImportant needsPermanence
     
    irys upload-dir ./bigFolder -h https://turbo.ardrive.io 
     

    Other flags may be used as normal

    # Differences

    # Crypto Top Ups / Withdrawals

    Turbo does not natively support block chains other than Arweave. This means that some features dealing with other chains, like topping up your Irys balance with other coins, or withdrawing from your Irys balance are not currently supported.

    # Wallet Extensions and Providers

    Turbo is not yet designed to interact with wallet extensions and providers that are not a part of the Arweave ecosystem. While the ArDrive Web App does support generating an Arweave wallet from an EVM wallet using Metamask, Turbo cannot facilitate uploading using an EVM wallet directly.

    # GraphQL

    Projects that do claim to allow uploading from non-arweave wallets actually accept payment on their front ends and handle the actual uploading using an Arweave wallet. As such, the owner of an upload will not match the non-arweave wallet address and the upload cannot be found by searching for it in GraphQL. This value can, however, be added as a tag on the upload and searched in that way.

    - + diff --git a/docs/turbo/turbo-sdk/index.html b/docs/turbo/turbo-sdk/index.html index ab6f987..14816b5 100644 --- a/docs/turbo/turbo-sdk/index.html +++ b/docs/turbo/turbo-sdk/index.html @@ -17,11 +17,11 @@ - + -

    # @ardriveapp/turbo-sdk πŸš€

    Welcome to the @ardrive/turbo-sdk! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.

    # Installation

    npm install @ardrive/turbo-sdk
    +    

    # @ardriveapp/turbo-sdk πŸš€

    Welcome to the @ardrive/turbo-sdk! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.

    # Installation

    npm install @ardrive/turbo-sdk
     

    or

    yarn add @ardrive/turbo-sdk
     

    # Quick Start

    import { TurboFactory } from '@ardrive/turbo-sdk';
     
    @@ -69,47 +69,186 @@
       const { winc: newBalance } = await turbo.getBalance();
       console.log('New balance:', newBalance);
     }
    -

    # Usage

    The SDK is provided in both CommonJS and ESM formats, and it's compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriate named exports provided by this SDK's package.json (opens new window) based on your project's configuration. Refer to the examples (opens new window) directory to see how to use the SDK in various environments.

    # Web

    # Bundlers (Webpack, Rollup, ESbuild, etc.)

    import { TurboFactory } from '@ardrive/turbo-sdk';
    +

    # Usage

    The SDK is provided in both CommonJS and ESM formats, and it's compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriate named exports provided by this SDK's [package.json] based on your project's configuration. Refer to the [examples] directory to see how to use the SDK in various environments.

    # Web

    # Bundlers (Webpack, Rollup, ESbuild, etc.)

    import { TurboFactory } from "@ardrive/turbo-sdk";
     
     const turbo = TurboFactory.unauthenticated();
     const rates = await turbo.getFiatRates();
    -

    # Browser

    
    -<script type="module">
    -  import { TurboFactory } from 'https://unpkg.com/@ardrive/turbo-sdk';
    -
    +

    # Browser

    <script type="module">
    +  import { TurboFactory } from "https://unpkg.com/@ardrive/turbo-sdk";
     
       const turbo = TurboFactory.unauthenticated();
       const rates = await turbo.getFiatRates();
     </script>
     

    # NodeJS

    # CommonJS

    Project's package.json:

    {
    -  "type": "commonjs" // or absent
    +  "type": "commonjs",
    +  "scripts": {
    +    "test": "ts-node ./index.ts"
    +  },
    +  "dependencies": {
    +    "@ardrive/turbo-sdk": "latest",
    +    "arweave": "^1.14.4",
    +    "typescript": "^5.4.2"
    +  },
    +  "devDependencies": {
    +    "ts-node": "^10.9.2"
    +  }
     }
     

    Project's tsconfig.json:

    {
       "compilerOptions": {
         "module": "CommonJS",
    -    "moduleResolution": "Node",
    -    "skipLibCheck": true
    -  }
    +    "moduleResolution": "node",
    +    "target": "ES2021",
    +    "esModuleInterop": true
    +  },
    +  "include": ["./index.ts"],
    +  "exclude": ["node_modules"]
     }
    -

    Usage:

    const { TurboFactory } = require('@ardrive/turbo-sdk');
    +

    Usage:

    import {
    +  TurboFactory,
    +  USD,
    +  WinstonToTokenAmount,
    +  developmentTurboConfiguration,
    +} from "@ardrive/turbo-sdk";
    +import Arweave from "arweave";
    +import fs from "fs";
    +import path from "path";
     
    -const turbo = TurboFactory.unauthenticated();
    -const rates = await turbo.getFiatRates();
    +(async () => {
    +  /**
    +   * Generate a key from the arweave wallet.
    +   */
    +  const arweave = new Arweave({});
    +  const jwk = await arweave.wallets.generate();
    +  /**
    +   * Use the arweave key to create an authenticated turbo client
    +   */
    +  const turboAuthClient = TurboFactory.authenticated({
    +    privateKey: jwk,
    +    ...developmentTurboConfiguration,
    +  });
    +
    +  /**
    +   * Fetch the balance for the private key.
    +   */
    +  const balance = await turboAuthClient.getBalance();
    +  console.log("Balance:", balance);
    +
    +  /**
    +   * Fetch the estimated amount of winc returned for 10 USD (1000 cents).
    +   */
    +  const estimatedWinc = await turboAuthClient.getWincForFiat({
    +    amount: USD(10),
    +  });
    +  console.log("10 USD to winc:", estimatedWinc);
    +
    +  /**
    +   * Post local files to the Turbo service.
    +   */
    +  console.log("Posting raw file to Turbo service...");
    +  const filePath = path.join(__dirname, "../../files/1KB_file");
    +  const fileSize = fs.statSync(filePath).size;
    +  const uploadResult = await turboAuthClient.uploadFile({
    +    fileStreamFactory: () => fs.createReadStream(filePath),
    +    fileSizeFactory: () => fileSize,
    +    signal: AbortSignal.timeout(10_000), // cancel the upload after 10 seconds
    +  });
    +  console.log(JSON.stringify(uploadResult, null, 2));
    +
    +  /**
    +   * Tops up a wallet with Credits using tokens.
    +   * Default token is AR, using Winston as the unit.
    +   */
    +  const topUpResult = await turboAuthClient.topUpWithTokens({
    +    tokenAmount: WinstonToTokenAmount(100_000_000), // 0.0001 AR
    +  });
    +  console.log(JSON.stringify(topUpResult, null, 2));
    +})();
     

    # ESM

    Project's package.json:

    {
    -  "type": "module"
    +  "type": "module",
    +  "scripts": {
    +    "test": "ts-node ./index.ts"
    +  },
    +  "dependencies": {
    +    "@ardrive/turbo-sdk": "latest",
    +    "arweave": "^1.14.4"
    +  },
    +  "devDependencies": {
    +    "ts-node": "^10.9.2"
    +  }
     }
     

    Project's tsconfig.json:

    {
       "compilerOptions": {
         "module": "NodeNext",
         "moduleResolution": "NodeNext",
    -    "skipLibCheck": true
    +    "target": "ESNext"
    +  },
    +  "include": ["./index.ts"],
    +  "exclude": ["node_modules"],
    +  "ts-node": {
    +    "esm": true
       }
     }
    -

    Usage:

    import { TurboFactory } from '@ardrive/turbo-sdk/node';
    +

    Usage:

    // or use @ardrive/turbo-sdk/web depending on your environment
    +import {
    +  TurboFactory,
    +  USD,
    +  WinstonToTokenAmount,
    +  developmentTurboConfiguration,
    +} from "@ardrive/turbo-sdk/node";
    +import Arweave from "arweave";
    +import fs from "fs";
     
    -const turbo = TurboFactory.unauthenticated();
    -const rates = await turbo.getFiatRates();
    -

    # Typescript

    The SDK provides TypeScript types. When you import the SDK in a TypeScript project:

    import { TurboFactory } from '@ardrive/turbo-sdk/web';
    +(async () => {
    +  /**
    +   * Generate a key from the arweave wallet.
    +   */
    +  const arweave = new Arweave({});
    +  const jwk = await arweave.wallets.generate();
    +  /**
    +   * Use the arweave key to create an authenticated turbo client
    +   */
    +  const turboAuthClient = TurboFactory.authenticated({
    +    privateKey: jwk,
    +    ...developmentTurboConfiguration,
    +  });
    +
    +  /**
    +   * Fetch the balance for the private key.
    +   */
    +  const balance = await turboAuthClient.getBalance();
    +  console.log("Balance:", balance);
    +
    +  /**
    +   * Fetch the estimated amount of winc returned for 10 USD (1000 cents).
    +   */
    +  const estimatedWinc = await turboAuthClient.getWincForFiat({
    +    amount: USD(10),
    +  });
    +  console.log("10 USD to winc:", estimatedWinc);
    +
    +  /**
    +   * Post local files to the Turbo service.
    +   */
    +  console.log("Posting raw file to Turbo service...");
    +  const filePath = new URL("../../files/1KB_file", import.meta.url).pathname;
    +  const fileSize = fs.statSync(filePath).size;
    +  const uploadResult = await turboAuthClient.uploadFile({
    +    fileStreamFactory: () => fs.createReadStream(filePath),
    +    fileSizeFactory: () => fileSize,
    +    signal: AbortSignal.timeout(10_000), // cancel the upload after 10 seconds
    +  });
    +  console.log(JSON.stringify(uploadResult, null, 2));
    +
    +  /**
    +   * Tops up a wallet with Credits using tokens.
    +   * Default token is AR, using Winston as the unit.
    +   */
    +  const topUpResult = await turboAuthClient.topUpWithTokens({
    +    tokenAmount: WinstonToTokenAmount(100_000_000), // 0.0001 AR
    +  });
    +  console.log(JSON.stringify(topUpResult, null, 2));
    +})();
    +

    # Typescript

    The SDK provides TypeScript types. When you import the SDK in a TypeScript project:

    import { TurboFactory } from "@ardrive/turbo-sdk/web";
     
     // or '@ardrive/turbo-sdk/node' for Node.js projects
     

    Types are exported from ./lib/types/[node/web]/index.d.ts and should be automatically recognized, offering benefits such as type-checking and autocompletion.

    # APIs

    # TurboFactory

    • unauthenticated() - Creates an instance of a client that accesses Turbo's unauthenticated services.

      const turbo = TurboFactory.unauthenticated();
      @@ -117,23 +256,23 @@
       const turbo = TurboFactory.authenticated({ privateKey: jwk });
       

    # TurboUnauthenticatedClient

    • getSupportedCurrencies() - Returns the list of currencies supported by the Turbo Payment Service for topping up a user balance of AR Credits (measured in Winston Credits, or winc).

      const currencies = await turbo.getSupportedCurrencies();
       
    • getSupportedCountries() - Returns the list of countries supported by the Turbo Payment Service's top up workflow.

      const countries = await turbo.getSupportedCountries();
      -
    • getFiatToAR({ currency }) - Returns the current raw fiat to AR conversion rate for a specific currency as reported by third-party pricing oracles.

      const fiatToAR = await turbo.getFiatToAR({ currency: 'USD' });
      +
    • getFiatToAR({ currency }) - Returns the current raw fiat to AR conversion rate for a specific currency as reported by third-party pricing oracles.

      const fiatToAR = await turbo.getFiatToAR({ currency: "USD" });
       
    • getFiatRates() - Returns the current fiat rates for 1 GiB of data for supported currencies, including all top-up adjustments and fees.

      const rates = await turbo.getFiatRates();
      -
    • getWincForFiat({ amount }) - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount. To leverage promo codes, see TurboAuthenticatedClient.

      const { winc, paymentAmount, quotedPaymentAmount, adjustments } =
      +
    • getWincForFiat({ amount }) - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount. To leverage promo codes, see [TurboAuthenticatedClient].

      const { winc, paymentAmount, quotedPaymentAmount, adjustments } =
         await turbo.getWincForFiat({
           amount: USD(100),
           // promo codes require an authenticated client
         });
       
    • getUploadCosts({ bytes }) - Returns the estimated cost in Winston Credits for the provided file sizes, including all upload adjustments and fees.

      const [uploadCostForFile] = await turbo.getUploadCosts({ bytes: [1024] });
       const { winc, adjustments } = uploadCostForFile;
      -
    • uploadSignedDataItem({ dataItemStreamFactory, dataItemSizeFactory, signal }) - Uploads a signed data item. The provided dataItemStreamFactory should produce a NEW signed data item stream each time is it invoked. The dataItemSizeFactory is a function that returns the size of the file. The signal is an optional AbortSignal (opens new window) that can be used to cancel the upload or timeout the request.

      const filePath = path.join(__dirname, './my-signed-data-item');
      +
    • uploadSignedDataItem({ dataItemStreamFactory, dataItemSizeFactory, signal }) - Uploads a signed data item. The provided dataItemStreamFactory should produce a NEW signed data item stream each time is it invoked. The dataItemSizeFactory is a function that returns the size of the file. The signal is an optional [AbortSignal] that can be used to cancel the upload or timeout the request.

      const filePath = path.join(__dirname, "./my-signed-data-item");
       const dataItemSize = fs.statSync(filePath).size;
       const uploadResponse = await turbo.uploadSignedDataItem({
         dataItemStreamFactory: () => fs.createReadStream(filePath),
         dataItemSizeFactory: () => dataItemSize,
         signal: AbortSignal.timeout(10_000), // cancel the upload after 10 seconds
       });
      -
    • createCheckoutSession({ amount, owner }) - Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner. The returned URL can be opened in the browser, all payments are processed by Stripe. To leverage promo codes, see TurboAuthenticatedClient.

      const { url, winc, paymentAmount, quotedPaymentAmount, adjustments } =
      +
    • createCheckoutSession({ amount, owner }) - Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner. The returned URL can be opened in the browser, all payments are processed by Stripe. To leverage promo codes, see [TurboAuthenticatedClient].

      const { url, winc, paymentAmount, quotedPaymentAmount, adjustments } =
         await turbo.createCheckoutSession({
           amount: USD(10.0), // $10.00 USD
           owner: publicArweaveAddress,
      @@ -141,48 +280,72 @@
         });
       
       // Open checkout session in a browser
      -if (process.platform === 'darwin') {
      +if (process.platform === "darwin") {
         // macOS
         exec(`open ${url}`);
      -} else if (process.platform === 'win32') {
      +} else if (process.platform === "win32") {
         // Windows
         exec(`start "" "${url}"`, { shell: true });
       } else {
         // Linux/Unix
         open(url);
       }
      -

    # TurboAuthenticatedClient

    • getBalance() - Issues a signed request to get the credit balance of a wallet measured in AR (measured in Winston Credits, or winc).

      const { winc: balance } = await turbo.getBalance();
      -
    • getWincForFiat({ amount, promoCodes }) - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount, and optional promo codes.

      const { winc, paymentAmount, quotedPaymentAmount, adjustments } =
      +
    • submitFundTransaction({ txId}) - Submits the transaction ID of a funding transaction to Turbo Payment Service for top up processing. The txId is the transaction ID of the transaction to be submitted.

      • Note: use this API if you've already executed your token transfer to the Turbo wallet. Otherwise, consider using topUpWithTokens to execute a new token transfer to the Turbo wallet and submit its resulting transaction ID for top up processing all in one go.
      const turbo = TurboFactory.unauthenticated(); // defaults to arweave token type
      +const { status, id, ...fundResult } = await turbo.submitFundTransaction({
      +  txId: "my-valid-arweave-fund-transaction-id",
      +});
      +
    
    +### TurboAuthenticatedClient
    +
    +- `getBalance()` - Issues a signed request to get the credit balance of a wallet measured in AR (measured in Winston Credits, or winc).
    +
    +  ```typescript
    +  const { winc: balance } = await turbo.getBalance();
    +
    • getWincForFiat({ amount, promoCodes }) - Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount, and optional promo codes.

      const { winc, paymentAmount, quotedPaymentAmount, adjustments } =
         await turbo.getWincForFiat({
           amount: USD(100),
      -    promoCodes: ['MY_PROMO_CODE'], // promo codes require an authenticated client
      +    promoCodes: ["MY_PROMO_CODE"], // promo codes require an authenticated client
         });
       
    • createCheckoutSession({ amount, owner, promoCodes }) - Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner, and optional promo codes. The returned URL can be opened in the browser, all payments are processed by Stripe. Promo codes require an authenticated client.

      const { url, winc, paymentAmount, quotedPaymentAmount, adjustments } =
         await turbo.createCheckoutSession({
           amount: USD(10.0), // $10.00 USD
           owner: publicArweaveAddress,
      -    promoCodes: ['MY_PROMO_CODE'], // promo codes require an authenticated client
      +    promoCodes: ["MY_PROMO_CODE"], // promo codes require an authenticated client
         });
       
       // Open checkout session in a browser
      -if (process.platform === 'darwin') {
      +if (process.platform === "darwin") {
         // macOS
         exec(`open ${url}`);
      -} else if (process.platform === 'win32') {
      +} else if (process.platform === "win32") {
         // Windows
         exec(`start "" "${url}"`, { shell: true });
       } else {
         // Linux/Unix
         open(url);
       }
      -
    • uploadFile({ fileStreamFactory, fileSizeFactory, signal }) - Signs and uploads a raw file. The provided fileStreamFactory should produce a NEW file data stream each time is it invoked. The fileSizeFactory is a function that returns the size of the file. The signal is an optional AbortSignal (opens new window) that can be used to cancel the upload or timeout the request.

      const filePath = path.join(__dirname, './my-unsigned-file.txt');
      +
    • uploadFile({ fileStreamFactory, fileSizeFactory, signal }) - Signs and uploads a raw file. The provided fileStreamFactory should produce a NEW file data stream each time is it invoked. The fileSizeFactory is a function that returns the size of the file. The signal is an optional [AbortSignal] that can be used to cancel the upload or timeout the request.

      const filePath = path.join(__dirname, "./my-unsigned-file.txt");
       const fileSize = fs.stateSync(filePath).size;
       const uploadResult = await turbo.uploadFile({
         fileStreamFactory: () => fs.createReadStream(filePath),
         fileSizeFactory: () => fileSize,
         // no timeout or AbortSignal provided
       });
      -

    # Contributions

    If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are both welcome and encouraged.

    - +
  • topUpWithTokens({ tokenAmount, feeMultiplier }) - Tops up the connected wallet with Credits by submitting a payment transaction for the token amount to the Turbo wallet and then submitting that transaction ID to Turbo Payment Service for top up processing.

    • The tokenAmount is the amount of tokens in the token type's smallest unit value (e.g: Winston for arweave token type) to fund the wallet with. +
      • Note: As of release 1.5.0, only AR tokens are supported with topUpWithTokens.
    • The feeMultiplier (optional) is the multiplier to apply to the reward for the transaction to modify its chances of being mined. Credits will be added to the wallet balance after the transaction is confirmed on the given blockchain. Defaults to 1.0, meaning no multiplier.
    const turbo = TurboFactory.authenticated({ signer, token: "arweave" });
    +
  • const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({ +tokenAmount: WinstonToTokenAmount(100_000_000), // 0.0001 AR +feeMultiplier: 1.1, // 10% increase in reward for improved mining chances +});

    
    +## Contributions
    +
    +If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are both welcome and encouraged.
    +
    +[package.json]: https://github.com/ardriveapp/turbo-sdk/blob/main/package.json
    +[examples]: https://github.com/ardriveapp/turbo-sdk/tree/main/examples
    +[TurboAuthenticatedClient]: #turboauthenticatedclient
    +[AbortSignal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
    +
    + diff --git a/docs/turbo/turbo-sdk/release-notes.html b/docs/turbo/turbo-sdk/release-notes.html index 0915c00..3b4fcd6 100644 --- a/docs/turbo/turbo-sdk/release-notes.html +++ b/docs/turbo/turbo-sdk/release-notes.html @@ -17,11 +17,11 @@ - + -

    # Turbo SDK Release Notes

    # Overview

    Welcome to the documentation page for the Turbo SDK release notes. Here, you will find detailed information about each version of the Turbo SDK, including the enhancements, bug fixes, and any other changes introduced in every release. This page serves as a comprehensive resource to keep you informed about the latest developments and updates in the Turbo SDK. For those interested in exploring the source code, each version's code is readily accessible at our GitHub repository: Turbo SDK Releases (opens new window). Stay updated with the continuous improvements and advancements in the Turbo SDK by referring to this page for all release-related information.

    # Releases

    # V1.4.1

    (2024-01-30)

    Bug Fixes

    • checkout session: correct query param, change type, add coverage

    # V1.4.0

    (2024-01-30)

    Features

    • ui mode: support query param for checkout session ui mode

    # V1.3.0

    (2024-01-03)

    Bug Fixes

    • web: ensure we have the public key for arconnect wallets when signing data
    • web: remove reference to node:crypto in websigner, use signer to signer to sign header

    Features

    • signer: allow an optional signer to be passed instead of JWK for signing data items

    # V1.2.0

    (2023-12-15)

    Features

    • data item opts: init tags anchor and target support PE-5035

    # V1.1.1

    (2023-12-14)

    Bug Fixes

    • exports: use bundled export to avoid issue with polyfilled features needed for web
    • exports: web exports reference an invalid build path
    • polyfills: update esbuild script to include crypto polyfill

    # V1.1.0

    (2023-11-10)

    Bug Fixes

    • axios: set maxRedirects to 0 on our axios instances

    Features

    • logger: add configurable global logger

    # V1.0.2

    (2023-11-03)

    Bug Fixes

    • upload: update the default upload service URL

    # V1.0.1

    (2023-09-27)

    Bug Fixes

    • headers: add default headers for all HTTP requests
    • release: use script that updates built version.js files
    • version: update version.js to proper version on build and commit it back to git after a release

    # V1.0.0

    (2023-09-26)

    Bug Fixes

    • add command that removes type module from package.json
    • add command that removes type module from package.json
    • add main import and allow wildcard imports
    • add module to package.json and tweak types
    • add one more step to make esm useable
    • add owner to TurboUploadDataItemResponse and remove byteCount
    • add separate folder for types, use it in named exports
    • change name of public facing clients.
    • cjs: add separate cjs and esm outputs
    • content-length: require content length factory for uploads
    • exports: move turbo configurations to turbo.ts so it is available to clients
    • fix package.json
    • modify return type of signDataItem function, tweak implementation of ArweaveSigner header
    • move from getWincPriceForBytes to getUploadCosts
    • package.json: add back module to package.json
    • remove package.json from lib directory
    • remove postinstall command
    • replace retry-axios, add additional retry logic
    • retry-axios: pin retry-axios to 3.0.0
    • revert to single file upload/data item upload
    • swap adding package.json to esm to cjs
    • top up: export type PE-4465
    • type imports for web and node
    • types: finalize types, update default payment and upload URLs
    • update main and types path in package.json
    • update package.json output for esm
    • update web signer and cleanup examples
    • use .cjs as base for types to avoid reference require errors
    • use declare in sub-classes to overwrite parent class type
    • wildcard: allow wildcard exports for older projects
    • wrong path for types!

    Features

    • abstract axios to TurboHTTPService class
    • abstract JWKInterface used in AuthenticatedPayment and AuthenticatedUploadService
    • add remaining unauthenticated apis for payment service, introduce some new types, add tests
    • add uploadFiles implementation for node and web
    • break services into auth vs unauth
    • initial implementation of TurboWebClient and TurboNodeClient
    • introduce AbortController
    • introduce uploadSignedDataItem interface, implement for node
    • remove TurboDataItemVerifier
    • sdk: all uphill from here πŸš€ PE-4064
    • top-up: init get checkout session PE-4465
    • winc for fiat: extend AmountMapper pattern and add promoCode support PE-4465
    - +

    # Turbo SDK Release Notes

    # Overview

    Welcome to the documentation page for the Turbo SDK release notes. Here, you will find detailed information about each version of the Turbo SDK, including the enhancements, bug fixes, and any other changes introduced in every release. This page serves as a comprehensive resource to keep you informed about the latest developments and updates in the Turbo SDK. For those interested in exploring the source code, each version's code is readily accessible at our GitHub repository: Turbo SDK Releases (opens new window). Stay updated with the continuous improvements and advancements in the Turbo SDK by referring to this page for all release-related information.

    # Releases

    # V1.5.0

    (2024-04-16)

    Bug Fixes

    • fund with AR: add web esm compatible arweave export
    • export Arconnect and ArweaveSigner from env specific signers

    Features

    • crypto payments: Init fund methods
    • crypto payments: Refactor arweave-js out of signer
    • fund with AR: Add ToTokenAmount helper utils
    • fund with AR: Catch polling error
    • fund with AR: Continue polling on request error
    • fund with AR: Throw no wallet found as error
    • signers: Exports arbundles ArconnectSigner and ArweaveSigner

    # V1.4.2

    (2024-03-15)

    Bug Fixes

    • arbundles: pin arbundles to v0.9.9 and run tests locally

    # V1.4.1

    (2024-01-30)

    Bug Fixes

    • checkout session: correct query param, change type, add coverage

    # V1.4.0

    (2024-01-30)

    Features

    • ui mode: support query param for checkout session ui mode

    # V1.3.0

    (2024-01-03)

    Bug Fixes

    • web: ensure we have the public key for arconnect wallets when signing data
    • web: remove reference to node:crypto in websigner, use signer to signer to sign header

    Features

    • signer: allow an optional signer to be passed instead of JWK for signing data items

    # V1.2.0

    (2023-12-15)

    Features

    • data item opts: init tags anchor and target support PE-5035

    # V1.1.1

    (2023-12-14)

    Bug Fixes

    • exports: use bundled export to avoid issue with polyfilled features needed for web
    • exports: web exports reference an invalid build path
    • polyfills: update esbuild script to include crypto polyfill

    # V1.1.0

    (2023-11-10)

    Bug Fixes

    • axios: set maxRedirects to 0 on our axios instances

    Features

    • logger: add configurable global logger

    # V1.0.2

    (2023-11-03)

    Bug Fixes

    • upload: update the default upload service URL

    # V1.0.1

    (2023-09-27)

    Bug Fixes

    • headers: add default headers for all HTTP requests
    • release: use script that updates built version.js files
    • version: update version.js to proper version on build and commit it back to git after a release

    # V1.0.0

    (2023-09-26)

    Bug Fixes

    • add command that removes type module from package.json
    • add command that removes type module from package.json
    • add main import and allow wildcard imports
    • add module to package.json and tweak types
    • add one more step to make esm useable
    • add owner to TurboUploadDataItemResponse and remove byteCount
    • add separate folder for types, use it in named exports
    • change name of public facing clients.
    • cjs: add separate cjs and esm outputs
    • content-length: require content length factory for uploads
    • exports: move turbo configurations to turbo.ts so it is available to clients
    • fix package.json
    • modify return type of signDataItem function, tweak implementation of ArweaveSigner header
    • move from getWincPriceForBytes to getUploadCosts
    • package.json: add back module to package.json
    • remove package.json from lib directory
    • remove postinstall command
    • replace retry-axios, add additional retry logic
    • retry-axios: pin retry-axios to 3.0.0
    • revert to single file upload/data item upload
    • swap adding package.json to esm to cjs
    • top up: export type PE-4465
    • type imports for web and node
    • types: finalize types, update default payment and upload URLs
    • update main and types path in package.json
    • update package.json output for esm
    • update web signer and cleanup examples
    • use .cjs as base for types to avoid reference require errors
    • use declare in sub-classes to overwrite parent class type
    • wildcard: allow wildcard exports for older projects
    • wrong path for types!

    Features

    • abstract axios to TurboHTTPService class
    • abstract JWKInterface used in AuthenticatedPayment and AuthenticatedUploadService
    • add remaining unauthenticated apis for payment service, introduce some new types, add tests
    • add uploadFiles implementation for node and web
    • break services into auth vs unauth
    • initial implementation of TurboWebClient and TurboNodeClient
    • introduce AbortController
    • introduce uploadSignedDataItem interface, implement for node
    • remove TurboDataItemVerifier
    • sdk: all uphill from here πŸš€ PE-4064
    • top-up: init get checkout session PE-4465
    • winc for fiat: extend AmountMapper pattern and add promoCode support PE-4465
    + diff --git a/docs/turbo/turbo-sdk/turbo-web.html b/docs/turbo/turbo-sdk/turbo-web.html index a9d32ba..a67dc39 100644 --- a/docs/turbo/turbo-sdk/turbo-web.html +++ b/docs/turbo/turbo-sdk/turbo-web.html @@ -17,11 +17,11 @@ - +

    # Using Turbo SDK in a Browser Environment

    # Overview

    With Turbo-SDK v1.3.0, You can authenticate a Turbo instance by passing in an arweave signer instance instead of JWK. This supports the ArweaveSigner or ArconnectSigner classes from arbundles (opens new window).

    - + diff --git a/docs/turbo/what-is-turbo.html b/docs/turbo/what-is-turbo.html index 6f3308b..cde3f70 100644 --- a/docs/turbo/what-is-turbo.html +++ b/docs/turbo/what-is-turbo.html @@ -17,12 +17,12 @@ - +

    # What Is Turbo?

    Turbo, offered by ArDrive, is a streamlined service that simplifies permaweb storage, making it more accessible by allowing users to pay for uploads with credit or debit cards. It integrates two key components: a service that bundles uploads for efficiency and ease, and a payment system designed for straightforward transactions. Turbo Credits, which users can purchase within the ArDrive web app, enable a direct conversion from AR tokens, reflecting the amount of data one can upload. These credits are meticulously calibrated, with the Winston Credit (winc) representing the smallest unit, ensuring users have precise control over their storage needs. As an open-source technology, Turbo encourages community engagement, allowing developers to contribute to its continuous enhancement.

    Type Feature
    Access
    • Optimistic, instant data caching, using arweave.net.
    • Optimistic, near instant GraphQL indexing including cross-chain token address indexing, using arweave.net.
    • Irys-compatible transaction status endpoint for checking transaction finality.
    Development and Integration
    Enterprise Built for scale and trusted by enterprises
    Identity
    • Cryptographic sign in using Arweave, Ethereum, Solana or other Irys-compatible keys.
    • Arweave ecosystem supported web wallets and providers:
      • βœ… Arconnect
      • βœ… arweave.app
      • βœ… ArweaveWalletAdapter
    Maturity
    Payments
    • Instantly fund your Turbo account with your credit card.
    • Leverage other Turbo benefits like Gifting and Coupon Codes.
    Performance
    • Irys-compatible single request or multipart uploading.
    • Proven, high layer 2 transactional throughput with 860/sec sustained on 12/18 and 12/19
    Provenance Irys-compatible receipts with transaction id, high resolution timestamp, upload price and cryptographic signature.
    Transparency Open source infrastructure and software development kit with AGPL3.0 licensing.
    - + diff --git a/index.html b/index.html index d07f5c4..6378ea5 100644 --- a/index.html +++ b/index.html @@ -17,11 +17,11 @@ - +

    # About ArDrive

    ArDrive offers never-ending storage of your most valuable files. Pay once and save your memories forever.

    Feature ArDrive Traditional Cloud Storage
    One time payments for file storage βœ“ βœ—
    No monthly subscriptions βœ“ βœ—
    200+ years of file storage βœ“ βœ—
    Data available even if company disappears βœ“ βœ—
    Decentralized and open source βœ“ βœ—
    Inactive accounts never deleted βœ“ βœ—

    # Control Your Own Data

    # True Data Ownership

    With pay-once pricing you no longer have to add another subscription fee to your monthly budget. Save big when you only have to pay for what you use.

    # No More Lost Data

    Feel safe about the longevity of your files and avoid the horror stories of broken hard drives, deleted accounts, or lost files.

    # Decentralized Network

    Break free from Big Tech and leverage the power of the decentralized Arweave blockchain network that puts you back in control. Own your data instead of renting it.

    # Community Owned

    You're the boss. As a Web3 organization, ArDrive is owned collectively so you can have a say in our governance and share in our rewards.

    # How can Ardrive Help You?

    # Store Family Memories Forever

    Never lose a cherished photo or video again. Keep and pass along all of your most important photos and documents to the present or future generations. Learn more (opens new window)

    # Permanence

    In a digital world, how do you guarantee information is kept for long-periods of time? Just as the web connects data and people over vast distances, your data can now be kept over vast periods of time. Learn more (opens new window)

    # Totally Private or Totally Public

    It’s your choice in how you want to manage your data. Keep it private, share with select individuals, or make it public to the world. ArDrive is optimized for photography, digital art and NFT storage. Learn more (opens new window)

    # Eliminate Subscription Fees

    If you are paying monthly for cloud storage you are renting out your data. Get a digital wallet and move to full ownership of your data with our innovative pay once per file pricing. Learn more (opens new window)

    # Control Your Data

    Break free from the whims of centralized big tech and ever-changing terms of service. Enjoy the benefits of total privacy, security, and extreme data redundancy on a decentralized network. Learn more (opens new window)

    # Perfect Record Keeping

    Data integrity, accuracy and consistency for your most important files! Achieve regulatory compliance in any industry or your personal life by having an immutable (unchanging) and time-stamped record of all your files. Learn more (opens new window)

    # Durable NFTs

    NFTs make the internet ownable. But when you buy an NFT how do you know it is going to be around in 20 years? Who is paying to store it? And what if they stop? Learn more (opens new window)

    # Archive the Web

    Save a copy of any webpage you create or find! Each page will be given a unique url and saved on to Arweave’s permaweb (just like the web, but forever!). Learn more (opens new window)

    - +