A web client for the miner application that interacts with blockchain contracts.
- Node.js (use the version specified in
.nvmrc) - Yarn package manager
- Basic knowledge of blockchain concepts and IPFS
-
Create Environment Configuration
Create a
.envfile in theweb-client/directory. All environment variables are optional. See.env.examplefor reference:CONTRACT_ADDRESS: Bus tree contract addressINTERVAL: Mining intervalRPC_URL: Chain RPC URLSUBGRAPH_ID: The subgraph ID
-
Install Dependencies
nvm use && yarn
-
Build Miner SDK and Generate Types
cd sdk/ && ./gen-types.sh && yarn build
-
Build the Web Client
cd web-client/ && yarn build:prod
-
Bundle the WASM/ZKeys Files
yarn bundle:wasm
You can deploy the build folder to IPFS using any of the following methods:
-
Install IPFS CLI if not already installed:
# Installation instructions: https://docs.ipfs.tech/install/command-line/ ipfs --version -
Initialize IPFS (if first time):
ipfs init
-
Start the IPFS daemon:
ipfs daemon
-
Add your build folder to IPFS:
ipfs add -r web-client/build
-
Use the CID from the last line of the output to access your deployment:
https://ipfs.io/ipfs/<YOUR_CID>
- Create an account on Pinata or another IPFS pinning service
- Upload your build folder through their web interface
- Access your deployment via the provided CID:
https://ipfs.io/ipfs/<YOUR_CID>
- Sign up at web3.storage
- Install their CLI tool:
yarn global add @web3-storage/w3cli ```3. Configure and authenticate: ```bash w3 login
- Upload your build folder:
w3 put web-client/build
- Access your deployment via the provided CID:
https://ipfs.io/ipfs/<YOUR_CID>
For production deployments, consider:
- Pinning your content with services like Pinata, Infura, or web3.storage
- Running your own IPFS node and pinning the content
- Using a service like Fleek for automatic deployment from git to IPFS
This project is licensed under the MIT License - see the LICENSE file in the root directory of this project for details.
Copyright 2024 Panther Protocol Foundation