This repository contains a clean, light-weight gateawy for the Blockchain Operating System (BOS). It serves as a great starting point for launching a customized BOS gateway. Contributions are most welcome!
-
Initialize repo:
pnpm i
-
Add .env file:
cp .env.example .env
-
The entry component is
BosMain
and it's located at/src/components/index.tsx
It loads the
ciocan.near/widget/hello-world
BOS component. The source can be found here. -
Edit
web3.js
and change the projectId and dappUrl for WalletConnect (dappUrl is required by WalletConnect to work with the MetaMask on mobile)
Start development version:
pnpm dev:next
This is a Next.js app and a fork of NEAR Discovery gateway app.
For static exports just run next build
and upload the build files to your hosting provider. More info here.
For Vercel, Cloudflare or others that supports a Next app just connect the repo and follow the deploy steps from the dashboards.
More info on Next.js deployments here.
docker build -t bos-gateway-template .
docker run -p 3000:3000 bos-gateway-template
We use Tauri to build the native apps.
The first step is to install Rust and system dependencies. More info here here.
Edit the src-tauri/tauri.conf.json
file and change:
productName
fromBOS Gateway Template
to your gateway name.identifier
fromcom.bos-gateway-template
to your gateway identifier.icon
array to your gateway icons.windows.title
fromBOS Gateway Template
to your gateway name.
For the macOS app you need to have a valid Apple Developer account and a valid certificate. Set these env variables to configure the build:
export APPLE_ID=your-apple-id
export APPLE_PASSWORD=your-apple-password
export APPLE_CERTIFICATE=your-apple-certificate
export APPLE_CERTIFICATE_PASSWORD=your-apple-certificate-password
export APPLE_DEVELOPER_TEAM_NAME=your-apple-developer-team-name
export APPLE_SIGNING_IDENTITY=your-apple-developer-code-sign-identity
More info here about the Apple code signing: here.
Optionally if you want to use the Tauri updater you need to set the TAURI_PRIVATE_KEY
and TAURI_KEY_PASSWORD
env variable. More info here: here.
Then run:
pnpm build
The native app will be located in src-tauri/target/release/bundle
.
Note: Tauri relies heavily on native libraries and toolchains, so meaningful cross-compilation is not possible at the current moment. The next best option is to compile utilizing a CI/CD pipeline More info here.
To distribute the native app you need Code Signing for specific platforms. More info here.
Run this action to publish the release files to GitHub:
.github/workflows/publish.yml