aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-01 05:26:16 +0800
committerobscuren <geffobscura@gmail.com>2014-10-01 05:26:16 +0800
commit6db40ecb22c28a777f4ab1cd4de5a12e41ac669d (patch)
treed444855839bf2e498dc9c4724928c7eb07cf6c22 /ethereum
parent41ae6f298e079a073282de001e6b1eaa51472638 (diff)
downloadgo-tangerine-6db40ecb22c28a777f4ab1cd4de5a12e41ac669d.tar.gz
go-tangerine-6db40ecb22c28a777f4ab1cd4de5a12e41ac669d.tar.zst
go-tangerine-6db40ecb22c28a777f4ab1cd4de5a12e41ac669d.zip
WebSocket interface
Web sockets handlers fully implemented. Filter handlers have yet to be implemented.
Diffstat (limited to 'ethereum')
-rw-r--r--ethereum/flags.go62
-rw-r--r--ethereum/main.go4
2 files changed, 38 insertions, 28 deletions
diff --git a/ethereum/flags.go b/ethereum/flags.go
index c488e6314..58220f4e6 100644
--- a/ethereum/flags.go
+++ b/ethereum/flags.go
@@ -10,36 +10,41 @@ import (
"github.com/ethereum/eth-go/ethlog"
)
-var Identifier string
-var KeyRing string
-var DiffTool bool
-var DiffType string
-var KeyStore string
-var StartRpc bool
-var RpcPort int
-var UseUPnP bool
-var OutboundPort string
-var ShowGenesis bool
-var AddPeer string
-var MaxPeer int
-var GenAddr bool
-var UseSeed bool
-var SecretFile string
-var ExportDir string
-var NonInteractive bool
-var Datadir string
-var LogFile string
-var ConfigFile string
-var DebugFile string
-var LogLevel int
-var Dump bool
-var DumpHash string
-var DumpNumber int
+var (
+ Identifier string
+ KeyRing string
+ DiffTool bool
+ DiffType string
+ KeyStore string
+ StartRpc bool
+ StartWebSockets bool
+ RpcPort int
+ UseUPnP bool
+ OutboundPort string
+ ShowGenesis bool
+ AddPeer string
+ MaxPeer int
+ GenAddr bool
+ UseSeed bool
+ SecretFile string
+ ExportDir string
+ NonInteractive bool
+ Datadir string
+ LogFile string
+ ConfigFile string
+ DebugFile string
+ LogLevel int
+ Dump bool
+ DumpHash string
+ DumpNumber int
+)
// flags specific to cli client
-var StartMining bool
-var StartJsConsole bool
-var InputFile string
+var (
+ StartMining bool
+ StartJsConsole bool
+ InputFile string
+)
func defaultDataDir() string {
usr, _ := user.Current()
@@ -62,6 +67,7 @@ func Init() {
flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers")
flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on")
flag.BoolVar(&StartRpc, "rpc", false, "start rpc server")
+ flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server")
flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)")
flag.BoolVar(&UseSeed, "seed", true, "seed peers")
flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key")
diff --git a/ethereum/main.go b/ethereum/main.go
index 6521188ff..0f0df20bb 100644
--- a/ethereum/main.go
+++ b/ethereum/main.go
@@ -103,6 +103,10 @@ func main() {
utils.StartRpc(ethereum, RpcPort)
}
+ if StartWebSockets {
+ utils.StartWebSockets(ethereum)
+ }
+
utils.StartEthereum(ethereum, UseSeed)
// this blocks the thread