An application built on Node.js and Express that makes it easy for people to generate P2SH addresses that enforce a proportional distribution of coins. Payments to the address can only be spent when the value is sent to specific target addresses and in an assigned proportion. For example, if 100.00 XEC are received, a fee of 12.00 XEC is deducted, and then 90% (72.00 XEC) is transferred to one address and 10% (8.00 XEC) to another. The missing 8.00 XEC are explained by the use of integer math and the use of
The website can be run locally without any extra dependencies besides internet connection to download packages and contact the Chronik server. The usual commands apply:
npm installnpm run buildnpm run start
The server can be reached at http://localhost:3000 as will be shown in the console.
The standard target of npm run test will run unit tests that are standalone and can be run any time.
The application can be deployed ExpressJS being used directly as web server. That may require the setup of HTTPS certificates and running NodeJS with a privileged user so that it can open the HTTP/HTTPS ports.
The etc/systemd folder contains templates that can be used on a standard Ubuntu system. The tbg.service file provides a simple systemd service unit that launches the server and restarts on failure. The env.conf file provides a template for the environment variables that control the service.
| Variable | Description |
|---|---|
PORT |
The HTTP port to use or 3000, if not specified. |
HTTPS_PORT |
The HTTPS port to use. When specified the HTTPS_KEY and HTTPS_CERT must also be specified. |
LOG_ACCESS_FILE |
The path to the HTTP access log. If specified the server will log requests in Apache's combined format. |
HTTPS_KEY |
The path to private key to the HTTPS certificate. |
HTTPS_CERT |
The path to the HTTPS certificate for the host. |