Skip to content

Instantly share code, notes, and snippets.

@cahlan
Last active October 11, 2018 23:16
Show Gist options
  • Save cahlan/12a26a47420af29a509f3295db09fc7c to your computer and use it in GitHub Desktop.
Save cahlan/12a26a47420af29a509f3295db09fc7c to your computer and use it in GitHub Desktop.
Sarah Wiley's walkthrough of Erebos, Morpheus-UI, and Bluzelle POC

Setup

  • Install/run local swarm node (referenced at localhost:8500)

  • Install/run local Bluzelle swarm (referenced at my IP address on port 51010)

  • Install/run Bluzelle CRUD visualizer tool

Running the App:

In browser, load app (from localhost:3000)

Input username (which is later used to construct/reference a Bluzelle table)

Input text content for a New Note (this content gets uploaded to swarm)

Input a label (this label gets used as the key to store the swarm hash in Bluzelle)

Click “Save”

App uploads content of note to swarm via erebos’s SwarmClient.bzz.upload() API. Hash to content on swarm is returned.

(This upload can be verified at localhost:8500 with a swarm lookup using the returned hash. Original content should be returned)

App stores the swarm hash in the Bluzelle table named _mfdb, in a record with key=the label given by user above and value=the swarm hash returned from content upload. Use bluzelle.connect() to establish DB connection and bluzelle.create() APIs to save the new key/value pair

(The contents of Bluzelle can be verified in their CRUD visualizer tool. Should see new key/value added immediately)

App refreshes list of all keys from Bluzelle (bluzelle.keys()) to display as an index to all previously saved notes.

(Should match list of keys visible in Bluzelle’s CRUD visualizer tool.)

User can click to select an entry from list of labels, which reads and displays the associated value (the hash) from Bluzelle (bluzelle.read())

User can click “retrieve note” button which then queries swarm via erebos’s SwarmClient.bzz.download() API, passing the hash for the selected note previously retrieved from Bluzelle, and returning the original content of the note which is then displayed back to the user.

All buttons in the app are custom components from the shared UI library in @morpheus-ui/core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment