No description
Find a file
2020-04-25 18:45:42 -04:00
.github/workflows chore: add GitHub Actions CI workflow 2020-04-14 19:17:49 -04:00
.vscode feat: add Loop History component, tests, and stories 2020-04-24 12:03:39 -04:00
app fix: fully expand page content when sidebar is collapsed 2020-04-25 18:45:42 -04:00
proto rewrite backend and add loop proxy 2020-04-07 18:39:55 -04:00
.gitignore chore: add .env.local for environment local vars 2020-04-14 11:32:21 -04:00
config.go rewrite backend and add loop proxy 2020-04-07 18:39:55 -04:00
go.mod chore: add configs for eslint, prettier, import-sorter 2020-04-09 12:48:03 -04:00
go.sum rewrite backend and add loop proxy 2020-04-07 18:39:55 -04:00
proxy.go rewrite backend and add loop proxy 2020-04-07 18:39:55 -04:00
README.md chore: add GitHub Actions CI workflow 2020-04-14 19:17:49 -04:00
shustar.go rewrite backend and add loop proxy 2020-04-07 18:39:55 -04:00

This document is currently a scratchpad for developer setup and temporary hacks to run the project. It will be made more user-friendly in the future

CI

Requirements: Go, protoc, nodejs

One-time Setup

Create certificate for browser to backend proxy communication

openssl genrsa -out https.key 2048
openssl req -new -x509 -key https.key -out https.cert -days 365

Install client app dependencies

npm install -g yarn # if yarn isn't already installed
cd app/
yarn

Development

  • Spin up a local regtest env with nautilus and loopd (See docker-regtest)
  • Create a .env.local file in the app/ directory with the following content. Replace <macaroon> with the HEX encoded admin.macaroon of the LND node to connect to
    REACT_APP_DEV_MACAROON=<macaroon>
    REACT_APP_DEV_HOST=http://localhost:3000
    
  • Start backend server, updating the ports for the LND and Loop nodes if necessary
    go run . --lndhost=localhost:10011 --loophost=localhost:11010
    
  • Run the client app in a separate terminal
    cd app
    yarn start
    

Open browser at http://localhost:3000

Testing

  • Run all unit tests and output coverage
    yarn test:ci
    
  • Run tests on locally modified files in watch mode
    yarn test
    

Logging

Client-side logs are disabled by default in production builds and enabled by default in a development environment. In production, logging can be turned on by adding a couple keys to your browser's localStorage. Simply run these two JS statements in you browser's DevTools console:

localStorage.setItem('debug', '*'); localStorage.setItem('debug-level', 'debug');

The value for debug is a namespace filter which determines which portions of the app to display logs for. The namespaces currently used by the app are as follows:

  • main: logs general application messages
  • action: logs all actions that modify the internal application state
  • grpc: logs all GRPC API requests and responses

Example filters: main,action will only log main and action messages. *,-action will log everything except action messages.

The value for debug-level determines the verbosity of the logs. The value can be one of debug, info, warn, or error.