The Nimiq Hub provides a unified interface for all Nimiq accounts, addresses, and contracts. It is the primary UI for Nimiq users to manage their accounts and provides websites and apps with a concise API to interact with their users’ Nimiq addresses.
The documentation for the Hub API is at https://nimiq.github.io/hub.
TODO
If you want to run your own instance of Hub, you also need to run an instance of the Keyguard.
To get started with working on the source code, pull the code and install the dependencies:
git clone https://github.com/nimiq/hub.git
cd hub
yarn
Compile and serve with hot-reload in the background for development:
yarn serve
Compile and lint continuously in the background for development:
yarn build --watch
Lint and fix files:
yarn lint
Run unit tests:
yarn test
Compile and minify for production:
# Using local config
yarn build
# Using testnet config
build=testnet yarn build
# Using mainnet config
build=mainnet yarn build
The following values can be changed via configuration files:
- keyguardEndpoint: The location of your keyguard instance.
- network: The network you want to use. Possible values are 'main', 'test' and 'dev'. You can use the constants (see default configs).
- networkEndpoint: The location of the network iframe instance you want to use.
- privilegedOrigins: An array of origins with special access rights, nameley
permission to use iframe methods like
list()
. - redirectTarget: In case of empty referrer or absence of request, the user is redirected to this page.
The default config file is config.local.ts
. To use a different file
(especially useful for deployment), set an environment variable
build
. E.g. export build='testnet'
to use config.testnet.ts
. To set
environment variables permanently, please refer to your server's documentation,
e.g. for Apache.