Skip to content

huamou/SmartRaiden

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

173 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartRaiden

SmartRaiden is a standard compliant implementation of the Raiden Network protocol in Golang. In this project, optimized raiden network will be available on multiple platforms, and decentralized micropayments on smart mobile devices can be realized.SmartRaiden currently can works on Windows, Linux ,Android, iOS etc. In order to better fit for the mobile network, SmartRaiden also has some special functions, including P2P communication under ICE framework, crash recovery and channel charging function.

Project Status

This project is still very much a work in progress. It can be used for testing, but it should not be used for real funds. We are doing our best to identify and fix problems, and implement missing features. Any help testing the implementation, reporting bugs, or helping with outstanding issues is very welcome.

Build

  1. install pjsip
wget http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2
tar xjf pjproject-2.7.2.tar.bz2
cd pjproject-2.7.2
./configure --disable-sound --disable-video --disable-ssl
make dep && make && make install
  1. build smartraiden
  go get github.com/SmartMeshFoundation/SmartRaiden/cmd/smartraiden

Listing API

SmartRaiden API has the main functions of Raiden Network API. Detailed function description please refer to Getting started with the Raiden API and Raiden’s API Documentation in the official documentation of Raiden Network. The primary API list and description are as follows:

  • QueryingNodeAddress         Query a node address
  • QueryingNodeAllChannels      Query all channels of a node
  • QueryingNodeSpecificChannel     Query a specified channel for a node
  • QueryingRegisteredTokens      Query system registration Token
  • QueryingAllPartnersForOneTokens  Query the Partner address in the channel of special Token
  • RegisteringOneToken        Registration of new Token to Raiden Network
  • TokenSwaps            Exchange the token
  • OpenChannel            Establish a channel
  • CloseChannel            Close the specified channel for the node
  • SettleChannel            Settle the specified channel for the node
  • Deposit2Channel          Deposit to the specified channel
  • Connecting2TokenNetwork      Connect to a TokenNetwork
  • LeavingTokenNetwork        Leave the TokenNetwork
  • QueryingConnectionsDetails     Query the details of the Token network connection
  • QueryingGeneralNetworkEvents   Query network events
  • QueryingTokenNetworkEvents    Query Token network events
  • QueryingChannelEvents       Query channel event

Raiden Contract

These are the currently deployed raiden contract addresses for the ethereum testnet:

Usage

 smartraiden [global options] command [command options] [arguments...]
VERSION: 0.1
 COMMANDS:
  help, h                                                   Shows a list of commands or help for one command
 GLOBAL OPTIONS:
 --address value                                            The ethereum address you would like raiden to use and for
                                                            which a keystore file exists in your local system.
 --keystore-path                                           "/Users/your name/Library/Ethereum/keystore"  If you have a 
                                                            non-standard path for the ethereum keystore directory 
                                                            provide it using this argument.
--eth-rpc-endpoint value                                   "host:port" address of ethereum JSON-RPC server.\n'
                                                           'Also accepts a protocol prefix (ws:// or ipc channel)
                                                            with optional port', (default: 
                                                            "/Users/your name/Library/Ethereum/geth.ipc")
--registry-contract-address value                           hex encoded address of the registry contract. (default:
                                                            "0x1BB1437d4e387Be1E8C04762536217B3240f2323")
--discovery-contract-address value                          hex encoded address of the discovery contract. (default: 
                                                            "0x95A4e1251B87DCEf6B0cD18D3356CdA8cFB8f6CC")
--listen-address value                                     "host:port" for the raiden service to listen on. (default:
                                                            "0.0.0.0:40001")
--rpccorsdomain value                                        Comma separated list of domains to accept cross origin
                                                             requests. (localhost enabled by default) (default: 
                                                            "http://localhost:* /*")
--logging value                                              ethereum.slogging config-string{trace,debug,info,warn,
                                                             error,critical  (default: "trace")
--logfile value                                              file path for logging to file
--max-unresponsive-time value                                Max time in seconds for which an address can send no
                                                             packets and still be considered healthy. (default: 120)
--send-ping-time value                                       Time in seconds after which if we have received no 
                                                             message from a node we have a connection with, we are 
                                                             going to send a PING message (default: 60)
--rpc                                                        Start with or without the RPC server. Default is to
                                                              start the RPC server
--api-address value                                          host:port" for the RPC server to listen on. (default: 
                                                             "0.0.0.0:5001")
--datadir ~/.smartraiden                                     Directory for storing raiden data.
--password-file value                                         Text file containing password for provided account
--nat value                                                   [auto|upnp|stun|ice|none] Manually specify method to use 
                                                              for determining public IP / NAT traversal.
                                                             "auto" - Try UPnP, then STUN, fallback to none. "upnp"
                                                             - Try UPnP,fallback to none. "stun" - Try STUN, fallback 
                                                                to none
                                                              "none" - Use the local interface
                                                              address (this will likely cause connectivity issues).
                                                              "ice"- Use ice framework for nat punching
                                                              [default: ice] (default: "ice")
--debug                                                       enable debug feature
--conditionquit value                                        quit at specified point for test
--turn-server value                                          turn server for ice 
--turn-user value                                            turn username for turn server  
--turn-pass value                                            turn password for turn server 
--nonetwork                                                  disable network, for example ,when we 
                                                             want to settle all channels
--fee                                                        enable mediation fee
--help, -h                                                   how help
--version,-v                                                 print the version
                                                                                                                                                                                                                                     

Requirements

geth >=1.7.3

About

SmartRaiden for mobile devices and other devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.4%
  • TypeScript 3.9%
  • HTML 1.1%
  • CSS 0.2%
  • Makefile 0.2%
  • JavaScript 0.1%
  • Shell 0.1%