Merge pull request #411 from ethersphere/readme

[WIP] Update Readme
This commit is contained in:
Jeffrey Wilcke 2015-03-03 20:17:51 +01:00
commit 253eb778d1
5 changed files with 48 additions and 132 deletions

112
README.md
View File

@ -24,7 +24,25 @@ Ethereum (CLI):
`go get github.com/ethereum/go-ethereum/cmd/ethereum` `go get github.com/ethereum/go-ethereum/cmd/ethereum`
For further, detailed, build instruction please see the [Wiki](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go)) 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:
Mist (GUI):
```
godep go build -v ./cmd/mist
```
Ethereum (CLI):
```
godep go build -v ./cmd/ethereum
```
Instead of `build`, you can use `install` which will also install the resulting binary.
For prerequisites and detailed build instructions please see the [Wiki](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go))
If you intend to develop on go-ethereum, check the [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)
Automated (dev) builds Automated (dev) builds
====================== ======================
@ -34,97 +52,47 @@ Automated (dev) builds
* [Windows] Coming soon™ * [Windows] Coming soon™
* [Linux] Coming soon™ * [Linux] Coming soon™
Binaries Executables
======== ===========
Go Ethereum comes with several binaries found in Go Ethereum comes with several wrappers/executables found in
[cmd](https://github.com/ethereum/go-ethereum/tree/master/cmd): [the `cmd` directory](https://github.com/ethereum/go-ethereum/tree/develop/cmd):
* `mist` Official Ethereum Browser * `mist` Official Ethereum Browser (ethereum GUI client)
* `ethereum` Ethereum CLI * `ethereum` Ethereum CLI (ethereum command line interface client)
* `ethtest` test tool which runs with the [tests](https://github.com/ethereum/testes) suit: * `bootnode` runs a bootstrap node for the Discovery Protocol
* `ethtest` test tool which runs with the [tests](https://github.com/ethereum/testes) suite:
`cat file | ethtest`. `cat file | ethtest`.
* `evm` is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas * `evm` is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas
10000 -price 0 -dump`. See `-h` for a detailed description. 10000 -price 0 -dump`. See `-h` for a detailed description.
* `rlpdump` converts a rlp stream to `interface{}`.
* `peerserver` simple P2P (noi-ethereum) peer server.
* `disasm` disassembles EVM code: `echo "6001" | disasm` * `disasm` disassembles EVM code: `echo "6001" | disasm`
* `rlpdump` converts a rlp stream to `interface{}`.
General command line options Command line options
============================ ============================
Both `mist` and `ethereum` can be configured via command line options, environment variables and config files.
To get the options available:
``` ```
== Shared between ethereum and Mist == ethereum -help
= Settings
-id Set the custom identifier of the client (shows up on other clients)
-port Port on which the server will accept incomming connections
-upnp Enable UPnP
-maxpeer Desired amount of peers
-rpc Start JSON RPC
-dir Data directory used to store configs and databases
= Utility
-h This
-import Import a private key
-genaddr Generates a new address and private key (destructive action)
-dump Dump a specific state of a block to stdout given the -number or -hash
-difftool Supress all output and prints VM output to stdout
-diff vm=only vm output, all=all output including state storage
Ethereum only
ethereum [options] [filename]
-js Start the JavaScript REPL
filename Load the given file and interpret as JavaScript
-m Start mining blocks
== Mist only ==
-asset_path absolute path to GUI assets directory
``` ```
For further details on options, see the [wiki](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options)
Contribution Contribution
============ ============
If you'd like to contribute to Ethereum please fork, fix, commit and If you'd like to contribute to go-ethereum please fork, fix, commit and
send a pull request. Commits who do not comply with the coding standards send a pull request. Commits who do not comply with the coding standards
are ignored (use gofmt!). If you send pull requests make absolute sure that you are ignored (use gofmt!). If you send pull requests make absolute sure that you
commit on the `develop` branch and that you do not merge to master. commit on the `develop` branch and that you do not merge to master.
Commits that are directly based on master are simply ignored. Commits that are directly based on master are simply ignored.
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. 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.
To make life easier try [git flow](http://nvie.com/posts/a-successful-git-branching-model/) it sets 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.
this all up and streamlines your work flow.
Coding standards
================
Sources should be formatted according to the [Go Formatting
Style](http://golang.org/doc/effective_go.html#formatting).
Unless structs fields are supposed to be directly accesible, provide
Getters and hide the fields through Go's exporting facility.
When you comment put meaningful comments. Describe in detail what you
want to achieve.
*wrong*
```go
// Check if the value at x is greater than y
if x > y {
// It's greater!
}
```
Everyone reading the source probably know what you wanted to achieve
with above code. Those are **not** meaningful comments.
While the project isn't 100% tested I want you to write tests non the
less. I haven't got time to evaluate everyone's code in detail so I
expect you to write tests for me so I don't have to test your code
manually. (If you want to contribute by just writing tests that's fine
too!)
See [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)

View File

@ -93,7 +93,7 @@ func Init() {
flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug") flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug")
flag.StringVar(&Identifier, "id", "", "Custom client identifier") flag.StringVar(&Identifier, "id", "", "Custom client identifier")
flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use") flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use")
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)") flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file")
flag.StringVar(&RpcListenAddress, "rpcaddr", "127.0.0.1", "address for json-rpc server to listen on") flag.StringVar(&RpcListenAddress, "rpcaddr", "127.0.0.1", "address for json-rpc server to listen on")
flag.IntVar(&RpcPort, "rpcport", 8545, "port to start json-rpc server on") flag.IntVar(&RpcPort, "rpcport", 8545, "port to start json-rpc server on")
@ -106,8 +106,8 @@ func Init() {
flag.StringVar(&Datadir, "datadir", ethutil.DefaultDataDir(), "specifies the datadir to use") flag.StringVar(&Datadir, "datadir", ethutil.DefaultDataDir(), "specifies the datadir to use")
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file") flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)") flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)") flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5 (= silent,error,warn,info,debug,debug detail)")
flag.StringVar(&LogFormat, "logformat", "std", "logformat: std,raw)") flag.StringVar(&LogFormat, "logformat", "std", "logformat: std,raw")
flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0") flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0")
flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false") flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false")
flag.BoolVar(&ShowGenesis, "genesis", false, "Dump the genesis block") flag.BoolVar(&ShowGenesis, "genesis", false, "Dump the genesis block")
@ -117,7 +117,7 @@ func Init() {
flag.StringVar(&DumpHash, "hash", "", "specify arg in hex") flag.StringVar(&DumpHash, "hash", "", "specify arg in hex")
flag.IntVar(&DumpNumber, "number", -1, "specify arg in number") flag.IntVar(&DumpNumber, "number", -1, "specify arg in number")
flag.BoolVar(&StartMining, "mine", false, "start dagger mining") flag.BoolVar(&StartMining, "mine", false, "start mining")
flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console") flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console")
flag.BoolVar(&PrintVersion, "version", false, "prints version number") flag.BoolVar(&PrintVersion, "version", false, "prints version number")
flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads") flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads")
@ -134,6 +134,7 @@ func Init() {
flag.StringVar(&BootNodes, "bootnodes", "", "space-separated node URLs for discovery bootstrap") flag.StringVar(&BootNodes, "bootnodes", "", "space-separated node URLs for discovery bootstrap")
flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers") flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers")
flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads")
flag.Parse() flag.Parse()

View File

@ -77,7 +77,7 @@ func Init() {
flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug") flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug")
flag.StringVar(&Identifier, "id", "", "Custom client identifier") flag.StringVar(&Identifier, "id", "", "Custom client identifier")
flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use") flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use")
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)") flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file")
flag.StringVar(&RpcListenAddress, "rpcaddr", "127.0.0.1", "address for json-rpc server to listen on") flag.StringVar(&RpcListenAddress, "rpcaddr", "127.0.0.1", "address for json-rpc server to listen on")
flag.IntVar(&RpcPort, "rpcport", 8545, "port to start json-rpc server on") flag.IntVar(&RpcPort, "rpcport", 8545, "port to start json-rpc server on")
flag.BoolVar(&StartRpc, "rpc", true, "start rpc server") flag.BoolVar(&StartRpc, "rpc", true, "start rpc server")
@ -89,7 +89,7 @@ func Init() {
flag.StringVar(&Datadir, "datadir", ethutil.DefaultDataDir(), "specifies the datadir to use") flag.StringVar(&Datadir, "datadir", ethutil.DefaultDataDir(), "specifies the datadir to use")
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file") flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)") flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)") flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5 (= silent,error,warn,info,debug,debug detail)")
flag.StringVar(&AssetPath, "asset_path", ethutil.DefaultAssetPath(), "absolute path to GUI assets directory") flag.StringVar(&AssetPath, "asset_path", ethutil.DefaultAssetPath(), "absolute path to GUI assets directory")

View File

@ -146,7 +146,7 @@ func New(config *Config) (*Ethereum, error) {
d, _ := db.Get([]byte("ProtocolVersion")) d, _ := db.Get([]byte("ProtocolVersion"))
protov := ethutil.NewValue(d).Uint() protov := ethutil.NewValue(d).Uint()
if protov != ProtocolVersion && protov != 0 { if protov != ProtocolVersion && protov != 0 {
path := path.Join(config.DataDir, "database") path := path.Join(config.DataDir, "blockchain")
return nil, fmt.Errorf("Database version mismatch. Protocol(%d / %d). `rm -rf %s`", protov, ProtocolVersion, path) return nil, fmt.Errorf("Database version mismatch. Protocol(%d / %d). `rm -rf %s`", protov, ProtocolVersion, path)
} }

View File

@ -1,53 +0,0 @@
#!/bin/sh
if [ "$1" == "" ]; then
echo "Usage $0 executable branch"
echo "executable ethereum | mist"
echo "branch develop | master"
exit
fi
exe=$1
path=$exe
branch=$2
if [ "$branch" == "develop" ]; then
path="cmd/$exe"
fi
# Test if go is installed
command -v go >/dev/null 2>&1 || { echo >&2 "Unable to find 'go'. This script requires go."; exit 1; }
# Test if $GOPATH is set
if [ "$GOPATH" == "" ]; then
echo "\$GOPATH not set"
exit
fi
echo "changing branch to $branch"
cd $GOPATH/src/github.com/ethereum/go-ethereum
git checkout $branch
# installing package dependencies doesn't work for develop
# branch as go get always pulls from master head
# so build will continue to fail, but this installs locally
# for people who git clone since go install will manage deps
#echo "go get -u -d github.com/ethereum/go-ethereum/$path"
#go get -v -u -d github.com/ethereum/go-ethereum/$path
#if [ $? != 0 ]; then
# echo "go get failed"
# exit
#fi
cd $GOPATH/src/github.com/ethereum/go-ethereum/$path
if [ "$exe" == "mist" ]; then
echo "Building Mist GUI. Assuming Qt is installed. If this step"
echo "fails; please refer to: https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go)"
else
echo "Building ethereum CLI."
fi
go install
echo "done. Please run $exe :-)"