Skip to content

Commit

Permalink
Merge pull request #168 from GeekGene/fix/launcher-build
Browse files Browse the repository at this point in the history
Fix/launcher build
  • Loading branch information
mattyg authored Aug 2, 2023
2 parents d6a5e73 + de8078f commit c375f11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
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

0 comments on commit c375f11

Please sign in to comment.