docs/runtimeverification-wasm-semantics | ||
ggreganov-llama.cpp | ||
scripts | ||
src | ||
Cargo.lock | ||
Cargo.toml | ||
cosmo-overlay.nix | ||
justfile | ||
README.md | ||
shell.nix | ||
vespa-cli-overlay.nix |
Nexus
Welcome to the Nexus! This README will guide you through setting up your development environment and getting started with the project.
Prerequisites
Before you begin, make sure you have the following installed on your system:
- Nix
- Git
- Rust
- wasm32-unknown-unknown target
- OpenSSL 1.1
- Cosmoonic
Getting Started
- Clone the repository and navigate to the project directory:
git clone https://github.com/plurigrid/nexus.git
cd nexus
- Start nix shell and run the following command to install all required dependencies:
nix-shell
make all
This will automatically check for and install Rust, wasm32-unknown-unknown target, OpenSSL 1.1, and Cosmo CLI if they are not already installed on your system.
- Create a new actor using Cosmo CLI:
cosmo new actor <your_project_name>
Replace <your_project_name>
with your desired project name.
- Navigate to your newly created project directory:
cd <your_project_name>
- Edit
src/lib.rs
file in your favorite text editor.
The default file content looks like this:
use wasmbus_rpc::actor::prelude::*;
use wasmcloud_interface_httpserver::{HttpRequest, HttpResponse, HttpServer, HttpServerReceiver};
#[derive(Debug, Default, Actor, HealthResponder)]
#[services(Actor, HttpServer)]
struct DuckActor {}
/// Implementation of the HttpServer capability contract
#[async_trait]
impl HttpServer for DuckActor {
async fn handle_request(&self, _ctx: &Context, _req: &HttpRequest) -> RpcResult<HttpResponse> {
Ok(HttpResponse::ok("message"))
}
}
You can modify the file to accommodate more text like this:
use wasmbus_rpc::actor::prelude::*;
use wasmcloud_interface_httpserver::{HttpRequest, HttpResponse, HttpServer, HttpServerReceiver};
#[derive(Debug, Default, Actor, HealthResponder)]
#[services(Actor, HttpServer)]
struct HelloActor {}
/// Implementation of the HTTP server capability
#[async_trait]
impl HttpServer for HelloActor {
async fn handle_request(&self, _ctx: &Context, _req: &HttpRequest) -> RpcResult<HttpResponse> {
let message: &str = r#"message"#;
HttpResponse::ok(message)
}
}
Now you're all set! You can start building your project and explore the Nexus repository. Happy coding!