GithubHelp home page GithubHelp logo

isabella232 / ae-channel-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aeternity/ae-channel-service

0.0 0.0 0.0 1.85 MB

License: ISC License

Elixir 87.36% Makefile 0.54% CSS 4.18% JavaScript 5.38% HTML 2.34% Nix 0.19%

ae-channel-service's Introduction

ae-channel-service

This is a reference client implementaion using the aeternity state channels. State channels allows secure transaction at very low fees. Extensive documentation on aeternity state channels can be found here.

The project consists of the following applications

  • ae_socket_connector
    implements the FSM protocol and manages the websocket to the FSM (node connection). This application will automatically persist channel_id and related data allowing reestablish.

Default location is ./data. remove folder to start from a clean slate. Location is configurabe as shown i example here.

  • ae_channel_interface
    an interactive web interface which visualizes channel messages with the intention to ease onboarding. Read more here.
  • ae_backend_service
    sample backend service which can orchestrate a number of channels. Current implementation showcases a coin toss backend service. Read more on ae_backend_service here.

ae_socket_connector benefits by being able to call erlang functions used by the aeternity node.

Build

you need to have elixir installed locally. Instructions here.

clone this repository, then;

cd ae-channel-service/
make clean deps # requires jq to be installed

to get the user interface look sane you could also:
cd apps/ae_channel_interface/assets && npm install && cd -

Run interactive test client (local)

NODE_REF=master NODE_CONFIGURATION=./test/aeternity_node_normal_test_config.yml docker-compose up
AE_NODE_NETWORK_ID="ae_channel_service_test" iex -S mix phx.server

Point your browser to http://localhost:4000/. Each tab can represent a peer. Initiator or responder. "Backend helper" starts a channel governed by the ae_backend_service and does not affect the tab.

Run sample interactive web client (testnet)

AE_NODE_URL="wss://testnet.aeternity.io:443/channel" AE_NODE_NETWORK_ID="ae_uat" iex -S mix phx.server

More detailed when needed

TOSS_MODE="random|tails|heads" GAME_MODE="fair|malicious" FORCE_PROGRESS_HEIGHT="15|any_positive_integer" AE_NODE_URL="wss://testnet.aeternity.io:443/channel" AE_NODE_NETWORK_ID="ae_uat" iex -S mix phx.server

defaults are listed as first available option

Point your browser to http://localhost:4000/. Each tab can represent a peer. Initiator or responder. "Backend helper" starts a channel governed by the ae_backend_service and does not affect the tab.

testnet is currently load balanced, you need to be persistent (try again) to get your channel up and running. Current recomended worksround is to host your own node.

Get going with the interactive web client

Get started here

Run test scenarios

Start the sample scenarios at your prompt by doing

mix test

or for testnet

AE_NODE_URL="wss://testnet.aeternity.io:443/channel" AE_NODE_NETWORK_ID="ae_uat" mix test

Scenarios executed can be found here

tests are designed to execute on a quick mining node, thus the test will fail when directed to testnet. This however is kept as reference.

Advanced configuration

Local node configuration

account used are found in apps/ae_socket_connector/test/accounts_test.exs

Testnet configuration

Create accounts here.

add valid accounts in apps/ae_socket_connector/test/accounts_test.exs.

Your account needs to exist on chain. To make it happen, just top up your accounts here and then you should be able to follow your on chain transactions here.

Node optional configuration

If you host your own node make sure to bump counter by adding the following to your aeternity.yaml.

regulators:
    sc_ws_handlers:
        counter: 100
        max_size: 5

Defaults can be found in your node config here.

more documentation on node configuration can be found here.

Related references

  • Refence to node api can be found here.

ae-channel-service's People

Contributors

aleksandarf avatar aleksandarfilipov avatar artur64 avatar tolbrino avatar orzen avatar dincho avatar sennui 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.