Skip to content

Commit

Permalink
rename appregistry -> workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
sparkplug0025 committed Sep 4, 2024
1 parent 85130c6 commit 0d234b5
Show file tree
Hide file tree
Showing 65 changed files with 141 additions and 136 deletions.
1 change: 1 addition & 0 deletions external/fmt
Submodule fmt added at 7bdf06
1 change: 1 addition & 0 deletions external/mdbook-mermaid
Submodule mdbook-mermaid added at ff4055
16 changes: 0 additions & 16 deletions services/user/AppRegistry/Cargo.toml

This file was deleted.

15 changes: 0 additions & 15 deletions services/user/AppRegistry/plugin/src/lib.rs

This file was deleted.

2 changes: 0 additions & 2 deletions services/user/AppRegistry/src/lib.rs

This file was deleted.

13 changes: 0 additions & 13 deletions services/user/AppRegistry/ui/index.html

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions services/user/Workshop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "workshop_package"
edition = "2021"
version = "0.1.0"

[package.metadata.psibase]
package-name = "Workshop"
description = "Workshop for psibase apps"
services = ["workshop"]

[lib]
crate-type = ["rlib"]

[dependencies]
workshop = { path = "service", version = "0.1.0" }
r-workshop = { path = "query", version = "0.1.0" }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Psibase AppRegistry
# Psibase Workshop

Steps to run the app in dev mode:

Expand All @@ -10,10 +10,13 @@ open http://localhost:8080

# go through the steps to create a network in dev mode, name the producer as prod and confirm

# ui development, from this ui folder
# TODO: steps to deploy the package

# ui development
cd ui
yarn dev
open http://appregistry.psibase.127.0.0.1.sslip.io:8081/
open http://workshop.psibase.127.0.0.1.sslip.io:8081/

# about writing a psibase service (kind of a smart contract in evm world)
# wip: about writing a psibase service
open http://docs.psibase.127.0.0.1.sslip.io:8080/development/services/rust-service/index.html
```

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "app-registry-plugin"
name = "workshop-plugin"
version = "0.1.0"
edition = "2021"

Expand All @@ -11,7 +11,7 @@ psibase = { path="../../../../rust/psibase" }
crate-type = ["cdylib"]

[package.metadata.component]
package = "app-registry:plugin"
package = "workshop:plugin"

[package.metadata.component.target]
world = "psibase-plugin"
Expand Down
15 changes: 15 additions & 0 deletions services/user/Workshop/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#[allow(warnings)]
mod bindings;

use bindings::exports::workshop::plugin::test::Guest as Test;
use bindings::host::common::types as CommonTypes;

struct WorkshopPlugin;

impl Test for WorkshopPlugin {
fn foo() -> Result<(), CommonTypes::Error> {
Ok(())
}
}

bindings::export!(WorkshopPlugin with_types_in bindings);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app-registry:plugin;
package workshop:plugin;

interface test {
use host:common/types.{error};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "r-app-reg"
description = "Query service for AppRegistry"
name = "r-workshop"
description = "Query service for Workshop"
edition = "2021"
version = "0.1.0"
publish = false

[package.metadata.psibase]
plugin = "app-registry-plugin"
plugin = "workshop-plugin"

[dependencies]
psibase = { path = "../../../../rust/psibase" }
serde = "1.0"
app-registry = { path = "../service", version = "0.1.0" }
workshop = { path = "../service", version = "0.1.0" }
async-graphql = "7.0.7"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[psibase::service]
#[allow(non_snake_case)]
mod service {
use app_registry;
use workshop;
use async_graphql::*;
use psibase::*;

Expand All @@ -13,24 +13,24 @@ mod service {
async fn app_metadata(
&self,
account_id: AccountNumber,
) -> Option<app_registry::service::AppMetadata> {
app_registry::service::AppMetadataTable::new()
) -> Option<workshop::service::AppMetadata> {
workshop::service::AppMetadataTable::new()
.get_index_pk()
.get(&account_id)
}

async fn event(
&self,
id: u64,
) -> Result<app_registry::service::event_structs::HistoryEvents, anyhow::Error> {
) -> Result<workshop::service::event_structs::HistoryEvents, anyhow::Error> {
get_event(id)
}
}

#[action]
fn serveSys(request: HttpRequest) -> Option<HttpReply> {
None.or_else(|| serve_content(&request, &app_registry::service::WebContentTable::new()))
.or_else(|| serve_simple_ui::<app_registry::Wrapper>(&request))
None.or_else(|| serve_content(&request, &workshop::service::WebContentTable::new()))
.or_else(|| serve_simple_ui::<workshop::Wrapper>(&request))
.or_else(|| serve_graphql(&request, Query))
.or_else(|| serve_graphiql(&request))
}
Expand Down
Loading

0 comments on commit 0d234b5

Please sign in to comment.