Use Yeoman in the TBSP Docker SDK container to create and upload plugins to your TBSP instance on Google Cloud Platform.
This article shows you how you can use the Docker SDK container to create and upload plugins.
To upload plugins to your TBSP instance on Google Cloud Platform, the system administrator must first log in:tymlez-dev auth getJWTToken --username=sysadmin --password=<GENERATED PASSWORD FROM OUTPUT>
and then change the status of the container to unlocked:tymlez-dev utils updateContainerStatus --context=cloud --immutable=true --state=unlocked --pluginManagerUploadUI=true --pluginManagerUploadCLI=true
This video shows you how you can use the Docker SDK container to create and upload plugins with either the command line or user interface.
What is a Plugin?
Plugins are applications developed and used by both Tymlez and third-party developers.
Plugins can be installed and activated on TBSP to extend the platform's capabilities by enabling new functionalities and new services.
What is Yeoman?
Yeoman is an open source client-side scaffolding tool for web applications.
Yeoman provides a generator ecosystem; a generator is basically a plugin that can be run with the `yo` command to scaffold complete projects or useful parts.
With Yeoman, you can easily create plugins and upload them to the TBSP platform, where you can run them as applications.
Use Yeoman to create a plugin
Scaffold empty application in the plugins of tymlez/ng-rt-core
In the Docker container, create a new plugin:
Available plugin types
- Server-side: contains both API routes and services
- Client-side: contains html files for the front-end and user interface
- Full-stack: contains both the server-side and client-side plugins.
- Validation: this contract checks if a specific condition is met.
- Escrow: this contract holds the digital assets and only changes the ownership of an asset as soon as a specified condition is met.
- Memory: this contract ensures the immutability of the content of a contract. Validated through a consensus involving different nodes, this kind of contract can be either read-only or modifiable (read/write).
Generates a plugin that enables you to use your **Custom Icons and CSS** for the server UI.
You will see the following prompt. Enter the following values:
- Plugin Name - give your plugin a name
- Project Root - specify a desired plugin folder
- TBSP Version - specify version 3.0
- Plugin Type - specify the kind of TBSP plugin you'd like to create
- Description - describe the functions of your plugin
- Author - you can enter your name or your organization's name here
- Advanced Options (Y/N) - select Y for advanced options; select N to skip
The generator will create a plugin folder in the project root.
Upload a plugin
You can use the command line interface to upload the plugin you just created.
First, a zip file must be first prepared.
Prepare zip file
Assuming your working directory is 'plugins/test1', build a distributable archive:
$ tymlez-dev gulp dist
Get your app key
The app key is required for uploading plugins. This section is also covered in the Obtain App Key article.
First log in as the admin user to obtain the JWT token:
tymlez-dev auth getJWTToken --username=admin --password=<GENERATED PASSWORD FROM OUTPUT>
After logging in with the admin user, obtain the app key for ng-rt-admin:
tymlez-dev utils addAppKey --username=admin --plugin=ng-rt-admin --domain=<DESIRED_DOMAIN_ID>
An app key is then generated:
[INFO] utilsCommands.addAppkey - appKey for ng-rt-admin added : <GENERATED_APP_KEY>
Upload zip file via the command line interface
Navigate to the folder containing the plugin. In this case, ng-rt-SmartContracts is used as an example:
$ cd ~/ng-rt-SmartContracts
In the plugin folder, install the required node modules:
$ tymlez-dev plugin upload
Upload zip file via the UI
Log in to your instance as administrator.
In the menu bar, select Plugins:
Click on 'Add plugin' at the top right corner:
Navigate to 'Local File':
Click 'Browse' to find the zip file you created.
If you created the plugin in your Docker SDK container, you'll find the file on your local development machine at this location:
Once your plugin has been uploaded, install and activate your plugin: