Skip to content

Commit

Permalink
small fixes on cli args
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed Jan 9, 2025
1 parent e918be5 commit 672ffb7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,44 @@ We launch our node using the `serve` command, followed by models of our choice a
If we provide no oracle types, it will default to the ones that we are registered to.

```sh
dria-oracle serve -m=gpt-4o-mini -m=llama3.1:latest
# run as generator
dria-oracle serve -m=gpt-4o-mini -m=llama3.1:latest generator

# run as validator
dria-oracle serve -m=gpt-4o validator

# run as kinds that you are registered to
dria-oracle serve -m=gpt-4o
```

We can start handling tasks from previous blocks until now, and then continue listening for more events:

```sh
# start from 100th block until now, and subscribe to new events
dria-oracle serve -m=gpt-4o --from=100
```

> [!TIP]
>
> You can terminate the application from the terminal as usual (e.g. CTRL+C) to quit the node.
Or, we can handle tasks between specific blocks only, the application will exit upon finishing blocks unlike before:

```sh
# handle tasks between blocks 100 and 500
dria-oracle serve -m=gpt-4o --from=100 --to=500
```

You can terminate the application from the terminal as usual (e.g. CTRL+C) to quit the node.
Finally, we can handle an existing task specifically as well (if its unhandled for some reason):

```sh
# note that if task id is given, `from` and `to` will be ignored
dria-oracle serve -m=gpt-4o --task-id <task>
```

> [!WARNING]
>
> Validators must use `gpt-4o` model.
#### Using Arweave

Expand All @@ -123,7 +157,7 @@ Following the same logic, the Oracle node can read task inputs from Arweave as w
You can `view` the details of a task by its task id:

```sh
dria-oracle view <task-id>
dria-oracle view --task-id <task>
```

You can also view the task status updates between blocks with the same command, by providing `from` and `to` blocks,
Expand Down
10 changes: 7 additions & 3 deletions core/src/cli/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub enum Commands {
Claim,
/// Serve the oracle node.
Serve {
#[arg(short, long = "kind", help = "The oracle kinds to handle tasks as, if omitted will default to all registered kinds.", value_parser = parse_oracle_kind)]
#[arg(help = "The oracle kinds to handle tasks as, if omitted will default to all registered kinds.", value_parser = parse_oracle_kind)]
kinds: Vec<OracleKind>,
#[arg(short, long = "model", help = "The models to serve.", required = true, value_parser = parse_model)]
models: Vec<Model>,
Expand All @@ -48,7 +48,11 @@ pub enum Commands {
value_parser = parse_block_number_or_tag
)]
to: Option<BlockNumberOrTag>,
#[arg(help = "Optional task id to serve specifically.", required = false)]
#[arg(
long,
help = "Optional task id to serve specifically.",
required = false
)]
task_id: Option<U256>,
},
/// View tasks. fsdkhfk fsdkjfdks
Expand All @@ -57,7 +61,7 @@ pub enum Commands {
from: Option<BlockNumberOrTag>,
#[arg(long, help = "Ending block number, defaults to 'latest'.", value_parser = parse_block_number_or_tag)]
to: Option<BlockNumberOrTag>,
#[arg(help = "Task id to view.")]
#[arg(long, help = "Task id to view.")]
task_id: Option<U256>,
},
/// Request a task.
Expand Down

0 comments on commit 672ffb7

Please sign in to comment.