Giter Club home page Giter Club logo

light-client's Introduction



Raiden Light Client SDK and dApp

JavaScript SDK and dApp to carry out fast, cheap, scalable off-chain token transfers with other Raiden Clients.

Getting Started βˆ™ Contact

CircleCI Badge Codecov Badge code style: prettier Gitter Raiden Badge

The Raiden Light Client SDK is a Raiden Network compatible client written in JavaScript/Typescript, capable of running in modern web3-enabled browsers, wallets and Node.js environments.

The Raiden dApp is a reference implementation of the Raiden Light Client SDK, which can be used with web3 wallets like Metamask (Desktop) or imToken (mobile).

INFO: The Light Client SDK and dApp are work in progress, don't work for token transfers yet and currently can only be used on the Ethereum Testnets.

Table of Contents

About The Project

The Raiden Network is an off-chain scaling solution, enabling near-instant, low-fee and scalable payments. It’s complementary to the Ethereum blockchain and works with any ERC20 compatible token.

The Raiden client code is available here and has been released for mainnet with a limited alpha release of the Raiden Network in December 2018.

The goal of the Raiden Light Client SDK is to provide an easy-to-use framework, which can be integrated by any JavaScript developer. The SDK will simplify the process of embedding and using the Raiden Network for token transfers in decentralized applications

With the SDK we want to make your life as a dApp dev easier:

  • You should be able to interact with the Raiden Network easily with your dApp.
  • We want to help you to enable your users to make token transfers using their consumer wallets like imToken or Metamask.
  • It should be possible to send tokens using low end devices, which would not be capable of running a full Raiden node.

Architecture

This is a standalone Typescript library which contains all the low level machinery to interact with the Ethereum blockchain and the Raiden Network.

Its target audience is blockchain and dApp developers looking into interacting with and performing payments through the Raiden Network from their apps. Targeting browsers and Node.js as initial platforms allows it to reach the majority of current and in-development dApps, as well as to work as a common language reference implementation for ports and re-implementations in other future languages and environments.

Look at the Raiden Light Client SDK folder of this repository for more information.

Raiden dApp

The Raiden dApp is the demo and first dApp user of the SDK. It's a single page application (SPA) built on top of Vue.js, vuex and vuetify as UI framework which uses Material Design as the design guideline.

Architecture diagram

            +-------------------+
            |                   |
            |   Raiden dApp   |
            |                   |
            |  vue/vuex/vuetify |
            |                   |
            +---------+---------+
            |                   |
            |    Raiden SDK     |
            |                   |
            +----+----+----+----+
            |         |         |      +------------+
         +--+  redux  +  epics  +------+ Matrix.org |
         |  |         |         |      +-----+------+
         |  +---------+-----+---+            |
         |                  |          +-----+------+
+--------+-------+   +------+------+   |   Raiden   |
|  localStorage  |   |  ethers.js  |   |   Network  |
+----------------+   +------+------+   +------------+
                            |
                     +------+------+
                     |  ethereum   |
                     +-------------+

Getting Started

Learn about Raiden

If you didn't use Raiden before, you can

Prerequisites

To run the code in this repository, you must have Node.js 10+ on your computer and a web3-enabled browser (e.g. Firefox with Metamask extension), as well as some ETH on the account.

SDK Installation

npm install <raiden_npm_package>

Then in your JavaScript or TypeScript project:

import { Raiden } from 'raiden';

# async factory
const raiden = await Raiden.create(web3.currentProvider, 0, localStorage);

# subscribe to channels$ observable
raiden.channels$.subscribe((channels) => console.log('# raiden channels:', channels));

# open a Raiden payment channel!
const openTxHash = await raiden.openChannel('0xtoken', '0xpartner');

# output:
# {
#   '0xtoken': {
#     '0xpartner': {
#       state: 'open',
#       totalDeposit: BigNumber(0),
#       partnerDeposit: BigNumber(0),
#       id: 123,
#       settleTimeout: 500,
#       openBlock: 5123
#     }
#   }
# }

You can find more detailed information on how to use the SDK in the Raiden Light Client SDK folder of this repository.

dApp Installation

git clone https://github.com/raiden-network/light-client.git
cd light-client/raiden-dapp

Build the Raiden SDK

First you need to build the sdk. For this you have to go to the raiden directory and run the following commands.

cd ../raiden
npm install
npm run build

Install the dApp Dependencies

Then you need to install the wallet app dependencies.

cd ../raiden-dapp
npm install

This will also create a symbolic link in raiden-dapp/node_modules/raiden to raiden.

Running the dApp locally

To start the development server you have to run the following command.

npm run serve

After the development server starts you have to navigate to http://localhost:8080, in order to use the Raiden dApp. It requires either MetaMask to be installed on your browser or some other web3 provider (e.g. Wallet apps with dApp support).

Roadmap and Timeline

We are working in 2 weekly iterations. Priorities are managed within the Product Backlog. We are currently working towards milestone 0, where the SDK and dApp are able to send payments, but will not be able to receive payments.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Also have a look at the Raiden Light Client Development Guide for more info.

License

Distributed under the MIT License.

Contact

Dev Chat: Gitter

Twitter: @raiden_network

Website: Raiden Network

Mail: [email protected]

Project Link: https://github.com/raiden-network/light-client

light-client's People

Contributors

andrevmatos avatar christianbrb avatar franzihei avatar kelsos avatar marcosmartinez7 avatar

Watchers

 avatar  avatar

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.