This repository hosts the code for a simplified client application for the Squads V4 Program. The app can be built, verified for integrity, and deployed as a static site using multiple hosting options, including self-hostable solutions like Docker with Nginx. Here’s how you can use it effectively.
- Verifiable Build: The
dist/
directory contains the static files that can be verified via a hash. This ensures the integrity of the build delivered.- Verification can be done against:
- Remote URLs: Downloaded files can be verified for consistency with the expected hash.
- IPFS CID: Retrieve the build from IPFS and verify its authenticity.
- Verification can be done against:
- Self-hosting: Run the application as a Docker container using an Nginx server for fully self-managed hosting.
The following steps will guide you to build, verify, and host the application.
-
Clone the repository:
git clone https://github.com/Squads-Protocol/public-v4-client cd public-v4-client
-
Install dependencies:
yarn install --frozen-lockfile
-
Build the application:
yarn build
A
dist/
directory will be created containing the static files. -
Generate a hash of the build:
./scripts/generate-hash.sh
To verify the files hosted at a remote URL:
- Use the
scripts/verify-remote.sh
script:Replace./scripts/verify-remote.sh <REMOTE_URL> <EXPECTED_HASH>
<REMOTE_URL>
with the base URL of the remote site and<EXPECTED_HASH>
with the known SHA-256 hash of the build.
To verify an IPFS-hosted build:
- Ensure you have the IPFS CLI installed (
ipfs
). - Use the
scripts/verify-ipfs.sh
script:Replace./scripts/verify-ipfs.sh <IPFS_CID> <EXPECTED_HASH>
<IPFS_CID>
with the CID of the IPFS build and<EXPECTED_HASH>
with the known SHA-256 hash.
You can deploy the web app via a self-hosted Docker container using Nginx:
-
Build the Docker image:
docker build -t squads-public-v4-client .
-
Run the container:
docker run -d -p 8080:80 squads-public-v4-client
The app will now be available at http://localhost:8080
.
- Retrieve the hash from the running container:
docker exec <container_id> cat /var/build-metadata/hash.txt
A SHA-256 build hash is generated by combining all files in the dist/
directory in a deterministic order.
-
Run the
scripts/generate-hash.sh
script:./scripts/generate-hash.sh
The output will show the computed hash of the local
dist/
content. This hash should match the one provided in the deployment.
A manifest.json
file is included in the build, containing references to all static assets. It ensures that asset file mappings remain consistent during deployment.
Recent hashes may be found here: Recent Hashes
Contributions are welcome! Please fork the repository, make your changes, and open a pull request.
This project is licensed under the MIT License. Please see the included LICENSE
file for details.