get10101 / 10101-PoC

The world needs more Lightning!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

10101 (a.k.a TenTenOne) - PoC

⚠️ The code within this repository was created during the Legends of Lightning Tournament. It is now archived and replaced by https://github.com/get10101/10101

Dependencies

This project requires Flutter and Rust. Rust toolchain can be installed via Rustup. In order to setup Flutter (as well as mobile simulators etc), please see the excellent Flutter guide here

A lot of complexity for building the app has been encapsulated in a Makefile. To see the available commands, simply run make help or make.

To install necessary project dependencies for all targets, run the following:

make deps

Documentation

This project uses flutter-rust-bridge. It is strongly encouraged to read its documentation before jumping into the project in order to understand the project's structure, conventions and ways of integrating between Rust and Flutter.

Building

The instructions below allow building the Rust backend for 10101 application.

Bindings to Flutter

Bindings for Flutter can be generated with the following command:

make gen

Native (desktop)

make native

iOS

make ios

Android

Native

For building for target devices, run:

make android

Simulator

make android-sim

Formatting

We strive to keep the code consistent, therefore before submitting PRs one should run: make format to ensure code is properly formatted.

Linting

Static analysers (clippy and flutter analyze) can be run by calling make lint.

Running

After compiling the relevant Rust backend in the previous section, invoke Flutter:

flutter run

note: Flutter might ask you which target you'd like to run.

Running 10101 for web target is currently unsupported.

regtest

To run on regtest you have to change the default network (testnet) to regtest by setting the NETWORK environment variable.

Example command for maker:

make maker

(make runs prepend NETWORK=regtest automatically)

Example command for taker:

NETWORK=regtest flutter run

Note that the iOS simulator will not pick up the environment variable, so make sure you run on a native target when testing with regtest!

Running a regtest setup

For regtest you need to run a local electrs server on localhost:50000. We make use of nigiri for this.

Run

nigiri start

To get some money run

nigiri faucet <address>

To generate a block, simply call the faucet again.

Run maker in docker

DATA_DIR=$(pwd)
docker run -v$DATA_DIR:/data -p8000 -p9045 ghcr.io/bonomat/10101:main

About

The world needs more Lightning!

License:MIT License


Languages

Language:Dart 47.9%Language:Rust 38.3%Language:C++ 5.5%Language:CMake 4.7%Language:Makefile 0.8%Language:Ruby 0.8%Language:HTML 0.6%Language:Swift 0.5%Language:C 0.4%Language:CSS 0.2%Language:Shell 0.1%Language:Dockerfile 0.1%Language:JavaScript 0.0%Language:Kotlin 0.0%Language:Objective-C 0.0%