GithubHelp home page GithubHelp logo

fairlayer / fair Goto Github PK

View Code? Open in Web Editor NEW
81.0 23.0 16.0 9.77 MB

Fairlayer node in JS

Home Page: https://fairlayer.com

License: MIT License

JavaScript 99.03% HTML 0.03% CSS 0.19% Vue 0.66% Shell 0.08% Batchfile 0.01%
blockchain payment-channel lightning-network offchain payment-gateway

fair's Introduction

code style: prettier

Intro

Fairlayer is a two-layered blockchain capable of processing billion+ transaction per second. It implements the idea of Extended Lightning Network XLN.

Our goal is to keep it easy to be a full node on any laptop, no matter how many payments happen on the second layer. The node processes few publicly broadcasted onchain transactions (insurance rebalances, disputes etc). All the payments happen instantly offchain and can be enforced in onchain "court" when needed.

Installation

This repo contains generic code not attached to any network, by design. Use ./simulate to start local private network.

For existing public network, go to a validator website and find Install page (https://fairlayer.com/#install). This will use latest state and latest code automatically.

When you install on a server, pass -s/--silent to switch off opn that tries to open a browser with the wallet for you. The script will simply output the URL with auth_code you need to visit.

For full documentation go to wiki

fair's People

Contributors

homakov avatar lendar avatar phantoms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fair's Issues

Generated .tar snapshots are still NOT deterministic?

With ./simulate running we see two different hashes on Install page for member 1 and 2. This must be equal hash, and the underlying data in .tar is identitcal. Something must be wrong with .tar() generation though last time I did my best to do it deterministic. Help would be great!

shepherd.js usage

๐Ÿ‘‹ Hello! I see you are using shepherd.js in this project. We are so pleased to see that! We would love to showcase your usage in the Shepherd docs, and we would love to hear how things have been going for you using it. What has worked well, do you have any feature requests or improvements, etc. Please let us know!

Little UI things

  • clipboard js to copy invoice automatically

  • filters on payment history

Running a node on Ubuntu 16.04

What are the steps/commands to run a testnet node on a Linux platform? Below are the steps I have tried (with Node v9.11.1 via nvm) .

a. git clone https://github.com/fairlayer/fair && cd fair
b. ./install
c. node fair
Resulting command line :
Reading db data/onchain/db.sqlite
Reading and syncing offchain db: sqlite
Loading K data
[Error] Unable to read "./data/onchain/k.json", quitting
(node:9994) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open './data/onchain/k.json'
at Object.fs.openSync (fs.js:660:18)
at Object.fs.readFileSync (fs.js:565:33)
at loadKFile (/home/decryptoed/FairLayer/fair/src/fair.js:81:19)
at startFairlayer (/home/decryptoed/FairLayer/fair/src/fair.js:162:7)
at
(node:9994) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9994) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

a. git clone https://github.com/fairlayer/fair && cd fair
b. ./deploy
Resulting command line :
yarn install v1.9.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 4.14s.

@ build /home/decryptoed/FairLayer/fair
parcel build wallet/index.html

โณ Building bootstrap.min.css...
Node#moveTo was deprecated. Use Container#append.
โœจ Built in 9.99s.

dist/main.795f3128.js 299.45 KB 28.89s
dist/chart.63163a79.js 145.45 KB 3.26s
dist/bootstrap.min.20abbb74.css 118.87 KB 520ms
dist/notyf.d8b8ab42.js 2.96 KB 1.60s
dist/notyf.efdd8d3b.css 2.11 KB 77ms
dist/reddit.c46e82d0.svg 2.05 KB 58ms
dist/main.5648710d.css 1020 B 63ms
dist/index.html 1013 B 400ms
dist/github.01dc78db.svg 898 B 58ms
dist/twitter.75ac189e.svg 830 B 58ms
dist/atelier-dune-dark.a1c3758f.css 587 B 85ms
dist/medium.3464a892.svg 552 B 58ms
dist/notyf.d8b8ab42.map 0 B 1.63s
dist/chart.63163a79.map 0 B 3.30s
dist/main.bd03407c.map 0 B 28.91s
./prod: line 33: pm2: command not found
Reading db data/onchain/db.sqlite
Reading and syncing offchain db: mysql
(node:10242) UnhandledPromiseRejectionWarning: SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306
at Utils.Promise.tap.then.catch.err (/home/decryptoed/FairLayer/fair/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:139:19)
at tryCatcher (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/promise.js:689:18)
at Async._drainQueue (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (/home/decryptoed/FairLayer/fair/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:763:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate (timers.js:716:5)
at process.topLevelDomainCallback (domain.js:102:23)
(node:10242) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10242) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
./prod: line 38: pm2: command not found

Proposer's behavior

Hi guys

You have a very promising project. I'm also working on something right now and try to get involved in reading other peoples code, especially new projects. Consensus is hard, so any opportunity of improving understanding is priceless.

I'm mainly a Java developer, so I apologize if I say some bullshit here)

I looked through the code and can admit it is an interesting idea - replacing PBFT view changes with just time rounds. It makes it more similar to DPOS actually, without sacrificing finality. If I understood it correctly of course.

Regarding the code, I've got a couple of minor question:

  1. Is there a control of how many proposals can active validator do in it's round? And how many prevotes/precommits can other validators do in the same round for the same height? I was not able to find such a check, but it might be because of my poor JavaScript skills. I the case these check are absent, I would suggest to add them as otherwise it is possible to lock the majority of validators on different blocks.

  2. In process_block.js, line 114 if (!result.success) l(result) , shouldn't it be if (!result.success) l(result); return; as it looks like we are accepting block with partially incorrect transactions.

Thank you, again, very interesting project. I should find more time and read how is the planned performance will be achieved and probably steal some ideas from you)

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.