Skip to content

Commit

Permalink
docs(create/edit): updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinse12 committed Nov 18, 2023
1 parent c3e33d8 commit 823da01
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 39 deletions.
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ In Bash (or powershell if you're on Windows), run `plebbit daemon` to able to co

```sh-session
$ plebbit daemon
IPFS API listening on: http://localhost:32429/api/v0
IPFS Gateway listening on: http://localhost:32430
Plebbit API listening on: http://localhost:32431/api/v0
You can find Plebbit API documentation at: http://localhost:32431/api/v0/docs
IPFS API listening on: http://localhost:5001/api/v0
IPFS Gateway listening on: http://localhost:8080
Plebbit RPC API listening on: ws://localhost:9138
Plebbit data path: /root/.local/share/plebbit
```

### Seeding Subplebbits
<!-- ### Seeding Subplebbits
If you're feeling generous, and would like to seed the default subplebbits you can do so by using the `--seed` flag
```sh-session
Expand All @@ -91,31 +91,38 @@ Seeding subplebbits: [
'censorship-watch.eth',
'reddit-screenshots.eth'
]
```
``` -->

### Creating your first sub
```sh-session
$ plebbit subplebbit create --title "Hello Plebs!" --description "This is gonna be great"
QmPjewdKya8iVkuQiiXQ5qRBsgVUAZg2LQ2m8v3LNJ7Ht8
12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu
```

### Listing all your subs
```sh-session
$ plebbit subplebbit list
Address Started
────────────────────────────────────────────── ───────
QmPjewdKya8iVkuQiiXQ5qRBsgVUAZg2LQ2m8v3LNJ7Ht8 false
QmRcyUK7jUhFyPTEvwWyfGZEAaSoDugNJ8PZSC4PWRjUqd false
Address Started
──────────────────────────────────────────────────── ───────
12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu true
business-and-finance.eth true
censorship-watch.eth true
health-nutrition-science.eth true
movies-tv-anime.eth true
pleblore.eth true
politically-incorrect.eth true
reddit-screenshots.eth false
videos-livestreams-podcasts.eth false
```

### Adding an author role
### Adding a role moderator to your sub
```sh-session
$ plebbit subplebbit role set QmPjewdKya8iVkuQiiXQ5qRBsgVUAZg2LQ2m8v3LNJ7Ht8 author-address.eth --role moderator
$ plebbit subplebbit edit mysub.eth '--roles["author-address.eth"].role' moderator
```

### Removing a role
```sh-session
$ plebbit subplebbit role remove QmPjewdKya8iVkuQiiXQ5qRBsgVUAZg2LQ2m8v3LNJ7Ht8 author-address.eth
$ plebbit subplebbit edit mysub.eth '--roles["author-address.eth"]' null
```


Expand Down
22 changes: 0 additions & 22 deletions src/cli/base-subplebbit-options.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/cli/commands/subplebbit/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BaseCommand } from "../../base-command.js";

export default class Create extends BaseCommand {
static override description =
"Create a subplebbit with specific properties. A newly created sub will be started after creation and be able to receive publications";
"Create a subplebbit with specific properties. A newly created sub will be started after creation and be able to receive publications. For a list of properties, visit https://github.com/plebbit/plebbit-js#subplebbiteditsubplebbiteditoptions";

static override examples = [
{
Expand Down
23 changes: 21 additions & 2 deletions src/cli/commands/subplebbit/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { Args } from "@oclif/core";
import { BaseCommand } from "../../base-command.js";

export default class Edit extends BaseCommand {
static override description = "Edit a subplebbit";
static override description =
"Edit a subplebbit properties. For a list of properties, visit https://github.com/plebbit/plebbit-js#subplebbiteditsubplebbiteditoptions";

static override args = {
address: Args.string({
Expand All @@ -17,7 +18,25 @@ export default class Edit extends BaseCommand {
})
};

static override examples = [];
static override examples = [
{
description: "Change the address of the sub to a new ENS address",
command: "plebbit subplebbit edit 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu --address newAddress.eth"
},
{
description: "Add the author address 'esteban.eth' as an admin on the sub",
command: `plebbit subplebbit edit mysub.eth '--roles["esteban.eth"].role' admin`
},
{
description:
"Add two challenges to the sub. The first challenge will be a question and answer, and the second will be an image captcha",
command: `plebbit subplebbit edit mysub.eth --settings.challenges[0].name question --settings.challenges[0].options.question "what is the password?" --settings.challenges[0].options.answer thepassword --settings.challenges[1].name captcha-canvas-v3`
},
{
description: "Change the title and description",
command: `plebbit subplebbit edit mysub.eth --title "This is the new title" --description "This is the new description" `
}
];

async run(): Promise<void> {
const { flags, args } = await this.parse(Edit);
Expand Down

0 comments on commit 823da01

Please sign in to comment.