Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 9 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ the [releases tab](https://github.com/ethersphere/swarm-cli/releases).
- [Uploading a File](#uploading-a-file)
- [Creating an Identity](#creating-an-identity)
- [Uploading to a Feed](#uploading-to-a-feed)
- [Upload file with ACT](#upload-file-with-act)
- [Download file with ACT](#download-file-with-act)
- [Create grantees list](#create-grantees-list)
- [Get grantees list](#get-grantees-list)
- [Patch grantees list](#patch-grantees-list)
- [Access control trie (ACT)](#access-control-trie-(act))
- [Initialize ACT](#initialize-act)
- [Grant access to a certain grantee](#grant-access-to-a-certain-grantee)
- [Revoke access from a certain grantee](#revoke-access-from-a-certain-grantee)
- [Show list of grantee lists](#show-list-of-grantee-lists)
- [Show grantees in a certain grantee list](#show-grantees-in-a-certain-grantee-list)
- [Get the list of events for a certain grantee list](#get-the-list-of-events-for-a-certain-grantee-list)
- [Upload a file with ACT](#upload-a-file-with-act)
- [Download a file with ACT](#download-a-file-with-act)
- [Description](#description)
- [Installation](#installation)
- [From npm](#from-npm)
Expand Down Expand Up @@ -149,11 +153,6 @@ swarm-cli access history --list-name <grantee_list_name>
swarm-cli upload <file> --share-with <grantee_list_name>
```

##### [DEPRECATED]
```sh
swarm-cli upload <file> --act --stamp <postage_batch_id>
```

### Download a file with ACT

`token` constructed from the owner's public key and the history address
Expand All @@ -162,57 +161,6 @@ swarm-cli upload <file> --act --stamp <postage_batch_id>
swarm-cli download <swarm_hash> <file> --access <token>
```

##### [DEPRECATED]
```sh
swarm-cli download <swarm_hash> <file> --act --act-history-address <swarm_history_address> --act-publisher <public_key>
```

### Create a grantees list [DEPRECATED]

```sh
swarm-cli grantee create grantees.json --stamp <postage_batch_id>
```

`grantees.json`:

```json
{ "grantees": [
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12e8",
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12e9",
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12ee"
]
}
```

### Get a grantees list [DEPRECATED]

```sh
swarm-cli grantee get <grantee_reference>
```

### Patch a grantees list [DEPRECATED]

```sh
swarm-cli grantee patch grantees-patch.json \
--reference <grantee_reference> \
--history <grantee_history_reference> \
--stamp <postage_batch_id>
```

`grantees-patch.json`:

```json
{
"add": [
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12e7"
],
"revoke": [
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12e9",
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12ee"
]
}
```

# Description

> Manage your Bee node and interact with the Swarm network via the CLI
Expand Down Expand Up @@ -269,7 +217,6 @@ stamp Buy, list and show postage stamps
pss Send, receive, or subscribe to PSS messages
manifest Operate on manifests
utility Utility commands for managing wallets
grantee Create, Get, Patch grantee list
history Get upload history
access Share access to your uploaded files/folders

Expand Down
9 changes: 1 addition & 8 deletions src/command/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ export class Download extends RootCommand implements LeafCommand {
let response: Bytes
let nameOverride: string | undefined

if (this.manifestDownload.act) {
const responseAct = await this.bee.downloadFile(this.address.hash, this.manifestDownload.destination, {
actPublisher: this.manifestDownload.actPublisher,
actHistoryAddress: this.manifestDownload.actHistoryAddress,
actTimestamp: this.manifestDownload.actTimestamp,
})
response = responseAct.data
} else if (this.manifestDownload.access) {
if (this.manifestDownload.access) {
const [publisher, historyAddress] = this.manifestDownload.access.split(':')
const responseAct = await this.bee.downloadFile(this.address.hash, this.manifestDownload.destination, {
actPublisher: publisher,
Expand Down
40 changes: 0 additions & 40 deletions src/command/grantee/create.ts

This file was deleted.

24 changes: 0 additions & 24 deletions src/command/grantee/get.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/command/grantee/grantee-command.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/command/grantee/index.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/command/grantee/patch.ts

This file was deleted.

25 changes: 1 addition & 24 deletions src/command/manifest/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { join, parse } from 'path'
import { exit } from 'process'
import { directoryExists } from '../../utils'
import { BzzAddress, makeBzzAddress } from '../../utils/bzz-address'
import { deprecationWarningText } from '../../utils/text'
import { RootCommand } from '../root-command'

export class Download extends RootCommand implements LeafCommand {
Expand All @@ -24,34 +23,12 @@ export class Download extends RootCommand implements LeafCommand {
@Option({ key: 'stdout', type: 'boolean', description: 'Print to stdout (single files only)' })
public stdout!: boolean

@Option({ key: 'access', type: 'string', description: 'Download using grantee list', conflicts: 'act' })
@Option({ key: 'access', type: 'string', description: 'Download using grantee list' })
public access!: string

@Option({ key: 'act', type: 'boolean', description: 'Download with ACT', default: false })
public act!: boolean

@Option({ key: 'act-timestamp', type: 'string', description: 'ACT history timestamp', default: '1' })
public actTimestamp!: string

// required if act is true
@Option({ key: 'act-history-address', type: 'string', description: 'ACT history address', required: { when: 'act' } })
public actHistoryAddress!: string

// required if act is true
@Option({ key: 'act-publisher', type: 'string', description: 'ACT publisher', required: { when: 'act' } })
public actPublisher!: string

public async run(): Promise<void> {
super.init()

if (this.act) {
this.console.log(
deprecationWarningText(
'--act option is deprecated and will be removed in future versions. Please use --access option with publisher:historyAddress format instead.',
),
)
}

// can be already set from other command
if (!this.address) {
this.address = await makeBzzAddress(this.bee, this.bzzUrl)
Expand Down
Loading
Loading