Skip to content

HoloPortOS config initialization and management

Notifications You must be signed in to change notification settings

Holo-Host/hpos-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

mattgeddesMatthew Geddes
and
Matthew Geddes
Sep 20, 2024
2bd060f · Sep 20, 2024
Mar 6, 2023
Aug 22, 2024
Aug 21, 2024
Sep 17, 2024
Jul 12, 2024
Jul 12, 2024
Sep 20, 2024
Aug 21, 2024
Aug 24, 2020
Aug 27, 2024
Aug 27, 2024
Oct 22, 2021
Sep 20, 2024
Sep 20, 2024
Dec 17, 2019
Sep 21, 2022
Mar 6, 2023
May 1, 2024
Aug 27, 2024
Jul 8, 2021

Repository files navigation

hpos-config

Ownership Info

Codeowner: @zo-el Codeowner - gen-web (quickstart UI): @mateuszRybczonek Consulted: None Informed: None

This repo contains

  • A web UI called Quickstart
  • A Rust library called hpos-config-core
  • A bunch of utility binaries for interacting with the data structures provided by hpos-config-core
    • (gen-cli, into-base36-id, is-valid, seed-bundle-explorer, seed-encoder)

Quickstart UI allows registered HoloPort owners to generate configuration files and private keys for their HoloPorts and walks them through the set up process.

hpos-config-core contains the structure of initial HoloPort configuration files and the keypair generation algorithms used during Quickstart. It is used as a dependency by Quickstart UI through Wasm, as well as by various other services that run on the HoloPort. For a (hopefully) complete list of downstream dependents, see hpos-config-core.

The production copy of Quickstart UI is deployed at https://quickstart.holo.host/. The staging/development copy is deployed at https://holo-host.github.io/hpos-config and follows the gh-pages branch of this repo.

Quickstart UI Development

Quickstart UI is written in vanilla JS and does not use any web framework. The code lives in the gen-web folder of this repository.

Membrane Proof Service

After the user enters a Registration Code, Quickstart makes a request to a Membrane Proof Service (see this function). When working with Quickstart, you need to choose which Membrane Proof Service to use.

Serving the UI

(inside gen-web)

Once you've picked a Membrane Proof Service (e.g http://localhost:8800), you can run the following command to serve the UI in optimized mode. (Takes longer to build each time)

MEMBRANE_PROOF_SERVICE_URL=http://localhost:8800 yarn serve

You can serve the UI in unoptimized mode using

yarn start

Note: yarn start currently has MEMBRANE_PROOF_SERVICE_URL=http://localhost:8800 hardcoded.

If you encounter the "Generating your Keys" page taking a long time in unoptimized mode, try switching to optimized. There seems to be some issue with the unoptimized Wasm.

Deploying the UI to GitHub Pages

You need to push a commit to the gh-pages branch that contains the built files from gen-web/dist/. Here is an example of the exact commands you could use to deploy. (Perhaps this should be made into a script)

COMMIT_HASH="$(git rev-parse HEAD)"
cd gen-web
yarn install
rm -r dist/
MEMBRANE_PROOF_SERVICE_URL=https://hbs.dev.holotest.net yarn build
git checkout gh-pages
cd ..
git rm assets/ *.js *.wasm *.css *.png *.html
mv gen-web/dist/* .
git commit -a -m "Deploy $COMMIT_HASH (https://hbs.dev.holotest.net)"
git push