The Bitcoin Staking dApp is a web application integrating with extension wallets that allows a user to stake their Bitcoin. It is hosted by Babylon and serves as a reference implementation for entities that want to set up their own staking website.
To set up a development environment, first specify the required environment
variables in the .env.local file in the root directory:
cp .env.example .env.local
where,
NEXT_PUBLIC_MEMPOOL_APIspecifies the mempool.space host to use for Bitcoin node queriesNEXT_PUBLIC_API_URLspecifies the back-end API to use for the staking system queriesNEXT_PUBLIC_NETWORKspecifies the BTC network environmentNEXT_PUBLIC_DISPLAY_TESTING_MESSAGESboolean value to indicate whether display testing network related message. Default to trueNEXT_PUBLIC_FIXED_STAKING_TERMboolean value to indicate whether the staking term is fixed. Default to falseNEXT_PUBLIC_STAKING_DISABLEDboolean value to disable staking on the dashboardNEXT_PUBLIC_BBN_GAS_PRICEspecifies the gas price for BABY. Default to 0.002NEXT_PUBLIC_SENTRY_DSNspecifies the Sentry DSN for error reportingNEXT_PUBLIC_SIDECAR_API_URLspecifies the base URL for the sidecar API serviceNEXT_PUBLIC_BABY_RPC_URLspecifies the RPC to override the default valuesNEXT_PUBLIC_BABY_LCD_URLspecifies the LCD to override the default valuesNEXT_PUBLIC_COMMIT_HASH(Optional) The git commit hash, usually injected during CI build for reference.NEXT_PUBLIC_BABYLON_EXPLORER(Optional) specifies the URL for the Babylon block explorer.NEXT_PUBLIC_REPLAYS_RATE(Optional) specifies the sample rate for Sentry Session Replays (0.0 to 1.0).SENTRY_ORG(Optional) The Sentry organization slug, needed for source map uploads during build.SENTRY_PROJECT(Optional) The Sentry project slug, needed for source map uploads during build.SENTRY_URL(Optional) The URL to your self-hosted Sentry instance, needed for source map uploads during build.
Then, to start a development server:
npm run devInstructions for wallet integration can be found in the bbn-wallet-connect documentation.
To build the E2E tests, run:
npm run build:e2eTo run the E2E tests, run:
npm run test:e2eNote that the E2E tests use the environment variables specified in the .env.test file.
The E2E tests are located in the e2e/specs directory.