Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short tech docs from readme #168

Open
tfius opened this issue Aug 30, 2023 · 2 comments
Open

Short tech docs from readme #168

tfius opened this issue Aug 30, 2023 · 2 comments

Comments

@tfius
Copy link
Contributor

tfius commented Aug 30, 2023

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

  1. Build the extension by running:

    npm run build

    This will generate compiled files in the dist directory.

  2. 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.

  1. Install the Swarm extension in the same browser as the Blossom extension.
  2. 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.

  1. Install the environment:

    npm install -g @fairdatasociety/fdp-play
  2. Start the environment:

    fdp-play start

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:

npm start

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 test

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:

bundle exec jekyll serve

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.

@tfius
Copy link
Contributor Author

tfius commented Aug 30, 2023

Swarm extension is no longer required ! Should be changed in readme and here !

@tomicvladan
Copy link
Collaborator

It's already updated in the readme:

blossom/README.md

Lines 45 to 60 in 0920d35

### Swarm extension
The Blossom extension can be configured to retrieve Bee URL and Bee debug URL directly from the Swarm extension. That is requred for running tests successfully. Before running tests, the required environment must be executed first.
The [Swarm extension](https://chrome.google.com/webstore/detail/ethereum-swarm-extension/afpgelfcknfbbfnipnomfdbbnbbemnia) must be installed in the same browser as where the Blossom extension. You can install it from the browser's extension store page, or you can build it locally.
To build and run a local version of the Swarm extension check [the extension's repo`](https://github.com/ethersphere/swarm-extension) or execute the following script from the root directory:
```bash
./scripts/compile-swarm-extension.sh
```
This script will generate the `swarm-extension` directory inside the root directory. You can load the compiled Swarm extension the same way as the Blossom extension by loading the `swarm-extension/dist` directory. Check the [Installation](#installation) section for the details how to load the extension.
> **_NOTE_:** If you are running your version of the Swarm extension, the `.env` file should be updated with its extension ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants