Skip to content

Experimental Reader Prototype for the Value-Enabled Web

License

Notifications You must be signed in to change notification settings

value-enabled-web/vew-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📖 vew-reader

An experimental reader prototype for the Value-Enabled Web.

📦 Components

                   +----------------+ +----------------+
                   |     Local      | |  vew-accounts  |
                   |    Regtest     | |    (LNBits)    |
                   |                | |                |
                   | docker/regtest | | docker/mainnet |
                   +----------------+ +----------------+
                           ^                  ^
                           |                  |
                           |                  |
                           +---------+--------+
                                     |
+--------------------+    +----------+---------+
|                    |    |                    |
|       vew-api      |    |      Custodial     |
|  (readability.js)  |    |     LN Accounts    |
|                    |    |       System       |
|                    |    |                    |
+--------------------+    +--------------------+
           ^                         ^
           |                         |
           |                         |
           +------------+------------+
                        |
             +----------+---------+
             |                    |
             |     vew-reader     |
             |    (Reader App)    |
             |                    |
             +--------------------+
  • vew-reader
    • The mobile reader app.
  • vew-api
  • vew-accounts
    • Wrapper around LNBits for custodial LN accounts. See docker/mainnet.
    • For a drop-in regtest version with the same API, see docker/regtest.

🚀 How to Run

You can run teh app either against a local regtest environment or in mainnet environment.

Regtest Backend

For local testing, you can make use of the dockerized backend in /docker/regtest/. It runs the following software:

  • A Bitcoin Core node in regtest
  • An LND node in regtest representing the main node holding users' funds
  • LNDHUB as an accounting layer for this LND node
  • A second LND node in regtest representing an author's node
  • A lightning address server for this author node hosting the lighting address author@localhost:3001
  • A third LND node that serves as funding source for the reader app.

To run the regtest backend:

  • cd docker/regtest
  • docker compose up

Then when everythign is running:

  • ./setup-regtest.sh

The setup script will fund the main LND node and open a channel to the author node so we can pay the author using their lightning address.

If you get any errors in the setup script yelling at you that RPC APIs are not ready yet or that servers are still starting up, just wait for a minute and try again. This just means that Bitcoin Core or LND have not fully started up yet.

Helper Scripts

Alongside the docker setup, some helper scripts in docker/regtest simplify development and testing:

  • fund-app.sh <invoice> Use this script to fund the reader app by giving it the funding invoice generated by the app as argument.
  • author-balance.sh Use this script to get the balance of the author node and check if payments from the app actually made it through to the author.

Mainnet Backend

For testing with real sats, make use of the dockerized backend in /docker/mainnet. It runs a simple NodeJS gateway which uses LNBits as custodial Lightning accounting system. See vew-accounts.

To run the mainnet backend fiorst create a wallet on legend.lnbits.com and enable the User Manger extension. Add a file docker/mainnet/vew-accounts/.env with the credentials of the created LNBits wallet. Refer to docker/mainnet/vew-accounts/.env.example for which credentials are necessary.

Then:

  • cd docker/mainnet
  • docker compose build --build-arg GH_ACCESS_TOKEN=<Your GitHub Access Token>
  • docker compose up

The access token is needed to clone the private vew-accounts repo.

Mobile App

The prototype app uses React Native. Have a look at Setting up the Development Environment for how to get stup developing with React Native.

Make sure to edit .env.development according to your preferred settings. It includes recommended settings for regtest and mainnet operation. Just comment out whatever you don't want.

Once setup, run:

  • npm start to start the JS bundler; and in a separate terminal
  • npm run ios:development; or npm run android:development

Depending on which backend you're running at the moment, these builds will run on regtest or mainnet.

Production Builds

To create fully independent buils that don't need react-native's JS bundler running, run:

  • npm run ios:production; or
  • npm run android:production

Note that these builds will source their environemnt from .env.production and not .env.development.

Depending on which backend you're running at the moment, these builds will run on regtest or mainnet.

About

Experimental Reader Prototype for the Value-Enabled Web

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published