Fork of plugeth with any needed changes for statediff plugin
Go to file
Lefteris Karapetsas e2fdd33541 common: Fix HomeDir detection
I am working on porting geth to [Ubuntu Core](https://developer.ubuntu.com/en/snappy/https://developer.ubuntu.com/en/snappy/). I am testing geth on a Raspberry PI and for Ubuntu Core the $HOME directory is unique for each application. See [here](https://developer.ubuntu.com/en/snappy/guides/filesystem-layout) for more information of their filesystem layout.

For some reason in Go `usr.HomeDir` returns a different value than `$HOME` in Ubuntu Core.

Adding this at the end of `HomeDir()`
```go
fmt.Printf("at HomeDir, user.HomeDir = %s and $HOME is %s\n", usr.HomeDir, os.Getenv("HOME"))
```

gives the following output

```
at HomeDir, user.HomeDir = /home/ubuntu and $HOME is /home/ubuntu/apps/geth.sideload/IJcODREBYbHO
```

With this commit, I propose giving precedence to the `$HOME` environment variable as is also suggested by the [homedir](https://github.com/mitchellh/go-homedir/blob/master/homedir.go) project.
2016-01-08 13:36:37 +01:00
_data Chain tests 2014-12-30 15:42:26 +01:00
accounts Merge pull request #2035 from bas-vk/rcp-v2-rebase 2015-12-14 17:38:10 +01:00
build all: Add GPU mining, disabled by default 2015-10-07 13:19:30 +02:00
cmd Merge pull request #2064 from fjl/remove-common-rlp 2015-12-18 20:26:19 +01:00
common common: Fix HomeDir detection 2016-01-08 13:36:37 +01:00
compression/rle all: fix license headers one more time 2015-07-23 18:35:11 +02:00
core Merge pull request #2097 from karalabe/block-state-checks 2016-01-05 12:26:38 +01:00
crypto Merge pull request #2056 from fjl/fix-account-format 2015-12-10 10:45:00 +01:00
docker update Dockerfile, remove supervisord and unattended-upgrades 2015-10-26 18:06:19 -04:00
errs all: fix license headers one more time 2015-07-23 18:35:11 +02:00
eth core, eth/downloader: ensure state presence in ancestor lookup 2016-01-04 16:27:23 +02:00
ethdb common: remove old RLP implementation, Value and ExtPackage 2015-12-18 12:09:10 +01:00
event event/filter: fix data race in the test 2015-11-05 16:55:53 +02:00
generators all: fix license headers one more time 2015-07-23 18:35:11 +02:00
Godeps rpc/v2: optionally passing context argument to rpc v2 api methods 2015-12-16 03:48:08 +01:00
jsre Merge pull request #1999 from karalabe/javascript-timer-argcheck 2015-11-26 23:00:36 +01:00
light light: implemented odr-capable trie and state structures 2015-12-17 16:07:54 +01:00
logger all: fix license headers one more time 2015-07-23 18:35:11 +02:00
metrics eth, metrics, p2p: prepare metrics and net packets to eth/62 2015-08-21 10:30:57 +03:00
miner rpc: new RPC implementation with pub/sub support 2015-12-14 16:34:05 +01:00
node core, eth, node, rpc: port the admin and debug API 2015-12-14 19:36:51 +02:00
p2p p2p/discover: attempt to deflake TestUDP_responseTimeouts 2015-12-17 23:44:56 +01:00
params miner: gas limit strategy, target 3141592 & def gas price 50 Shannon 2015-08-04 15:20:28 +02:00
pow all: Add GPU mining, disabled by default 2015-10-07 13:19:30 +02:00
rlp rlp: move ListSize to raw.go 2015-09-10 19:41:51 +02:00
rpc Merge pull request #2061 from zsfelfoldi/rpc-context 2015-12-16 11:12:06 +01:00
tests cmd, common, core, eth, node, rpc, tests, whisper, xeth: use protocol stacks 2015-11-27 11:06:12 +02:00
trie light: implemented odr-capable trie and state structures 2015-12-17 16:07:54 +01:00
whisper Merge pull request #2035 from bas-vk/rcp-v2-rebase 2015-12-14 17:38:10 +01:00
xeth common: remove old RLP implementation, Value and ExtPackage 2015-12-18 12:09:10 +01:00
.gitattributes .gitattributes: add 2015-08-06 17:18:59 +02:00
.gitignore updated ignore 2015-05-07 00:03:11 +02:00
.gitmodules cmd/geth, jsre: updated ethereum.js => web3.js 2015-04-24 11:37:58 +02:00
.mailmap Adjust .mailmap 2015-07-07 11:50:49 -05:00
.travis.yml crypto/secp256k1: remove dependency on libgmp 2015-12-03 21:12:13 +01:00
AUTHORS all: update license information 2015-07-07 14:12:44 +02:00
CONTRIBUTING.md Updated README, Added CONTRIBUTING 2015-08-18 23:00:15 +02:00
COPYING all: update license information 2015-07-07 14:12:44 +02:00
COPYING.LESSER all: update license information 2015-07-07 14:12:44 +02:00
Makefile Makefile, cmd/geth: support building Android archives 2015-12-14 14:28:14 +02:00
README.md crypto/secp256k1: remove dependency on libgmp 2015-12-03 21:12:13 +01:00
VERSION VERSION, cmd/geth: bumped version 1.4.0 2015-11-03 11:48:18 +01:00

Ethereum Go

Official golang implementation of the Ethereum protocol

      | Linux   | OSX | ARM | Windows | Tests

----------|---------|-----|-----|---------|------ develop | Build+Status | Build+Status | Build+Status | Build+Status | Buildr+Status codecov.io master | Build+Status | Build+Status | Build+Status | Build+Status | Buildr+Status codecov.io

API Reference Gitter

Automated development builds

The following builds are build automatically by our build servers after each push to the develop branch.

Building the source

For prerequisites and detailed build instructions please read the Installation Instructions on the wiki.

Building geth requires both a Go and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run

make geth

Executables

Go Ethereum comes with several wrappers/executables found in the cmd directory:

Command
geth Ethereum CLI (ethereum command line interface client)
bootnode runs a bootstrap node for the Discovery Protocol
ethtest test tool which runs with the tests suite: /path/to/test.json > ethtest --test BlockTests --stdin.
evm is a generic Ethereum Virtual Machine: evm -code 60ff60ff -gas 10000 -price 0 -dump. See -h for a detailed description.
disasm disassembles EVM code: `echo "6001"
rlpdump prints RLP structures

Command line options

geth can be configured via command line options, environment variables and config files.

To get the options available:

geth help

For further details on options, see the wiki

Contribution

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 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. Commits that are directly based on master are simply ignored.

See Developers' Guide for more details on configuring your environment, testing, and dependency management.