Skip to content

Commit bb15261

Browse files
committed
Merge branch 'develop' into poc-9
Conflicts: cmd/utils/cmd.go
2 parents cfe3af0 + 253eb77 commit bb15261

9 files changed

Lines changed: 49 additions & 285 deletions

File tree

‎README.md‎

Lines changed: 40 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,25 @@ Ethereum (CLI):
2424

2525
`go get github.com/ethereum/go-ethereum/cmd/ethereum`
2626

27-
For further, detailed, build instruction please see the [Wiki](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go))
27+
As of POC-8, go-ethereum uses [Godep](https://github.com/tools/godep) to manage dependencies. Assuming you have [your environment all set up](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go)), switch to the go-ethereum repository root folder, and build/install the executable you need:
28+
29+
Mist (GUI):
30+
31+
```
32+
godep go build -v ./cmd/mist
33+
```
34+
35+
Ethereum (CLI):
36+
37+
```
38+
godep go build -v ./cmd/ethereum
39+
```
40+
41+
Instead of `build`, you can use `install` which will also install the resulting binary.
42+
43+
For prerequisites and detailed build instructions please see the [Wiki](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go))
44+
45+
If you intend to develop on go-ethereum, check the [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)
2846

2947
Automated (dev) builds
3048
======================
@@ -34,97 +52,47 @@ Automated (dev) builds
3452
* [Windows] Coming soon™
3553
* [Linux] Coming soon™
3654

37-
Binaries
38-
========
55+
Executables
56+
===========
3957

40-
Go Ethereum comes with several binaries found in
41-
[cmd](https://github.com/ethereum/go-ethereum/tree/master/cmd):
58+
Go Ethereum comes with several wrappers/executables found in
59+
[the `cmd` directory](https://github.com/ethereum/go-ethereum/tree/develop/cmd):
4260

43-
* `mist` Official Ethereum Browser
44-
* `ethereum` Ethereum CLI
45-
* `ethtest` test tool which runs with the [tests](https://github.com/ethereum/testes) suit:
61+
* `mist` Official Ethereum Browser (ethereum GUI client)
62+
* `ethereum` Ethereum CLI (ethereum command line interface client)
63+
* `bootnode` runs a bootstrap node for the Discovery Protocol
64+
* `ethtest` test tool which runs with the [tests](https://github.com/ethereum/testes) suite:
4665
`cat file | ethtest`.
4766
* `evm` is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas
4867
10000 -price 0 -dump`. See `-h` for a detailed description.
49-
* `rlpdump` converts a rlp stream to `interface{}`.
50-
* `peerserver` simple P2P (noi-ethereum) peer server.
5168
* `disasm` disassembles EVM code: `echo "6001" | disasm`
69+
* `rlpdump` converts a rlp stream to `interface{}`.
5270

53-
General command line options
71+
Command line options
5472
============================
5573

74+
Both `mist` and `ethereum` can be configured via command line options, environment variables and config files.
75+
76+
To get the options available:
77+
5678
```
57-
== Shared between ethereum and Mist ==
58-
59-
= Settings
60-
-id Set the custom identifier of the client (shows up on other clients)
61-
-port Port on which the server will accept incomming connections
62-
-upnp Enable UPnP
63-
-maxpeer Desired amount of peers
64-
-rpc Start JSON RPC
65-
-dir Data directory used to store configs and databases
66-
67-
= Utility
68-
-h This
69-
-import Import a private key
70-
-genaddr Generates a new address and private key (destructive action)
71-
-dump Dump a specific state of a block to stdout given the -number or -hash
72-
-difftool Supress all output and prints VM output to stdout
73-
-diff vm=only vm output, all=all output including state storage
74-
75-
Ethereum only
76-
ethereum [options] [filename]
77-
-js Start the JavaScript REPL
78-
filename Load the given file and interpret as JavaScript
79-
-m Start mining blocks
80-
81-
== Mist only ==
82-
83-
-asset_path absolute path to GUI assets directory
79+
ethereum -help
8480
```
8581

82+
For further details on options, see the [wiki](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options)
83+
8684
Contribution
8785
============
8886

89-
If you'd like to contribute to Ethereum please fork, fix, commit and
87+
If you'd like to contribute to go-ethereum please fork, fix, commit and
9088
send a pull request. Commits who do not comply with the coding standards
9189
are ignored (use gofmt!). If you send pull requests make absolute sure that you
9290
commit on the `develop` branch and that you do not merge to master.
9391
Commits that are directly based on master are simply ignored.
9492

95-
For dependency management, we use [godep](https://github.com/tools/godep). After installing with `go get github.com/tools/godep`, run `godep restore` to ensure that changes to other repositories do not break the build. To update a dependency version (for example, to include a new upstream fix), run `go get -u <foo/bar>` then `godep update <foo/...>`. To track a new dependency, add it to the project as normal than run `godep save ./...`. Changes to the Godeps folder should be manually verified then commited.
96-
97-
To make life easier try [git flow](http://nvie.com/posts/a-successful-git-branching-model/) it sets
98-
this all up and streamlines your work flow.
99-
100-
Coding standards
101-
================
102-
103-
Sources should be formatted according to the [Go Formatting
104-
Style](http://golang.org/doc/effective_go.html#formatting).
105-
106-
Unless structs fields are supposed to be directly accesible, provide
107-
Getters and hide the fields through Go's exporting facility.
108-
109-
When you comment put meaningful comments. Describe in detail what you
110-
want to achieve.
111-
112-
*wrong*
113-
114-
```go
115-
// Check if the value at x is greater than y
116-
if x > y {
117-
// It's greater!
118-
}
119-
```
120-
121-
Everyone reading the source probably know what you wanted to achieve
122-
with above code. Those are **not** meaningful comments.
93+
For dependency management, we use [godep](https://github.com/tools/godep). After installing with `go get github.com/tools/godep`, run `godep restore` to ensure that changes to other repositories do not break the build. To update a dependency version (for example, to include a new upstream fix), run `go get -u <foo/bar>` then `godep update <foo/...>`. To track a new dependency, add it to the project as normal than run `godep save ./...`. Changes to the [Godeps folder](https://github.com/ethereum/go-ethereum/tree/develop/Godeps): should be manually verified then commited.
12394

124-
While the project isn't 100% tested I want you to write tests non the
125-
less. I haven't got time to evaluate everyone's code in detail so I
126-
expect you to write tests for me so I don't have to test your code
127-
manually. (If you want to contribute by just writing tests that's fine
128-
too!)
95+
To make life easier try [git flow](http://nvie.com/posts/a-successful-git-branching-model/) it sets this all up and streamlines your work flow.
12996

97+
See [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)
13098

‎cmd/ethereum/flags.go‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ var (
4646
StartWebSockets bool
4747
RpcListenAddress string
4848
RpcPort int
49-
WsPort int
5049
OutboundPort string
5150
ShowGenesis bool
5251
AddPeer string
@@ -94,13 +93,11 @@ func Init() {
9493
flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug")
9594
flag.StringVar(&Identifier, "id", "", "Custom client identifier")
9695
flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use")
97-
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)")
96+
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file")
9897

9998
flag.StringVar(&RpcListenAddress, "rpcaddr", "127.0.0.1", "address for json-rpc server to listen on")
10099
flag.IntVar(&RpcPort, "rpcport", 8545, "port to start json-rpc server on")
101-
flag.IntVar(&WsPort, "wsport", 40404, "port to start websocket rpc server on")
102100
flag.BoolVar(&StartRpc, "rpc", false, "start rpc server")
103-
flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server")
104101
flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)")
105102
flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key")
106103
flag.StringVar(&SecretFile, "import", "", "imports the file given (hex or mnemonic formats)")
@@ -109,8 +106,8 @@ func Init() {
109106
flag.StringVar(&Datadir, "datadir", ethutil.DefaultDataDir(), "specifies the datadir to use")
110107
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
111108
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
112-
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)")
113-
flag.StringVar(&LogFormat, "logformat", "std", "logformat: std,raw)")
109+
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5 (= silent,error,warn,info,debug,debug detail)")
110+
flag.StringVar(&LogFormat, "logformat", "std", "logformat: std,raw")
114111
flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0")
115112
flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false")
116113
flag.BoolVar(&ShowGenesis, "genesis", false, "Dump the genesis block")
@@ -120,7 +117,7 @@ func Init() {
120117
flag.StringVar(&DumpHash, "hash", "", "specify arg in hex")
121118
flag.IntVar(&DumpNumber, "number", -1, "specify arg in number")
122119

123-
flag.BoolVar(&StartMining, "mine", false, "start dagger mining")
120+
flag.BoolVar(&StartMining, "mine", false, "start mining")
124121
flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console")
125122
flag.BoolVar(&PrintVersion, "version", false, "prints version number")
126123
flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads")
@@ -137,6 +134,7 @@ func Init() {
137134

138135
flag.StringVar(&BootNodes, "bootnodes", "", "space-separated node URLs for discovery bootstrap")
139136
flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers")
137+
flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads")
140138

141139
flag.Parse()
142140

‎cmd/ethereum/main.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ func main() {
128128
utils.StartRpc(ethereum, RpcListenAddress, RpcPort)
129129
}
130130

131-
if StartWebSockets {
132-
utils.StartWebSockets(ethereum, WsPort)
133-
}
134-
135131
utils.StartEthereum(ethereum)
136132

137133
fmt.Printf("Welcome to the FRONTIER\n")

‎cmd/mist/flags.go‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ var (
4141
KeyRing string
4242
KeyStore string
4343
StartRpc bool
44-
StartWebSockets bool
4544
RpcListenAddress string
4645
RpcPort int
47-
WsPort int
4846
OutboundPort string
4947
ShowGenesis bool
5048
AddPeer string
@@ -79,12 +77,10 @@ func Init() {
7977
flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug")
8078
flag.StringVar(&Identifier, "id", "", "Custom client identifier")
8179
flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use")
82-
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)")
80+
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file")
8381
flag.StringVar(&RpcListenAddress, "rpcaddr", "127.0.0.1", "address for json-rpc server to listen on")
8482
flag.IntVar(&RpcPort, "rpcport", 8545, "port to start json-rpc server on")
85-
flag.IntVar(&WsPort, "wsport", 40404, "port to start websocket rpc server on")
8683
flag.BoolVar(&StartRpc, "rpc", true, "start rpc server")
87-
flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server")
8884
flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)")
8985
flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key")
9086
flag.StringVar(&SecretFile, "import", "", "imports the file given (hex or mnemonic formats)")
@@ -93,7 +89,7 @@ func Init() {
9389
flag.StringVar(&Datadir, "datadir", ethutil.DefaultDataDir(), "specifies the datadir to use")
9490
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
9591
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
96-
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)")
92+
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5 (= silent,error,warn,info,debug,debug detail)")
9793

9894
flag.StringVar(&AssetPath, "asset_path", ethutil.DefaultAssetPath(), "absolute path to GUI assets directory")
9995

‎cmd/mist/main.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ func run() error {
7676
utils.StartRpc(ethereum, RpcListenAddress, RpcPort)
7777
}
7878

79-
if StartWebSockets {
80-
utils.StartWebSockets(ethereum, WsPort)
81-
}
82-
8379
gui := NewWindow(ethereum, config, KeyRing, LogLevel)
8480

8581
utils.RegisterInterrupt(func(os.Signal) {

‎cmd/utils/cmd.go‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"github.com/ethereum/go-ethereum/logger"
3535
"github.com/ethereum/go-ethereum/rlp"
3636
rpchttp "github.com/ethereum/go-ethereum/rpc/http"
37-
rpcws "github.com/ethereum/go-ethereum/rpc/ws"
3837
"github.com/ethereum/go-ethereum/state"
3938
"github.com/ethereum/go-ethereum/xeth"
4039
)
@@ -169,18 +168,6 @@ func StartRpc(ethereum *eth.Ethereum, RpcListenAddress string, RpcPort int) {
169168
}
170169
}
171170

172-
func StartWebSockets(eth *eth.Ethereum, wsPort int) {
173-
clilogger.Infoln("Starting WebSockets")
174-
175-
var err error
176-
eth.WsServer, err = rpcws.NewWebSocketServer(xeth.New(eth), wsPort)
177-
if err != nil {
178-
clilogger.Errorf("Could not start RPC interface (port %v): %v", wsPort, err)
179-
} else {
180-
go eth.WsServer.Start()
181-
}
182-
}
183-
184171
func FormatTransactionData(data string) []byte {
185172
d := ethutil.StringToByteFunc(data, func(s string) (ret []byte) {
186173
slice := regexp.MustCompile("\\n|\\s").Split(s, 1000000000)

‎eth/backend.go‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ type Ethereum struct {
129129
miner *miner.Miner
130130

131131
RpcServer rpc.RpcServer
132-
WsServer rpc.RpcServer
133132
keyManager *crypto.KeyManager
134133

135134
logger logger.LogSystem
@@ -149,7 +148,7 @@ func New(config *Config) (*Ethereum, error) {
149148
d, _ := db.Get([]byte("ProtocolVersion"))
150149
protov := ethutil.NewValue(d).Uint()
151150
if protov != ProtocolVersion && protov != 0 {
152-
path := path.Join(config.DataDir, "database")
151+
path := path.Join(config.DataDir, "blockchain")
153152
return nil, fmt.Errorf("Database version mismatch. Protocol(%d / %d). `rm -rf %s`", protov, ProtocolVersion, path)
154153
}
155154

@@ -289,9 +288,7 @@ func (s *Ethereum) Stop() {
289288
if s.RpcServer != nil {
290289
s.RpcServer.Stop()
291290
}
292-
if s.WsServer != nil {
293-
s.WsServer.Stop()
294-
}
291+
295292
s.txPool.Stop()
296293
s.eventMux.Stop()
297294
s.blockPool.Stop()

‎install.sh‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)