This is the official documentation for the bPanel project, a full featured, fully extensible enterprise level GUI for your bcoin Bitcoin node.
bPanel is still in alpha, so while we wish there was a one click install (and it is on the road map), there is a small amount of setup required to get things running first.
First, download the project files with the link below:
Luckily almost all configuration can be done through a single docker-compose.yml. If you don't have docker installed locally, download and install here:
To spin up your app server, a bcoin node on regtest, and mine 101 blocks (and generate lots of fake Satoshis for you to play with), navigate to your repo and run:
npm installto create a secrets.env file.
docker-compose up -d(if this is your first time installing, this could take a while)
- Navigate to
http://localhost:5000in a browser to see your webapp.
Note: HTTP requests to the
\node endpoint will get forwarded to your bcoin node through the
bclient module interface.
For Local Development
If you have an existing node you want to connect to, update the configuration and run:
npm run start:dev
For OSX run
npm run start:poll instead since webpack's watch can act strangely
on mac) Note that if you have some plugins or themes being loaded, webpack needs to build twice and there will be some errors between the two.
Configurations are shared between the two docker containers.
Your bcoin node will expect an API key given to it. If you are connecting to an existing node, you can set an API key by adding it in a
secrets.env file and set
BCOIN_API_KEY=[YOUR-AWESOME-KEY]. This key can be any value you want (but if you are running a node with real Bitcoins, make sure it's secure!). NOTE: DO NOT CHECK THIS FILE IN TO VERSION CONTROL. If you run
npm install and there is no
secrets.env present, one will automatically be generated for you with a cryptographically secure api key.
The configs are managed through environment variables set in a
bcoin.env file (this is not ignored by git, so make sure to only put sensitive information in the
secrets.env file). These get used by both the app and bcoin containers. The
bcoin.env configs are used as the default configuration options for the bcoin Docker container and bPanel. These can be overwritten by adding environment variables to the
environment field in docker-compose.yml or as normal through the command line.
Make sure to comment out the environment variables according to the network you want your webapp to connect to and/or what kind of node you want to run if you're running the bcoin service.
If you want to connect to an existing node on a remote server, update the environment configs to point to your remote node. To deploy in a docker container run:
docker-compose up app
Otherwise, for local development, run
npm run start:poll
(For Linux you can run
npm run start:dev instead)
Setup scripts are also supported. This will allow you to run scripts on your node for a repeatable and predictable environment for testing or development.
Three circumstances need to be met to run a script:
- There needs to be a js file to run in the
scriptsdirectory that exports a function to run
- You need to pass the name of this file (including the extension)
as an environment variable named
BCOIN_INIT_SCRIPTin the docker-compose
- There should be no walletdb in the container. This makes sure that a setup script doesn't overwrite your data if you're mapping volumes or if you restart a container.
These checks are done in the
docker-bcoin-init.js which sets up a node
based on the configs described above.
Setup scripts will also be passed the bcoin node object that has been created.
To persist your bcoin node information (and skip the setup if the walletdb is persisted), uncomment and edit the volumes in the bcoin service (this should be uncommented by default). This is useful if you're working on testnet or mainnet and don't want to wait for a full sync to happen every time you create a new container.
You can read more about bcoin configuration here.
- Copyright (c) 2018, The Bcoin Devs (MIT License).