Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

HaySayCheese/EthSC_GEO_ETHBerlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Crosschain transfers through general L2

Logo


What is this all about?

Imagine the general-purpose Layer-2 network that provides ability to send tokens / assets / IOU / binary data / etc to (almost) anyone participant of the network.
How should it be developed? We know it.


What must be done in general?

We already have a general purpose state channels network - GEO Protocol. All we need are middleware "connectors" for it to various environments. The role of the connector - atomic mirroring of the state from the network channels to the related environment.


What was done during the hackaton?

This thing Logo


The goal of this dirty hacked prototype is to provide PoC of L2 state channels, that are covered by different blockchain ecosystems (common Layer 2 for various blockchain ecosystems, (BTC/ETH/etc)).

How does it works?

arch

How can I check it?

Please, join:

ip: 104.248.47.57
ssh-port: 2277
user: ethBerlin
pass: berlin2018
ssh ethBerlin@104.248.47.57 -p 2277
Instructions how to prepare the environment
  1. Build and deploy the contract to the net.
  2. Create 2 nodes. First node created would be "Alice", and second one would be "Bob".
curl -X POST private.localhost:2000/api/v1/nodes
curl -X POST private.localhost:2000/api/v1/nodes

This Requests would return you UUID of the nodes created.
You should remember which UUID belongs to which node.
In case if nodes are present - you may use already present pair of nodes.

  1. For Bob in /home/nodes_handler/io/<bob_uuid>/ create file middleware.port with 5000 in it.
  2. For Alice in /home/nodes_handler/io/<alice_uuid>/ create file middleware.port with 5001 in it.
  3. Stop both Alice and Bob middlewares:
killall -r "GeoEth*"
  1. Change corresponding contract->address, account address and PK in middlewares configurations (if needed) Alice:
nano middleware/ubuntu-x64-5001/publish/appsettings.json

Bob:

nano middleware/ubuntu-x64-5000/publish/appsettings.json
  1. Start corresponding middlewares:
~/middleware/ubuntu-x64-5000/publish$ nohup > /dev/null ./GeoEthereumMiddleware &
~/middleware/ubuntu-x64-5001/publish$ nohup > /dev/null ./GeoEthereumMiddleware &
  1. Update (if needed) ethereum address to the Alice and Bob config (conf.json) in /home/nodes_handler/io/<node_uuid>/. Example of result config:
{
  "gateway": [1],
  "network": {
    "interface": "0.0.0.0",
    "port": 8090
  },

  "uuid2address": {
    "host": "0.0.0.0",
    "port": 1500
  },

  "node": {
    "uuid": "13e5cf8c-5834-4e52-b65b-f9281dd1ff90",
    "ethereum": "234wrew534tgerger4eegrthrt"
  }
}
  1. Start nodes handler:
sudo systemctl start handler.service
  1. Create TL from Bob to Alice
curl -X PUT private.localhost:2000/api/v1/nodes/{bob_uuid}/contractors/{alice_uuid}/trust-lines/1/?amount=500000&state-channel=1
  1. [optional] Create TL from Alice to Bob
curl -X PUT private.localhost:2000/api/v1/nodes/{alice_uuid}/contractors/{bob_uuid}/trust-lines/1/?amount=400000
  1. Send several payments in boths directions:
curl -X PUT private.localhost:2000/api/v1/nodes/{bob_uuid}/contractors/{alice_uuid}/transactions/1/?amount=500
...
curl -X PUT private.localhost:2000/api/v1/nodes/{alice_uuid}/contractors/{bob_uuid}/transactions/1/?amount=500
  1. Close channel via:
curl -X POST private.localhost:2000/api/v1/nodes/{alice_uuid}/contractors/{bob_uuid}/trust-lines-close-channel/1/

On the Bob's side channel would be closed utomatically.

  1. Check nodes eth. wallets.

  2. [Optional] nodes logs are accessible in /home/nodes_handler/io/<node_uuid>/operations.log.

Licence - MIT

Copyright 2018 ETH Berlin Hackaton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Hacked with <3 to

eth

About

Ethereum implementation of SC connector for GEO Protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published