Find a file
2023-05-25 02:46:49 -07:00
docs/runtimeverification-wasm-semantics authenticity is all you need 2023-05-18 03:22:13 +00:00
ggreganov-llama.cpp fiat nexus ▦ 2023-04-20 22:38:56 +00:00
scripts Fixed syntac error in update_source.sh. 2023-05-25 02:46:49 -07:00
src fiat nexus ▦ 2023-04-20 22:38:56 +00:00
Cargo.lock fiat nexus ▦ 2023-04-20 22:38:56 +00:00
Cargo.toml Updated justfile, added script to set shell path, and fixed Cargo.toml version issue. 2023-05-25 01:19:57 -07:00
cosmo-overlay.nix Updated shell nix to install cosmo if not already installed. Added README and cleaned up repo. 2023-05-18 12:36:09 +00:00
justfile Fixed typo cuasing path shell source to not be reloaded in justfile. 2023-05-25 02:41:03 -07:00
README.md Update README.md 2023-05-24 17:37:37 -07:00
shell.nix Updated justfile, added script to set shell path, and fixed Cargo.toml version issue. 2023-05-25 01:19:57 -07:00
vespa-cli-overlay.nix Updated comments. 2023-05-17 21:19:50 +00:00

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:

Getting Started

  1. Clone the repository and navigate to the project directory:
git clone https://github.com/plurigrid/nexus.git
cd nexus
  1. 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.

  1. Create a new actor using Cosmo CLI:
cosmo new actor <your_project_name>

Replace <your_project_name> with your desired project name.

  1. Navigate to your newly created project directory:
cd <your_project_name>
  1. 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 <your_project_name>Actor {}

/// Implementation of the HttpServer capability contract
#[async_trait]
impl HttpServer for <your_project_name>Actor {
    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 <your_project_name>Actor {}

/// Implementation of the HTTP server capability
#[async_trait]
impl HttpServer for <your_project_name>Actor {
    async fn handle_request(&self, _ctx: &Context, _req: &HttpRequest) -> RpcResult<HttpResponse> {
        let message: &str = r#"message"#;

        Ok(HttpResponse::ok(message))
    }
}

Launching the Project

  1. Build and sign your actor:
cosmo build
  1. Launch the actor using Cosmo CLI:
cosmo launch
  1. Navigate to Cosmonic App and sign in with your account.

  2. In the Logic view, you should see the new actor you just launched.

  3. To make your actor accessible from the web, launch a new provider for an HTTP server with the following OCI URL: cosmonic.azurecr.io/httpserver_wormhole:0.5.3. Give the link a name, and note that the HTTP server must be launched on a Cosmonic Manager resource.

  4. Once the HTTP server is launched, link it to your actor.

  5. Launch a wormhole and connect it to your actor link (the HTTP server and the actor).

  6. Your actor should now be accessible at the domain of the wormhole followed by .cosmonic.app. For example: https://white-morning-5041.cosmonic.app.

Now you can access your project from any web browser using the provided URL!

You're all set! You can start building your project and explore the Nexus repository. Happy coding!