drewc / state-channels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

State Channels Library

(C) MUKN 2022, 2023

This fork is for demonstrations and pull requests for the master repository. It attempts to be in a working state and may be self contained regarding upstream compilers such as gerbil.

Installation & Usage

Right now, <2023-03-22 Wed>, we need to build our own Gerbil. That takes 15+ minutes on my Thinkpad Yoga so expect a wee bit of a wait.

Build

# Choose whatever directory you want to run from
cd /tmp/ ; rm -rf state-channels

# Clone it! Shallow is fine
git clone --depth=1 https://github.com/drewc/state-channels.git

# This makes a gerbil to compile with that accepts JS
cd state-channels ; ./bin/make

Run the executables

There are 3 different forms of what was built.

  1. ./bin/exe :: A binary executable that runs the mp1_1 test with fake sockets.
    ./bin/exe | (head -n6 ; tail -n3)
        

    =>

    ---
    PID   NAME   USER    PEER  SELF
    0h_   HOST1  system  (_)   _
    rl:
    transfer PR1=>GR1 (dupont 5) (�[31;49mS�[39;49m smith durand)�[31;49m�[39;49m
    out:
        
  2. ./js/bin/exe :: The same code as the binary compiled to JavaScript with a Node.js shebang.
    head -n1 ./js/bin/exe
    ./js/bin/exe | (head -n6 ; tail -n3)
        

=>

#!/usr/bin/env node
---
PID   NAME   USER    PEER  SELF
0h_   HOST1  system  (_)   _
rl:
transfer PR1=>GR1 (dupont 5) (�[31;49mS�[39;49m smith durand)�[31;49m�[39;49m
out:
  1. ./html/exe.html :: An HTML version of the JS script. Open that file in a browser and look at the console.
    head -n3 ./html/exe.html
    head -n7 ./html/exe.html| tail -n2
        

    =>

    <!doctype html>
    <head><meta charset="utf-8"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><script>
    // File generated by Gambit v4.9.4
    _z = (s) => {
    var leng = s.length;
        

Github

git@github.com:drewc/state-channels.git

Emacs

(defun state-channels/create-new-log ()
  (interactive)
  (let ((org-static-blog-drafts-directory "~/me/MuKn/src/state-channels/journal"))
    (org-static-blog-create-new-draft)))

About

License:Apache License 2.0


Languages

Language:HTML 49.1%Language:Scheme 46.4%Language:TypeScript 3.4%Language:JavaScript 0.5%Language:TeX 0.2%Language:Common Lisp 0.1%Language:Emacs Lisp 0.1%Language:Shell 0.1%Language:C 0.1%Language:Makefile 0.0%Language:M4 0.0%Language:Dockerfile 0.0%Language:CSS 0.0%Language:Stylus 0.0%