1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-25 21:35:50 +03:00
juvix/app
Paul Cadman 669474f345
Add juvix dev anoma {start, stop, status} to manage an Anoma client (#3183)
This PR adds the `juvix dev anoma {start, stop, status}` commands to
manage a running Anoma client.

The motivation for this is that we can add additional commands (e.g
`indexer`, `prove`, `(mempool)-submit`) which interact with the
persistent Anoma client.

`juvix dev anoma start` now writes a configuration file in
`<juvix_config>/anoma-client/config.yaml` which contains the host URL
and
port of the started Anoma client and the pid of the Anoma client
process.

For example:

config.yaml
```
host:
  port: 58922
  url: localhost
pid: 75299
```

The `anoma stop` command kills the Anoma client and the `anoma status`
command shows the config of the currently running client.

There can be at most one Anoma client running when using this mechanism.

## Dependency

This PR adds a new dependency on the `unix` package. This is used for
APIs to send signals to processes.

## CLI docs

### `juvix dev anoma`

```
Usage: juvix dev anoma COMMAND

  Subcommands related to the Anoma client

Available options:
  -h,--help                Show this help text

Available commands:
  start                    Start an Anoma client
  status                   Show the status of the Anoma client
  stop                     Stop the Anoma client
```

### `juvix dev anoma start`

```
Usage: juvix dev anoma start --anoma-dir ANOMA_DIR [-g|--foreground]
                             [-f|--force]

  Start an Anoma client

Available options:
  --anoma-dir ANOMA_DIR    Path to anoma repository
  -g,--foreground          Start the client in the foreground
  -f,--force               Forcefully start a client, terminating any currently
                           running client if necessary
  -h,--help                Show this help text
```

### `juvix dev anoma status`

```
Usage: juvix dev anoma status

  Show the status of the Anoma client

Available options:
  -h,--help                Show this help text
```

### `juvix dev anoma stop`

```
Usage: juvix dev anoma stop

  Stop the Anoma client

Available options:
  -h,--help                Show this help text
```
2024-11-22 16:03:30 +00:00
..
Commands Add juvix dev anoma {start, stop, status} to manage an Anoma client (#3183) 2024-11-22 16:03:30 +00:00
TopCommand Export Juvix source code to latex (#2917) 2024-08-05 11:28:19 +02:00
App.hs Add --vscode option (#3162) 2024-11-11 10:06:57 +01:00
AsmInterpreter.hs Replace polysemy by effectful (#2663) 2024-03-21 12:09:34 +00:00
CommonOptions.hs Support running nockma code with a running Anoma client (#3180) 2024-11-20 08:53:21 +01:00
Evaluator.hs Make compile targets a subcommand instead of a flag (#2700) 2024-04-09 13:29:07 +02:00
GlobalOptions.hs Add --vscode option (#3162) 2024-11-11 10:06:57 +01:00
HaskelineJB.hs upgrade to Ghc 9.8.1 (#2624) 2024-02-07 09:47:48 +00:00
Main.hs Export Juvix source code to latex (#2917) 2024-08-05 11:28:19 +02:00
RegInterpreter.hs Replace polysemy by effectful (#2663) 2024-03-21 12:09:34 +00:00
TopCommand.hs Logger (#2908) 2024-07-22 17:14:37 +02:00
TreeEvaluator.hs Replace polysemy by effectful (#2663) 2024-03-21 12:09:34 +00:00