-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Katana-CI | ||
|
||
This repository contains a tool that helps starting Katana sequencer on demand (mostly for CI purposes). | ||
To work, the `katana-proxifier` binary must be deployed on a server with docker installed. | ||
|
||
## Design | ||
|
||
To keep things simple and flexible for CI, the `katana-proxifier` uses docker under the hood. | ||
With an `in-memory` database for now, each user have an `api-key` that allows the `start` and `stop` of a Katana instance. | ||
When a user starts an instance, a new container is created and started. | ||
|
||
The database trait `ProxifierDb` is for now targetting `Sqlite`, but may be reworked to support any backend supported by `sqlx` rust crate. | ||
|
||
## Usage | ||
|
||
1. Start an instance | ||
```bash | ||
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer my-key' https://katana-ci.arkproject.dev/start | ||
|
||
# Returns a name: | ||
4f2b3c60ae32 | ||
``` | ||
The start will return an instance `name`, that can then be used to target Katana for this specific instance. | ||
The `name` returned is always URL friendly. | ||
|
||
2. Use `starkli` to interact with the instance, for example: | ||
```bash | ||
starkli block --full --rpc https://katana-ci.arkproject.dev/<name>/katana | ||
``` | ||
|
||
3. To check the logs, you can hit the endpoint `/logs` of your instance, by default it returns `25` tail lines. You can use `all` or any number you like using the query parameter `n`. | ||
```bash | ||
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer my-key' http://localhost:5050/<name>/logs | ||
``` | ||
|
||
4. Then, you can stop the instance if it's not needed. | ||
```bash | ||
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer my-key' https://katana-ci.arkproject.dev/<name>/stop | ||
``` | ||
# Work in progress | ||
- [ ] Load initial users keys from environement file. | ||
- [ ] Add an endpoint to register a user with a system of `whitelist-admins`. | ||
- [ ] Deploy an instance to accept requests on `katana-ci.arkproject.dev`. | ||