Skip to content

Commit

Permalink
add and update blob commands (#176)
Browse files Browse the repository at this point in the history
* update from generated docs from clap
* restore examples from diff
* allow empty arguments
* change from get to download to align with lib api
* regen changed page
  • Loading branch information
divagant-martian committed Aug 22, 2024
1 parent 81ec5fb commit d6feb5d
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 171 deletions.
188 changes: 36 additions & 152 deletions api-code-examples/api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -459,136 +459,54 @@ const blobs = [
description: 'Add data from PATH to the running node',
slug: 'blobs-add',
arguments: [
{
name: 'source',
necessity: 'required',
description: 'Path to a file or folder'
},
{
name: 'in-place',
necessity: '',
description: 'Add in place'
},
{
name: 'tag',
necessity: '',
description: 'Tag to tag the data with'
},
{
name: 'wrap',
necessity: '',
description: 'Wrap the added file or directory in a collection'
},
{
name: 'filename',
necessity: '',
description: 'Override the filename used for the entry in the created collection'
},
{
name: 'no-ticket',
necessity: '',
description: 'Do not print the all-in-one ticket to get the added data from this node'
}
{ name: 'source', necessity: 'required', description: 'Path to a file or folder' },
{ name: 'in-place', necessity: '', description: 'Add in place' },
{ name: 'tag', necessity: '', description: 'Tag to tag the data with' },
{ name: 'wrap', necessity: '', description: 'Wrap the added file or directory in a collection' },
{ name: 'filename', necessity: '', description: 'Override the filename used for the entry in the created collection' },
{ name: 'no-ticket', necessity: '', description: 'Do not print the all-in-one ticket to get the added data from this node' }
],
examples: {
console: `> blobs add ~/my_txt.txt
Adding my_txt.txt as /Users/me/my_txt.txt...
- /Users/me/my_txt.txt: 328 B bafkr4igef2yiz2nz33tljfdezzr45cos5lnc2urjmfi6zghbsnfzvpdpa4
Total: 328 B
Collection: bafkr4ie3xsx3vdsbflainnk6p4xs4h2hq3hdmuasuoflkgybvnsbljb3ke`
Collection: bafkr4ie3xsx3vdsbflainnk6p4xs4h2hq3hdmuasuoflkgybvnsbljb3ke`,
}
},
{
name: 'blobs download',
name: 'blobs download', // console and cli blobs get
description: 'Download data to the running node\'s database and provide it',
slug: 'blobs-get',
arguments: [
{
name: 'ticket or hash',
necessity: 'required',
description: 'Ticket or Hash to use'
},
{
name: 'address',
necessity: '',
description: 'Additional socket address to use to contact the node. Can be used multiple times'
},
{
name: 'relay-url',
necessity: '',
description: 'Override the relay URL to use to contact the node'
},
{
name: 'recursive',
necessity: '',
description: 'Override to treat the blob as a raw blob or a hash sequence'
},
{
name: 'override-addresses',
necessity: '',
description: 'If set, the ticket\'s direct addresses will not be used'
},
{
name: 'node',
necessity: '',
description: 'NodeId of the provider'
},
{
name: 'out',
necessity: '',
description: 'Directory or file in which to save the file(s)'
},
{
name: 'stable',
necessity: '',
description: 'If set, the data will be moved to the output directory, and iroh will assume that it will not change'
},
{
name: 'tag',
necessity: '',
description: 'Tag to tag the data with'
},
{
name: 'queued',
necessity: '',
description: 'If set, will queue the download in the download queue'
}
{ name: 'ticket or hash', necessity: 'required', description: 'Ticket or Hash to use' },
{ name: 'address', necessity: '', description: 'Additional socket address to use to contact the node. Can be used multiple times' },
{ name: 'relay-url', necessity: '', description: 'Override the relay URL to use to contact the node' },
{ name: 'recursive', necessity: '', description: 'Override to treat the blob as a raw blob or a hash sequence' },
{ name: 'override-addresses', necessity: '', description: 'If set, the ticket\'s direct addresses will not be used' },
{ name: 'node', necessity: '', description: 'NodeId of the provider' },
{ name: 'out', necessity: '', description: 'Directory or file in which to save the file(s)' },
{ name: 'stable', necessity: '', description: 'If set, the data will be moved to the output directory, and iroh will assume that it will not change' },
{ name: 'tag', necessity: '', description: 'Tag to tag the data with' },
{ name: 'queued', necessity: '', description: 'If set, will queue the download in the download queue' }
],
examples: {
console: `> blobs get his7xcvl5jc734mwbtgtkkvxeafrdcitmg2jvdmxk7ri7abgr33a --address 192.168.0.15:41918 --node w3mj2iw47i2pgbdrnutaamsqm6h2bj6r7yp7h2vliruq3vry535a
Fetching: his7xcvl5jc734mwbtgtkkvxeafrdcitmg2jvdmxk7ri7abgr33a
Transferred 14.20 KiB in 0 seconds, 173.20 KiB/s`
console: '> blobs get'
}
},
{
name: 'blobs export',
description: 'Export a blob from the internal blob store to the local filesystem',
slug: 'blobs-export',
arguments: [
{
name: 'hash',
necessity: 'required',
description: 'The hash to export'
},
{
name: 'out',
necessity: 'required',
description: 'Directory or file in which to save the file(s)'
},
{
name: 'recursive',
necessity: '',
description: 'Set to true if the hash refers to a collection and you want to export all children of the collection'
},
{
name: 'stable',
necessity: '',
description: 'If set, the data will be moved to the output directory, and iroh will assume that it will not change'
}
{ name: 'hash', necessity: 'required', description: 'The hash to export' },
{ name: 'out', necessity: 'required', description: 'Directory or file in which to save the file(s)' },
{ name: 'recursive', necessity: '', description: 'Set to true if the hash refers to a collection and you want to export all children of the collection' },
{ name: 'stable', necessity: '', description: 'If set, the data will be moved to the output directory, and iroh will assume that it will not change' }
],
examples: {
console: '> blobs export his7xcvl5jc734mwbtgtkkvxeafrdcitmg2jvdmxk7ri7abgr33a ./very_important.txt'
console: '> blobs export'
}
},
{
Expand All @@ -609,7 +527,7 @@ Transferred 14.20 KiB in 0 seconds, 173.20 KiB/s`
},
{
name: 'blobs list incomplete-blobs',
description: 'List the blobs on the running provider that are not full files',
description: 'List the available blobs on the running provider',
slug: 'blobs-list-incomplete-blobs',
arguments: [],
examples: {
Expand All @@ -622,25 +540,16 @@ Transferred 14.20 KiB in 0 seconds, 173.20 KiB/s`
slug: 'blobs-list-collections',
arguments: [],
examples: {
console: `> blobs list collections
"auto-2024-08-20T17:49:54.244Z": myumj2a42x6ky72erzt4djhu3ya46h2e7sp4ibqzew2ne4xnbpua 3 blobs (0 B)`
console: '> blobs list collections'
}
},
{
name: 'blobs validate',
description: 'Validate hashes on the running node',
slug: 'blobs-validate',
arguments: [
{
name: 'verbose',
necessity: '',
description: ''
},
{
name: 'repair',
necessity: '',
description: 'Repair the store by removing invalid data'
}
{ name: 'verbose', necessity: '', description: '' },
{ name: 'repair', necessity: '', description: 'Repair the store by removing invalid data' }
],
examples: {
console: '> blobs validate'
Expand All @@ -651,16 +560,8 @@ Transferred 14.20 KiB in 0 seconds, 173.20 KiB/s`
description: 'Perform a database consistency check on the running node',
slug: 'blobs-consistency-check',
arguments: [
{
name: 'verbose',
necessity: '',
description: ''
},
{
name: 'repair',
necessity: '',
description: 'Repair the store by removing invalid data'
}
{ name: 'verbose', necessity: '', description: '' },
{ name: 'repair', necessity: '', description: 'Repair the store by removing invalid data' }
],
examples: {
console: '> blobs consistency-check'
Expand All @@ -671,40 +572,23 @@ Transferred 14.20 KiB in 0 seconds, 173.20 KiB/s`
description: 'Delete the given blobs',
slug: 'blobs-delete-blob',
arguments: [
{
name: 'hash',
necessity: 'required',
description: 'Blobs to delete'
}
{ name: 'hash', necessity: 'required', description: 'Blobs to delete' }
],
examples: {
console: '> blobs delete blob'
}
},
{
name: 'blobs share',
description: 'Get a ticket to share this blob',
slug: 'blobs-share',
arguments: [
{
name: 'hash',
necessity: 'required',
description: 'Hash of the blob to share'
},
{
name: 'addr-options',
necessity: '',
description: 'Options to configure the address information in the generated ticket'
},
{
name: 'recursive',
necessity: '',
description: 'If the blob is a collection, the requester will also fetch the listed blobs'
}
{ name: 'hash', necessity: 'required', description: 'Hash of the blob to share' },
{ name: 'addr-options', necessity: '', description: 'Options to configure the address information in the generated ticket' },
{ name: 'recursive', necessity: '', description: 'If the blob is a collection, the requester will also fetch the listed blobs' }
],
examples: {
console: `> blobs share myumj2a42x6ky72erzt4djhu3ya46h2e7sp4ibqzew2ne4xnbpua
Ticket for blob myumj2a42x6ky72erzt4djhu3ya46h2e7sp4ibqzew2ne4xnbpua (96 B)
blobac3nrhjc3t5dj4yeofwsmabskbty7ifh2h7b747kvncgsdowhdxpuaaaabtcrrhidtk7zld7ishgpqne6tpadty7it6j7ragdes3juts5uf6q`
console: '> blobs share'
}
}
]
Expand Down
3 changes: 0 additions & 3 deletions src/app/docs/api/blobs-consistency-check/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,4 @@ Perform a database consistency check on the running node {{ className: 'lead' }}
> blobs consistency-check
```




</CodeGroup>
3 changes: 1 addition & 2 deletions src/app/docs/api/blobs-delete-blob/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ Delete the given blobs {{ className: 'lead' }}

<CodeGroup title="blobs delete blob">
```text {{ title: 'console' }}
> blobs delete blob
```




</CodeGroup>
3 changes: 1 addition & 2 deletions src/app/docs/api/blobs-export/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ Export a blob from the internal blob store to the local filesystem {{ className:

<CodeGroup title="blobs export">
```text {{ title: 'console' }}
> blobs export his7xcvl5jc734mwbtgtkkvxeafrdcitmg2jvdmxk7ri7abgr33a ./very_important.txt
> blobs export
```




</CodeGroup>
5 changes: 1 addition & 4 deletions src/app/docs/api/blobs-get/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ Download data to the running node&#39;s database and provide it {{ className: 'l

<CodeGroup title="blobs download">
```text {{ title: 'console' }}
> blobs get his7xcvl5jc734mwbtgtkkvxeafrdcitmg2jvdmxk7ri7abgr33a --address 192.168.0.15:41918 --node w3mj2iw47i2pgbdrnutaamsqm6h2bj6r7yp7h2vliruq3vry535a
Fetching: his7xcvl5jc734mwbtgtkkvxeafrdcitmg2jvdmxk7ri7abgr33a
Transferred 14.20 KiB in 0 seconds, 173.20 KiB/s
> blobs get
```




</CodeGroup>
1 change: 0 additions & 1 deletion src/app/docs/api/blobs-list-collections/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ List the available collections on the running provider {{ className: 'lead' }}
<CodeGroup title="blobs list collections">
```text {{ title: 'console' }}
> blobs list collections
"auto-2024-08-20T17:49:54.244Z": myumj2a42x6ky72erzt4djhu3ya46h2e7sp4ibqzew2ne4xnbpua 3 blobs (0 B)
```

```rust {{ title: 'rust' }}
Expand Down
4 changes: 2 additions & 2 deletions src/app/docs/api/blobs-list-incomplete-blobs/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Breadcrumbs from '@/components/Breadcrumbs'
export const metadata = {
title: "blobs list incomplete-blobs",
description: "List the blobs on the running provider that are not full files"
description: "List the available blobs on the running provider"
}

<div className='not-prose mb-5'>
Expand All @@ -14,7 +14,7 @@ export const metadata = {

# blobs list incomplete-blobs

List the blobs on the running provider that are not full files {{ className: 'lead' }}
List the available blobs on the running provider {{ className: 'lead' }}



Expand Down
5 changes: 1 addition & 4 deletions src/app/docs/api/blobs-share/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ Get a ticket to share this blob {{ className: 'lead' }}

<CodeGroup title="blobs share">
```text {{ title: 'console' }}
> blobs share myumj2a42x6ky72erzt4djhu3ya46h2e7sp4ibqzew2ne4xnbpua
Ticket for blob myumj2a42x6ky72erzt4djhu3ya46h2e7sp4ibqzew2ne4xnbpua (96 B)
blobac3nrhjc3t5dj4yeofwsmabskbty7ifh2h7b747kvncgsdowhdxpuaaaabtcrrhidtk7zld7ishgpqne6tpadty7it6j7ragdes3juts5uf6q
> blobs share
```




</CodeGroup>
1 change: 0 additions & 1 deletion src/app/docs/api/blobs-validate/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ Validate hashes on the running node {{ className: 'lead' }}




</CodeGroup>

0 comments on commit d6feb5d

Please sign in to comment.