From 5620e2d5b25fcfa1b0e7361a4529c15ea5f65a09 Mon Sep 17 00:00:00 2001 From: 8e8b2c <138928994+8e8b2c@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:22:27 +0100 Subject: [PATCH] chore: rename to holoom and add readme (#9) --- .github/workflows/e2e.yml | 22 +-- .gitignore | 2 +- .vscode/settings.json | 10 +- Cargo.lock | 166 +++++++++--------- Cargo.toml | 16 +- README.md | 35 ++++ crates/game_identity_rocket_server/Cargo.toml | 12 -- .../Cargo.toml | 6 +- .../src/lib.rs | 17 +- .../src/tests/mod.rs | 0 .../src/tests/signer.rs | 8 +- .../src/tests/username_registry/mod.rs | 0 .../tests/username_registry/user_metadata.rs | 2 +- .../username_registry/username_attestation.rs | 2 +- .../username_registry/wallet_attestation.rs | 2 +- .../Cargo.toml | 10 +- .../src/health.rs | 4 +- .../src/holochain.rs | 6 +- .../src/lib.rs | 0 .../src/username_registry.rs | 17 +- crates/holoom_rocket_server/Cargo.toml | 12 ++ .../src/main.rs | 4 +- .../src/utils/cors.rs | 0 .../src/utils/mod.rs | 0 .../Cargo.toml | 6 +- .../src/holochain.rs | 2 +- .../src/lib.rs | 0 .../Cargo.toml | 4 +- .../src/endpoint.rs | 0 .../src/error.rs | 0 .../src/lib.rs | 0 .../src/result.rs | 0 .../Cargo.toml | 4 +- .../src/lib.rs | 4 +- crates/signer_coordinator/Cargo.toml | 2 +- crates/signer_coordinator/src/lib.rs | 2 +- .../username_registry_coordinator/Cargo.toml | 2 +- .../username_registry_coordinator/src/lib.rs | 2 +- .../src/user_metadata.rs | 2 +- .../src/username_attestation.rs | 2 +- .../src/wallet_attestation.rs | 2 +- crates/username_registry_integrity/Cargo.toml | 2 +- crates/username_registry_integrity/src/lib.rs | 2 +- .../username_registry_validation/Cargo.toml | 2 +- .../src/agent_username_attestation.rs | 2 +- .../src/agent_wallet_attestation.rs | 2 +- .../src/user_metadata.rs | 2 +- .../src/username_attestation.rs | 2 +- .../src/wallet_attestation.rs | 4 +- docker/misc_hc/prepare_sandbox.sh | 6 +- docker/misc_hc/readme.md | 2 +- docker/misc_hc/run_holo_dev_server.sh | 2 +- docker/rocket/Dockerfile | 6 +- package-lock.json | 32 ++-- package.json | 8 +- packages/client/package.json | 2 +- ...me-identity-client.ts => holoom-client.ts} | 24 +-- packages/client/src/index.ts | 2 +- packages/e2e/package.json | 4 +- packages/e2e/src/main.ts | 12 +- packages/e2e/tests/evm-wallet-binding.test.js | 10 +- packages/e2e/tests/metadata.test.js | 24 +-- packages/e2e/tests/username.test.js | 12 +- packages/e2e/tests/utils/holo.js | 2 +- packages/e2e/tests/utils/testcontainers.js | 14 +- scripts/Dockerfile | 4 +- scripts/build_docker_images.sh | 6 +- scripts/build_rocket_bookworm.sh | 6 +- workdir/dna.yaml | 2 +- workdir/happ.yaml | 6 +- 70 files changed, 306 insertions(+), 285 deletions(-) create mode 100644 README.md delete mode 100644 crates/game_identity_rocket_server/Cargo.toml rename crates/{game_identity_tests => holoom_dna_tests}/Cargo.toml (83%) rename crates/{game_identity_tests => holoom_dna_tests}/src/lib.rs (85%) rename crates/{game_identity_tests => holoom_dna_tests}/src/tests/mod.rs (100%) rename crates/{game_identity_tests => holoom_dna_tests}/src/tests/signer.rs (79%) rename crates/{game_identity_tests => holoom_dna_tests}/src/tests/username_registry/mod.rs (100%) rename crates/{game_identity_tests => holoom_dna_tests}/src/tests/username_registry/user_metadata.rs (95%) rename crates/{game_identity_tests => holoom_dna_tests}/src/tests/username_registry/username_attestation.rs (99%) rename crates/{game_identity_tests => holoom_dna_tests}/src/tests/username_registry/wallet_attestation.rs (98%) rename crates/{game_identity_rocket_controllers => holoom_rocket_controllers}/Cargo.toml (54%) rename crates/{game_identity_rocket_controllers => holoom_rocket_controllers}/src/health.rs (81%) rename crates/{game_identity_rocket_controllers => holoom_rocket_controllers}/src/holochain.rs (82%) rename crates/{game_identity_rocket_controllers => holoom_rocket_controllers}/src/lib.rs (100%) rename crates/{game_identity_rocket_controllers => holoom_rocket_controllers}/src/username_registry.rs (91%) create mode 100644 crates/holoom_rocket_server/Cargo.toml rename crates/{game_identity_rocket_server => holoom_rocket_server}/src/main.rs (93%) rename crates/{game_identity_rocket_server => holoom_rocket_server}/src/utils/cors.rs (100%) rename crates/{game_identity_rocket_server => holoom_rocket_server}/src/utils/mod.rs (100%) rename crates/{game_identity_rocket_state => holoom_rocket_state}/Cargo.toml (70%) rename crates/{game_identity_rocket_state => holoom_rocket_state}/src/holochain.rs (99%) rename crates/{game_identity_rocket_state => holoom_rocket_state}/src/lib.rs (100%) rename crates/{game_identity_rocket_types => holoom_rocket_types}/Cargo.toml (82%) rename crates/{game_identity_rocket_types => holoom_rocket_types}/src/endpoint.rs (100%) rename crates/{game_identity_rocket_types => holoom_rocket_types}/src/error.rs (100%) rename crates/{game_identity_rocket_types => holoom_rocket_types}/src/lib.rs (100%) rename crates/{game_identity_rocket_types => holoom_rocket_types}/src/result.rs (100%) rename crates/{game_identity_types => holoom_types}/Cargo.toml (80%) rename crates/{game_identity_types => holoom_types}/src/lib.rs (94%) rename packages/client/src/{holochain-game-identity-client.ts => holoom-client.ts} (90%) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0432bf4..35240d6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -29,7 +29,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: game-identity-dna-${{ hashFiles('**/Cargo.lock') }} + key: holoom-dna-${{ hashFiles('**/Cargo.lock') }} - name: Build DNA run: | nix develop --command \ @@ -52,13 +52,13 @@ jobs: docker run -i \ -v "$(pwd):/proj" \ -w /proj rocket-builder bash -c \ - "cargo build --release --package game_identity_rocket_server" + "cargo build --release --package holoom_rocket_server" - run: ls -l target # - run: ls -l target/release - run: whoami - run: sudo chown -R $(whoami) target - name: Ready artifact dir - run: mkdir artifact && mv target/release/game_identity_rocket_server artifact/ + run: mkdir artifact && mv target/release/holoom_rocket_server artifact/ - uses: actions/upload-artifact@v4 if: always() with: @@ -93,7 +93,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: game-identity-dna-tests-${{ hashFiles('**/Cargo.lock') }} + key: holoom-dna-tests-${{ hashFiles('**/Cargo.lock') }} - run: rm -rf workdir - name: Download DNA uses: actions/download-artifact@v4 @@ -124,13 +124,13 @@ jobs: with: name: rocket path: rocket-artifact - - run: mv rocket-artifact/game_identity_rocket_server docker/rocket/ + - run: mv rocket-artifact/holoom_rocket_server docker/rocket/ - name: Build images run: | - docker build --target local-services -t game-identity/local-services docker/misc_hc - docker build --target authority-agent-sandbox -t game-identity/authority-agent-sandbox docker/misc_hc - docker build --target holo-dev-server -t game-identity/holo-dev-server docker/misc_hc - docker build -t game-identity/rocket docker/rocket + docker build --target local-services -t holoom/local-services docker/misc_hc + docker build --target authority-agent-sandbox -t holoom/authority-agent-sandbox docker/misc_hc + docker build --target holo-dev-server -t holoom/holo-dev-server docker/misc_hc + docker build -t holoom/rocket docker/rocket - name: Setup Node uses: actions/setup-node@v3 with: @@ -145,6 +145,6 @@ jobs: - run: npx puppeteer browsers install chrome - run: npm run build:client - name: Start frontend in background - run: npm run dev -w @holochain-game-identity/e2e & + run: npm run dev -w @holoom/e2e & - name: Run e2e tests - run: npm run test -w @holochain-game-identity/e2e + run: npm run test -w @holoom/e2e diff --git a/.gitignore b/.gitignore index 4efe223..9cbe682 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ node_modules dist docker/misc_hc/happ_workdir -docker/rocket/game_identity_rocket_server +docker/rocket/holoom_rocket_server diff --git a/.vscode/settings.json b/.vscode/settings.json index bc5f7bf..2a66d4a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,11 @@ { - "cSpell.words": ["Dalek", "Holochain", "pubkey", "Solana", "zome", "zomes"] + "cSpell.words": [ + "Dalek", + "Holochain", + "Holoom", + "pubkey", + "Solana", + "zome", + "zomes" + ] } diff --git a/Cargo.lock b/Cargo.lock index 0d09640..d0d5c82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2859,85 +2859,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "game_identity_rocket_controllers" -version = "0.0.1" -dependencies = [ - "bs58 0.5.0", - "game_identity_rocket_state", - "game_identity_rocket_types", - "game_identity_types", - "holo_hash", - "holochain_zome_types", - "rocket", - "rocket_okapi", -] - -[[package]] -name = "game_identity_rocket_server" -version = "0.1.0" -dependencies = [ - "game_identity_rocket_controllers", - "game_identity_rocket_state", - "game_identity_rocket_types", - "rocket", - "rocket_cors", - "rocket_okapi", -] - -[[package]] -name = "game_identity_rocket_state" -version = "0.0.1" -dependencies = [ - "game_identity_rocket_types", - "holochain_client", - "holochain_conductor_api", - "holochain_zome_types", - "rocket", - "serde", -] - -[[package]] -name = "game_identity_rocket_types" -version = "0.0.1" -dependencies = [ - "holochain_client", - "rocket", - "rocket_okapi", - "schemars", - "serde", - "serde_variant", - "snafu", - "strum 0.26.2", - "strum_macros 0.26.2", -] - -[[package]] -name = "game_identity_tests" -version = "0.0.1" -dependencies = [ - "bs58 0.5.0", - "ed25519-dalek", - "ethers-signers", - "game_identity_types", - "hdk", - "holochain", - "holochain_keystore", - "serde", - "tokio", - "username_registry_validation", -] - -[[package]] -name = "game_identity_types" -version = "0.0.3" -dependencies = [ - "alloy-primitives", - "ed25519-dalek", - "hdi", - "serde", -] - [[package]] name = "gcc" version = "0.3.55" @@ -3995,6 +3916,85 @@ dependencies = [ "tracing", ] +[[package]] +name = "holoom_dna_tests" +version = "0.0.1" +dependencies = [ + "bs58 0.5.0", + "ed25519-dalek", + "ethers-signers", + "hdk", + "holochain", + "holochain_keystore", + "holoom_types", + "serde", + "tokio", + "username_registry_validation", +] + +[[package]] +name = "holoom_rocket_controllers" +version = "0.0.1" +dependencies = [ + "bs58 0.5.0", + "holo_hash", + "holochain_zome_types", + "holoom_rocket_state", + "holoom_rocket_types", + "holoom_types", + "rocket", + "rocket_okapi", +] + +[[package]] +name = "holoom_rocket_server" +version = "0.1.0" +dependencies = [ + "holoom_rocket_controllers", + "holoom_rocket_state", + "holoom_rocket_types", + "rocket", + "rocket_cors", + "rocket_okapi", +] + +[[package]] +name = "holoom_rocket_state" +version = "0.0.1" +dependencies = [ + "holochain_client", + "holochain_conductor_api", + "holochain_zome_types", + "holoom_rocket_types", + "rocket", + "serde", +] + +[[package]] +name = "holoom_rocket_types" +version = "0.0.1" +dependencies = [ + "holochain_client", + "rocket", + "rocket_okapi", + "schemars", + "serde", + "serde_variant", + "snafu", + "strum 0.26.2", + "strum_macros 0.26.2", +] + +[[package]] +name = "holoom_types" +version = "0.0.3" +dependencies = [ + "alloy-primitives", + "ed25519-dalek", + "hdi", + "serde", +] + [[package]] name = "home" version = "0.5.9" @@ -7762,8 +7762,8 @@ dependencies = [ name = "signer_coordinator" version = "0.0.1" dependencies = [ - "game_identity_types", "hdk", + "holoom_types", "serde", ] @@ -9104,8 +9104,8 @@ name = "username_registry_coordinator" version = "0.0.1" dependencies = [ "bincode", - "game_identity_types", "hdk", + "holoom_types", "username_registry_integrity", "username_registry_validation", ] @@ -9114,8 +9114,8 @@ dependencies = [ name = "username_registry_integrity" version = "0.0.1" dependencies = [ - "game_identity_types", "hdi", + "holoom_types", "serde", "username_registry_validation", ] @@ -9127,9 +9127,9 @@ dependencies = [ "bincode", "bs58 0.5.0", "ed25519-dalek", - "game_identity_types", "hdi", "holo_hash", + "holoom_types", "serde", ] diff --git a/Cargo.toml b/Cargo.toml index a9ee7f4..bd560cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,8 +28,8 @@ holochain_zome_types = "0.2.6" rocket = "0.5.0" rocket_okapi = { version = "0.8.0", features = ["swagger"] } -[workspace.dependencies.game_identity_types] -path = "crates/game_identity_types" +[workspace.dependencies.holoom_types] +path = "crates/holoom_types" [workspace.dependencies.username_registry_validation] path = "crates/username_registry_validation" @@ -43,11 +43,11 @@ path = "crates/username_registry_coordinator" [workspace.dependencies.signer_coordinator] path = "crates/signer_coordinator" -[workspace.dependencies.game_identity_rocket_types] -path = "crates/game_identity_rocket_types" +[workspace.dependencies.holoom_rocket_types] +path = "crates/holoom_rocket_types" -[workspace.dependencies.game_identity_rocket_state] -path = "crates/game_identity_rocket_state" +[workspace.dependencies.holoom_rocket_state] +path = "crates/holoom_rocket_state" -[workspace.dependencies.game_identity_rocket_controllers] -path = "crates/game_identity_rocket_controllers" +[workspace.dependencies.holoom_rocket_controllers] +path = "crates/holoom_rocket_controllers" diff --git a/README.md b/README.md new file mode 100644 index 0000000..bf5d631 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Holoom + +Tools for weaving blockchain data into holochain. + +## Key Components + +### Holoom hApp + +A Holoom hApp network provides a space in which users can: + +- Register a unique username to their holochain agent (made possible by an authority agent) +- Bind their various blockchain wallets to their agent with use of signatures +- Curate freeform metadata strings linked to their own agent + +### `@holoom/client` + +An npm library that provides helpers for interacting with a Holoom hApp agent, whether that be via the holo network, or with a conductor directly. + +### Holoom Rocket Server + +Provides a REST API wrapper for a Holoom conductor instance (usually the authority agent). This is useful for building services around a Holoom network that are intended to be accessed without requiring ownership of an agent within the network. + +## The Authority Agent + +Each Holoom network is intialised with an authority agent specified in the network's DNA properties. The role of the authority agent is to maintain a registry of unique usernames, and is expected to be run on a server maintained by the instigator of the network. The authority agent is considered to be a partially trusted node in that users can validate its correct execution, but cannot prevent its downtime or censorship decisions. + +## Testing + +### `crates/holoom_dna_tests` + +This provides coverage for the holoom hApp's various zomes, and can be invoked locally using `npm run test:dna`. + +### `packages/e2e` + +This provides coverage for using the hApp in conjunction with the `@holoom/client` and `holoom_rocket_server` components. diff --git a/crates/game_identity_rocket_server/Cargo.toml b/crates/game_identity_rocket_server/Cargo.toml deleted file mode 100644 index 9636f9e..0000000 --- a/crates/game_identity_rocket_server/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "game_identity_rocket_server" -version = "0.1.0" -edition = "2021" - -[dependencies] -rocket = { workspace = true } -rocket_cors = "0.6.0" -rocket_okapi = { workspace = true } -game_identity_rocket_types = { workspace = true } -game_identity_rocket_state = { workspace = true } -game_identity_rocket_controllers = { workspace = true } diff --git a/crates/game_identity_tests/Cargo.toml b/crates/holoom_dna_tests/Cargo.toml similarity index 83% rename from crates/game_identity_tests/Cargo.toml rename to crates/holoom_dna_tests/Cargo.toml index fe579af..201fc0c 100644 --- a/crates/game_identity_tests/Cargo.toml +++ b/crates/holoom_dna_tests/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "game_identity_tests" +name = "holoom_dna_tests" version = "0.0.1" edition = "2021" [lib] crate-type = ["cdylib", "rlib"] -name = "game_identity_tests" +name = "holoom_dna_tests" [dependencies] serde = { workspace = true } -game_identity_types = { workspace = true } +holoom_types = { workspace = true } hdk = { workspace = true, features = ["encoding", "test_utils"] } holochain = { workspace = true, default-features = false, features = [ "test_utils", diff --git a/crates/game_identity_tests/src/lib.rs b/crates/holoom_dna_tests/src/lib.rs similarity index 85% rename from crates/game_identity_tests/src/lib.rs rename to crates/holoom_dna_tests/src/lib.rs index 8ab833e..ea2a76a 100644 --- a/crates/game_identity_tests/src/lib.rs +++ b/crates/holoom_dna_tests/src/lib.rs @@ -1,12 +1,12 @@ use std::time::Duration; -use game_identity_types::GameIdentityDnaProperties; use hdk::prelude::*; use holochain::{ conductor::{api::error::ConductorApiResult, config::ConductorConfig}, prelude::DnaFile, sweettest::{consistency, SweetAgents, SweetCell, SweetConductorBatch, SweetDnaFile}, }; +use holoom_types::HoloomDnaProperties; #[cfg(test)] mod tests; @@ -15,14 +15,14 @@ async fn load_dna() -> DnaFile { // Use prebuilt dna file let dna_path = std::env::current_dir() .unwrap() - .join("../../workdir/game_identity.dna"); + .join("../../workdir/holoom.dna"); SweetDnaFile::from_bundle(&dna_path).await.unwrap() } -pub async fn game_identity_dna_with_authority(authority_agent: &AgentPubKey) -> DnaFile { +pub async fn holoom_dna_with_authority(authority_agent: &AgentPubKey) -> DnaFile { let dna = load_dna().await; - let properties = SerializedBytes::try_from(GameIdentityDnaProperties { + let properties = SerializedBytes::try_from(HoloomDnaProperties { authority_agent: authority_agent.to_string(), }) .unwrap(); @@ -47,19 +47,16 @@ impl TestSetup { let authority_agent_pubkey = SweetAgents::one(conductors[0].keystore()).await; - let dnas = &[game_identity_dna_with_authority(&authority_agent_pubkey).await]; + let dnas = &[holoom_dna_with_authority(&authority_agent_pubkey).await]; let authority_app = conductors[0] - .setup_app_for_agent("game_identity", authority_agent_pubkey.clone(), dnas) + .setup_app_for_agent("holoom", authority_agent_pubkey.clone(), dnas) .await .unwrap(); let (authority_cell,) = authority_app.into_tuple(); let mut cells = Vec::from([authority_cell]); for i in 1..1 + user_count { - let user_app = conductors[i] - .setup_app("game_identity", dnas) - .await - .unwrap(); + let user_app = conductors[i].setup_app("holoom", dnas).await.unwrap(); let (user_cell,) = user_app.into_tuple(); cells.push(user_cell); } diff --git a/crates/game_identity_tests/src/tests/mod.rs b/crates/holoom_dna_tests/src/tests/mod.rs similarity index 100% rename from crates/game_identity_tests/src/tests/mod.rs rename to crates/holoom_dna_tests/src/tests/mod.rs diff --git a/crates/game_identity_tests/src/tests/signer.rs b/crates/holoom_dna_tests/src/tests/signer.rs similarity index 79% rename from crates/game_identity_tests/src/tests/signer.rs rename to crates/holoom_dna_tests/src/tests/signer.rs index 8d68841..fa492f4 100644 --- a/crates/game_identity_tests/src/tests/signer.rs +++ b/crates/holoom_dna_tests/src/tests/signer.rs @@ -1,19 +1,19 @@ -use crate::game_identity_dna_with_authority; -use game_identity_types::SignableBytes; +use crate::holoom_dna_with_authority; use hdk::prelude::fake_agent_pubkey_1; use holochain::{conductor::config::ConductorConfig, prelude::Signature, sweettest::*}; use holochain_keystore::AgentPubKeyExt; +use holoom_types::SignableBytes; #[tokio::test(flavor = "multi_thread")] async fn sign_message_verify_signature() { - let dna = game_identity_dna_with_authority(&fake_agent_pubkey_1()).await; + let dna = holoom_dna_with_authority(&fake_agent_pubkey_1()).await; // Set up conductors let mut conductor = SweetConductor::from_config(ConductorConfig::default()).await; let alice_agentpubkey = SweetAgents::one(conductor.keystore()).await; let app = conductor - .setup_app_for_agent("game_identity", alice_agentpubkey.clone(), &[dna]) + .setup_app_for_agent("holoom", alice_agentpubkey.clone(), &[dna]) .await .unwrap(); let (alice,) = app.into_tuple(); diff --git a/crates/game_identity_tests/src/tests/username_registry/mod.rs b/crates/holoom_dna_tests/src/tests/username_registry/mod.rs similarity index 100% rename from crates/game_identity_tests/src/tests/username_registry/mod.rs rename to crates/holoom_dna_tests/src/tests/username_registry/mod.rs diff --git a/crates/game_identity_tests/src/tests/username_registry/user_metadata.rs b/crates/holoom_dna_tests/src/tests/username_registry/user_metadata.rs similarity index 95% rename from crates/game_identity_tests/src/tests/username_registry/user_metadata.rs rename to crates/holoom_dna_tests/src/tests/username_registry/user_metadata.rs index 2c6dfd6..2ade9a5 100644 --- a/crates/game_identity_tests/src/tests/username_registry/user_metadata.rs +++ b/crates/holoom_dna_tests/src/tests/username_registry/user_metadata.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; -use game_identity_types::{GetMetadataItemValuePayload, UpdateMetadataItemPayload}; use holochain::conductor::api::error::ConductorApiError; +use holoom_types::{GetMetadataItemValuePayload, UpdateMetadataItemPayload}; use crate::TestSetup; diff --git a/crates/game_identity_tests/src/tests/username_registry/username_attestation.rs b/crates/holoom_dna_tests/src/tests/username_registry/username_attestation.rs similarity index 99% rename from crates/game_identity_tests/src/tests/username_registry/username_attestation.rs rename to crates/holoom_dna_tests/src/tests/username_registry/username_attestation.rs index 89be6c8..f8dce0f 100644 --- a/crates/game_identity_tests/src/tests/username_registry/username_attestation.rs +++ b/crates/holoom_dna_tests/src/tests/username_registry/username_attestation.rs @@ -1,6 +1,6 @@ -use game_identity_types::{SignableBytes, SignedUsername, UsernameAttestation}; use hdk::prelude::*; use holochain::conductor::api::error::ConductorApiError; +use holoom_types::{SignableBytes, SignedUsername, UsernameAttestation}; use crate::TestSetup; diff --git a/crates/game_identity_tests/src/tests/username_registry/wallet_attestation.rs b/crates/holoom_dna_tests/src/tests/username_registry/wallet_attestation.rs similarity index 98% rename from crates/game_identity_tests/src/tests/username_registry/wallet_attestation.rs rename to crates/holoom_dna_tests/src/tests/username_registry/wallet_attestation.rs index 1e74d05..ec3c64c 100644 --- a/crates/game_identity_tests/src/tests/username_registry/wallet_attestation.rs +++ b/crates/holoom_dna_tests/src/tests/username_registry/wallet_attestation.rs @@ -1,6 +1,6 @@ -use game_identity_types::{ChainWalletSignature, EvmAddress, EvmSignature, WalletAttestation}; use hdk::prelude::*; use holochain::conductor::api::error::ConductorApiResult; +use holoom_types::{ChainWalletSignature, EvmAddress, EvmSignature, WalletAttestation}; use std::str::FromStr; use username_registry_validation::{evm_signing_message, solana_signing_message}; diff --git a/crates/game_identity_rocket_controllers/Cargo.toml b/crates/holoom_rocket_controllers/Cargo.toml similarity index 54% rename from crates/game_identity_rocket_controllers/Cargo.toml rename to crates/holoom_rocket_controllers/Cargo.toml index ad27e0d..7bb5f8a 100644 --- a/crates/game_identity_rocket_controllers/Cargo.toml +++ b/crates/holoom_rocket_controllers/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "game_identity_rocket_controllers" +name = "holoom_rocket_controllers" version = "0.0.1" edition = "2021" [lib] crate-type = ["cdylib", "rlib"] -name = "game_identity_rocket_controllers" +name = "holoom_rocket_controllers" [dependencies] -game_identity_types = { workspace = true } -game_identity_rocket_types = { workspace = true } -game_identity_rocket_state = { workspace = true } +holoom_types = { workspace = true } +holoom_rocket_types = { workspace = true } +holoom_rocket_state = { workspace = true } holo_hash = { workspace = true } holochain_zome_types = { workspace = true } bs58 = { workspace = true } diff --git a/crates/game_identity_rocket_controllers/src/health.rs b/crates/holoom_rocket_controllers/src/health.rs similarity index 81% rename from crates/game_identity_rocket_controllers/src/health.rs rename to crates/holoom_rocket_controllers/src/health.rs index f725beb..7fb197d 100644 --- a/crates/game_identity_rocket_controllers/src/health.rs +++ b/crates/holoom_rocket_controllers/src/health.rs @@ -1,11 +1,11 @@ -use game_identity_rocket_types::{endpoint::BlankResponse, result::JsonResult}; +use holoom_rocket_types::{endpoint::BlankResponse, result::JsonResult}; use rocket::{get, serde::json::Json}; use rocket_okapi::openapi; /// # /// ## Confirm the API is alive /// -/// *This is intended to be called by tests or monitoring services, not the game.* +/// *This is intended to be called by tests or monitoring services.* /// /// Always returns a blank success response. #[openapi(tag = "health")] diff --git a/crates/game_identity_rocket_controllers/src/holochain.rs b/crates/holoom_rocket_controllers/src/holochain.rs similarity index 82% rename from crates/game_identity_rocket_controllers/src/holochain.rs rename to crates/holoom_rocket_controllers/src/holochain.rs index 1a689e3..656e781 100644 --- a/crates/game_identity_rocket_controllers/src/holochain.rs +++ b/crates/holoom_rocket_controllers/src/holochain.rs @@ -1,5 +1,5 @@ -use game_identity_rocket_state::holochain::HolochainClientState; -use game_identity_rocket_types::{endpoint::*, result::*}; +use holoom_rocket_state::holochain::HolochainClientState; +use holoom_rocket_types::{endpoint::*, result::*}; use rocket::{get, serde::json::Json, State}; use rocket_okapi::openapi; @@ -30,7 +30,7 @@ pub async fn app_info( pub async fn ping(holochain_state: &State) -> JsonResult { holochain_state .client - .call_zome::<(), ()>("game_identity", "ping", "ping", ()) + .call_zome::<(), ()>("holoom", "ping", "ping", ()) .await?; Ok(Json(BlankResponse { success: true })) diff --git a/crates/game_identity_rocket_controllers/src/lib.rs b/crates/holoom_rocket_controllers/src/lib.rs similarity index 100% rename from crates/game_identity_rocket_controllers/src/lib.rs rename to crates/holoom_rocket_controllers/src/lib.rs diff --git a/crates/game_identity_rocket_controllers/src/username_registry.rs b/crates/holoom_rocket_controllers/src/username_registry.rs similarity index 91% rename from crates/game_identity_rocket_controllers/src/username_registry.rs rename to crates/holoom_rocket_controllers/src/username_registry.rs index 9c60c9b..dd5e3fe 100644 --- a/crates/game_identity_rocket_controllers/src/username_registry.rs +++ b/crates/holoom_rocket_controllers/src/username_registry.rs @@ -1,10 +1,10 @@ use std::collections::HashMap; -use game_identity_rocket_state::holochain::HolochainClientState; -use game_identity_rocket_types::{endpoint::*, result::*, ApiError}; -use game_identity_types::{ChainWalletSignature, UsernameAttestation, WalletAttestation}; use holo_hash::AgentPubKey; use holochain_zome_types::Record; +use holoom_rocket_state::holochain::HolochainClientState; +use holoom_rocket_types::{endpoint::*, result::*, ApiError}; +use holoom_types::{ChainWalletSignature, UsernameAttestation, WalletAttestation}; use rocket::{get, serde::json::Json, State}; use rocket_okapi::openapi; @@ -22,7 +22,7 @@ pub async fn bare( let records: Vec = holochain_state .client .call_zome( - "game_identity", + "holoom", "username_registry", "get_all_username_attestations", (), @@ -68,7 +68,7 @@ pub async fn wallets( let records: Vec = holochain_state .client .call_zome( - "game_identity", + "holoom", "username_registry", "get_wallet_attestations_for_agent", agent_pubkey, @@ -127,12 +127,7 @@ pub async fn metadata( .map_err(|_| ApiError::AgentPubKeyB64Invalid { agent_pubkey_b64 })?; let metadata: HashMap = holochain_state .client - .call_zome( - "game_identity", - "username_registry", - "get_metadata", - agent_pubkey, - ) + .call_zome("holoom", "username_registry", "get_metadata", agent_pubkey) .await?; Ok(Json(UsernameRegistryMetadataResponse { diff --git a/crates/holoom_rocket_server/Cargo.toml b/crates/holoom_rocket_server/Cargo.toml new file mode 100644 index 0000000..603560d --- /dev/null +++ b/crates/holoom_rocket_server/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "holoom_rocket_server" +version = "0.1.0" +edition = "2021" + +[dependencies] +rocket = { workspace = true } +rocket_cors = "0.6.0" +rocket_okapi = { workspace = true } +holoom_rocket_types = { workspace = true } +holoom_rocket_state = { workspace = true } +holoom_rocket_controllers = { workspace = true } diff --git a/crates/game_identity_rocket_server/src/main.rs b/crates/holoom_rocket_server/src/main.rs similarity index 93% rename from crates/game_identity_rocket_server/src/main.rs rename to crates/holoom_rocket_server/src/main.rs index 50c394f..e986698 100644 --- a/crates/game_identity_rocket_server/src/main.rs +++ b/crates/holoom_rocket_server/src/main.rs @@ -1,5 +1,5 @@ -use game_identity_rocket_controllers as controllers; -use game_identity_rocket_state as state; +use holoom_rocket_controllers as controllers; +use holoom_rocket_state as state; use rocket_cors::catch_all_options_routes; use rocket_okapi::openapi_get_routes; use rocket_okapi::swagger_ui::{make_swagger_ui, SwaggerUIConfig}; diff --git a/crates/game_identity_rocket_server/src/utils/cors.rs b/crates/holoom_rocket_server/src/utils/cors.rs similarity index 100% rename from crates/game_identity_rocket_server/src/utils/cors.rs rename to crates/holoom_rocket_server/src/utils/cors.rs diff --git a/crates/game_identity_rocket_server/src/utils/mod.rs b/crates/holoom_rocket_server/src/utils/mod.rs similarity index 100% rename from crates/game_identity_rocket_server/src/utils/mod.rs rename to crates/holoom_rocket_server/src/utils/mod.rs diff --git a/crates/game_identity_rocket_state/Cargo.toml b/crates/holoom_rocket_state/Cargo.toml similarity index 70% rename from crates/game_identity_rocket_state/Cargo.toml rename to crates/holoom_rocket_state/Cargo.toml index df68a2f..0f2f560 100644 --- a/crates/game_identity_rocket_state/Cargo.toml +++ b/crates/holoom_rocket_state/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "game_identity_rocket_state" +name = "holoom_rocket_state" version = "0.0.1" edition = "2021" [lib] crate-type = ["cdylib", "rlib"] -name = "game_identity_rocket_state" +name = "holoom_rocket_state" [dependencies] serde = { workspace = true } rocket = { workspace = true } -game_identity_rocket_types = { workspace = true } +holoom_rocket_types = { workspace = true } holochain_client = { workspace = true } holochain_conductor_api = { workspace = true } holochain_zome_types = { workspace = true } diff --git a/crates/game_identity_rocket_state/src/holochain.rs b/crates/holoom_rocket_state/src/holochain.rs similarity index 99% rename from crates/game_identity_rocket_state/src/holochain.rs rename to crates/holoom_rocket_state/src/holochain.rs index 6d39dc3..25028df 100644 --- a/crates/game_identity_rocket_state/src/holochain.rs +++ b/crates/holoom_rocket_state/src/holochain.rs @@ -1,4 +1,4 @@ -use game_identity_rocket_types::{error::*, result::*}; +use holoom_rocket_types::{error::*, result::*}; use holochain_client::{ AdminWebsocket, AppAgentWebsocket, AppInfo, AppWebsocket, AuthorizeSigningCredentialsPayload, diff --git a/crates/game_identity_rocket_state/src/lib.rs b/crates/holoom_rocket_state/src/lib.rs similarity index 100% rename from crates/game_identity_rocket_state/src/lib.rs rename to crates/holoom_rocket_state/src/lib.rs diff --git a/crates/game_identity_rocket_types/Cargo.toml b/crates/holoom_rocket_types/Cargo.toml similarity index 82% rename from crates/game_identity_rocket_types/Cargo.toml rename to crates/holoom_rocket_types/Cargo.toml index 0928dfa..ad55586 100644 --- a/crates/game_identity_rocket_types/Cargo.toml +++ b/crates/holoom_rocket_types/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "game_identity_rocket_types" +name = "holoom_rocket_types" version = "0.0.1" edition = "2021" [lib] crate-type = ["cdylib", "rlib"] -name = "game_identity_rocket_types" +name = "holoom_rocket_types" [dependencies] serde = { workspace = true } diff --git a/crates/game_identity_rocket_types/src/endpoint.rs b/crates/holoom_rocket_types/src/endpoint.rs similarity index 100% rename from crates/game_identity_rocket_types/src/endpoint.rs rename to crates/holoom_rocket_types/src/endpoint.rs diff --git a/crates/game_identity_rocket_types/src/error.rs b/crates/holoom_rocket_types/src/error.rs similarity index 100% rename from crates/game_identity_rocket_types/src/error.rs rename to crates/holoom_rocket_types/src/error.rs diff --git a/crates/game_identity_rocket_types/src/lib.rs b/crates/holoom_rocket_types/src/lib.rs similarity index 100% rename from crates/game_identity_rocket_types/src/lib.rs rename to crates/holoom_rocket_types/src/lib.rs diff --git a/crates/game_identity_rocket_types/src/result.rs b/crates/holoom_rocket_types/src/result.rs similarity index 100% rename from crates/game_identity_rocket_types/src/result.rs rename to crates/holoom_rocket_types/src/result.rs diff --git a/crates/game_identity_types/Cargo.toml b/crates/holoom_types/Cargo.toml similarity index 80% rename from crates/game_identity_types/Cargo.toml rename to crates/holoom_types/Cargo.toml index 2b5eef1..f39ce38 100644 --- a/crates/game_identity_types/Cargo.toml +++ b/crates/holoom_types/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "game_identity_types" +name = "holoom_types" version = "0.0.3" edition = "2021" [lib] crate-type = ["cdylib", "rlib"] -name = "game_identity_types" +name = "holoom_types" [dependencies] hdi = { workspace = true } diff --git a/crates/game_identity_types/src/lib.rs b/crates/holoom_types/src/lib.rs similarity index 94% rename from crates/game_identity_types/src/lib.rs rename to crates/holoom_types/src/lib.rs index af1e9f9..446427a 100644 --- a/crates/game_identity_types/src/lib.rs +++ b/crates/holoom_types/src/lib.rs @@ -64,12 +64,12 @@ pub struct SignableBytes(pub Vec); #[dna_properties] #[derive(Clone)] -pub struct GameIdentityDnaProperties { +pub struct HoloomDnaProperties { pub authority_agent: String, } pub fn get_authority_agent() -> ExternResult { - let dna_props = GameIdentityDnaProperties::try_from_dna_properties()?; + let dna_props = HoloomDnaProperties::try_from_dna_properties()?; AgentPubKey::try_from(dna_props.authority_agent).map_err(|_| { wasm_error!(WasmErrorInner::Guest( "Failed to deserialize AgentPubKey from dna properties".into() diff --git a/crates/signer_coordinator/Cargo.toml b/crates/signer_coordinator/Cargo.toml index fcd8080..7e30a6e 100644 --- a/crates/signer_coordinator/Cargo.toml +++ b/crates/signer_coordinator/Cargo.toml @@ -10,4 +10,4 @@ name = "signer_coordinator" [dependencies] hdk = { workspace = true } serde = { workspace = true } -game_identity_types = { workspace = true } +holoom_types = { workspace = true } diff --git a/crates/signer_coordinator/src/lib.rs b/crates/signer_coordinator/src/lib.rs index 1d5c887..ef18f8e 100644 --- a/crates/signer_coordinator/src/lib.rs +++ b/crates/signer_coordinator/src/lib.rs @@ -1,5 +1,5 @@ -use game_identity_types::SignableBytes; use hdk::prelude::*; +use holoom_types::SignableBytes; /// Sign secret message with agent key as transferable proof that user owns this account #[hdk_extern] diff --git a/crates/username_registry_coordinator/Cargo.toml b/crates/username_registry_coordinator/Cargo.toml index c5ddbf7..c6a3e80 100644 --- a/crates/username_registry_coordinator/Cargo.toml +++ b/crates/username_registry_coordinator/Cargo.toml @@ -11,5 +11,5 @@ name = "username_registry_coordinator" hdk = { workspace = true } bincode = { workspace = true } username_registry_integrity = { workspace = true } -game_identity_types = { workspace = true } +holoom_types = { workspace = true } username_registry_validation = { workspace = true } diff --git a/crates/username_registry_coordinator/src/lib.rs b/crates/username_registry_coordinator/src/lib.rs index 9dbc012..9a4a804 100644 --- a/crates/username_registry_coordinator/src/lib.rs +++ b/crates/username_registry_coordinator/src/lib.rs @@ -1,8 +1,8 @@ pub mod user_metadata; pub mod username_attestation; pub mod wallet_attestation; -use game_identity_types::get_authority_agent; use hdk::prelude::*; +use holoom_types::get_authority_agent; #[hdk_extern] pub fn init(_: ()) -> ExternResult { diff --git a/crates/username_registry_coordinator/src/user_metadata.rs b/crates/username_registry_coordinator/src/user_metadata.rs index 294a5a3..8c43324 100644 --- a/crates/username_registry_coordinator/src/user_metadata.rs +++ b/crates/username_registry_coordinator/src/user_metadata.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; -use game_identity_types::{GetMetadataItemValuePayload, MetadataItem, UpdateMetadataItemPayload}; use hdk::prelude::*; +use holoom_types::{GetMetadataItemValuePayload, MetadataItem, UpdateMetadataItemPayload}; use username_registry_integrity::*; #[hdk_extern] diff --git a/crates/username_registry_coordinator/src/username_attestation.rs b/crates/username_registry_coordinator/src/username_attestation.rs index ad3421b..590f36b 100644 --- a/crates/username_registry_coordinator/src/username_attestation.rs +++ b/crates/username_registry_coordinator/src/username_attestation.rs @@ -1,4 +1,4 @@ -use game_identity_types::{get_authority_agent, SignedUsername, UsernameAttestation}; +use holoom_types::{get_authority_agent, SignedUsername, UsernameAttestation}; use hdk::prelude::*; use username_registry_integrity::*; diff --git a/crates/username_registry_coordinator/src/wallet_attestation.rs b/crates/username_registry_coordinator/src/wallet_attestation.rs index 05f89ef..4e7c870 100644 --- a/crates/username_registry_coordinator/src/wallet_attestation.rs +++ b/crates/username_registry_coordinator/src/wallet_attestation.rs @@ -1,5 +1,5 @@ -use game_identity_types::{ChainWalletSignature, EvmAddress, SolanaAddress, WalletAttestation}; use hdk::prelude::*; +use holoom_types::{ChainWalletSignature, EvmAddress, SolanaAddress, WalletAttestation}; use username_registry_integrity::*; use username_registry_validation::{evm_signing_message, solana_signing_message}; diff --git a/crates/username_registry_integrity/Cargo.toml b/crates/username_registry_integrity/Cargo.toml index 48e8a41..a0f9d12 100644 --- a/crates/username_registry_integrity/Cargo.toml +++ b/crates/username_registry_integrity/Cargo.toml @@ -10,5 +10,5 @@ name = "username_registry_integrity" [dependencies] hdi = { workspace = true } serde = { workspace = true } -game_identity_types = { workspace = true } +holoom_types = { workspace = true } username_registry_validation = { workspace = true } diff --git a/crates/username_registry_integrity/src/lib.rs b/crates/username_registry_integrity/src/lib.rs index a83f32e..84e0a56 100644 --- a/crates/username_registry_integrity/src/lib.rs +++ b/crates/username_registry_integrity/src/lib.rs @@ -1,5 +1,5 @@ -use game_identity_types::{UsernameAttestation, WalletAttestation}; use hdi::prelude::*; +use holoom_types::{UsernameAttestation, WalletAttestation}; use username_registry_validation::*; #[derive(Serialize, Deserialize)] diff --git a/crates/username_registry_validation/Cargo.toml b/crates/username_registry_validation/Cargo.toml index c80db45..49a43b9 100644 --- a/crates/username_registry_validation/Cargo.toml +++ b/crates/username_registry_validation/Cargo.toml @@ -12,6 +12,6 @@ hdi = { workspace = true } holo_hash = { workspace = true } serde = { workspace = true } bincode = { workspace = true } -game_identity_types = { workspace = true } +holoom_types = { workspace = true } ed25519-dalek = { workspace = true } bs58 = { workspace = true } diff --git a/crates/username_registry_validation/src/agent_username_attestation.rs b/crates/username_registry_validation/src/agent_username_attestation.rs index c9ec0c3..91a02df 100644 --- a/crates/username_registry_validation/src/agent_username_attestation.rs +++ b/crates/username_registry_validation/src/agent_username_attestation.rs @@ -1,5 +1,5 @@ -use game_identity_types::{get_authority_agent, UsernameAttestation}; use hdi::prelude::*; +use holoom_types::{get_authority_agent, UsernameAttestation}; pub fn validate_create_link_agent_to_username_attestations( action: CreateLink, diff --git a/crates/username_registry_validation/src/agent_wallet_attestation.rs b/crates/username_registry_validation/src/agent_wallet_attestation.rs index 3a93acb..6c506ec 100644 --- a/crates/username_registry_validation/src/agent_wallet_attestation.rs +++ b/crates/username_registry_validation/src/agent_wallet_attestation.rs @@ -1,5 +1,5 @@ -use game_identity_types::WalletAttestation; use hdi::prelude::*; +use holoom_types::WalletAttestation; pub fn validate_create_link_agent_to_wallet_attestations( action: CreateLink, diff --git a/crates/username_registry_validation/src/user_metadata.rs b/crates/username_registry_validation/src/user_metadata.rs index f94f795..06ef711 100644 --- a/crates/username_registry_validation/src/user_metadata.rs +++ b/crates/username_registry_validation/src/user_metadata.rs @@ -1,5 +1,5 @@ -use game_identity_types::MetadataItem; use hdi::prelude::*; +use holoom_types::MetadataItem; pub fn validate_create_link_user_metadata( action: CreateLink, diff --git a/crates/username_registry_validation/src/username_attestation.rs b/crates/username_registry_validation/src/username_attestation.rs index bdf725f..aace545 100644 --- a/crates/username_registry_validation/src/username_attestation.rs +++ b/crates/username_registry_validation/src/username_attestation.rs @@ -1,5 +1,5 @@ -use game_identity_types::{get_authority_agent, UsernameAttestation}; use hdi::prelude::*; +use holoom_types::{get_authority_agent, UsernameAttestation}; pub fn validate_create_username_attestation( action: EntryCreationAction, diff --git a/crates/username_registry_validation/src/wallet_attestation.rs b/crates/username_registry_validation/src/wallet_attestation.rs index a0a73d4..6675426 100644 --- a/crates/username_registry_validation/src/wallet_attestation.rs +++ b/crates/username_registry_validation/src/wallet_attestation.rs @@ -1,8 +1,8 @@ -use game_identity_types::{ +use hdi::prelude::*; +use holoom_types::{ ChainWalletSignature, EvmAddress, EvmSignature, SolanaAddress, SolanaSignature, WalletAttestation, }; -use hdi::prelude::*; pub fn evm_signing_message( evm_address: &EvmAddress, diff --git a/docker/misc_hc/prepare_sandbox.sh b/docker/misc_hc/prepare_sandbox.sh index 8326b69..5badc32 100644 --- a/docker/misc_hc/prepare_sandbox.sh +++ b/docker/misc_hc/prepare_sandbox.sh @@ -2,14 +2,14 @@ HAPP_WORKDIR=/happ_workdir HAPP_YAML_PATH=$HAPP_WORKDIR/happ.yaml - PACKED_HAPP_PATH=$HAPP_WORKDIR/game_identity.happ + PACKED_HAPP_PATH=$HAPP_WORKDIR/holoom.happ SANDBOX_PATH=/prebuilt_sandbox PROPS_TAG_PATH=$SANDBOX_PATH/props_tag CONDUCTOR_PATH=$SANDBOX_PATH/conductor SANDBOX_ENV_PATH=$SANDBOX_PATH/.env UNPACKED_HAPP_PATH=$SANDBOX_PATH/unpacked APP_WS_PORT=3333 -APP_ID=game_identity +APP_ID=holoom # External build args: # NETWORK_SEED @@ -49,7 +49,7 @@ echo "Saved .env:" cat $SANDBOX_ENV_PATH echo "Updating manifest" -# game_identity role +# holoom role yq -i ".roles[0].dna.modifiers.network_seed = \"$HOLOCHAIN_NETWORK_SEED\"" $HAPP_YAML_PATH yq -i ".roles[0].dna.modifiers.properties.authority_agent = \"$HOLOCHAIN_AGENT_PUBKEY\"" $HAPP_YAML_PATH diff --git a/docker/misc_hc/readme.md b/docker/misc_hc/readme.md index d7b856f..205291b 100644 --- a/docker/misc_hc/readme.md +++ b/docker/misc_hc/readme.md @@ -1,3 +1,3 @@ # Authority Agent Sandbox -The `authority-agent-sandbox` docker image contains a prebuilt and pre-configured holochain conductor sandbox. The sandbox comes preinstalled with the game-identity happ, alongside a holochain agent that acts as its authority agent. +The `authority-agent-sandbox` docker image contains a prebuilt and pre-configured holochain conductor sandbox. The sandbox comes preinstalled with the holoom happ, alongside a holochain agent that acts as its authority agent. diff --git a/docker/misc_hc/run_holo_dev_server.sh b/docker/misc_hc/run_holo_dev_server.sh index 2dfcc9a..49fce72 100644 --- a/docker/misc_hc/run_holo_dev_server.sh +++ b/docker/misc_hc/run_holo_dev_server.sh @@ -5,5 +5,5 @@ socat TCP-LISTEN:24274,fork TCP:localhost:24275 & RUST_BACKTRACE=1 holo-dev-server \ -p 24275 \ --bootstrap-server $BOOTSTRAP_SERVER \ - --signal-server $SIGNAL_SERVER /happ_workdir/game_identity.happ + --signal-server $SIGNAL_SERVER /happ_workdir/holoom.happ diff --git a/docker/rocket/Dockerfile b/docker/rocket/Dockerfile index 18dc0de..05ebf56 100644 --- a/docker/rocket/Dockerfile +++ b/docker/rocket/Dockerfile @@ -1,5 +1,5 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y libssl3 libssl-dev ca-certificates libpq-dev -COPY game_identity_rocket_server /usr/local/bin/game_identity_rocket_server -RUN chmod +x /usr/local/bin/game_identity_rocket_server -ENTRYPOINT ["/usr/local/bin/game_identity_rocket_server"] +COPY holoom_rocket_server /usr/local/bin/holoom_rocket_server +RUN chmod +x /usr/local/bin/holoom_rocket_server +ENTRYPOINT ["/usr/local/bin/holoom_rocket_server"] diff --git a/package-lock.json b/package-lock.json index 4e94174..a1f0992 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,10 +1,10 @@ { - "name": "game-identity", + "name": "holoom", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "game-identity", + "name": "holoom", "devDependencies": { "typescript": "^5.4.2" }, @@ -1075,14 +1075,6 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, - "node_modules/@holochain-game-identity/client": { - "resolved": "packages/client", - "link": true - }, - "node_modules/@holochain-game-identity/e2e": { - "resolved": "packages/e2e", - "link": true - }, "node_modules/@holochain/client": { "version": "0.16.11", "resolved": "https://registry.npmjs.org/@holochain/client/-/client-0.16.11.tgz", @@ -1108,6 +1100,14 @@ "resolved": "https://registry.npmjs.org/@holochain/serialization/-/serialization-0.1.0-beta-rc.3.tgz", "integrity": "sha512-DJx4V2KXHVLciyOGjOYKTM/JLBpBEZ3RsPIRCgf7qmwhQdxXvhi2p+oFFRD51yUT5uC1/MzIVeJCl/R60PwFbw==" }, + "node_modules/@holoom/client": { + "resolved": "packages/client", + "link": true + }, + "node_modules/@holoom/e2e": { + "resolved": "packages/e2e", + "link": true + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -7406,8 +7406,8 @@ } }, "packages/client": { - "name": "@holochain-game-identity/client", - "version": "1.0.5", + "name": "@holoom/client", + "version": "1.0.6", "dependencies": { "@msgpack/msgpack": "^2.7.2", "bs58": "^4.0.1", @@ -7432,12 +7432,12 @@ } }, "packages/e2e": { - "name": "@holochain-game-identity/e2e", + "name": "@holoom/e2e", "version": "0.0.0", "dependencies": { "@holo-host/web-sdk": "0.6.17-prerelease", - "@holochain-game-identity/client": "file:../client", - "@holochain/client": "^0.16.7" + "@holochain/client": "^0.16.7", + "@holoom/client": "file:../client" }, "devDependencies": { "concurrently": "^8.2.2", @@ -7451,7 +7451,7 @@ "vite": "^5.1.6" } }, - "packages/game-identity-client": { + "packages/holoom-client": { "version": "0.0.0", "extraneous": true, "devDependencies": { diff --git a/package.json b/package.json index 35ad5f6..7ae7ab4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "game-identity", - "description": "Monorepo for gamer identity on holochain", + "name": "holoom", + "description": "Monorepo for Holoom components", "private": true, "workspaces": { "packages": [ @@ -11,9 +11,9 @@ "build:zomes": "scripts/build_zomes.sh", "build:dna": "npm run build:zomes && hc dna pack workdir", "test:dna": "npm run build:dna && cargo nextest run -j 1", - "build:client": "npm run build -w @holochain-game-identity/client", + "build:client": "npm run build -w @holoom/client", "build:docker": "npm run build:zomes && scripts/build_docker_images.sh", - "test:e2e": "npm run build:zomes && npm run build:docker && npm run build:client && npm run e2e -w @holochain-game-identity/e2e" + "test:e2e": "npm run build:zomes && npm run build:docker && npm run build:client && npm run e2e -w @holoom/e2e" }, "devDependencies": { "typescript": "^5.4.2" diff --git a/packages/client/package.json b/packages/client/package.json index 4dcb72e..4f1b3bd 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,5 +1,5 @@ { - "name": "@holochain-game-identity/client", + "name": "@holoom/client", "version": "1.0.6", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/client/src/holochain-game-identity-client.ts b/packages/client/src/holoom-client.ts similarity index 90% rename from packages/client/src/holochain-game-identity-client.ts rename to packages/client/src/holoom-client.ts index 7f1ce31..7aad75f 100644 --- a/packages/client/src/holochain-game-identity-client.ts +++ b/packages/client/src/holoom-client.ts @@ -16,12 +16,12 @@ import { } from "viem"; import bs58 from "bs58"; -export class HolochainGameIdentityClient { +export class HoloomClient { constructor(readonly appAgent: AppAgentWebsocket) {} async ping(): Promise { await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "ping", fn_name: "ping", payload: null, @@ -38,12 +38,12 @@ export class HolochainGameIdentityClient { await new Promise((r) => setTimeout(r, interval)); } } - throw new Error("HolochainGameIdentityClient.untilReady timed out"); + throw new Error("HoloomClient.untilReady timed out"); } async getUsername(): Promise { const record = await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "get_username_attestation_for_agent", payload: this.appAgent.myPubKey, @@ -58,7 +58,7 @@ export class HolochainGameIdentityClient { async registerUsername(username: string) { await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "sign_username_to_attest", payload: username, @@ -67,7 +67,7 @@ export class HolochainGameIdentityClient { async setMetadata(name: string, value: string) { await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "update_metadata_item", payload: { agent_pubkey: this.appAgent.myPubKey, name, value }, @@ -76,7 +76,7 @@ export class HolochainGameIdentityClient { async getMetadata(name: string): Promise { const value = await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "get_metadata_item_value", payload: { agent_pubkey: this.appAgent.myPubKey, name }, @@ -87,7 +87,7 @@ export class HolochainGameIdentityClient { async getEvmWalletBindingMessage(evmAddress: Hex) { const message: string = await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "get_evm_wallet_binding_message", payload: hexToBytes(evmAddress), @@ -103,7 +103,7 @@ export class HolochainGameIdentityClient { }, }; await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "attest_wallet_signature", payload: chain_wallet_signature, @@ -112,7 +112,7 @@ export class HolochainGameIdentityClient { async getSolanaWalletBindingMessage(solanaPublicKey: SolanaPublicKey) { const message: string = await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "get_solana_wallet_binding_message", payload: solanaPublicKey.toBytes(), @@ -131,7 +131,7 @@ export class HolochainGameIdentityClient { }, }; await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "attest_wallet_signature", payload: chain_wallet_signature, @@ -140,7 +140,7 @@ export class HolochainGameIdentityClient { async getBoundWallets(): Promise { const records: Record[] = await this.appAgent.callZome({ - role_name: "game_identity", + role_name: "holoom", zome_name: "username_registry", fn_name: "get_wallet_attestations_for_agent", payload: this.appAgent.myPubKey, diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index ced5308..825184b 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -1 +1 @@ -export { HolochainGameIdentityClient } from "./holochain-game-identity-client"; +export { HoloomClient } from "./holoom-client"; diff --git a/packages/e2e/package.json b/packages/e2e/package.json index f8c6d5b..bbd4d53 100644 --- a/packages/e2e/package.json +++ b/packages/e2e/package.json @@ -1,5 +1,5 @@ { - "name": "@holochain-game-identity/e2e", + "name": "@holoom/e2e", "private": true, "version": "0.0.0", "type": "module", @@ -12,7 +12,7 @@ }, "dependencies": { "@holo-host/web-sdk": "0.6.17-prerelease", - "@holochain-game-identity/client": "file:../client", + "@holoom/client": "file:../client", "@holochain/client": "^0.16.7" }, "devDependencies": { diff --git a/packages/e2e/src/main.ts b/packages/e2e/src/main.ts index 4db9c40..b29d775 100644 --- a/packages/e2e/src/main.ts +++ b/packages/e2e/src/main.ts @@ -1,6 +1,6 @@ import "./style.css"; import { AppAgentWebsocket, encodeHashToBase64 } from "@holochain/client"; -import { HolochainGameIdentityClient } from "@holochain-game-identity/client"; +import { HoloomClient } from "@holoom/client"; import WebSdkApi, { ChaperoneState } from "@holo-host/web-sdk"; function untilSignedIn(holoClient: WebSdkApi) { @@ -29,13 +29,13 @@ async function createClient() { // Hand off the puppeteer to fill out iframe await untilSignedIn(holoClient); global.agentPubKeyB64 = encodeHashToBase64(holoClient.myPubKey); - const gameIdentityClient = new HolochainGameIdentityClient( + const holoomClient = new HoloomClient( holoClient as unknown as AppAgentWebsocket ); - await gameIdentityClient.untilReady(); - return gameIdentityClient; + await holoomClient.untilReady(); + return holoomClient; } -global.gameIdentityClientProm = createClient().then((client) => { - global.gameIdentityClient = client; +global.holoomClientProm = createClient().then((client) => { + global.holoomClient = client; }); diff --git a/packages/e2e/tests/evm-wallet-binding.test.js b/packages/e2e/tests/evm-wallet-binding.test.js index 04336b5..4b34bdf 100644 --- a/packages/e2e/tests/evm-wallet-binding.test.js +++ b/packages/e2e/tests/evm-wallet-binding.test.js @@ -19,7 +19,7 @@ describe("EVM Wallet Binding", () => { // Starts with no username await expect( - page.evaluate(() => window.gameIdentityClient.getBoundWallets()) + page.evaluate(() => window.holoomClient.getBoundWallets()) ).resolves.toEqual([]); debug("Checked bound wallets initially empty"); @@ -42,8 +42,7 @@ describe("EVM Wallet Binding", () => { // Get and sign the binding message const message = await page.evaluate( - (address) => - window.gameIdentityClient.getEvmWalletBindingMessage(address), + (address) => window.holoomClient.getEvmWalletBindingMessage(address), account.address ); const evmSignature = await account.signMessage({ message }); @@ -51,8 +50,7 @@ describe("EVM Wallet Binding", () => { // Submit the signature await expect( page.evaluate( - (addr, sig) => - window.gameIdentityClient.submitEvmWalletBinding(addr, sig), + (addr, sig) => window.holoomClient.submitEvmWalletBinding(addr, sig), account.address, evmSignature ) @@ -62,7 +60,7 @@ describe("EVM Wallet Binding", () => { // Poll bound wallets until defined (gossiping) while (true) { const boundWallets = await page.evaluate(() => - window.gameIdentityClient.getBoundWallets() + window.holoomClient.getBoundWallets() ); if (boundWallets.length) { expect(boundWallets).toEqual([ diff --git a/packages/e2e/tests/metadata.test.js b/packages/e2e/tests/metadata.test.js index e2a658e..b794d3e 100644 --- a/packages/e2e/tests/metadata.test.js +++ b/packages/e2e/tests/metadata.test.js @@ -17,9 +17,7 @@ describe("metadata", () => { debug("Loaded chaperone and registered agent"); await expect( - page.evaluate(() => - window.gameIdentityClient.getMetadata("profile-picture") - ) + page.evaluate(() => window.holoomClient.getMetadata("profile-picture")) ).resolves.toBeNull(); debug("Checked profile-picture metadata initially null"); @@ -35,46 +33,40 @@ describe("metadata", () => { await expect( page.evaluate(() => - window.gameIdentityClient.setMetadata("profile-picture", "image1.jpg") + window.holoomClient.setMetadata("profile-picture", "image1.jpg") ) ).resolves.toBeUndefined(); debug("Set profile-picture metadata"); await expect( - page.evaluate(() => - window.gameIdentityClient.getMetadata("profile-picture") - ) + page.evaluate(() => window.holoomClient.getMetadata("profile-picture")) ).resolves.toBe("image1.jpg"); debug("Checked profile-picture metadata set"); await expect( - page.evaluate(() => - window.gameIdentityClient.setMetadata("location", "moon") - ) + page.evaluate(() => window.holoomClient.setMetadata("location", "moon")) ).resolves.toBeUndefined(); debug("Set location metadata"); await expect( - page.evaluate(() => window.gameIdentityClient.getMetadata("location")) + page.evaluate(() => window.holoomClient.getMetadata("location")) ).resolves.toBe("moon"); debug("Checked location metadata set"); await expect( page.evaluate(() => - window.gameIdentityClient.setMetadata("profile-picture", "image2.jpg") + window.holoomClient.setMetadata("profile-picture", "image2.jpg") ) ).resolves.toBeUndefined(); debug("Replace profile-picture metadata"); await expect( - page.evaluate(() => - window.gameIdentityClient.getMetadata("profile-picture") - ) + page.evaluate(() => window.holoomClient.getMetadata("profile-picture")) ).resolves.toBe("image2.jpg"); debug("Checked profile-picture metadata replaced"); await expect( - page.evaluate(() => window.gameIdentityClient.getMetadata("location")) + page.evaluate(() => window.holoomClient.getMetadata("location")) ).resolves.toBe("moon"); debug("Checked location metadata unchanged"); diff --git a/packages/e2e/tests/username.test.js b/packages/e2e/tests/username.test.js index ca53b1c..740439c 100644 --- a/packages/e2e/tests/username.test.js +++ b/packages/e2e/tests/username.test.js @@ -18,7 +18,7 @@ describe("username", () => { // Starts with no username await expect( - page.evaluate(() => window.gameIdentityClient.getUsername()) + page.evaluate(() => window.holoomClient.getUsername()) ).resolves.toBeNull(); debug("Checked username initially null"); @@ -30,16 +30,14 @@ describe("username", () => { // First register succeeds await expect( - page.evaluate(() => - window.gameIdentityClient.registerUsername("test1234") - ) + page.evaluate(() => window.holoomClient.registerUsername("test1234")) ).resolves.toBeUndefined(); debug("Registered username"); // Poll username until defined (gossiping) while (true) { const result = await page.evaluate(() => - window.gameIdentityClient.getUsername() + window.holoomClient.getUsername() ); if (result) { expect(result).toBe("test1234"); @@ -50,9 +48,7 @@ describe("username", () => { // Second registration fails await expect( - page.evaluate(() => - window.gameIdentityClient.registerUsername("test1234") - ) + page.evaluate(() => window.holoomClient.registerUsername("test1234")) ).rejects.toSatisfy((error) => error.message.includes("InvalidCommit")); debug("Checked second registration fails"); diff --git a/packages/e2e/tests/utils/holo.js b/packages/e2e/tests/utils/holo.js index ff69f54..37e91da 100644 --- a/packages/e2e/tests/utils/holo.js +++ b/packages/e2e/tests/utils/holo.js @@ -19,6 +19,6 @@ module.exports.loadPageAndRegister = async (email, password) => { // Wait until form processes and client ready await page.evaluate(async () => { - await window.gameIdentityClientProm; + await window.holoomClientProm; }); }; diff --git a/packages/e2e/tests/utils/testcontainers.js b/packages/e2e/tests/utils/testcontainers.js index 2b6df67..adb7a90 100644 --- a/packages/e2e/tests/utils/testcontainers.js +++ b/packages/e2e/tests/utils/testcontainers.js @@ -5,7 +5,7 @@ const BOOTSTRAP_PORT = 51804; const SIGNAL_PORT = 51805; function startLocalServicesContainer(network) { - return new GenericContainer("game-identity/local-services") + return new GenericContainer("holoom/local-services") .withNetwork(network) .withEnvironment({ BOOTSTRAP_PORT, @@ -16,7 +16,7 @@ function startLocalServicesContainer(network) { } function startAuthorityContainer(network, localServicesIp) { - return new GenericContainer("game-identity/authority-agent-sandbox") + return new GenericContainer("holoom/authority-agent-sandbox") .withNetwork(network) .withEnvironment({ BOOTSTRAP_SERVER_OVERRIDE: `http://${localServicesIp}:${BOOTSTRAP_PORT}`, @@ -37,7 +37,7 @@ function startAuthorityContainer(network, localServicesIp) { } function startHoloContainer(network, localServicesIp) { - return new GenericContainer("game-identity/holo-dev-server") + return new GenericContainer("holoom/holo-dev-server") .withExposedPorts( { host: 24274, container: 24274 }, { host: 9999, container: 9999 } @@ -52,7 +52,7 @@ function startHoloContainer(network, localServicesIp) { } function startRocketContainer(network, authorityIp) { - return new GenericContainer("game-identity/rocket") + return new GenericContainer("holoom/rocket") .withExposedPorts({ host: 8000, container: 8000 }) .withNetwork(network) .withEnvironment({ @@ -61,8 +61,8 @@ function startRocketContainer(network, authorityIp) { HOLOCHAIN_HOST_NAME: authorityIp, HOLOCHAIN_ADMIN_WS_PORT: 3334, HOLOCHAIN_APP_WS_PORT: 3336, - HOLOCHAIN_APP_ID: "game_identity", - HOLOCHAIN_CELL_ROLES: "game_identity", + HOLOCHAIN_APP_ID: "holoom", + HOLOCHAIN_CELL_ROLES: "holoom", }) .withLogConsumer((stream) => { const logInfo = createDebug("e2e:rocket:info"); @@ -70,7 +70,7 @@ function startRocketContainer(network, authorityIp) { stream.on("data", logInfo); stream.on("err", logErr); }) - .withCommand("/usr/local/bin/game_identity_rocket_server") + .withCommand("/usr/local/bin/holoom_rocket_server") .start(); } diff --git a/scripts/Dockerfile b/scripts/Dockerfile index 096e5a5..f3891d9 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,4 +1,4 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y libssl3 libssl-dev ca-certificates libpq-dev -COPY game_identity_rocket_server /usr/local/bin/game_identity_rocket_server -ENTRYPOINT ["/usr/local/bin/game_identity_rocket_server"] +COPY holoom_rocket_server /usr/local/bin/holoom_rocket_server +ENTRYPOINT ["/usr/local/bin/holoom_rocket_server"] diff --git a/scripts/build_docker_images.sh b/scripts/build_docker_images.sh index 30a53b5..c9f0a85 100755 --- a/scripts/build_docker_images.sh +++ b/scripts/build_docker_images.sh @@ -5,6 +5,6 @@ cd .. rm -rf docker/misc_hc/happ_workdir cp -r workdir docker/misc_hc/happ_workdir -docker build --target local-services -t game-identity/local-services docker/misc_hc -docker build --target authority-agent-sandbox -t game-identity/authority-agent-sandbox docker/misc_hc -docker build --target holo-dev-server -t game-identity/holo-dev-server docker/misc_hc +docker build --target local-services -t holoom/local-services docker/misc_hc +docker build --target authority-agent-sandbox -t holoom/authority-agent-sandbox docker/misc_hc +docker build --target holo-dev-server -t holoom/holo-dev-server docker/misc_hc diff --git a/scripts/build_rocket_bookworm.sh b/scripts/build_rocket_bookworm.sh index 191f15b..f4bac5b 100755 --- a/scripts/build_rocket_bookworm.sh +++ b/scripts/build_rocket_bookworm.sh @@ -4,7 +4,7 @@ cd -- "$( dirname -- "$0" )" cd .. PROJ_DIR=$(pwd) CACHE_DIR=$HOME/.cache -DOCKER_HOST_TARGET=$CACHE_DIR/game_identity_target_bookworm +DOCKER_HOST_TARGET=$CACHE_DIR/holoom_target_bookworm DOCKER_HOST_CARGO_HOME=$CACHE_DIR/bookworm_cargo_home BUILDER_ID_DIR=$CACHE_DIR/rocket-builder-id CONTAINER_CARGO_HOME=/usr/local/cargo/ @@ -33,7 +33,7 @@ id=$(head -n 1 $BUILDER_ID_DIR) docker start $id echo "Starting build..." docker exec $id bash -c \ - "CARGO_TARGET_DIR=/target cargo build --release --package game_identity_rocket_server" + "CARGO_TARGET_DIR=/target cargo build --release --package holoom_rocket_server" echo "Copying built binary to docker context..." -cp $DOCKER_HOST_TARGET/release/game_identity_rocket_server $PROJ_DIR/docker/rocket/ +cp $DOCKER_HOST_TARGET/release/holoom_rocket_server $PROJ_DIR/docker/rocket/ diff --git a/workdir/dna.yaml b/workdir/dna.yaml index 1762324..ae7b30d 100644 --- a/workdir/dna.yaml +++ b/workdir/dna.yaml @@ -1,6 +1,6 @@ --- manifest_version: "1" -name: game_identity +name: holoom integrity: network_seed: ~ properties: diff --git a/workdir/happ.yaml b/workdir/happ.yaml index 43cbf08..c886fa2 100644 --- a/workdir/happ.yaml +++ b/workdir/happ.yaml @@ -1,14 +1,14 @@ --- manifest_version: "1" -name: game_identity +name: holoom description: ~ roles: - - name: game_identity + - name: holoom provisioning: strategy: create deferred: false dna: - bundled: "./game_identity.dna" + bundled: "./holoom.dna" modifiers: network_seed: ~ properties: ~