nectar/README.md

79 lines
3.3 KiB
Markdown
Raw Normal View History

2023-10-02 23:02:53 +03:00
## Setup
### Building components
```bash
# Clone the repo.
2023-10-03 18:45:46 +03:00
git clone git@github.com:uqbar-dao/uqbar.git
2023-10-02 23:02:53 +03:00
2023-11-30 13:44:21 +03:00
# Configure dependency retrieval from GitHub
mkdir .cargo
echo "net.git-fetch-with-cli = true" > .cargo/config
2023-10-17 00:53:24 +03:00
2023-10-02 23:02:53 +03:00
# Get some stuff so we can build wasm.
2023-10-17 00:53:42 +03:00
cd uqbar
2023-10-02 23:02:53 +03:00
cargo install wasm-tools
rustup install nightly
rustup target add wasm32-wasi
rustup target add wasm32-wasi --toolchain nightly
cargo install cargo-wasi
2023-10-02 23:02:53 +03:00
# Build the runtime, along with a number of booted-at-startup WASM modules including terminal and key_value
# OPTIONAL: --release flag
2023-10-03 21:25:46 +03:00
cargo +nightly build --release
2023-10-02 23:02:53 +03:00
```
### Boot
Get an eth-sepolia-rpc API key and pass that as an argument. You can get one for free at `alchemy.com`.
2023-10-02 23:02:53 +03:00
2023-12-05 21:37:33 +03:00
Make sure not to use the same home directory for two nodes at once! You can use any name for the home directory: here we just use `home`. The `--` here separates cargo arguments from binary arguments.
2023-12-11 19:06:36 +03:00
TODO: document feature flags `--simulation-mode`
2023-10-02 23:02:53 +03:00
```bash
cargo +nightly run --release -- home --rpc wss://eth-sepolia.g.alchemy.com/v2/<your-api-key>
2023-10-02 23:02:53 +03:00
```
On boot you will be prompted to navigate to `localhost:8080`. Make sure your ETH wallet is connected to the Sepolia test network. Login should be straightforward, just submit the transactions and follow the flow. If you want to register a new ID you will either need [Sepolia testnet tokens](https://www.infura.io/faucet/sepolia) or an invite code.
2023-10-02 23:02:53 +03:00
## Terminal syntax
- CTRL+C or CTRL+D to gracefully shutdown node
- CTRL+V to toggle through verbose modes (0-3, 0 is default and lowest verbosity)
2023-10-02 23:02:53 +03:00
- CTRL+J to toggle debug mode
- CTRL+S to step through events in debug mode
- CTRL+L to toggle logging mode, which writes all terminal output to the `.terminal_log` file. Off by default, this will write all events and verbose prints with timestamps.
2023-10-02 23:02:53 +03:00
- CTRL+A to jump to beginning of input
- CTRL+E to jump to end of input
- UpArrow/DownArrow or CTRL+P/CTRL+N to move up and down through command history
- CTRL+R to search history, CTRL+R again to toggle through search results, CTRL+G to cancel search
- `/message <address> <json>`: send an inter-process message. <address> is formatted as <node>@<process_id>. <process_id> is formatted as <process_name>:<package_name>:<publisher_node>.
- Example: `/message our@net:sys:uqbar diagnostics`
- `our` will always be interpolated by the system as your node's name
- Can also use `/m` for same command: `/m our@net:sys:uqbar diagnostics`
- `/app <address>`: set the terminal to a mode where all messages go to a specific app. To clear this selection, use `/app clear` or simply `/app`. This is useful for apps that have a command line interface.
- Example: `/app our@net:sys:uqbar`, then `/m diagnostics`
- Can also use `/a` for same command: `/a our@net:sys:uqbar`
- Example of sending many messages:
- `/a ben.uq@net:sys:uqbar`
- `/m hey there`
- `/m how are you?`
- `/a` (to exit app mode)
- `/hi <name> <string>`: send a text message to another node's command line.
- Example: `/hi ben.uq hello world`
2023-10-02 23:02:53 +03:00
## Example usage
2023-11-01 23:37:31 +03:00
Download and install an app:
```
2023-12-14 00:45:30 +03:00
/m our@main:app_store:uqbar {"Download": {"package": {"package_name": "<pkg>", "publisher_node": "<node>"}, "install_from": "<node>"}}
/m our@main:app_store:uqbar {"Install": {"package_name": "<pkg>", "publisher_node": "<node>"}}
2023-11-01 23:37:31 +03:00
```