Blossom Technical Documentation
Introduction
Blossom is a browser extension that acts as a web3 framework for dApps and serves as a Fair Data Society account manager for end-users. It is available on the Chrome web store.
Configuration
Before running the extension, it needs to be configured for proper build and execution. Configuration is stored in the .env file at the root directory. If it doesn't exist, create one using the .default.env template. The main configuration properties are:
- ENVIRONMENT: Set to
production or development based on the build mode.
- SWARM_EXTENSION_ID: Used for communication with the Swarm extension in development mode.
Note: Ensure the bee URL in the Swarm extension is set to the correct endpoint.
Installation
-
Build the extension by running:
This will generate compiled files in the dist directory.
-
To load the extension in the Chrome browser:
- Open a new tab and navigate to
chrome://extensions.
- Enable "Developer mode" in the top right corner.
- Click on the
Load unpacked button and select the dist folder.
- The extension should now appear in the list of installed extensions.
Note: Currently, only the Chrome browser is supported.
Setting up the Environment
Swarm Extension
The Blossom extension can be configured to retrieve Bee URL and Bee debug URL directly from the Swarm extension. This is required for running tests. Before running tests, ensure the required environment is set up.
- Install the Swarm extension in the same browser as the Blossom extension.
- Alternatively, build a local version of the Swarm extension by following instructions in its repository or run the script:
./scripts/compile-swarm-extension.sh
FDP Play
The Blossom extension requires a blockchain RPC provider and a Swarm gateway. For development, use fdp-play.
-
Install the environment:
npm install -g @fairdatasociety/fdp-play
-
Start the environment:
Bee Postage Batch
Ensure there's at least one postage stamp created. To create one in the Bee node, run:
curl -s -XPOST http://localhost:1635/stamps/10000000/18
Development
To start the project in development mode:
This will watch for changes in source files and compile them on every change.
Tests
Tests include both unit and integration tests. To run tests, ensure all dependencies are started and then execute:
Note: Tests rely on a fresh state of running services. If tests are run multiple times, restart all docker containers.
Documentation
To run documentation web pages locally, navigate to the docs directory and install dependencies:
gem install jekyll bundler
bundle install
Then start the server:
This documentation provides a comprehensive guide on how to set up, install, and run the Blossom extension. For more advanced interactions and details, developers can refer to the javascript library documentation in the library folder as mentioned in the original README.
Blossom Technical Documentation
Introduction
Blossom is a browser extension that acts as a web3 framework for dApps and serves as a Fair Data Society account manager for end-users. It is available on the Chrome web store.
Configuration
Before running the extension, it needs to be configured for proper build and execution. Configuration is stored in the
.envfile at the root directory. If it doesn't exist, create one using the.default.envtemplate. The main configuration properties are:productionordevelopmentbased on the build mode.Installation
Build the extension by running:
This will generate compiled files in the
distdirectory.To load the extension in the Chrome browser:
chrome://extensions.Load unpackedbutton and select thedistfolder.Setting up the Environment
Swarm Extension
The Blossom extension can be configured to retrieve Bee URL and Bee debug URL directly from the Swarm extension. This is required for running tests. Before running tests, ensure the required environment is set up.
FDP Play
The Blossom extension requires a blockchain RPC provider and a Swarm gateway. For development, use fdp-play.
Install the environment:
Start the environment:
Bee Postage Batch
Ensure there's at least one postage stamp created. To create one in the Bee node, run:
Development
To start the project in development mode:
This will watch for changes in source files and compile them on every change.
Tests
Tests include both unit and integration tests. To run tests, ensure all dependencies are started and then execute:
npm testDocumentation
To run documentation web pages locally, navigate to the
docsdirectory and install dependencies:Then start the server:
bundle exec jekyll serveThis documentation provides a comprehensive guide on how to set up, install, and run the Blossom extension. For more advanced interactions and details, developers can refer to the javascript library documentation in the
libraryfolder as mentioned in the original README.