Skip to content

NearDeFi/mantle-bos-gateway

 
 

Repository files navigation

BOS Gateway Template

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!

Setup & Development

  1. Initialize repo:

    pnpm i
  2. Add .env file:

    cp .env.example .env
  3. 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.

  4. 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

Deployment

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.

Running with docker

docker build -t bos-gateway-template .
docker run -p 3000:3000 bos-gateway-template

Building the native apps

We use Tauri to build the native apps.

Prerequisites

The first step is to install Rust and system dependencies. More info here here.

Building

Edit the src-tauri/tauri.conf.json file and change:

  • productName from BOS Gateway Template to your gateway name.
  • identifier from com.bos-gateway-template to your gateway identifier.
  • icon array to your gateway icons.
  • windows.title from BOS Gateway Template to your gateway name.

Then run:

pnpm build-tauri

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.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 78.0%
  • JavaScript 16.1%
  • CSS 5.0%
  • Other 0.9%