Git Product home page Git Product logo

mutiny-web-poc's Introduction

mutiny-web (proof of concept)

The first version of the mutiny web concept, built during the bolt.fun hackathon.

The node logic is built in rust and located here and the typescript bindings for that is located here.

Development

Dependencies

Build

Get all the dependencies above first.

cd frontend
npm i
npm start

Local node-manager

To make local development easier with a latest local version of the node manager, you may want to npm link it.

In your mutiny-node local repo:

just pack && cd node-manager/pkg && npm link

Now in this repo, link them.

just local

To revert back and use the remote version of node-manager:

just remote

With SSL

Since we plan to use web workers and other SSL-required things, we can also do SSL in localhost to make testing a little less gotch-ey.

First generate the local cert (requires mkcert command):

just cert

Then start react with SSL flags:

npm run start-ssl

PWA

To test out PWA stuff you need to build and then run the built artifact:

npm run build

(if you don't have a server installed: npm install -g serve)

Then serve the build folder:

serve -s build

They recommend running this in an incognito window because caching can be annoying with this stuff. Works for me in Chrome to install Mutiny as a desktop app.

Bitcoin networks

You'll need a regtest bitcoin node, electrs, and an exposed port to whatever regtest node you are connecting to.

For Testnet / Mainnet mutiny

Mutiny defaults to regtest, but the network can be set by environment variable (it's set to "bitcoin" in the production deployment).

Create a .env.local file in the frontend dir and add this:

REACT_APP_NETWORK="testnet"

Or

REACT_APP_NETWORK="bitcoin"

Then restart your dev server.

First build it, then run this script for regtest, replacing paths and passwords where necessary. YMMV. One special note is that this is for cookie password based auth.

/path/to/target/release/electrs -vvvv --daemon-dir /path/to/.bitcoin/regtest/data/ --timestamp --blocks-dir /path/to/.bitcoin/regtest/data/regtest/blocks/ --cookie="bitcoinrpc:{cookiebasedpassword}" --db-dir /path/to/.electrs/ --network regtest --http-addr 0.0.0.0:3003

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.