Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add The Federation Layer v0.6.0 #922

Merged
merged 134 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
293c0b6
Refactor contexts and models (#921)
KoalaSat Oct 27, 2023
66c1676
Fix version, release_note and small typo
Reckless-Satoshi Oct 27, 2023
2361b72
Fix (some) lint issues
Reckless-Satoshi Oct 27, 2023
59bac99
Fix old merge conflict on federation.md
Reckless-Satoshi Oct 27, 2023
48c551d
Add cordinator: Temple of Sats
Reckless-Satoshi Oct 27, 2023
1fcd12d
Federation view fixes (#923)
KoalaSat Nov 1, 2023
4eb46f1
Fix lint issues
Reckless-Satoshi Nov 1, 2023
7f78f69
More fixes
Reckless-Satoshi Nov 2, 2023
7eaaab7
Fix PRO
Reckless-Satoshi Nov 3, 2023
6a5b760
Remove template coordinator
Reckless-Satoshi Nov 3, 2023
9d87bf6
Add coordinator: Satstralia
Reckless-Satoshi Nov 3, 2023
013ca08
Add Simplex contact method to coordinator dialog
Reckless-Satoshi Nov 3, 2023
7e8b263
Add new X icons, replace Twitter
Reckless-Satoshi Nov 3, 2023
07edb12
Add satstralia PGP keys
Reckless-Satoshi Nov 4, 2023
b973afe
Add PGP keys to /static
Reckless-Satoshi Nov 4, 2023
8d8e3a5
Fix robot recovery (#945)
KoalaSat Nov 14, 2023
7c06c22
Fix order page
KoalaSat Nov 15, 2023
88833a5
Fix last order
KoalaSat Nov 15, 2023
b9bab30
Not expose current notification order
KoalaSat Nov 15, 2023
48dd17b
Fix
KoalaSat Nov 15, 2023
937ac62
Change getRobot by getSlot (#955)
KoalaSat Nov 19, 2023
eb840c5
Fix order workflow (#957)
KoalaSat Nov 20, 2023
fbee60e
Add coordinator notice
Reckless-Satoshi Nov 20, 2023
bfd967c
Fix and update About
Reckless-Satoshi Nov 21, 2023
e870117
Update Dispute prompts for multi-coordinator
Reckless-Satoshi Nov 22, 2023
e8ec7f9
Adapt garage to coordinators
KoalaSat Nov 21, 2023
8029427
Fix mobile app (#969)
KoalaSat Nov 26, 2023
9fee3b3
Update temple of sats, new prettier format
Reckless-Satoshi Dec 2, 2023
2408190
Fix statusToDelay, linting and others
Reckless-Satoshi Dec 2, 2023
7e97c32
Add robo-identity-wasm
Reckless-Satoshi Dec 2, 2023
4fda937
Small fixes
Reckless-Satoshi Dec 2, 2023
25e6e82
Small fixes
Reckless-Satoshi Dec 2, 2023
4a273fd
Avatar hashid in Garage (#983)
KoalaSat Dec 15, 2023
a2695ca
Merge pull request #971 from RoboSats/add-roboidentity-generator
Reckless-Satoshi Dec 15, 2023
8884c7f
Fix and disable strict boolean lintern
KoalaSat Dec 22, 2023
05fb65d
Merge pull request #1019 from KoalaSat/fix-and-disable-strict-boolean…
Reckless-Satoshi Dec 25, 2023
1724fb2
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Dec 25, 2023
0976010
Fix un-silence all mainnet coordinators
Reckless-Satoshi Dec 27, 2023
7648fa9
Fix add extra JS bundles and .wasm to uploaded artifacts
Reckless-Satoshi Dec 27, 2023
16a16da
Fix navbar and book duplication (#1031)
KoalaSat Dec 30, 2023
138d5ca
Add coordinator: TheBigLake
Reckless-Satoshi Dec 30, 2023
e4b5843
Feat hide LocalDev coordinator conditionally
Reckless-Satoshi Dec 30, 2023
40b687d
Robohash gereator queue (#1035)
KoalaSat Dec 30, 2023
781aee5
Fix coordinator table avatars flip
Reckless-Satoshi Dec 30, 2023
278c222
Fix coordinator avatar on maker form
Reckless-Satoshi Dec 30, 2023
bfb97e0
Fix update coordinators urls on network change
Reckless-Satoshi Dec 30, 2023
4b99b38
Fix depth chart and coordinator table (#1039)
KoalaSat Dec 31, 2023
807355e
Add coordinator warning
Reckless-Satoshi Jan 2, 2024
353897c
Fix show coordinator warning only once
Reckless-Satoshi Jan 2, 2024
e885585
Remove generating avatar animation
Reckless-Satoshi Jan 2, 2024
42591b3
Fix order tab navigation
Reckless-Satoshi Jan 2, 2024
085e9cc
Fix order flow (#1040)
KoalaSat Jan 4, 2024
399671d
Add extra row to coordinator table
Reckless-Satoshi Jan 5, 2024
94af0b2
Fix order autoupdate and chat (#1047)
KoalaSat Jan 6, 2024
3c8adac
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 6, 2024
9a21569
fix: Remove .js files from linting (#1049)
nullcount Jan 6, 2024
fa0781b
Perf hide animated backgrounds
Reckless-Satoshi Jan 6, 2024
a44e280
Fix onboarding offers/create navigation
Reckless-Satoshi Jan 6, 2024
d380925
Fix undefined currencyCode
Reckless-Satoshi Jan 7, 2024
0d9dbe5
Fix chat avatars and numeric displays
Reckless-Satoshi Jan 7, 2024
53037a3
Fix successful prompt avatars, rate text and txid
Reckless-Satoshi Jan 7, 2024
a4b2327
Small fixes and lint fixes
Reckless-Satoshi Jan 7, 2024
d1699b3
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 7, 2024
200efc5
Fix coordinator avatars orientation
Reckless-Satoshi Jan 7, 2024
447c361
Fix unsafeAlert and grab safe urls from federation.json
Reckless-Satoshi Jan 9, 2024
804f4c4
Fix click order on order map
Reckless-Satoshi Jan 9, 2024
3945305
Fix cancel button, add debug console log fetchOrder
Reckless-Satoshi Jan 10, 2024
7ef7e2a
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 10, 2024
3b7f54c
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 10, 2024
b18dcec
Add setAcknowledgeWarning to initialAppContext
Reckless-Satoshi Jan 11, 2024
2472551
Add simple web hosted federated client
Reckless-Satoshi Jan 11, 2024
8af3eda
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 11, 2024
51c5bad
Update federated frontend url
Reckless-Satoshi Jan 12, 2024
963a3b9
Fix Contexts
KoalaSat Jan 12, 2024
657b88d
Fix do not share chat logs on disputes by default
Reckless-Satoshi Jan 13, 2024
ab6c902
fix infinite re-render loop
Reckless-Satoshi Jan 13, 2024
af3007b
Merge branch 'fix-context' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 13, 2024
8ae259e
Re-set fetchOrder on page change, empty book on not_found
Reckless-Satoshi Jan 13, 2024
017601c
Add coordinator endpoint to stats for nerds
Reckless-Satoshi Jan 13, 2024
9d8c8d5
Fix navigation
Reckless-Satoshi Jan 14, 2024
c98e643
Small fixes
Reckless-Satoshi Jan 14, 2024
27b2652
Fix too-many fetchRobots and coordinator endpoints print
Reckless-Satoshi Jan 14, 2024
ed9dd35
Fix currentOrder fetch
Reckless-Satoshi Jan 15, 2024
043b690
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 15, 2024
87d217a
Fix duplicated version on stats for nerds
Reckless-Satoshi Jan 15, 2024
f7b504c
Minor lint fixes
Reckless-Satoshi Jan 15, 2024
5dcb6f0
Fix coordinator hosted web app
Reckless-Satoshi Jan 15, 2024
82f1e90
Fix amount string on order details
Reckless-Satoshi Jan 15, 2024
759e9f7
Fix unsafe_alert locale string
Reckless-Satoshi Jan 18, 2024
876846a
Add devfund donation to coordinator summary accordion
Reckless-Satoshi Jan 19, 2024
5cdaf93
Fix book table in the v0.6.0 version (#1083)
aftermath2 Jan 22, 2024
b4b10cd
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 22, 2024
14c2917
Revert to v0.6.0 deps and notes
Reckless-Satoshi Jan 22, 2024
c226060
Fix devfund fraction validation
Reckless-Satoshi Jan 22, 2024
d080b6a
Fix garage deletion (#1085)
KoalaSat Jan 23, 2024
9d96326
Fix compute exchange active robots by max
Reckless-Satoshi Jan 23, 2024
30f7c04
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 23, 2024
c648132
Fix book loading (#1086)
KoalaSat Jan 23, 2024
83410c1
Book coordinator filter (#1087)
KoalaSat Jan 23, 2024
7882dd3
Fix matches in MakerPage
Reckless-Satoshi Jan 23, 2024
bee30ea
Fix book filter avatar sizes and bookUpdate on refresh
Reckless-Satoshi Jan 24, 2024
edbc290
Fix host filter overflow on small displays
Reckless-Satoshi Jan 24, 2024
e681bdc
Delete Rebellion
Reckless-Satoshi Jan 24, 2024
0f8ebdc
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Jan 28, 2024
550cb7e
Fix decimal fees and exchange stats
Reckless-Satoshi Jan 28, 2024
61d6406
Fix telegram link (#1099)
KoalaSat Jan 29, 2024
042fbdc
Fix rewards claim
Reckless-Satoshi Jan 29, 2024
fd7a62d
Fix hide collab cancel request after fiat sent
Reckless-Satoshi Jan 30, 2024
5f602ab
Add federation coordinator est. date and hard limits
Reckless-Satoshi Feb 7, 2024
4b7b940
Add programatic order size limit to new coordinators
Reckless-Satoshi Feb 8, 2024
683cca6
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Feb 11, 2024
035cf28
Add size limits and onchain swap status to coordinator prof
Reckless-Satoshi Feb 11, 2024
d617ae7
Update templeofsats tg handle
Reckless-Satoshi Feb 12, 2024
627286b
Update dispute prompt contacts
Reckless-Satoshi Feb 14, 2024
9d83831
update temple of sats
Reckless-Satoshi Feb 18, 2024
3b09fb5
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Mar 2, 2024
259cbab
Add coordinator: BitcoinVeneto
Reckless-Satoshi Mar 2, 2024
841c6eb
fix change veneto coordinator badges
Reckless-Satoshi Mar 3, 2024
3604d2f
update bitcoinveneto contact methods
Reckless-Satoshi Mar 7, 2024
2d92724
Fix coordinator selector maker page (#1157)
KoalaSat Mar 7, 2024
e26435f
Fix loading robots (#1166)
Reckless-Satoshi Mar 9, 2024
a20defb
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Mar 9, 2024
5f8c25c
Add loading robot profile (#1176)
KoalaSat Mar 14, 2024
2b5bc90
Fix undefined prices error (#1173)
KoalaSat Mar 14, 2024
09f70c4
Makes filtering by multiple payment methods in desktop possible (#1172)
Renato1478 Mar 14, 2024
0ac68d7
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Mar 14, 2024
4741c66
Fix order navbar (#1178)
KoalaSat Mar 15, 2024
b8fd2e2
Fix renew order refresh (#1179)
KoalaSat Mar 15, 2024
0e049ee
Fix federation summary (#1180)
KoalaSat Mar 15, 2024
f12e242
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Mar 15, 2024
bedbe1d
Fix depth chart borked and premium precision
Reckless-Satoshi Mar 17, 2024
1456c29
Update coordinator BitcoinVeneto
Reckless-Satoshi Mar 17, 2024
c6c02e4
Add established date to coordinator dialog
Reckless-Satoshi Mar 17, 2024
9a0ad1d
Merge branch 'main' into the-federation-layer-v0.6.0
Reckless-Satoshi Mar 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: '(api|chat|control)/migrations/.*'
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v2.3.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-yaml
Expand Down
2 changes: 1 addition & 1 deletion api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def send_devfund_donation(order_id, proceeds, reason):

order = Order.objects.get(id=order_id)
coordinator_alias = config("COORDINATOR_ALIAS", cast=str, default="NoAlias")
donation_fraction = max(0.05, config("DEVFUND", cast=float, default=0.2))
donation_fraction = min(1.0, max(0.00, config("DEVFUND", cast=float, default=0.2)))
message = f"Devfund donation; {coordinator_alias}; {order}; {donation_fraction}; {reason};"
num_satoshis = int(proceeds * donation_fraction)
routing_budget_sats = int(max(5, num_satoshis * 0.000_1))
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ services:
volumes:
- ./nodeapp/:/usr/src/robosats/
- ./nodeapp/nginx.conf:/etc/nginx/nginx.conf
- ./nodeapp/coordinators/:/etc/nginx/conf.d/
- ./frontend/static:/usr/src/robosats/static

clean-orders:
Expand Down
12 changes: 11 additions & 1 deletion federation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_RoboSats Federation Basis v0.6.0~2_
_RoboSats Federation Basis v0.6.0~3_

## Introduction
RoboSats is a Free and Open Source project, anyone can spin up a new RoboSats backend instance. This is in fact ideal, given that the more backend instances there are, the more decentralized RoboSats becomes and the harder it is to stop. However, this decentralization creates some challenges:
Expand Down Expand Up @@ -96,6 +96,16 @@ Some of these badges can be objectively measured and awarded. Other badges rely

We also envision more badges in the future, for example milestones by number of trades coordinated (200, 1K, 5K, 25K, 100K, etc).

## New coordinator limits.
The RoboSats client app limits the size of order tha robots can place on newly joined coordinators. This way new coordinators can show their worth with smaller orders before handling all order sizes. The client allows orders of up to 250K Sats for completely new coordinators. The client will increase the size limite by 30% every 2016 blocks (that is, 2 weeks, same as the difficulty adjustment). After 6 months, a coordinator will be considered "mature" and able to host any order size. Coordinator that gained the "Founder" badge by joining before the v0.6.0 release are considered "mature".

## New Coordinator Order Size Limits
The RoboSats client application imposes limits on the order size that robots can place on newly established coordinators. This mechanism allows new coordinators to demonstrate their capabilities with progressively larger orders.

New coordinators are initially restricted to hosting orders of up to 250,000 Sats. Over time, the order size limit increases. Specifically, the limit grows by 30% every 2016 blocks (2 weeks), the same cadence of the Bitcoin mining difficulty adjustment.

After six months, or approximately 12,288 blocks, a coordinator reaches maturity and the app grants it the ability to handle orders of any size. Notably, coordinators that earned the "Founder" badge upon joining prior to the v0.6.0 release are considered mature and can process any order size immediately.

## Timeline

In a sense the RoboSats federation is already online. New coordinators can gradually join. Eventually, the RoboSats "Experimental" coordinator that is run by the development team will be phased out. The RoboSats Federated client app can be used already in `robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion`. You can also run a pre-release of the v0.6.0 selfhosted client.
Expand Down
14 changes: 12 additions & 2 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@
"sourceType": "module",
"project": "./tsconfig.json"
},
"ignorePatterns": ["index.js", "**/PaymentMethods/Icons/code/code.js"],
"plugins": ["react", "react-hooks", "@typescript-eslint", "prettier"],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react-hooks/exhaustive-deps": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off"
"react/react-in-jsx-scope": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variableLike",
"format": ["camelCase", "snake_case", "PascalCase", "UPPER_CASE"],
"leadingUnderscore": "allow"
}
]
},
"settings": {
"import/resolver": {
Expand Down
83 changes: 52 additions & 31 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "frontend",
"version": "0.5.4",
"version": "0.6.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "node --max-old-space-size=4096 ./node_modules/.bin/webpack --watch --progress --mode development",
"test": "jest",
"build": "webpack --mode production",
"lint": "eslint src/**/*.{js,ts,tsx}",
"lint:fix": "eslint --fix 'src/**/*.{js,ts,tsx}'",
"lint": "eslint src/**/*.{ts,tsx}",
"lint:fix": "eslint --fix 'src/**/*.{ts,tsx}'",
"format": "prettier --write '**/**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc"
},
"keywords": [],
Expand All @@ -29,14 +29,14 @@
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.35.1",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^12.0.2",
"copy-webpack-plugin": "^12.0.1",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^36.1.0",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down Expand Up @@ -86,6 +86,7 @@
"react-smooth-image": "^1.1.0",
"react-world-flags": "^1.6.0",
"reconnecting-websocket": "^4.4.0",
"robo-identities-wasm": "^0.1.0",
"simple-plist": "^1.3.1",
"webln": "^0.3.2",
"websocket": "^1.0.34"
Expand Down
25 changes: 14 additions & 11 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { StrictMode, Suspense } from 'react';
import ReactDOM from 'react-dom/client';
import Main from './basic/Main';
import { CssBaseline, ThemeProvider } from '@mui/material';
import { AppContext, useAppStore } from './contexts/AppContext';
import { CssBaseline } from '@mui/material';
import HostAlert from './components/HostAlert';
import TorConnectionBadge from './components/TorConnection';

Expand All @@ -11,29 +10,33 @@ import i18n from './i18n/Web';

import { systemClient } from './services/System';
import ErrorBoundary from './components/ErrorBoundary';
import { AppContextProvider } from './contexts/AppContext';
import { GarageContextProvider } from './contexts/GarageContext';
import { FederationContextProvider } from './contexts/FederationContext';

const App = (): JSX.Element => {
const store = useAppStore();
return (
<StrictMode>
<ErrorBoundary>
<Suspense fallback='loading'>
<I18nextProvider i18n={i18n}>
<AppContext.Provider value={store}>
<ThemeProvider theme={store.theme}>
<CssBaseline />
{window.NativeRobosats === undefined ? <HostAlert /> : <TorConnectionBadge />}
<Main />
</ThemeProvider>
</AppContext.Provider>
<AppContextProvider>
<GarageContextProvider>
<FederationContextProvider>
<CssBaseline />
{window.NativeRobosats === undefined ? <HostAlert /> : <TorConnectionBadge />}
<Main />
</FederationContextProvider>
</GarageContextProvider>
</AppContextProvider>
</I18nextProvider>
</Suspense>
</ErrorBoundary>
</StrictMode>
);
};

const loadApp = () => {
const loadApp = (): void => {
// waits until the environment is ready for the Android WebView app
if (systemClient.loading) {
setTimeout(loadApp, 200);
Expand Down
Loading