Meta Pool is a liquid staking solution built on the NEAR Protocol. Meta Pool unlocks liquidity of the staked NEAR by creating a staking derivative to be engaged with various DeFi protocols on NEAR and Aurora, while also enjoying over 10% APY staking rewards of the underlying base tokens.
This repository holds Meta Pool BOS components hosted on NEAR BOS (Blockchain Operating System), to interact with Meta Pool smart contract.
Use BOS Loader to enable instant preview in local environment, so you don't have to deploy all your components to mainnet to preview and test your changes.
Linux / Mac: Install prebuilt binaries via shell script
# WARNING: this installer is experimental curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mpeterdev/bos-loader/releases/download/v0.6.0/bos-loader-v0.6.0-installer.sh | shWindows: Install prebuilt binaries via powershell script
# WARNING: this installer is experimental irm https://github.com/mpeterdev/bos-loader/releases/download/v0.6.0/bos-loader-v0.6.0-installer.ps1 | iex
- Open https://test.near.org/flags, and set the loader URL to http://127.0.0.1:3030
- Clone repository:
git clone https://github.com/PierreLeGuen/metapool-bos
- Install dependencies:
cd metapool-bos && yarn
- Launch testnet preview page and BOS loader:
yarn dev
- Modify meta pool components code, and refresh preview page to view the latest change. Please notice that because hot reload is not ready in BOS loader, you need to refresh the preview page in browser after code change.
prettier
is configured in Git pre-commit hook with husky and lint-staged to automatically format the modified components code.
The source code of Meta Pool components are available in the src
folder, and organized by sub-folders. For example, the pierre-dev.near/widget/MetaPool.Element.Button
component is available in src/MetaPool/Element/Button.jsx
. BOS Loader and BOS CLI both use .
delimiter when converting local file path to component name, and vice versa.
Use BOS CLI and its GitHub actions for continuous integration and delivery.
- testnet GitHub action to deploy latest commit in pull request to testnet for preview and testing once the PR is submitted. (However, since only configured on
TESTNET_DEPLOY_ACCOUNT
, if you have multiple open PRs, they may conflict with each other. This will be fixed later.) - mainnet GitHub action to deploy the latest
main branch
components code to mainnet.
To make the CI workflow work, you need to create function call keys for testnet and mainnet deployment, following the instructions in BOS CLI, and set up below GitHub actions variables and secrets.
TESTNET_DEPLOY_ACCOUNT
/TESTNET_SIGNER_PUBLIC_KEY
/TESTNET_SIGNER_PRIVATE_KEY
MAINNET_DEPLOY_ACCOUNT
/MAINNET_SIGNER_PUBLIC_KEY
/MAINNET_SIGNER_PRIVATE_KEY
- Testing locally with BOS Loader first, before submit pull request for code review and testnet testing.
- Once a PR is submitted, it will be automatically deployed to testnet, which makes it easy for others to test and provide feedback.
- Only after a PR is well tested and reviewed, it will be merged and the latest
main branch
commit will be deployed to mainnet.
MIT License