Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/launcher build #168

Merged
merged 3 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dnas/mewsfeed/workdir/dna.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ coordinator:
- name: ping
hash: ~
bundled: "../../../target/wasm32-unknown-unknown/release/ping.wasm"
dependencies: ~
dependencies: []
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
"network": "npm run build:happ && UI_PORT=8888 concurrently \"npm run playground\" \"npm run local-services\" \"npm run start:agent\" \"npm run start:agent\"",
"start:agent": "HC_PORT=$(port) HC_ADMIN_PORT=$(port) concurrently \"npm run launch:happ\" \"npm run start:browser -w ui\"",
"launch:happ": "hc s clean && echo pass | RUST_LOG=warn hc s --piped -f=$HC_ADMIN_PORT generate ./workdir/mewsfeed.happ --run=$HC_PORT -a mewsfeed network -b http://127.0.0.1:54000 webrtc ws://127.0.0.1:55000",
"start:launcher": "AGENTS=2 npm run network:launcher",
"start:launcher": "VITE_IS_LAUNCHER=true AGENTS=2 npm run network:launcher",
"network:launcher": "hc s clean && npm run build:happ && UI_PORT=8888 concurrently \"npm run local-services\" \"npm start -w ui\" \"npm run launch:happ:launcher\" \"holochain-playground\"",
"launch:happ:launcher": "echo \"pass\" | RUST_LOG=warn hc launch --piped -n $AGENTS workdir/mewsfeed.happ --ui-port $UI_PORT network -b http://127.0.0.1:54000 webrtc ws://127.0.0.1:55000",
"test": "npm run build:happ && npm t -w tests",
"test:watch": "cargo watch --clear -- npm test",
"package": "npm run build:happ && npm run package:ui && hc web-app pack workdir",
"package": "npm run build:happ && VITE_IS_LAUNCHER=true npm run package:ui && hc web-app pack workdir",
"package:ui": "npm run build -w ui && cd ui/dist && bestzip ../dist.zip *",
"package:holo": "npm run build:happ && npm run package:ui && hc web-app pack workdir",
"build:happ": "rm -f dnas/**/workdir/*.dna && npm run build:dnas && hc app pack ./workdir",
"build:dnas": "npm run build:zomes && hc dna pack ./dnas/mewsfeed/workdir",
"build:zomes": "CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown",
Expand Down
1 change: 1 addition & 0 deletions ui/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ interface ImportMetaEnv {
readonly VITE_HC_PORT: number;
readonly VITE_HC_ADMIN_PORT: number;
readonly VITE_IS_HOLO_HOSTED: boolean;
readonly VITE_IS_LAUNCHER: boolean;
readonly VITE_CHAPERONE_SERVER_URL: string;
}
10 changes: 5 additions & 5 deletions ui/src/utils/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import {
import WebSdkApi from "@holo-host/web-sdk";

export const HOLOCHAIN_APP_ID = "mewsfeed";
export const HOLOCHAIN_URL = new URL(
`ws://localhost:${import.meta.env.VITE_HC_PORT}`
);
export const IS_HOLO_HOSTED = Boolean(import.meta.env.VITE_IS_HOLO_HOSTED);
export const IS_LAUNCHER = import.meta.env.VITE_IS_LAUNCHER;
export const IS_HOLO_HOSTED = import.meta.env.VITE_IS_HOLO_HOSTED;

export const HOLO_CHAPERONE_URL = import.meta.env.VITE_CHAPERONE_SERVER_URL
? import.meta.env.VITE_CHAPERONE_SERVER_URL
Expand All @@ -19,7 +17,9 @@ export const HOLO_CHAPERONE_URL = import.meta.env.VITE_CHAPERONE_SERVER_URL
export const setupHolochain = async () => {
try {
const client = await AppAgentWebsocket.connect(
HOLOCHAIN_URL,
IS_LAUNCHER
? new URL(`ws://UNUSED`)
: new URL(`ws://localhost:${import.meta.env.VITE_HC_PORT}`),
HOLOCHAIN_APP_ID,
60000
);
Expand Down