Building a Bolt‑Based Web Application

To build a Bolt‑based web application, you will need the following:


1. Bolt Tools

Install and set up bolt-tools on your system by following the instructions in the repository:

https://github.com/rdkcentral/bolt-tools/tree/main

Bolt Tools provides the utilities required to package and sign your Bolt applications.



2. App Package Configuration

The app package configuration defines the entry point, dependencies, permissions, and other metadata required for building the Bolt package.

2.1 Key Fields:



Sample App Configuration (JSON)

{
  "id": "com.rdkcentral.appName",
  "version": "0.1.0",
  "versionName": "develop",
  "name": "tmdb",
  "packageType": "application",
  "entryPoint": "--url=https://lightningjs.io/tmdb/#splash",
  "dependencies": {
    "com.rdkcentral.wpe-rdk": "0.1.0"
  },
  "permissions": [
    "urn:rdk:permission:internet",
    "urn:rdk:permission:firebolt",
    "urn:rdk:permission:thunder",
    "urn:rdk:permission:rialto"
  ],
  "configuration": {}
}


3. Creating a Bolt Package

To package an HTML/Lightning app into a Bolt bundle, you need:

  1. A JSON configuration file (com.rdkcentral.app_name.json)
  2. A rootfs layer in .tgz format

For HTML/Lightning applications, the rootfs layer can be an empty .tgz file, since the app is launched via a browser using a URL.

Steps

  1. Create an empty .tgz file, e.g.:
    empty.tgz
    
  2. Create your App Package configuration JSON file.
  3. Run the Bolt pack command:
    bolt pack com.rdkcentral.app_name.json empty.tgz
    
  4. The command will generate:
    com.rdkcentral.app_name+<version>.bolt
    
    This is the Bolt package to be installed on the platform.

4. Signing Your Bolt App

Every Bolt app must be digitally signed before installation.

Follow the signing instructions here:
https://wiki.rdkcentral.com/spaces/RDKM/pages/447124247/Bolt+package+-+signing+and+verification


5. Sideloading the Bolt App to the Platform

  1. Copy/SCP the .bolt package to the device, for example:
    /tmp/com.rdkcentral.app_name+0.1.0.bolt
    
  2. Install the app using the PackageManager.
    curl -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc":2.0,"id":1,"method":"org.rdk.PackageManagerRDKEMS.install","params":{"packageId":"com.rdkcentral.app_name+0.1.0.bolt","version":"0.1.0","fileLocator":"/tmp/com.rdkcentral.app_name+0.1.0.bolt"}}' -H "Content-Type: application/json"
  3. Launch the app using the Application Manager.
    curl -s -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc": "2.0","id": 1013, "method": "org.rdk.AppManager.1.launchApp", "params":{"appId":"com.rdkcentral.app_name"}}'