This commit is contained in:
Christopher Franko 2016-03-03 12:30:16 +00:00
commit 271a1dd8c7
449 changed files with 8071 additions and 3634 deletions

8
.gitignore vendored
View file

@ -3,14 +3,14 @@
# If you find yourself ignoring temporary files generated by your text editor # If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead: # or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global # git config --global core.excludesfile ~/.gitignore_global
tests/files/VMTests/RandomTests/*
/tmp /tmp
*/**/*un~ */**/*un~
*/**/*.test */**/*.test
*un~ *un~
.DS_Store .DS_Store
*/**/.DS_Store */**/.DS_Store
.ethtest .exptest
*/**/*tx_database* */**/*tx_database*
*/**/*dapps* */**/*dapps*
Godeps/_workspace/pkg Godeps/_workspace/pkg
@ -25,7 +25,7 @@ Godeps/_workspace/bin
deploy/osx/Mist.app deploy/osx/Mist.app
deploy/osx/Mist\ Installer.dmg deploy/osx/Mist\ Installer.dmg
cmd/mist/assets/ext/ethereum.js/ cmd/mist/assets/ext/expanse.js/
# used by the Makefile # used by the Makefile
/build/_workspace/ /build/_workspace/
@ -35,3 +35,5 @@ cmd/mist/assets/ext/ethereum.js/
profile.tmp profile.tmp
profile.cov profile.cov
.idea/workspace.xml
*.idea/

6
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "cmd/mist/assets/ext/ethereum.js"] [submodule "cmd/mist/assets/ext/expanse.js"]
path = cmd/mist/assets/ext/ethereum.js path = cmd/mist/assets/ext/expanse.js
url = https://github.com/ethereum/web3.js url = https://github.com/expanse-org/web3.js

View file

@ -1,7 +1,7 @@
Jeffrey Wilcke <jeffrey@ethereum.org> Jeffrey Wilcke <jeffrey@expanse.org>
Jeffrey Wilcke <jeffrey@ethereum.org> <geffobscura@gmail.com> Jeffrey Wilcke <jeffrey@expanse.org> <geffobscura@gmail.com>
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@obscura.com> Jeffrey Wilcke <jeffrey@expanse.org> <obscuren@obscura.com>
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@users.noreply.github.com> Jeffrey Wilcke <jeffrey@expanse.org> <obscuren@users.noreply.github.com>
Viktor Trón <viktor.tron@gmail.com> Viktor Trón <viktor.tron@gmail.com>
@ -12,7 +12,7 @@ Nick Savers <nicksavers@gmail.com>
Maran Hidskes <maran.hidskes@gmail.com> Maran Hidskes <maran.hidskes@gmail.com>
Taylor Gerring <taylor.gerring@gmail.com> Taylor Gerring <taylor.gerring@gmail.com>
Taylor Gerring <taylor.gerring@gmail.com> <taylor.gerring@ethereum.org> Taylor Gerring <taylor.gerring@gmail.com> <taylor.gerring@expanse.org>
Bas van Kervel <bas@ethdev.com> Bas van Kervel <bas@ethdev.com>
Bas van Kervel <bas@ethdev.com> <basvankervel@ziggo.nl> Bas van Kervel <bas@ethdev.com> <basvankervel@ziggo.nl>
@ -57,5 +57,5 @@ Nick Dodson <silentcicero@outlook.com>
Jason Carver <jacarver@linkedin.com> Jason Carver <jacarver@linkedin.com>
Jason Carver <jacarver@linkedin.com> <ut96caarrs@snkmail.com> Jason Carver <jacarver@linkedin.com> <ut96caarrs@snkmail.com>
Joseph Chow <ethereum@outlook.com> Joseph Chow <expanse@outlook.com>
Joseph Chow <ethereum@outlook.com> ethers <TODO> Joseph Chow <expanse@outlook.com> ethers <TODO>

View file

@ -13,7 +13,7 @@ before_script:
# - go vet ./... # - go vet ./...
# - go test -race ./... # - go test -race ./...
script: script:
- make travis-test-with-coverage - make gexp
after_success: after_success:
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)
env: env:

View file

@ -1,4 +1,4 @@
# This is the official list of go-ethereum authors for copyright purposes. # This is the official list of go-expanse authors for copyright purposes.
Alex Leverington <alex@ethdev.com> Alex Leverington <alex@ethdev.com>
Alexandre Van de Sande <alex.vandesande@ethdev.com> Alexandre Van de Sande <alex.vandesande@ethdev.com>
@ -10,8 +10,8 @@ Felix Lange <fjl@twurst.com>
Gustav Simonsson <gustav.simonsson@gmail.com> Gustav Simonsson <gustav.simonsson@gmail.com>
Jae Kwon <jkwon.work@gmail.com> Jae Kwon <jkwon.work@gmail.com>
Jason Carver <jacarver@linkedin.com> Jason Carver <jacarver@linkedin.com>
Jeffrey Wilcke <jeffrey@ethereum.org> Jeffrey Wilcke <jeffrey@expanse.org>
Joseph Chow <ethereum@outlook.com> Joseph Chow <expanse@outlook.com>
Kobi Gurkan <kobigurk@gmail.com> Kobi Gurkan <kobigurk@gmail.com>
Maran Hidskes <maran.hidskes@gmail.com> Maran Hidskes <maran.hidskes@gmail.com>
Marek Kotewicz <marek.kotewicz@gmail.com> Marek Kotewicz <marek.kotewicz@gmail.com>

View file

@ -1,9 +1,9 @@
If you'd like to contribute to go-ethereum please fork, fix, commit and If you'd like to contribute to go-expanse 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.
See [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide) See [Developers' Guide](https://github.com/expanse-project/go-expanse/wiki/Developers'-Guide)
for more details on configuring your environment, testing, and for more details on configuring your environment, testing, and
dependency management. dependency management.

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2014 The go-ethereum Authors. Copyright (C) 2015 The go-expanse Authors.
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.

8
Godeps/Godeps.json generated
View file

@ -1,5 +1,5 @@
{ {
"ImportPath": "github.com/ethereum/go-ethereum", "ImportPath": "github.com/expanse-project/go-expanse",
"GoVersion": "go1.4", "GoVersion": "go1.4",
"Packages": [ "Packages": [
"./..." "./..."
@ -15,9 +15,9 @@
"Rev": "3e6e67c4dcea3ac2f25fd4731abc0e1deaf36216" "Rev": "3e6e67c4dcea3ac2f25fd4731abc0e1deaf36216"
}, },
{ {
"ImportPath": "github.com/ethereum/ethash", "ImportPath": "github.com/expanse-project/ethash",
"Comment": "v23.1-238-g9401881", "Comment": "v23.1-238-g062e40a",
"Rev": "9401881ab040d1a3b0ae9e4780a115bc284a8a1a" "Rev": "fe2794dd2a3b1425dc3e3cc7f15a1dd591422bf1"
}, },
{ {
"ImportPath": "github.com/fatih/color", "ImportPath": "github.com/fatih/color",

View file

@ -39,8 +39,8 @@ import (
"unsafe" "unsafe"
"github.com/Gustav-Simonsson/go-opencl/cl" "github.com/Gustav-Simonsson/go-opencl/cl"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/pow" "github.com/expanse-project/go-expanse/pow"
) )
/* /*

View file

@ -6,12 +6,12 @@ before_install:
# for g++4.8 and C++11 # for g++4.8 and C++11
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# Set up go-ethereum # Set up go-expanse
- sudo apt-get update -y -qq - sudo apt-get update -y -qq
- sudo apt-get install -yqq libgmp3-dev - sudo apt-get install -yqq libgmp3-dev
- git clone --depth=10 https://github.com/ethereum/go-ethereum ${GOPATH}/src/github.com/ethereum/go-ethereum - git clone --depth=10 https://github.com/expanse-project/go-expanse ${GOPATH}/src/github.com/expanse-project/go-expanse
# use canned dependencies from the go-ethereum repository # use canned dependencies from the go-expanse repository
- export GOPATH=$GOPATH:$GOPATH/src/github.com/ethereum/go-ethereum/Godeps/_workspace/ - export GOPATH=$GOPATH:$GOPATH/src/github.com/expanse-project/go-expanse/Godeps/_workspace/
- echo $GOPATH - echo $GOPATH
install: install:

View file

@ -1,14 +1,14 @@
[![Build Status](https://travis-ci.org/ethereum/ethash.svg?branch=master)](https://travis-ci.org/ethereum/ethash) [![Build Status](https://travis-ci.org/expanse/ethash.svg?branch=master)](https://travis-ci.org/expanse/ethash)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/debris/ethash?branch=master&svg=true)](https://ci.appveyor.com/project/debris/ethash-nr37r/branch/master) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/debris/ethash?branch=master&svg=true)](https://ci.appveyor.com/project/debris/ethash-nr37r/branch/master)
# Ethash # Ethash
For details on this project, please see the Ethereum wiki: For details on this project, please see the Expanse wiki:
https://github.com/ethereum/wiki/wiki/Ethash https://github.com/expanse-project/wiki/wiki/Ethash
### Coding Style for C++ code: ### Coding Style for C++ code:
Follow the same exact style as in [cpp-ethereum](https://github.com/ethereum/cpp-ethereum/blob/develop/CodingStandards.txt) Follow the same exact style as in [cpp-expanse](https://github.com/expanse-project/cpp-expanse/blob/develop/CodingStandards.txt)
### Coding Style for C code: ### Coding Style for C code:

View file

@ -40,11 +40,11 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
"github.com/ethereum/go-ethereum/logger" "github.com/expanse-project/go-expanse/logger"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/expanse-project/go-expanse/logger/glog"
"github.com/ethereum/go-ethereum/pow" "github.com/expanse-project/go-expanse/pow"
) )
var ( var (
@ -128,7 +128,7 @@ func (l *Light) Verify(block pow.Block) bool {
/* Cannot happen if block header diff is validated prior to PoW, but can /* Cannot happen if block header diff is validated prior to PoW, but can
happen if PoW is checked first due to parallel PoW checking. happen if PoW is checked first due to parallel PoW checking.
We could check the minimum valid difficulty but for SoC we avoid (duplicating) We could check the minimum valid difficulty but for SoC we avoid (duplicating)
Ethereum protocol consensus rules here which are not in scope of Ethash Expanse protocol consensus rules here which are not in scope of Ethash
*/ */
if difficulty.Cmp(common.Big0) == 0 { if difficulty.Cmp(common.Big0) == 0 {
glog.V(logger.Debug).Infof("invalid block difficulty") glog.V(logger.Debug).Infof("invalid block difficulty")
@ -330,7 +330,7 @@ func (pow *Full) Search(block pow.Block, stop <-chan struct{}, index int) (nonce
ret := C.ethash_full_compute(dag.ptr, hash, C.uint64_t(nonce)) ret := C.ethash_full_compute(dag.ptr, hash, C.uint64_t(nonce))
result := h256ToHash(ret.result).Big() result := h256ToHash(ret.result).Big()
// TODO: disagrees with the spec https://github.com/ethereum/wiki/wiki/Ethash#mining // TODO: disagrees with the spec https://github.com/expanse-project/wiki/wiki/Ethash#mining
if ret.success && result.Cmp(target) <= 0 { if ret.success && result.Cmp(target) <= 0 {
mixDigest = C.GoBytes(unsafe.Pointer(&ret.mix_hash), C.int(32)) mixDigest = C.GoBytes(unsafe.Pointer(&ret.mix_hash), C.int(32))
atomic.AddInt32(&pow.hashRate, -previousHashrate) atomic.AddInt32(&pow.hashRate, -previousHashrate)

View file

@ -27,8 +27,8 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
) )
func init() { func init() {
@ -86,30 +86,30 @@ var invalidZeroDiffBlock = testBlock{
} }
func TestEthashVerifyValid(t *testing.T) { func TestEthashVerifyValid(t *testing.T) {
eth := New() exp := New()
for i, block := range validBlocks { for i, block := range validBlocks {
if !eth.Verify(block) { if !exp.Verify(block) {
t.Errorf("block %d (%x) did not validate.", i, block.hashNoNonce[:6]) t.Errorf("block %d (%x) did not validate.", i, block.hashNoNonce[:6])
} }
} }
} }
func TestEthashVerifyInvalid(t *testing.T) { func TestEthashVerifyInvalid(t *testing.T) {
eth := New() exp := New()
if eth.Verify(&invalidZeroDiffBlock) { if exp.Verify(&invalidZeroDiffBlock) {
t.Errorf("should not validate - we just ensure it does not panic on this block") t.Errorf("should not validate - we just ensure it does not panic on this block")
} }
} }
func TestEthashConcurrentVerify(t *testing.T) { func TestEthashConcurrentVerify(t *testing.T) {
eth, err := NewForTesting() exp, err := NewForTesting()
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.RemoveAll(eth.Full.Dir) defer os.RemoveAll(exp.Full.Dir)
block := &testBlock{difficulty: big.NewInt(10)} block := &testBlock{difficulty: big.NewInt(10)}
nonce, md := eth.Search(block, nil, 0) nonce, md := exp.Search(block, nil, 0)
block.nonce = nonce block.nonce = nonce
block.mixDigest = common.BytesToHash(md) block.mixDigest = common.BytesToHash(md)
@ -118,7 +118,7 @@ func TestEthashConcurrentVerify(t *testing.T) {
wg.Add(100) wg.Add(100)
for i := 0; i < 100; i++ { for i := 0; i < 100; i++ {
go func() { go func() {
if !eth.Verify(block) { if !exp.Verify(block) {
t.Error("Block could not be verified") t.Error("Block could not be verified")
} }
wg.Done() wg.Done()
@ -128,12 +128,12 @@ func TestEthashConcurrentVerify(t *testing.T) {
} }
func TestEthashConcurrentSearch(t *testing.T) { func TestEthashConcurrentSearch(t *testing.T) {
eth, err := NewForTesting() exp, err := NewForTesting()
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
eth.Turbo(true) exp.Turbo(true)
defer os.RemoveAll(eth.Full.Dir) defer os.RemoveAll(exp.Full.Dir)
type searchRes struct { type searchRes struct {
n uint64 n uint64
@ -152,7 +152,7 @@ func TestEthashConcurrentSearch(t *testing.T) {
// launch n searches concurrently. // launch n searches concurrently.
for i := 0; i < nsearch; i++ { for i := 0; i < nsearch; i++ {
go func() { go func() {
nonce, md := eth.Search(block, stop, 0) nonce, md := exp.Search(block, stop, 0)
select { select {
case found <- searchRes{n: nonce, md: md}: case found <- searchRes{n: nonce, md: md}:
case <-stop: case <-stop:
@ -169,25 +169,25 @@ func TestEthashConcurrentSearch(t *testing.T) {
block.nonce = res.n block.nonce = res.n
block.mixDigest = common.BytesToHash(res.md) block.mixDigest = common.BytesToHash(res.md)
if !eth.Verify(block) { if !exp.Verify(block) {
t.Error("Block could not be verified") t.Error("Block could not be verified")
} }
} }
func TestEthashSearchAcrossEpoch(t *testing.T) { func TestEthashSearchAcrossEpoch(t *testing.T) {
eth, err := NewForTesting() exp, err := NewForTesting()
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.RemoveAll(eth.Full.Dir) defer os.RemoveAll(exp.Full.Dir)
for i := epochLength - 40; i < epochLength+40; i++ { for i := epochLength - 40; i < epochLength+40; i++ {
block := &testBlock{number: i, difficulty: big.NewInt(90)} block := &testBlock{number: i, difficulty: big.NewInt(90)}
rand.Read(block.hashNoNonce[:]) rand.Read(block.hashNoNonce[:])
nonce, md := eth.Search(block, nil, 0) nonce, md := exp.Search(block, nil, 0)
block.nonce = nonce block.nonce = nonce
block.mixDigest = common.BytesToHash(md) block.mixDigest = common.BytesToHash(md)
if !eth.Verify(block) { if !exp.Verify(block) {
t.Fatalf("Block could not be verified") t.Fatalf("Block could not be verified")
} }
} }

View file

@ -39,9 +39,9 @@ setup(
author_email="matthew.wampler.doty@gmail.com", author_email="matthew.wampler.doty@gmail.com",
license='GPL', license='GPL',
version='0.1.23', version='0.1.23',
url='https://github.com/ethereum/ethash', url='https://github.com/expanse-project/ethash',
download_url='https://github.com/ethereum/ethash/tarball/v23', download_url='https://github.com/expanse-project/ethash/tarball/v23',
description=('Python wrappers for ethash, the ethereum proof of work' description=('Python wrappers for ethash, the expanse proof of work'
'hashing function'), 'hashing function'),
ext_modules=[pyethash], ext_modules=[pyethash],
) )

View file

@ -1,18 +1,18 @@
/* /*
This file is part of cpp-ethereum. This file is part of cpp-expanse.
cpp-ethereum is free software: you can redistribute it and/or modify cpp-expanse is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful, cpp-expanse is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. along with cpp-expanse. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** @file benchmark.cpp /** @file benchmark.cpp
* @author Tim Hughes <tim@twistedfury.com> * @author Tim Hughes <tim@twistedfury.com>

View file

@ -1,18 +1,18 @@
/* /*
This file is part of cpp-ethereum. This file is part of cpp-expanse.
cpp-ethereum is free software: you can redistribute it and/or modify cpp-expanse is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful, cpp-expanse is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. along with cpp-expanse. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** @file compiler.h /** @file compiler.h
* @date 2014 * @date 2014

View file

@ -1,18 +1,18 @@
/* /*
This file is part of cpp-ethereum. This file is part of cpp-expanse.
cpp-ethereum is free software: you can redistribute it and/or modify cpp-expanse is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software FoundationUUU,either version 3 of the LicenseUUU,or the Free Software FoundationUUU,either version 3 of the LicenseUUU,or
(at your option) any later version. (at your option) any later version.
cpp-ethereum is distributed in the hope that it will be usefulU, cpp-expanse is distributed in the hope that it will be usefulU,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with cpp-ethereum. If notUUU,see <http://www.gnu.org/licenses/>. along with cpp-expanse. If notUUU,see <http://www.gnu.org/licenses/>.
*/ */
/** @file data_sizes.h /** @file data_sizes.h

View file

@ -1,18 +1,18 @@
/* /*
This file is part of cpp-ethereum. This file is part of cpp-expanse.
cpp-ethereum is free software: you can redistribute it and/or modify cpp-expanse is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful, cpp-expanse is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. along with cpp-expanse. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** @file fnv.h /** @file fnv.h
* @author Matthew Wampler-Doty <negacthulhu@gmail.com> * @author Matthew Wampler-Doty <negacthulhu@gmail.com>

View file

@ -12,7 +12,7 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. along with cpp-expanse. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** @file internal.c /** @file internal.c
* @author Tim Hughes <tim@twistedfury.com> * @author Tim Hughes <tim@twistedfury.com>

View file

@ -38,7 +38,7 @@ extern "C" {
// 10 is for maximum number of digits of a uint32_t (for REVISION) // 10 is for maximum number of digits of a uint32_t (for REVISION)
// 1 is for - and 16 is for the first 16 hex digits for first 8 bytes of // 1 is for - and 16 is for the first 16 hex digits for first 8 bytes of
// the seedhash and last 1 is for the null terminating character // the seedhash and last 1 is for the null terminating character
// Reference: https://github.com/ethereum/wiki/wiki/Ethash-DAG // Reference: https://github.com/expanse-project/wiki/wiki/Ethash-DAG
#define DAG_MUTABLE_NAME_MAX_SIZE (6 + 10 + 1 + 16 + 1) #define DAG_MUTABLE_NAME_MAX_SIZE (6 + 10 + 1 + 16 + 1)
/// Possible return values of @see ethash_io_prepare /// Possible return values of @see ethash_io_prepare
enum ethash_io_rc { enum ethash_io_rc {
@ -80,7 +80,7 @@ enum ethash_io_rc {
* data directory. If it does not exist it's created. * data directory. If it does not exist it's created.
* @param[in] seedhash The seedhash of the current block number, used in the * @param[in] seedhash The seedhash of the current block number, used in the
* naming of the file as can be seen from the spec at: * naming of the file as can be seen from the spec at:
* https://github.com/ethereum/wiki/wiki/Ethash-DAG * https://github.com/expanse-project/wiki/wiki/Ethash-DAG
* @param[out] output_file If there was no failure then this will point to an open * @param[out] output_file If there was no failure then this will point to an open
* file descriptor. User is responsible for closing it. * file descriptor. User is responsible for closing it.
* In the case of memo match then the file is open on read * In the case of memo match then the file is open on read
@ -175,7 +175,7 @@ char* ethash_io_create_filename(
/** /**
* Gets the default directory name for the DAG depending on the system * Gets the default directory name for the DAG depending on the system
* *
* The spec defining this directory is here: https://github.com/ethereum/wiki/wiki/Ethash-DAG * The spec defining this directory is here: https://github.com/expanse-project/wiki/wiki/Ethash-DAG
* *
* @param[out] strbuf A string buffer of sufficient size to keep the * @param[out] strbuf A string buffer of sufficient size to keep the
* null termninated string of the directory name * null termninated string of the directory name

View file

@ -1,18 +1,18 @@
/* /*
This file is part of cpp-ethereum. This file is part of cpp-expanse.
cpp-ethereum is free software: you can redistribute it and/or modify cpp-expanse is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful, cpp-expanse is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. along with cpp-expanse. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** @file util.c /** @file util.c
* @author Tim Hughes <tim@twistedfury.com> * @author Tim Hughes <tim@twistedfury.com>

View file

@ -172,7 +172,7 @@ mine(PyObject *self, PyObject *args) {
// TODO: Multi threading? // TODO: Multi threading?
do { do {
ethash_full(&out, (void *) full_bytes, &params, (const ethash_h256_t *) header, nonce++); ethash_full(&out, (void *) full_bytes, &params, (const ethash_h256_t *) header, nonce++);
// TODO: disagrees with the spec https://github.com/ethereum/wiki/wiki/Ethash#mining // TODO: disagrees with the spec https://github.com/expanse-project/wiki/wiki/Ethash#mining
} while (!ethash_check_difficulty(&out.result, (const ethash_h256_t *) difficulty)); } while (!ethash_check_difficulty(&out.result, (const ethash_h256_t *) difficulty));
return Py_BuildValue("{" PY_CONST_STRING_FORMAT ":" PY_STRING_FORMAT ", " PY_CONST_STRING_FORMAT ":" PY_STRING_FORMAT ", " PY_CONST_STRING_FORMAT ":K}", return Py_BuildValue("{" PY_CONST_STRING_FORMAT ":" PY_STRING_FORMAT ", " PY_CONST_STRING_FORMAT ":" PY_STRING_FORMAT ", " PY_CONST_STRING_FORMAT ":K}",
@ -233,7 +233,7 @@ static struct PyModuleDef PyethashModule = {
PyMODINIT_FUNC PyInit_pyethash(void) { PyMODINIT_FUNC PyInit_pyethash(void) {
PyObject *module = PyModule_Create(&PyethashModule); PyObject *module = PyModule_Create(&PyethashModule);
// Following Spec: https://github.com/ethereum/wiki/wiki/Ethash#definitions // Following Spec: https://github.com/expanse-project/wiki/wiki/Ethash#definitions
PyModule_AddIntConstant(module, "REVISION", (long) ETHASH_REVISION); PyModule_AddIntConstant(module, "REVISION", (long) ETHASH_REVISION);
PyModule_AddIntConstant(module, "DATASET_BYTES_INIT", (long) ETHASH_DATASET_BYTES_INIT); PyModule_AddIntConstant(module, "DATASET_BYTES_INIT", (long) ETHASH_DATASET_BYTES_INIT);
PyModule_AddIntConstant(module, "DATASET_BYTES_GROWTH", (long) ETHASH_DATASET_BYTES_GROWTH); PyModule_AddIntConstant(module, "DATASET_BYTES_GROWTH", (long) ETHASH_DATASET_BYTES_GROWTH);
@ -251,7 +251,7 @@ PyMODINIT_FUNC PyInit_pyethash(void) {
PyMODINIT_FUNC PyMODINIT_FUNC
initpyethash(void) { initpyethash(void) {
PyObject *module = Py_InitModule("pyethash", PyethashMethods); PyObject *module = Py_InitModule("pyethash", PyethashMethods);
// Following Spec: https://github.com/ethereum/wiki/wiki/Ethash#definitions // Following Spec: https://github.com/expanse-project/wiki/wiki/Ethash#definitions
PyModule_AddIntConstant(module, "REVISION", (long) ETHASH_REVISION); PyModule_AddIntConstant(module, "REVISION", (long) ETHASH_REVISION);
PyModule_AddIntConstant(module, "DATASET_BYTES_INIT", (long) ETHASH_DATASET_BYTES_INIT); PyModule_AddIntConstant(module, "DATASET_BYTES_INIT", (long) ETHASH_DATASET_BYTES_INIT);
PyModule_AddIntConstant(module, "DATASET_BYTES_GROWTH", (long) ETHASH_DATASET_BYTES_GROWTH); PyModule_AddIntConstant(module, "DATASET_BYTES_GROWTH", (long) ETHASH_DATASET_BYTES_GROWTH);

View file

@ -36,7 +36,7 @@ namespace fs = boost::filesystem;
#define our_alloca(param__) alloca((size_t)(param__)) #define our_alloca(param__) alloca((size_t)(param__))
// some functions taken from eth::dev for convenience. // some functions taken from exp::dev for convenience.
std::string bytesToHexString(const uint8_t *str, const uint64_t s) std::string bytesToHexString(const uint8_t *str, const uint64_t s)
{ {
std::ostringstream ret; std::ostringstream ret;

View file

@ -975,7 +975,7 @@ var entity = map[string]rune{
"esdot;": '\U00002250', "esdot;": '\U00002250',
"esim;": '\U00002242', "esim;": '\U00002242',
"eta;": '\U000003B7', "eta;": '\U000003B7',
"eth;": '\U000000F0', "exp;": '\U000000F0',
"euml;": '\U000000EB', "euml;": '\U000000EB',
"euro;": '\U000020AC', "euro;": '\U000020AC',
"excl;": '\U00000021', "excl;": '\U00000021',
@ -2102,7 +2102,7 @@ var entity = map[string]rune{
"eacute": '\U000000E9', "eacute": '\U000000E9',
"ecirc": '\U000000EA', "ecirc": '\U000000EA',
"egrave": '\U000000E8', "egrave": '\U000000E8',
"eth": '\U000000F0', "exp": '\U000000F0',
"euml": '\U000000EB', "euml": '\U000000EB',
"frac12": '\U000000BD', "frac12": '\U000000BD',
"frac14": '\U000000BC', "frac14": '\U000000BC',

118
Makefile
View file

@ -2,110 +2,110 @@
# with Go source code. If you know what GOPATH is then you probably # with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make. # don't need to bother with make.
.PHONY: geth geth-cross evm all test travis-test-with-coverage xgo clean .PHONY: gexp gexp-cross evm all test travis-test-with-coverage xgo clean
.PHONY: geth-linux geth-linux-arm geth-linux-386 geth-linux-amd64 .PHONY: gexp-linux gexp-linux-arm gexp-linux-386 gexp-linux-amd64
.PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64 .PHONY: gexp-darwin gexp-darwin-386 gexp-darwin-amd64
.PHONY: geth-windows geth-windows-386 geth-windows-amd64 .PHONY: gexp-windows gexp-windows-386 gexp-windows-amd64
.PHONY: geth-android geth-android-16 geth-android-21 .PHONY: gexp-android gexp-android-16 gexp-android-21
GOBIN = build/bin GOBIN = build/bin
MODE ?= default MODE ?= default
GO ?= latest GO ?= latest
geth: gexp:
build/env.sh go install -v $(shell build/flags.sh) ./cmd/geth build/env.sh go install -v $(shell build/flags.sh) ./cmd/gexp
@echo "Done building." @echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth." @echo "Run \"$(GOBIN)/gexp\" to launch gexp."
geth-cross: geth-linux geth-darwin geth-windows geth-android gexp-cross: gexp-linux gexp-darwin gexp-windows gexp-android
@echo "Full cross compilation done:" @echo "Full cross compilation done:"
@ls -l $(GOBIN)/geth-* @ls -l $(GOBIN)/gexp-*
geth-linux: xgo geth-linux-arm geth-linux-386 geth-linux-amd64 gexp-linux: xgo gexp-linux-arm gexp-linux-386 gexp-linux-amd64
@echo "Linux cross compilation done:" @echo "Linux cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* @ls -l $(GOBIN)/gexp-linux-*
geth-linux-386: xgo gexp-linux-386: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Linux 386 cross compilation done:" @echo "Linux 386 cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* | grep 386 @ls -l $(GOBIN)/gexp-linux-* | grep 386
geth-linux-amd64: xgo gexp-linux-amd64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Linux amd64 cross compilation done:" @echo "Linux amd64 cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* | grep amd64 @ls -l $(GOBIN)/gexp-linux-* | grep amd64
geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64 gexp-linux-arm: gexp-linux-arm-5 gexp-linux-arm-6 gexp-linux-arm-7 gexp-linux-arm64
@echo "Linux ARM cross compilation done:" @echo "Linux ARM cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* | grep arm @ls -l $(GOBIN)/gexp-linux-* | grep arm
geth-linux-arm-5: xgo gexp-linux-arm-5: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-5 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-5 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Linux ARMv5 cross compilation done:" @echo "Linux ARMv5 cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* | grep arm-5 @ls -l $(GOBIN)/gexp-linux-* | grep arm-5
geth-linux-arm-6: xgo gexp-linux-arm-6: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-6 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-6 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Linux ARMv6 cross compilation done:" @echo "Linux ARMv6 cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* | grep arm-6 @ls -l $(GOBIN)/gexp-linux-* | grep arm-6
geth-linux-arm-7: xgo gexp-linux-arm-7: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-7 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-7 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Linux ARMv7 cross compilation done:" @echo "Linux ARMv7 cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* | grep arm-7 @ls -l $(GOBIN)/gexp-linux-* | grep arm-7
geth-linux-arm64: xgo gexp-linux-arm64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm64 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm64 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Linux ARM64 cross compilation done:" @echo "Linux ARM64 cross compilation done:"
@ls -l $(GOBIN)/geth-linux-* | grep arm64 @ls -l $(GOBIN)/gexp-linux-* | grep arm64
geth-darwin: geth-darwin-386 geth-darwin-amd64 gexp-darwin: gexp-darwin-386 gexp-darwin-amd64
@echo "Darwin cross compilation done:" @echo "Darwin cross compilation done:"
@ls -l $(GOBIN)/geth-darwin-* @ls -l $(GOBIN)/gexp-darwin-*
geth-darwin-386: xgo gexp-darwin-386: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Darwin 386 cross compilation done:" @echo "Darwin 386 cross compilation done:"
@ls -l $(GOBIN)/geth-darwin-* | grep 386 @ls -l $(GOBIN)/gexp-darwin-* | grep 386
geth-darwin-amd64: xgo gexp-darwin-amd64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Darwin amd64 cross compilation done:" @echo "Darwin amd64 cross compilation done:"
@ls -l $(GOBIN)/geth-darwin-* | grep amd64 @ls -l $(GOBIN)/gexp-darwin-* | grep amd64
geth-windows: xgo geth-windows-386 geth-windows-amd64 gexp-windows: xgo gexp-windows-386 gexp-windows-amd64
@echo "Windows cross compilation done:" @echo "Windows cross compilation done:"
@ls -l $(GOBIN)/geth-windows-* @ls -l $(GOBIN)/gexp-windows-*
geth-windows-386: xgo gexp-windows-386: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Windows 386 cross compilation done:" @echo "Windows 386 cross compilation done:"
@ls -l $(GOBIN)/geth-windows-* | grep 386 @ls -l $(GOBIN)/gexp-windows-* | grep 386
geth-windows-amd64: xgo gexp-windows-amd64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/gexp
@echo "Windows amd64 cross compilation done:" @echo "Windows amd64 cross compilation done:"
@ls -l $(GOBIN)/geth-windows-* | grep amd64 @ls -l $(GOBIN)/gexp-windows-* | grep amd64
geth-android: xgo gexp-android: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=android/* -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=android/* -v $(shell build/flags.sh) ./cmd/gexp
@echo "Android cross compilation done:" @echo "Android cross compilation done:"
@ls -l $(GOBIN)/geth-android-* @ls -l $(GOBIN)/gexp-android-*
geth-ios: geth-ios-arm-7 geth-ios-arm64 gexp-ios: gexp-ios-arm-7 gexp-ios-arm64
@echo "iOS cross compilation done:" @echo "iOS cross compilation done:"
@ls -l $(GOBIN)/geth-ios-* @ls -l $(GOBIN)/gexp-ios-*
geth-ios-arm-7: xgo gexp-ios-arm-7: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=ios/arm-7 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=ios/arm-7 -v $(shell build/flags.sh) ./cmd/gexp
@echo "iOS ARMv7 cross compilation done:" @echo "iOS ARMv7 cross compilation done:"
@ls -l $(GOBIN)/geth-ios-* | grep arm-7 @ls -l $(GOBIN)/gexp-ios-* | grep arm-7
geth-ios-arm64: xgo gexp-ios-arm64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=ios-7.0/arm64 -v $(shell build/flags.sh) ./cmd/geth build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=ios-7.0/arm64 -v $(shell build/flags.sh) ./cmd/gexp
@echo "iOS ARM64 cross compilation done:" @echo "iOS ARM64 cross compilation done:"
@ls -l $(GOBIN)/geth-ios-* | grep arm64 @ls -l $(GOBIN)/gexp-ios-* | grep arm64
evm: evm:
build/env.sh $(GOROOT)/bin/go install -v $(shell build/flags.sh) ./cmd/evm build/env.sh $(GOROOT)/bin/go install -v $(shell build/flags.sh) ./cmd/evm

View file

@ -1,73 +1,74 @@
## Ethereum Go ## Expanse Go
Official golang implementation of the Ethereum protocol Expanse Go Client, by Christopher Franko (forked from Jeffrey Wilcke (and some other people)'s Expanse Go client).
| Linux | OSX | ARM | Windows | Tests | Linux | OSX | ARM | Windows | Tests
----------|---------|-----|-----|---------|------ ----------|---------|-----|-----|---------|------
develop | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/Linux%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/OSX%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20develop%20branch)](https://build.ethdev.com/builders/ARM%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20develop%20branch)](https://build.ethdev.com/builders/Windows%20Go%20develop%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/ethereum/go-ethereum.svg?branch=develop)](https://travis-ci.org/ethereum/go-ethereum) [![codecov.io](http://codecov.io/github/ethereum/go-ethereum/coverage.svg?branch=develop)](http://codecov.io/github/ethereum/go-ethereum?branch=develop) develop | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/Linux%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/OSX%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20develop%20branch)](https://build.ethdev.com/builders/ARM%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20develop%20branch)](https://build.ethdev.com/builders/Windows%20Go%20develop%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/expanse-project/go-expanse.svg?branch=develop)](https://travis-ci.org/expanse/go-expanse) [![Coverage Status](https://coveralls.io/repos/expanse-project/go-expanse/badge.svg?branch=develop)](https://coveralls.io/r/expanse/go-expanse?branch=develop)
master | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20master%20branch)](https://build.ethdev.com/builders/Linux%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=OSX%20Go%20master%20branch)](https://build.ethdev.com/builders/OSX%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20master%20branch)](https://build.ethdev.com/builders/ARM%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20master%20branch)](https://build.ethdev.com/builders/Windows%20Go%20master%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/ethereum/go-ethereum.svg?branch=master)](https://travis-ci.org/ethereum/go-ethereum) [![codecov.io](http://codecov.io/github/ethereum/go-ethereum/coverage.svg?branch=master)](http://codecov.io/github/ethereum/go-ethereum?branch=master) master | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20master%20branch)](https://build.ethdev.com/builders/Linux%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=OSX%20Go%20master%20branch)](https://build.ethdev.com/builders/OSX%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20master%20branch)](https://build.ethdev.com/builders/ARM%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20master%20branch)](https://build.ethdev.com/builders/Windows%20Go%20master%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/expanse-project/go-expanse.svg?branch=master)](https://travis-ci.org/expanse-project/go-expanse) [![Coverage Status](https://coveralls.io/repos/expanse-project/go-expanse/badge.svg?branch=master)](https://coveralls.io/r/expanse-project/go-expanse?branch=master)
[![API Reference]( [![Bugs](https://badge.waffle.io/expanse-project/go-expanse.png?label=bug&title=Bugs)](https://waffle.io/expanse/go-expanse)
https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667 [![Stories in Ready](https://badge.waffle.io/expanse-project/go-expanse.png?label=ready&title=Ready)](https://waffle.io/expanse/go-expanse)
)](https://godoc.org/github.com/ethereum/go-ethereum) [![Stories in Progress](https://badge.waffle.io/expanse-project/go-expanse.svg?label=in%20progress&title=In Progress)](http://waffle.io/expanse/go-expanse)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/expanse/go-expanse?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
## Automated development builds ## Automated development builds
The following builds are build automatically by our build servers after each push to the [develop](https://github.com/ethereum/go-ethereum/tree/develop) branch. The following builds are build automatically by our build servers after each push to the [develop](https://github.com/expanse-project/go-expanse/tree/develop) branch.
* [Docker](https://registry.hub.docker.com/u/ethereum/client-go/) * [Docker](https://registry.hub.docker.com/u/expanse/go-expanse/)
* [OS X](http://build.ethdev.com/builds/OSX%20Go%20develop%20branch/Mist-OSX-latest.dmg) * [OS X](http://build.ethdev.com/builds/OSX%20Go%20develop%20branch/Mist-OSX-latest.dmg)
* Ubuntu * Ubuntu
[trusty](https://build.ethdev.com/builds/Linux%20Go%20develop%20deb%20i386-trusty/latest/) | [trusty](https://build.ethdev.com/builds/Linux%20Go%20develop%20deb%20i386-trusty/latest/) |
[utopic](https://build.ethdev.com/builds/Linux%20Go%20develop%20deb%20i386-utopic/latest/) [utopic](https://build.ethdev.com/builds/Linux%20Go%20develop%20deb%20i386-utopic/latest/)
* [Windows 64-bit](https://build.ethdev.com/builds/Windows%20Go%20develop%20branch/Geth-Win64-latest.zip) * [Windows 64-bit](https://build.ethdev.com/builds/Windows%20Go%20develop%20branch/Gexp-Win64-latest.zip)
* [ARM](https://build.ethdev.com/builds/ARM%20Go%20develop%20branch/geth-ARM-latest.tar.bz2) * [ARM](https://build.ethdev.com/builds/ARM%20Go%20develop%20branch/gexp-ARM-latest.tar.bz2)
## Building the source ## Building the source
For prerequisites and detailed build instructions please read the For prerequisites and detailed build instructions please read the
[Installation Instructions](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum) [Installation Instructions](https://github.com/expanse-project/go-expanse/wiki/Building-Expanse)
on the wiki. on the wiki.
Building geth requires both a Go and a C compiler. Building gexp requires both a Go and a C compiler.
You can install them using your favourite package manager. You can install them using your favourite package manager.
Once the dependencies are installed, run Once the dependencies are installed, run
make geth make gexp
## Executables ## Executables
Go Ethereum comes with several wrappers/executables found in Go Expanse comes with several wrappers/executables found in
[the `cmd` directory](https://github.com/ethereum/go-ethereum/tree/develop/cmd): [the `cmd` directory](https://github.com/expanse-project/go-expanse/tree/develop/cmd):
Command | | * `gexp` Expanse CLI (expanse command line interface client)
----------|---------| * `bootnode` runs a bootstrap node for the Discovery Protocol
`geth` | Ethereum CLI (ethereum command line interface client) | * `exptest` test tool which runs with the [tests](https://github.com/expanse-project/tests) suite:
`bootnode` | runs a bootstrap node for the Discovery Protocol | `/path/to/test.json > exptest --test BlockTests --stdin`.
`ethtest` | test tool which runs with the [tests](https://github.com/ethereum/tests) suite: `/path/to/test.json > ethtest --test BlockTests --stdin`. * `evm` is a generic Expanse 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.
`disasm` | disassembles EVM code: `echo "6001" | disasm` | * `disasm` disassembles EVM code: `echo "6001" | disasm`
`rlpdump` | prints RLP structures | * `rlpdump` prints RLP structures
## Command line options ## Command line options
`geth` can be configured via command line options, environment variables and config files. `gexp` can be configured via command line options, environment variables and config files.
To get the options available: To get the options available:
geth help geth help
For further details on options, see the [wiki](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) For further details on options, see the [wiki](https://github.com/expanse-project/go-expanse/wiki/Command-Line-Options)
## Contribution ## Contribution
If you'd like to contribute to go-ethereum please fork, fix, commit and If you'd like to contribute to go-expanse 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.
See [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide) See [Developers' Guide](https://github.com/expanse-project/go-expanse/wiki/Developers'-Guide)
for more details on configuring your environment, testing, and for more details on configuring your environment, testing, and
dependency management. dependency management.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package abi package abi
@ -22,7 +22,7 @@ import (
"io" "io"
"strings" "strings"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
) )
// Callable method given a `Name` and whether the method is a constant. // Callable method given a `Name` and whether the method is a constant.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package abi package abi
@ -25,8 +25,8 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
) )
const jsondata = ` const jsondata = `

View file

@ -1,23 +1,23 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
// Package abi implements the Ethereum ABI (Application Binary // Package abi implements the Expanse ABI (Application Binary
// Interface). // Interface).
// //
// The Ethereum ABI is strongly typed, known at compile time // The Expanse ABI is strongly typed, known at compile time
// and static. This ABI will handle basic type casting; unsigned // and static. This ABI will handle basic type casting; unsigned
// to signed and visa versa. It does not handle slice casting such // to signed and visa versa. It does not handle slice casting such
// as unsigned slice to signed slice. Bit size type casting is also // as unsigned slice to signed slice. Bit size type casting is also

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package abi package abi
@ -20,7 +20,7 @@ import (
"math/big" "math/big"
"reflect" "reflect"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
) )
var big_t = reflect.TypeOf(&big.Int{}) var big_t = reflect.TypeOf(&big.Int{})

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package abi package abi

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package abi package abi
@ -22,7 +22,7 @@ import (
"regexp" "regexp"
"strconv" "strconv"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
) )
const ( const (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
// Package implements a private key management facility. // Package implements a private key management facility.
// //
@ -31,8 +31,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
) )
var ( var (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package accounts package accounts
@ -22,7 +22,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
) )
var testSigData = make([]byte, 32) var testSigData = make([]byte, 32)
@ -142,7 +142,7 @@ func TestSignRace(t *testing.T) {
} }
func tmpKeyStore(t *testing.T, new func(string) crypto.KeyStore) (string, crypto.KeyStore) { func tmpKeyStore(t *testing.T, new func(string) crypto.KeyStore) (string, crypto.KeyStore) {
d, err := ioutil.TempDir("", "eth-keystore-test") d, err := ioutil.TempDir("", "exp-keystore-test")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View file

@ -10,23 +10,23 @@ fi
# Create fake Go workspace if it doesn't exist yet. # Create fake Go workspace if it doesn't exist yet.
workspace="$PWD/build/_workspace" workspace="$PWD/build/_workspace"
root="$PWD" root="$PWD"
ethdir="$workspace/src/github.com/ethereum" ethdir="$workspace/src/github.com/expanse-project"
if [ ! -L "$ethdir/go-ethereum" ]; then if [ ! -L "$ethdir/go-expanse" ]; then
mkdir -p "$ethdir" mkdir -p "$ethdir"
cd "$ethdir" cd "$ethdir"
ln -s ../../../../../. go-ethereum ln -s ../../../../../. go-expanse
cd "$root" cd "$root"
fi fi
# Set up the environment to use the workspace. # Set up the environment to use the workspace.
# Also add Godeps workspace so we build using canned dependencies. # Also add Godeps workspace so we build using canned dependencies.
GOPATH="$ethdir/go-ethereum/Godeps/_workspace:$workspace" GOPATH="$ethdir/go-expanse/Godeps/_workspace:$workspace"
GOBIN="$PWD/build/bin" GOBIN="$PWD/build/bin"
export GOPATH GOBIN export GOPATH GOBIN
# Run the command inside the workspace. # Run the command inside the workspace.
cd "$ethdir/go-ethereum" cd "$ethdir/go-expanse"
PWD="$ethdir/go-ethereum" PWD="$ethdir/go-expanse"
# Launch the arguments with the configured environment. # Launch the arguments with the configured environment.
exec "$@" exec "$@"

View file

@ -60,13 +60,13 @@ var (
licenseCommentRE = regexp.MustCompile(`^//\s*(Copyright|This file is part of).*?\n(?://.*?\n)*\n*`) licenseCommentRE = regexp.MustCompile(`^//\s*(Copyright|This file is part of).*?\n(?://.*?\n)*\n*`)
// this text appears at the start of AUTHORS // this text appears at the start of AUTHORS
authorsFileHeader = "# This is the official list of go-ethereum authors for copyright purposes.\n\n" authorsFileHeader = "# This is the official list of go-expanse authors for copyright purposes.\n\n"
) )
// this template generates the license comment. // this template generates the license comment.
// its input is an info structure. // its input is an info structure.
var licenseT = template.Must(template.New("").Parse(` var licenseT = template.Must(template.New("").Parse(`
// Copyright {{.Year}} The go-ethereum Authors // Copyright {{.Year}} The go-expanse Authors
// This file is part of {{.Whole false}}. // This file is part of {{.Whole false}}.
// //
// {{.Whole true}} is free software: you can redistribute it and/or modify // {{.Whole true}} is free software: you can redistribute it and/or modify
@ -105,12 +105,12 @@ func (i info) ShortLicense() string {
func (i info) Whole(startOfSentence bool) string { func (i info) Whole(startOfSentence bool) string {
if i.gpl() { if i.gpl() {
return "go-ethereum" return "go-expanse"
} }
if startOfSentence { if startOfSentence {
return "The go-ethereum library" return "The go-expanse library"
} }
return "the go-ethereum library" return "the go-expanse library"
} }
func (i info) gpl() bool { func (i info) gpl() bool {

View file

@ -1,20 +1,20 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// bootnode runs a bootstrap node for the Ethereum Discovery Protocol. // bootnode runs a bootstrap node for the Expanse Discovery Protocol.
package main package main
import ( import (
@ -26,15 +26,15 @@ import (
"log" "log"
"os" "os"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
"github.com/ethereum/go-ethereum/logger" "github.com/expanse-project/go-expanse/logger"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/expanse-project/go-expanse/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/nat" "github.com/expanse-project/go-expanse/p2p/nat"
) )
func main() { func main() {
var ( var (
listenAddr = flag.String("addr", ":30301", "listen address") listenAddr = flag.String("addr", ":42787", "listen address")
genKey = flag.String("genkey", "", "generate a node key and quit") genKey = flag.String("genkey", "", "generate a node key and quit")
nodeKeyFile = flag.String("nodekey", "", "private key filename") nodeKeyFile = flag.String("nodekey", "", "private key filename")
nodeKeyHex = flag.String("nodekeyhex", "", "private key as hex (for testing)") nodeKeyHex = flag.String("nodekeyhex", "", "private key as hex (for testing)")

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// disasm is a pretty-printer for EVM bytecode. // disasm is a pretty-printer for EVM bytecode.
package main package main
@ -22,8 +22,8 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/core/vm" "github.com/expanse-project/go-expanse/core/vm"
) )
func main() { func main() {

View file

@ -10,7 +10,7 @@
*un~ *un~
.DS_Store .DS_Store
*/**/.DS_Store */**/.DS_Store
ethereum/ethereum expanse/expanse
ethereal/ethereal ethereal/ethereal
example/js example/js
node_modules node_modules

View file

@ -1,20 +1,20 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// ethtest executes Ethereum JSON tests. // exptest executes Expanse JSON tests.
package main package main
import ( import (
@ -26,9 +26,9 @@ import (
"strings" "strings"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/core/vm" "github.com/expanse-project/go-expanse/core/vm"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/expanse-project/go-expanse/logger/glog"
"github.com/ethereum/go-ethereum/tests" "github.com/expanse-project/go-expanse/tests"
) )
var ( var (
@ -49,7 +49,7 @@ var (
Name: "file", Name: "file",
Usage: "Test file or directory. Directories are searched for .json files 1 level deep", Usage: "Test file or directory. Directories are searched for .json files 1 level deep",
Value: defaultDir, Value: defaultDir,
EnvVar: "ETHEREUM_TEST_PATH", EnvVar: "EXPANSE_TEST_PATH",
} }
ContinueOnErrorFlag = cli.BoolFlag{ ContinueOnErrorFlag = cli.BoolFlag{
Name: "continue", Name: "continue",
@ -204,11 +204,11 @@ func main() {
glog.SetToStderr(true) glog.SetToStderr(true)
app := cli.NewApp() app := cli.NewApp()
app.Name = "ethtest" app.Name = "exptest"
app.Usage = "go-ethereum test interface" app.Usage = "go-expanse test interface"
app.Action = setupApp app.Action = setupApp
app.Version = "0.2.0" app.Version = "0.2.0"
app.Author = "go-ethereum team" app.Author = "go-expanse team"
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
TestFlag, TestFlag,

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// evm executes EVM code snippets. // evm executes EVM code snippets.
package main package main
@ -25,14 +25,14 @@ import (
"time" "time"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/expanse-project/go-expanse/cmd/utils"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/core" "github.com/expanse-project/go-expanse/core"
"github.com/ethereum/go-ethereum/core/state" "github.com/expanse-project/go-expanse/core/state"
"github.com/ethereum/go-ethereum/core/types" "github.com/expanse-project/go-expanse/core/types"
"github.com/ethereum/go-ethereum/core/vm" "github.com/expanse-project/go-expanse/core/vm"
"github.com/ethereum/go-ethereum/ethdb" "github.com/expanse-project/go-expanse/ethdb"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/expanse-project/go-expanse/logger/glog"
) )
var ( var (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main package main
@ -21,10 +21,10 @@ import (
"os" "os"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/expanse-project/go-expanse/cmd/utils"
"github.com/ethereum/go-ethereum/eth" "github.com/expanse-project/go-expanse/exp"
"github.com/ethereum/go-ethereum/ethdb" "github.com/expanse-project/go-expanse/ethdb"
"github.com/ethereum/go-ethereum/tests" "github.com/expanse-project/go-expanse/tests"
) )
var blocktestCommand = cli.Command{ var blocktestCommand = cli.Command{
@ -56,7 +56,7 @@ func runBlockTest(ctx *cli.Context) {
file, testname = args[0], args[1] file, testname = args[0], args[1]
rpc = true rpc = true
default: default:
utils.Fatalf(`Usage: ethereum blocktest <path-to-test-file> [ <test-name> [ "rpc" ] ]`) utils.Fatalf(`Usage: expanse blocktest <path-to-test-file> [ <test-name> [ "rpc" ] ]`)
} }
bt, err := tests.LoadBlockTests(file) bt, err := tests.LoadBlockTests(file)
if err != nil { if err != nil {
@ -68,15 +68,15 @@ func runBlockTest(ctx *cli.Context) {
ecode := 0 ecode := 0
for name, test := range bt { for name, test := range bt {
fmt.Printf("----------------- Running Block Test %q\n", name) fmt.Printf("----------------- Running Block Test %q\n", name)
ethereum, err := runOneBlockTest(ctx, test) expanse, err := runOneBlockTest(ctx, test)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
fmt.Println("FAIL") fmt.Println("FAIL")
ecode = 1 ecode = 1
} }
if ethereum != nil { if expanse != nil {
ethereum.Stop() expanse.Stop()
ethereum.WaitForShutdown() expanse.WaitForShutdown()
} }
} }
os.Exit(ecode) os.Exit(ecode)
@ -87,49 +87,53 @@ func runBlockTest(ctx *cli.Context) {
if !ok { if !ok {
utils.Fatalf("Test file does not contain test named %q", testname) utils.Fatalf("Test file does not contain test named %q", testname)
} }
ethereum, err := runOneBlockTest(ctx, test) expanse, err := runOneBlockTest(ctx, test)
if err != nil { if err != nil {
utils.Fatalf("%v", err) utils.Fatalf("%v", err)
} }
if rpc { if rpc {
fmt.Println("Block Test post state validated, starting RPC interface.") fmt.Println("Block Test post state validated, starting RPC interface.")
startEth(ctx, ethereum) startEth(ctx, expanse)
utils.StartRPC(ethereum, ctx) utils.StartRPC(expanse, ctx)
ethereum.WaitForShutdown() expanse.WaitForShutdown()
} }
} }
func runOneBlockTest(ctx *cli.Context, test *tests.BlockTest) (*eth.Ethereum, error) { func runOneBlockTest(ctx *cli.Context, test *tests.BlockTest) (*exp.Expanse, error) {
cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx) cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
db, _ := ethdb.NewMemDatabase() db, _ := ethdb.NewMemDatabase()
cfg.NewDB = func(path string) (ethdb.Database, error) { return db, nil } cfg.NewDB = func(path string) (ethdb.Database, error) { return db, nil }
cfg.MaxPeers = 0 // disable network cfg.MaxPeers = 0 // disable network
cfg.Shh = false // disable whisper cfg.Shh = false // disable whisper
cfg.NAT = nil // disable port mapping cfg.NAT = nil // disable port mapping
ethereum, err := eth.New(cfg)
expanse, err := exp.New(cfg)
if err != nil { if err != nil {
return nil, err return nil, err
} }
// import the genesis block // import the genesis block
ethereum.ResetWithGenesisBlock(test.Genesis) expanse.ResetWithGenesisBlock(test.Genesis)
// import pre accounts // import pre accounts
_, err = test.InsertPreState(db, cfg.AccountManager) _, err = test.InsertPreState(db, cfg.AccountManager)
if err != nil { if err != nil {
return ethereum, fmt.Errorf("InsertPreState: %v", err) return expanse, fmt.Errorf("InsertPreState: %v", err)
} }
cm := ethereum.BlockChain() cm := expanse.BlockChain()
validBlocks, err := test.TryBlocksInsert(cm) validBlocks, err := test.TryBlocksInsert(cm)
if err != nil { if err != nil {
return ethereum, fmt.Errorf("Block Test load error: %v", err) return expanse, fmt.Errorf("Block Test load error: %v", err)
} }
newDB, err := cm.State() newDB, err := cm.State()
if err != nil { if err != nil {
return ethereum, fmt.Errorf("Block Test get state error: %v", err) return expanse, fmt.Errorf("Block Test get state error: %v", err)
} }
if err := test.ValidatePostState(newDB); err != nil { if err := test.ValidatePostState(newDB); err != nil {
return ethereum, fmt.Errorf("post state validation failed: %v", err) return expanse, fmt.Errorf("post state validation failed: %v", err)
} }
return ethereum, test.ValidateImportedHeaders(cm, validBlocks) return expanse, test.ValidateImportedHeaders(cm, validBlocks)
} }

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main package main
@ -24,13 +24,14 @@ import (
"time" "time"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/cmd/utils"
"github.com/ethereum/go-ethereum/core" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/core/state" "github.com/expanse-project/go-expanse/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/expanse-project/go-expanse/core/state"
"github.com/ethereum/go-ethereum/ethdb" "github.com/expanse-project/go-expanse/core/types"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/expanse-project/go-expanse/ethdb"
"github.com/expanse-project/go-expanse/logger/glog"
) )
var ( var (
@ -66,7 +67,7 @@ if already existing.
Usage: `dump a specific block from storage`, Usage: `dump a specific block from storage`,
Description: ` Description: `
The arguments are interpreted as block numbers or hashes. The arguments are interpreted as block numbers or hashes.
Use "ethereum dump 0" to dump the genesis block. Use "expanse dump 0" to dump the genesis block.
`, `,
} }
) )

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main package main
@ -28,18 +28,18 @@ import (
"sort" "sort"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/expanse-project/go-expanse/cmd/utils"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/common/natspec" "github.com/expanse-project/go-expanse/common/natspec"
"github.com/ethereum/go-ethereum/common/registrar" "github.com/expanse-project/go-expanse/common/registrar"
"github.com/ethereum/go-ethereum/eth" "github.com/expanse-project/go-expanse/exp"
re "github.com/ethereum/go-ethereum/jsre" re "github.com/expanse-project/go-expanse/jsre"
"github.com/ethereum/go-ethereum/rpc" "github.com/expanse-project/go-expanse/rpc"
"github.com/ethereum/go-ethereum/rpc/api" "github.com/expanse-project/go-expanse/rpc/api"
"github.com/ethereum/go-ethereum/rpc/codec" "github.com/expanse-project/go-expanse/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms" "github.com/expanse-project/go-expanse/rpc/comms"
"github.com/ethereum/go-ethereum/rpc/shared" "github.com/expanse-project/go-expanse/rpc/shared"
"github.com/ethereum/go-ethereum/xeth" "github.com/expanse-project/go-expanse/xeth"
"github.com/peterh/liner" "github.com/peterh/liner"
"github.com/robertkrimen/otto" "github.com/robertkrimen/otto"
) )
@ -77,13 +77,13 @@ func (r dumbterm) AppendHistory(string) {}
type jsre struct { type jsre struct {
re *re.JSRE re *re.JSRE
ethereum *eth.Ethereum expanse *exp.Expanse
xeth *xeth.XEth xeth *xeth.XEth
wait chan *big.Int wait chan *big.Int
ps1 string ps1 string
atexit func() atexit func()
corsDomain string corsDomain string
client comms.EthereumClient client comms.ExpanseClient
prompter prompter
} }
@ -146,7 +146,9 @@ func apiWordCompleter(line string, pos int) (head string, completions []string,
return begin, completionWords, end return begin, completionWords, end
} }
func newLightweightJSRE(docRoot string, client comms.EthereumClient, datadir string, interactive bool) *jsre {
func newLightweightJSRE(docRoot string, client comms.ExpanseClient, datadir string, interactive bool) *jsre {
js := &jsre{ps1: "> "} js := &jsre{ps1: "> "}
js.wait = make(chan *big.Int) js.wait = make(chan *big.Int)
js.client = client js.client = client
@ -176,18 +178,22 @@ func newLightweightJSRE(docRoot string, client comms.EthereumClient, datadir str
return js return js
} }
func newJSRE(ethereum *eth.Ethereum, docRoot, corsDomain string, client comms.EthereumClient, interactive bool, f xeth.Frontend) *jsre {
js := &jsre{ethereum: ethereum, ps1: "> "} func newJSRE(expanse *exp.Expanse, docRoot, corsDomain string, client comms.ExpanseClient, interactive bool, f xeth.Frontend) *jsre {
js := &jsre{expanse: expanse, ps1: "> "}
// set default cors domain used by startRpc from CLI flag // set default cors domain used by startRpc from CLI flag
js.corsDomain = corsDomain js.corsDomain = corsDomain
if f == nil { if f == nil {
f = js f = js
} }
js.xeth = xeth.New(ethereum, f)
js.xeth = xeth.New(expanse, f)
js.wait = js.xeth.UpdateState() js.wait = js.xeth.UpdateState()
js.client = client js.client = client
if clt, ok := js.client.(*comms.InProcClient); ok { if clt, ok := js.client.(*comms.InProcClient); ok {
if offeredApis, err := api.ParseApiString(shared.AllApis, codec.JSON, js.xeth, ethereum); err == nil { if offeredApis, err := api.ParseApiString(shared.AllApis, codec.JSON, js.xeth, expanse); err == nil {
clt.Initialize(api.Merge(offeredApis...)) clt.Initialize(api.Merge(offeredApis...))
} }
} }
@ -202,14 +208,14 @@ func newJSRE(ethereum *eth.Ethereum, docRoot, corsDomain string, client comms.Et
js.prompter = dumbterm{bufio.NewReader(os.Stdin)} js.prompter = dumbterm{bufio.NewReader(os.Stdin)}
} else { } else {
lr := liner.NewLiner() lr := liner.NewLiner()
js.withHistory(ethereum.DataDir, func(hist *os.File) { lr.ReadHistory(hist) }) js.withHistory(expanse.DataDir, func(hist *os.File) { lr.ReadHistory(hist) })
lr.SetCtrlCAborts(true) lr.SetCtrlCAborts(true)
js.loadAutoCompletion() js.loadAutoCompletion()
lr.SetWordCompleter(apiWordCompleter) lr.SetWordCompleter(apiWordCompleter)
lr.SetTabCompletionStyle(liner.TabPrints) lr.SetTabCompletionStyle(liner.TabPrints)
js.prompter = lr js.prompter = lr
js.atexit = func() { js.atexit = func() {
js.withHistory(ethereum.DataDir, func(hist *os.File) { hist.Truncate(0); lr.WriteHistory(hist) }) js.withHistory(expanse.DataDir, func(hist *os.File) { hist.Truncate(0); lr.WriteHistory(hist) })
lr.Close() lr.Close()
close(js.wait) close(js.wait)
} }
@ -240,17 +246,19 @@ func (self *jsre) batch(statement string) {
self.re.Stop(false) self.re.Stop(false)
} }
// show summary of current geth instance // show summary of current gexp instance
func (self *jsre) welcome() { func (self *jsre) welcome() {
self.re.Run(` self.re.Run(`
(function () { (function () {
console.log('instance: ' + web3.version.client); console.log('instance: ' + web3.version.client);
console.log(' datadir: ' + admin.datadir); console.log(' datadir: ' + admin.datadir);
console.log("coinbase: " + eth.coinbase); console.log("coinbase: " + exp.coinbase);
var ts = 1000 * eth.getBlock(eth.blockNumber).timestamp; var ts = 1000 * exp.getBlock(exp.blockNumber).timestamp;
console.log("at block: " + eth.blockNumber + " (" + new Date(ts) + ")"); console.log("at block: " + exp.blockNumber + " (" + new Date(ts) + ")");
})(); })();
`) `)
if modules, err := self.supportedApis(); err == nil { if modules, err := self.supportedApis(); err == nil {
loadedModules := make([]string, 0) loadedModules := make([]string, 0)
for api, version := range modules { for api, version := range modules {
@ -276,7 +284,7 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
apiNames = append(apiNames, a) apiNames = append(apiNames, a)
} }
apiImpl, err := api.ParseApiString(strings.Join(apiNames, ","), codec.JSON, js.xeth, js.ethereum) apiImpl, err := api.ParseApiString(strings.Join(apiNames, ","), codec.JSON, js.xeth, js.expanse)
if err != nil { if err != nil {
utils.Fatalf("Unable to determine supported api's: %v", err) utils.Fatalf("Unable to determine supported api's: %v", err)
} }
@ -294,7 +302,7 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
utils.Fatalf("Error loading bignumber.js: %v", err) utils.Fatalf("Error loading bignumber.js: %v", err)
} }
err = js.re.Compile("ethereum.js", re.Web3_JS) err = js.re.Compile("expanse.js", re.Web3_JS)
if err != nil { if err != nil {
utils.Fatalf("Error loading web3.js: %v", err) utils.Fatalf("Error loading web3.js: %v", err)
} }
@ -310,7 +318,7 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
} }
// load only supported API's in javascript runtime // load only supported API's in javascript runtime
shortcuts := "var eth = web3.eth; " shortcuts := "var exp = web3.exp; "
for _, apiName := range apiNames { for _, apiName := range apiNames {
if apiName == shared.Web3ApiName { if apiName == shared.Web3ApiName {
continue // manually mapped continue // manually mapped
@ -329,7 +337,9 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
utils.Fatalf("Error setting namespaces: %v", err) utils.Fatalf("Error setting namespaces: %v", err)
} }
js.re.Run(`var GlobalRegistrar = eth.contract(` + registrar.GlobalRegistrarAbi + `); registrar = GlobalRegistrar.at("` + registrar.GlobalRegistrarAddr + `");`)
js.re.Run(`var GlobalRegistrar = exp.contract(` + registrar.GlobalRegistrarAbi + `); registrar = GlobalRegistrar.at("` + registrar.GlobalRegistrarAddr + `");`)
return nil return nil
} }
@ -342,8 +352,9 @@ func (self *jsre) AskPassword() (string, bool) {
} }
func (self *jsre) ConfirmTransaction(tx string) bool { func (self *jsre) ConfirmTransaction(tx string) bool {
if self.ethereum.NatSpec {
notice := natspec.GetNotice(self.xeth, tx, self.ethereum.HTTPClient()) if self.expanse.NatSpec {
notice := natspec.GetNotice(self.xeth, tx, self.expanse.HTTPClient())
fmt.Println(notice) fmt.Println(notice)
answer, _ := self.Prompt("Confirm Transaction [y/n]") answer, _ := self.Prompt("Confirm Transaction [y/n]")
return strings.HasPrefix(strings.Trim(answer, " "), "y") return strings.HasPrefix(strings.Trim(answer, " "), "y")
@ -359,7 +370,7 @@ func (self *jsre) UnlockAccount(addr []byte) bool {
return false return false
} }
// TODO: allow retry // TODO: allow retry
if err := self.ethereum.AccountManager().Unlock(common.BytesToAddress(addr), pass); err != nil { if err := self.expanse.AccountManager().Unlock(common.BytesToAddress(addr), pass); err != nil {
return false return false
} else { } else {
fmt.Println("Account is now unlocked for this session.") fmt.Println("Account is now unlocked for this session.")
@ -437,6 +448,7 @@ func mustLogInHistory(input string) bool {
!leadingSpace.MatchString(input) !leadingSpace.MatchString(input)
} }
func (self *jsre) withHistory(datadir string, op func(*os.File)) { func (self *jsre) withHistory(datadir string, op func(*os.File)) {
hist, err := os.OpenFile(filepath.Join(datadir, "history"), os.O_RDWR|os.O_CREATE, os.ModePerm) hist, err := os.OpenFile(filepath.Join(datadir, "history"), os.O_RDWR|os.O_CREATE, os.ModePerm)
if err != nil { if err != nil {

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main package main
@ -28,18 +28,19 @@ import (
"testing" "testing"
"time" "time"
"github.com/ethereum/go-ethereum/accounts" "github.com/expanse-project/go-expanse/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/common/compiler" "github.com/expanse-project/go-expanse/common/compiler"
"github.com/ethereum/go-ethereum/common/httpclient" "github.com/expanse-project/go-expanse/common/httpclient"
"github.com/ethereum/go-ethereum/common/natspec" "github.com/expanse-project/go-expanse/common/natspec"
"github.com/ethereum/go-ethereum/common/registrar" "github.com/expanse-project/go-expanse/common/registrar"
"github.com/ethereum/go-ethereum/core" "github.com/expanse-project/go-expanse/core"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
"github.com/ethereum/go-ethereum/eth" "github.com/expanse-project/go-expanse/exp"
"github.com/ethereum/go-ethereum/ethdb" "github.com/expanse-project/go-expanse/ethdb"
"github.com/ethereum/go-ethereum/rpc/codec" "github.com/expanse-project/go-expanse/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms" "github.com/expanse-project/go-expanse/rpc/comms"
) )
const ( const (
@ -66,7 +67,7 @@ type testjethre struct {
} }
func (self *testjethre) UnlockAccount(acc []byte) bool { func (self *testjethre) UnlockAccount(acc []byte) bool {
err := self.ethereum.AccountManager().Unlock(common.BytesToAddress(acc), "") err := self.expanse.AccountManager().Unlock(common.BytesToAddress(acc), "")
if err != nil { if err != nil {
panic("unable to unlock") panic("unable to unlock")
} }
@ -74,18 +75,18 @@ func (self *testjethre) UnlockAccount(acc []byte) bool {
} }
func (self *testjethre) ConfirmTransaction(tx string) bool { func (self *testjethre) ConfirmTransaction(tx string) bool {
if self.ethereum.NatSpec { if self.expanse.NatSpec {
self.lastConfirm = natspec.GetNotice(self.xeth, tx, self.client) self.lastConfirm = natspec.GetNotice(self.xeth, tx, self.client)
} }
return true return true
} }
func testJEthRE(t *testing.T) (string, *testjethre, *eth.Ethereum) { func testJEthRE(t *testing.T) (string, *testjethre, *exp.Expanse) {
return testREPL(t, nil) return testREPL(t, nil)
} }
func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth.Ethereum) { func testREPL(t *testing.T, config func(*exp.Config)) (string, *testjethre, *exp.Expanse) {
tmp, err := ioutil.TempDir("", "geth-test") tmp, err := ioutil.TempDir("", "gexp-test")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -95,7 +96,7 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth
core.WriteGenesisBlockForTesting(db, core.GenesisAccount{common.HexToAddress(testAddress), common.String2Big(testBalance)}) core.WriteGenesisBlockForTesting(db, core.GenesisAccount{common.HexToAddress(testAddress), common.String2Big(testBalance)})
ks := crypto.NewKeyStorePlain(filepath.Join(tmp, "keystore")) ks := crypto.NewKeyStorePlain(filepath.Join(tmp, "keystore"))
am := accounts.NewManager(ks) am := accounts.NewManager(ks)
conf := &eth.Config{ conf := &exp.Config{
NodeKey: testNodeKey, NodeKey: testNodeKey,
DataDir: tmp, DataDir: tmp,
AccountManager: am, AccountManager: am,
@ -109,7 +110,7 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth
if config != nil { if config != nil {
config(conf) config(conf)
} }
ethereum, err := eth.New(conf) expanse, err := exp.New(conf)
if err != nil { if err != nil {
t.Fatal("%v", err) t.Fatal("%v", err)
} }
@ -129,21 +130,22 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth
t.Fatal(err) t.Fatal(err)
} }
assetPath := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "cmd", "mist", "assets", "ext") assetPath := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "expanse", "go-expanse", "cmd", "mist", "assets", "ext")
client := comms.NewInProcClient(codec.JSON) client := comms.NewInProcClient(codec.JSON)
tf := &testjethre{client: ethereum.HTTPClient()}
repl := newJSRE(ethereum, assetPath, "", client, false, tf) tf := &testjethre{client: expanse.HTTPClient()}
repl := newJSRE(expanse, assetPath, "", client, false, tf)
tf.jsre = repl tf.jsre = repl
return tmp, tf, ethereum return tmp, tf, expanse
} }
func TestNodeInfo(t *testing.T) { func TestNodeInfo(t *testing.T) {
t.Skip("broken after p2p update") t.Skip("broken after p2p update")
tmp, repl, ethereum := testJEthRE(t) tmp, repl, expanse := testJEthRE(t)
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err) t.Fatalf("error starting expanse: %v", err)
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
want := `{"DiscPort":0,"IP":"0.0.0.0","ListenAddr":"","Name":"test","NodeID":"4cb2fc32924e94277bf94b5e4c983beedb2eabd5a0bc941db32202735c6625d020ca14a5963d1738af43b6ac0a711d61b1a06de931a499fe2aa0b1a132a902b5","NodeUrl":"enode://4cb2fc32924e94277bf94b5e4c983beedb2eabd5a0bc941db32202735c6625d020ca14a5963d1738af43b6ac0a711d61b1a06de931a499fe2aa0b1a132a902b5@0.0.0.0:0","TCPPort":0,"Td":"131072"}` want := `{"DiscPort":0,"IP":"0.0.0.0","ListenAddr":"","Name":"test","NodeID":"4cb2fc32924e94277bf94b5e4c983beedb2eabd5a0bc941db32202735c6625d020ca14a5963d1738af43b6ac0a711d61b1a06de931a499fe2aa0b1a132a902b5","NodeUrl":"enode://4cb2fc32924e94277bf94b5e4c983beedb2eabd5a0bc941db32202735c6625d020ca14a5963d1738af43b6ac0a711d61b1a06de931a499fe2aa0b1a132a902b5@0.0.0.0:0","TCPPort":0,"Td":"131072"}`
@ -151,15 +153,15 @@ func TestNodeInfo(t *testing.T) {
} }
func TestAccounts(t *testing.T) { func TestAccounts(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t) tmp, repl, expanse := testJEthRE(t)
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err) t.Fatalf("error starting expanse: %v", err)
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `eth.accounts`, `["`+testAddress+`"]`) checkEvalJSON(t, repl, `exp.accounts`, `["`+testAddress+`"]`)
checkEvalJSON(t, repl, `eth.coinbase`, `"`+testAddress+`"`) checkEvalJSON(t, repl, `exp.coinbase`, `"`+testAddress+`"`)
val, err := repl.re.Run(`personal.newAccount("password")`) val, err := repl.re.Run(`personal.newAccount("password")`)
if err != nil { if err != nil {
t.Errorf("expected no error, got %v", err) t.Errorf("expected no error, got %v", err)
@ -169,26 +171,26 @@ func TestAccounts(t *testing.T) {
t.Errorf("address not hex: %q", addr) t.Errorf("address not hex: %q", addr)
} }
checkEvalJSON(t, repl, `eth.accounts`, `["`+testAddress+`","`+addr+`"]`) checkEvalJSON(t, repl, `exp.accounts`, `["`+testAddress+`","`+addr+`"]`)
} }
func TestBlockChain(t *testing.T) { func TestBlockChain(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t) tmp, repl, expanse := testJEthRE(t)
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err) t.Fatalf("error starting expanse: %v", err)
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
// get current block dump before export/import. // get current block dump before export/import.
val, err := repl.re.Run("JSON.stringify(debug.dumpBlock(eth.blockNumber))") val, err := repl.re.Run("JSON.stringify(debug.dumpBlock(exp.blockNumber))")
if err != nil { if err != nil {
t.Errorf("expected no error, got %v", err) t.Errorf("expected no error, got %v", err)
} }
beforeExport := val.String() beforeExport := val.String()
// do the export // do the export
extmp, err := ioutil.TempDir("", "geth-test-export") extmp, err := ioutil.TempDir("", "gexp-test-export")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -196,7 +198,7 @@ func TestBlockChain(t *testing.T) {
tmpfile := filepath.Join(extmp, "export.chain") tmpfile := filepath.Join(extmp, "export.chain")
tmpfileq := strconv.Quote(tmpfile) tmpfileq := strconv.Quote(tmpfile)
ethereum.BlockChain().Reset() expanse.BlockChain().Reset()
checkEvalJSON(t, repl, `admin.exportChain(`+tmpfileq+`)`, `true`) checkEvalJSON(t, repl, `admin.exportChain(`+tmpfileq+`)`, `true`)
if _, err := os.Stat(tmpfile); err != nil { if _, err := os.Stat(tmpfile); err != nil {
@ -205,57 +207,57 @@ func TestBlockChain(t *testing.T) {
// check import, verify that dumpBlock gives the same result. // check import, verify that dumpBlock gives the same result.
checkEvalJSON(t, repl, `admin.importChain(`+tmpfileq+`)`, `true`) checkEvalJSON(t, repl, `admin.importChain(`+tmpfileq+`)`, `true`)
checkEvalJSON(t, repl, `debug.dumpBlock(eth.blockNumber)`, beforeExport) checkEvalJSON(t, repl, `debug.dumpBlock(exp.blockNumber)`, beforeExport)
} }
func TestMining(t *testing.T) { func TestMining(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t) tmp, repl, expanse := testJEthRE(t)
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err) t.Fatalf("error starting expanse: %v", err)
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `eth.mining`, `false`) checkEvalJSON(t, repl, `exp.mining`, `false`)
} }
func TestRPC(t *testing.T) { func TestRPC(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t) tmp, repl, expanse := testJEthRE(t)
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err) t.Errorf("error starting expanse: %v", err)
return return
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `admin.startRPC("127.0.0.1", 5004, "*", "web3,eth,net")`, `true`) checkEvalJSON(t, repl, `admin.startRPC("127.0.0.1", 5004, "*", "web3,exp,net")`, `true`)
} }
func TestCheckTestAccountBalance(t *testing.T) { func TestCheckTestAccountBalance(t *testing.T) {
t.Skip() // i don't think it tests the correct behaviour here. it's actually testing t.Skip() // i don't think it tests the correct behaviour here. it's actually testing
// internals which shouldn't be tested. This now fails because of a change in the core // internals which shouldn't be tested. This now fails because of a change in the core
// and i have no means to fix this, sorry - @obscuren // and i have no means to fix this, sorry - @obscuren
tmp, repl, ethereum := testJEthRE(t) tmp, repl, expanse := testJEthRE(t)
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err) t.Errorf("error starting expanse: %v", err)
return return
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
repl.re.Run(`primary = "` + testAddress + `"`) repl.re.Run(`primary = "` + testAddress + `"`)
checkEvalJSON(t, repl, `eth.getBalance(primary)`, `"`+testBalance+`"`) checkEvalJSON(t, repl, `exp.getBalance(primary)`, `"`+testBalance+`"`)
} }
func TestSignature(t *testing.T) { func TestSignature(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t) tmp, repl, expanse := testJEthRE(t)
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err) t.Errorf("error starting expanse: %v", err)
return return
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
val, err := repl.re.Run(`eth.sign("` + testAddress + `", "` + testHash + `")`) val, err := repl.re.Run(`exp.sign("` + testAddress + `", "` + testHash + `")`)
// This is a very preliminary test, lacking actual signature verification // This is a very preliminary test, lacking actual signature verification
if err != nil { if err != nil {
@ -275,15 +277,15 @@ func TestSignature(t *testing.T) {
func TestContract(t *testing.T) { func TestContract(t *testing.T) {
t.Skip("contract testing is implemented with mining in ethash test mode. This takes about 7seconds to run. Unskip and run on demand") t.Skip("contract testing is implemented with mining in ethash test mode. This takes about 7seconds to run. Unskip and run on demand")
coinbase := common.HexToAddress(testAddress) coinbase := common.HexToAddress(testAddress)
tmp, repl, ethereum := testREPL(t, func(conf *eth.Config) { tmp, repl, expanse := testREPL(t, func(conf *exp.Config) {
conf.Etherbase = coinbase conf.Etherbase = coinbase
conf.PowTest = true conf.PowTest = true
}) })
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err) t.Errorf("error starting expanse: %v", err)
return return
} }
defer ethereum.Stop() defer expanse.Stop()
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
reg := registrar.New(repl.xeth) reg := registrar.New(repl.xeth)
@ -321,7 +323,7 @@ func TestContract(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("%v", err) t.Fatalf("%v", err)
} }
if checkEvalJSON(t, repl, `primary = eth.accounts[0]`, `"`+testAddress+`"`) != nil { if checkEvalJSON(t, repl, `primary = exp.accounts[0]`, `"`+testAddress+`"`) != nil {
return return
} }
if checkEvalJSON(t, repl, `source = "`+source+`"`, `"`+source+`"`) != nil { if checkEvalJSON(t, repl, `source = "`+source+`"`, `"`+source+`"`) != nil {
@ -346,7 +348,7 @@ func TestContract(t *testing.T) {
t.Errorf("%v", err) t.Errorf("%v", err)
} }
} else { } else {
if checkEvalJSON(t, repl, `contract = eth.compile.solidity(source).test`, string(contractInfo)) != nil { if checkEvalJSON(t, repl, `contract = exp.compile.solidity(source).test`, string(contractInfo)) != nil {
return return
} }
} }
@ -357,7 +359,7 @@ func TestContract(t *testing.T) {
if checkEvalJSON( if checkEvalJSON(
t, repl, t, repl,
`contractaddress = eth.sendTransaction({from: primary, data: contract.code})`, `contractaddress = exp.sendTransaction({from: primary, data: contract.code})`,
`"0x46d69d55c3c4b86a924a92c9fc4720bb7bce1d74"`, `"0x46d69d55c3c4b86a924a92c9fc4720bb7bce1d74"`,
) != nil { ) != nil {
return return
@ -368,7 +370,7 @@ func TestContract(t *testing.T) {
} }
callSetup := `abiDef = JSON.parse('[{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"type":"function"}]'); callSetup := `abiDef = JSON.parse('[{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"type":"function"}]');
Multiply7 = eth.contract(abiDef); Multiply7 = exp.contract(abiDef);
multiply7 = Multiply7.at(contractaddress); multiply7 = Multiply7.at(contractaddress);
` `
_, err = repl.re.Run(callSetup) _, err = repl.re.Run(callSetup)
@ -443,7 +445,7 @@ multiply7 = Multiply7.at(contractaddress);
} }
func pendingTransactions(repl *testjethre, t *testing.T) (txc int64, err error) { func pendingTransactions(repl *testjethre, t *testing.T) (txc int64, err error) {
txs := repl.ethereum.TxPool().GetTransactions() txs := repl.expanse.TxPool().GetTransactions()
return int64(len(txs)), nil return int64(len(txs)), nil
} }
@ -468,12 +470,13 @@ func processTxs(repl *testjethre, t *testing.T, expTxc int) bool {
t.Errorf("incorrect number of pending transactions, expected %v, got %v", expTxc, txc) t.Errorf("incorrect number of pending transactions, expected %v, got %v", expTxc, txc)
return false return false
} }
err = repl.ethereum.StartMining(runtime.NumCPU(), "")
err = repl.expanse.StartMining(runtime.NumCPU(), "")
if err != nil { if err != nil {
t.Errorf("unexpected error mining: %v", err) t.Errorf("unexpected error mining: %v", err)
return false return false
} }
defer repl.ethereum.StopMining() defer repl.expanse.StopMining()
timer := time.NewTimer(100 * time.Second) timer := time.NewTimer(100 * time.Second)
height := new(big.Int).Add(repl.xeth.CurrentBlock().Number(), big.NewInt(1)) height := new(big.Int).Add(repl.xeth.CurrentBlock().Number(), big.NewInt(1))

View file

@ -1,20 +1,20 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// geth is the official command-line client for Ethereum. // gexp is the official command-line client for Expanse.
package main package main
import ( import (
@ -29,25 +29,26 @@ import (
"time" "time"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/ethash" "github.com/expanse-project/ethash"
"github.com/ethereum/go-ethereum/accounts" "github.com/expanse-project/go-expanse/accounts"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/expanse-project/go-expanse/cmd/utils"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/core" "github.com/expanse-project/go-expanse/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/expanse-project/go-expanse/core/types"
"github.com/ethereum/go-ethereum/eth" "github.com/expanse-project/go-expanse/exp"
"github.com/ethereum/go-ethereum/ethdb" "github.com/expanse-project/go-expanse/ethdb"
"github.com/ethereum/go-ethereum/logger" "github.com/expanse-project/go-expanse/logger"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/expanse-project/go-expanse/logger/glog"
"github.com/ethereum/go-ethereum/metrics" "github.com/expanse-project/go-expanse/metrics"
"github.com/ethereum/go-ethereum/params" "github.com/expanse-project/go-expanse/params"
"github.com/ethereum/go-ethereum/rlp" "github.com/expanse-project/go-expanse/rlp"
"github.com/ethereum/go-ethereum/rpc/codec" "github.com/expanse-project/go-expanse/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms" "github.com/expanse-project/go-expanse/rpc/comms"
) )
const ( const (
ClientIdentifier = "Geth"
ClientIdentifier = "Gexp"
Version = "1.3.4" Version = "1.3.4"
VersionMajor = 1 VersionMajor = 1
VersionMinor = 3 VersionMinor = 3
@ -67,7 +68,7 @@ func init() {
nodeNameVersion = Version + "-" + gitCommit[:8] nodeNameVersion = Version + "-" + gitCommit[:8]
} }
app = utils.NewApp(Version, "the go-ethereum command line interface") app = utils.NewApp(Version, "the go-expanse command line interface")
app.Action = run app.Action = run
app.HideVersion = true // we have a command to print the version app.HideVersion = true // we have a command to print the version
app.Commands = []cli.Command{ app.Commands = []cli.Command{
@ -120,7 +121,7 @@ Runs quick benchmark on first GPU found.
{ {
Action: version, Action: version,
Name: "version", Name: "version",
Usage: "print ethereum version numbers", Usage: "print expanse version numbers",
Description: ` Description: `
The output of this command is supposed to be machine-readable. The output of this command is supposed to be machine-readable.
`, `,
@ -128,19 +129,19 @@ The output of this command is supposed to be machine-readable.
{ {
Name: "wallet", Name: "wallet",
Usage: "ethereum presale wallet", Usage: "expanse presale wallet",
Subcommands: []cli.Command{ Subcommands: []cli.Command{
{ {
Action: importWallet, Action: importWallet,
Name: "import", Name: "import",
Usage: "import ethereum presale wallet", Usage: "import expanse presale wallet",
}, },
}, },
Description: ` Description: `
get wallet import /path/to/my/presale.wallet get wallet import /path/to/my/presale.wallet
will prompt for your password and imports your ether presale account. will prompt for your password and imports your expanse presale account.
It can be used non-interactively with the --password option taking a It can be used non-interactively with the --password option taking a
passwordfile as argument containing the wallet password in plaintext. passwordfile as argument containing the wallet password in plaintext.
@ -168,7 +169,7 @@ Note that exporting your key in unencrypted format is NOT supported.
Keys are stored under <DATADIR>/keys. Keys are stored under <DATADIR>/keys.
It is safe to transfer the entire directory or the individual keys therein It is safe to transfer the entire directory or the individual keys therein
between ethereum nodes by simply copying. between expanse nodes by simply copying.
Make sure you backup your keys regularly. Make sure you backup your keys regularly.
In order to use your account to send transactions, you need to unlock them using In order to use your account to send transactions, you need to unlock them using
@ -192,7 +193,7 @@ And finally. DO NOT FORGET YOUR PASSWORD.
Usage: "create a new account", Usage: "create a new account",
Description: ` Description: `
ethereum account new expanse account new
Creates a new account. Prints the address. Creates a new account. Prints the address.
@ -202,7 +203,7 @@ You must remember this passphrase to unlock your account in the future.
For non-interactive use the passphrase can be specified with the --password flag: For non-interactive use the passphrase can be specified with the --password flag:
ethereum --password <passwordfile> account new expanse --password <passwordfile> account new
Note, this is meant to be used for testing only, it is a bad idea to save your Note, this is meant to be used for testing only, it is a bad idea to save your
password to file or expose in any other way. password to file or expose in any other way.
@ -214,7 +215,7 @@ password to file or expose in any other way.
Usage: "update an existing account", Usage: "update an existing account",
Description: ` Description: `
ethereum account update <address> expanse account update <address>
Update an existing account. Update an existing account.
@ -226,7 +227,7 @@ format to the newest format or change the password for an account.
For non-interactive use the passphrase can be specified with the --password flag: For non-interactive use the passphrase can be specified with the --password flag:
ethereum --password <passwordfile> account update <address> expanse --password <passwordfile> account update <address>
Since only one password can be given, only format update can be performed, Since only one password can be given, only format update can be performed,
changing your password is only possible interactively. changing your password is only possible interactively.
@ -241,7 +242,7 @@ changes.
Usage: "import a private key into a new account", Usage: "import a private key into a new account",
Description: ` Description: `
ethereum account import <keyfile> expanse account import <keyfile>
Imports an unencrypted private key from <keyfile> and creates a new account. Imports an unencrypted private key from <keyfile> and creates a new account.
Prints the address. Prints the address.
@ -254,10 +255,10 @@ You must remember this passphrase to unlock your account in the future.
For non-interactive use the passphrase can be specified with the -password flag: For non-interactive use the passphrase can be specified with the -password flag:
ethereum --password <passwordfile> account import <keyfile> expanse --password <passwordfile> account import <keyfile>
Note: Note:
As you can directly copy your encrypted accounts to another ethereum instance, As you can directly copy your encrypted accounts to another expanse instance,
this import mechanism is not needed when you transfer an account between this import mechanism is not needed when you transfer an account between
nodes. nodes.
`, `,
@ -267,30 +268,30 @@ nodes.
{ {
Action: console, Action: console,
Name: "console", Name: "console",
Usage: `Geth Console: interactive JavaScript environment`, Usage: `Gexp Console: interactive JavaScript environment`,
Description: ` Description: `
The Geth console is an interactive shell for the JavaScript runtime environment The Gexp console is an interactive shell for the JavaScript runtime environment
which exposes a node admin interface as well as the Ðapp JavaScript API. which exposes a node admin interface as well as the Ðapp JavaScript API.
See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console See https://github.com/expanse-project/go-expanse/wiki/Javascipt-Console
`}, `},
{ {
Action: attach, Action: attach,
Name: "attach", Name: "attach",
Usage: `Geth Console: interactive JavaScript environment (connect to node)`, Usage: `Gexp Console: interactive JavaScript environment (connect to node)`,
Description: ` Description: `
The Geth console is an interactive shell for the JavaScript runtime environment The Gexp console is an interactive shell for the JavaScript runtime environment
which exposes a node admin interface as well as the Ðapp JavaScript API. which exposes a node admin interface as well as the Ðapp JavaScript API.
See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console. See https://github.com/expanse-project/go-expanse/wiki/Javascipt-Console.
This command allows to open a console on a running geth node. This command allows to open a console on a running gexp node.
`, `,
}, },
{ {
Action: execJSFiles, Action: execJSFiles,
Name: "js", Name: "js",
Usage: `executes the given JavaScript files in the Geth JavaScript VM`, Usage: `executes the given JavaScript files in the Gexp JavaScript VM`,
Description: ` Description: `
The JavaScript VM exposes a node admin interface as well as the Ðapp The JavaScript VM exposes a node admin interface as well as the Ðapp
JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console JavaScript API. See https://github.com/expanse-project/go-expanse/wiki/Javascipt-Console
`, `,
}, },
} }
@ -408,18 +409,18 @@ func run(ctx *cli.Context) {
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx) cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
cfg.ExtraData = makeExtra(ctx) cfg.ExtraData = makeExtra(ctx)
ethereum, err := eth.New(cfg) expanse, err := exp.New(cfg)
if err != nil { if err != nil {
utils.Fatalf("%v", err) utils.Fatalf("%v", err)
} }
startEth(ctx, ethereum) startEth(ctx, expanse)
// this blocks the thread // this blocks the thread
ethereum.WaitForShutdown() expanse.WaitForShutdown()
} }
func attach(ctx *cli.Context) { func attach(ctx *cli.Context) {
var client comms.EthereumClient var client comms.ExpanseClient
var err error var err error
if ctx.Args().Present() { if ctx.Args().Present() {
client, err = comms.ClientFromEndpoint(ctx.Args().First(), codec.JSON) client, err = comms.ClientFromEndpoint(ctx.Args().First(), codec.JSON)
@ -431,7 +432,7 @@ func attach(ctx *cli.Context) {
} }
if err != nil { if err != nil {
utils.Fatalf("Unable to attach to geth node - %v", err) utils.Fatalf("Unable to attach to gexp node - %v", err)
} }
repl := newLightweightJSRE( repl := newLightweightJSRE(
@ -451,18 +452,19 @@ func attach(ctx *cli.Context) {
func console(ctx *cli.Context) { func console(ctx *cli.Context) {
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx) cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
cfg.ExtraData = makeExtra(ctx) cfg.ExtraData = makeExtra(ctx)
ethereum, err := eth.New(cfg) expanse, err := exp.New(cfg)
if err != nil { if err != nil {
utils.Fatalf("%v", err) utils.Fatalf("%v", err)
} }
client := comms.NewInProcClient(codec.JSON) client := comms.NewInProcClient(codec.JSON)
startEth(ctx, ethereum) startEth(ctx, expanse)
repl := newJSRE( repl := newJSRE(
ethereum, expanse,
ctx.GlobalString(utils.JSpathFlag.Name), ctx.GlobalString(utils.JSpathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name), ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
client, client,
@ -477,21 +479,21 @@ func console(ctx *cli.Context) {
repl.interactive() repl.interactive()
} }
ethereum.Stop() expanse.Stop()
ethereum.WaitForShutdown() expanse.WaitForShutdown()
} }
func execJSFiles(ctx *cli.Context) { func execJSFiles(ctx *cli.Context) {
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx) cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
ethereum, err := eth.New(cfg) expanse, err := exp.New(cfg)
if err != nil { if err != nil {
utils.Fatalf("%v", err) utils.Fatalf("%v", err)
} }
client := comms.NewInProcClient(codec.JSON) client := comms.NewInProcClient(codec.JSON)
startEth(ctx, ethereum) startEth(ctx, expanse)
repl := newJSRE( repl := newJSRE(
ethereum, expanse,
ctx.GlobalString(utils.JSpathFlag.Name), ctx.GlobalString(utils.JSpathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name), ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
client, client,
@ -502,8 +504,8 @@ func execJSFiles(ctx *cli.Context) {
repl.exec(file) repl.exec(file)
} }
ethereum.Stop() expanse.Stop()
ethereum.WaitForShutdown() expanse.WaitForShutdown()
} }
func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int, inputpassphrases []string) (addrHex, auth string, passphrases []string) { func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int, inputpassphrases []string) (addrHex, auth string, passphrases []string) {
@ -559,11 +561,11 @@ func blockRecovery(ctx *cli.Context) {
glog.Infof("Recovery succesful. New HEAD %x\n", block.Hash()) glog.Infof("Recovery succesful. New HEAD %x\n", block.Hash())
} }
func startEth(ctx *cli.Context, eth *eth.Ethereum) { func startEth(ctx *cli.Context, exp *exp.Expanse) {
// Start Ethereum itself // Start Expanse itself
utils.StartEthereum(eth) utils.StartExpanse(exp)
am := eth.AccountManager() am := exp.AccountManager()
account := ctx.GlobalString(utils.UnlockedAccountFlag.Name) account := ctx.GlobalString(utils.UnlockedAccountFlag.Name)
accounts := strings.Split(account, " ") accounts := strings.Split(account, " ")
var passphrases []string var passphrases []string
@ -577,17 +579,18 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
} }
// Start auxiliary services if enabled. // Start auxiliary services if enabled.
if !ctx.GlobalBool(utils.IPCDisabledFlag.Name) { if !ctx.GlobalBool(utils.IPCDisabledFlag.Name) {
if err := utils.StartIPC(eth, ctx); err != nil { if err := utils.StartIPC(exp, ctx); err != nil {
utils.Fatalf("Error string IPC: %v", err) utils.Fatalf("Error string IPC: %v", err)
} }
} }
if ctx.GlobalBool(utils.RPCEnabledFlag.Name) { if ctx.GlobalBool(utils.RPCEnabledFlag.Name) {
if err := utils.StartRPC(eth, ctx); err != nil { if err := utils.StartRPC(exp, ctx); err != nil {
utils.Fatalf("Error starting RPC: %v", err) utils.Fatalf("Error starting RPC: %v", err)
} }
} }
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) { if ctx.GlobalBool(utils.MiningEnabledFlag.Name) {
err := eth.StartMining(
err := exp.StartMining(
ctx.GlobalInt(utils.MinerThreadsFlag.Name), ctx.GlobalInt(utils.MinerThreadsFlag.Name),
ctx.GlobalString(utils.MiningGPUFlag.Name)) ctx.GlobalString(utils.MiningGPUFlag.Name))
if err != nil { if err != nil {
@ -709,7 +712,7 @@ func accountImport(ctx *cli.Context) {
func makedag(ctx *cli.Context) { func makedag(ctx *cli.Context) {
args := ctx.Args() args := ctx.Args()
wrongArgs := func() { wrongArgs := func() {
utils.Fatalf(`Usage: geth makedag <block number> <outputdir>`) utils.Fatalf(`Usage: gexp makedag <block number> <outputdir>`)
} }
switch { switch {
case len(args) == 2: case len(args) == 2:
@ -736,7 +739,7 @@ func makedag(ctx *cli.Context) {
} }
func gpuinfo(ctx *cli.Context) { func gpuinfo(ctx *cli.Context) {
eth.PrintOpenCLDevices() exp.PrintOpenCLDevices()
} }
func gpubench(ctx *cli.Context) { func gpubench(ctx *cli.Context) {
@ -750,9 +753,9 @@ func gpubench(ctx *cli.Context) {
if err != nil { if err != nil {
wrongArgs() wrongArgs()
} }
eth.GPUBench(n) exp.GPUBench(n)
case len(args) == 0: case len(args) == 0:
eth.GPUBench(0) exp.GPUBench(0)
default: default:
wrongArgs() wrongArgs()
} }
@ -764,7 +767,7 @@ func version(c *cli.Context) {
if gitCommit != "" { if gitCommit != "" {
fmt.Println("Git Commit:", gitCommit) fmt.Println("Git Commit:", gitCommit)
} }
fmt.Println("Protocol Versions:", eth.ProtocolVersions) fmt.Println("Protocol Versions:", exp.ProtocolVersions)
fmt.Println("Network Id:", c.GlobalInt(utils.NetworkIdFlag.Name)) fmt.Println("Network Id:", c.GlobalInt(utils.NetworkIdFlag.Name))
fmt.Println("Go Version:", runtime.Version()) fmt.Println("Go Version:", runtime.Version())
fmt.Println("OS:", runtime.GOOS) fmt.Println("OS:", runtime.GOOS)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main package main
@ -26,11 +26,11 @@ import (
"time" "time"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/expanse-project/go-expanse/cmd/utils"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/rpc" "github.com/expanse-project/go-expanse/rpc"
"github.com/ethereum/go-ethereum/rpc/codec" "github.com/expanse-project/go-expanse/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms" "github.com/expanse-project/go-expanse/rpc/comms"
"github.com/gizak/termui" "github.com/gizak/termui"
) )
@ -53,9 +53,9 @@ var (
monitorCommand = cli.Command{ monitorCommand = cli.Command{
Action: monitor, Action: monitor,
Name: "monitor", Name: "monitor",
Usage: `Geth Monitor: node metrics monitoring and visualization`, Usage: `Gexp Monitor: node metrics monitoring and visualization`,
Description: ` Description: `
The Geth monitor is a tool to collect and visualize various internal metrics The Gexp monitor is a tool to collect and visualize various internal metrics
gathered by the node, supporting different chart types as well as the capacity gathered by the node, supporting different chart types as well as the capacity
to display multiple metrics simultaneously. to display multiple metrics simultaneously.
`, `,
@ -70,13 +70,13 @@ to display multiple metrics simultaneously.
// monitor starts a terminal UI based monitoring tool for the requested metrics. // monitor starts a terminal UI based monitoring tool for the requested metrics.
func monitor(ctx *cli.Context) { func monitor(ctx *cli.Context) {
var ( var (
client comms.EthereumClient client comms.ExpanseClient
err error err error
) )
// Attach to an Ethereum node over IPC or RPC // Attach to an Expanse node over IPC or RPC
endpoint := ctx.String(monitorCommandAttachFlag.Name) endpoint := ctx.String(monitorCommandAttachFlag.Name)
if client, err = comms.ClientFromEndpoint(endpoint, codec.JSON); err != nil { if client, err = comms.ClientFromEndpoint(endpoint, codec.JSON); err != nil {
utils.Fatalf("Unable to attach to geth node: %v", err) utils.Fatalf("Unable to attach to gexp node: %v", err)
} }
defer client.Close() defer client.Close()
@ -95,7 +95,7 @@ func monitor(ctx *cli.Context) {
if len(list) > 0 { if len(list) > 0 {
utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - ")) utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - "))
} else { } else {
utils.Fatalf("No metrics collected by geth (--%s).\n", utils.MetricsEnabledFlag.Name) utils.Fatalf("No metrics collected by gexp (--%s).\n", utils.MetricsEnabledFlag.Name)
} }
} }
sort.Strings(monitored) sort.Strings(monitored)
@ -162,7 +162,7 @@ func monitor(ctx *cli.Context) {
} }
} }
// retrieveMetrics contacts the attached geth node and retrieves the entire set // retrieveMetrics contacts the attached gexp node and retrieves the entire set
// of collected system metrics. // of collected system metrics.
func retrieveMetrics(xeth *rpc.Xeth) (map[string]interface{}, error) { func retrieveMetrics(xeth *rpc.Xeth) (map[string]interface{}, error) {
return xeth.Call("debug_metrics", []interface{}{true}) return xeth.Call("debug_metrics", []interface{}{true})

View file

@ -1,5 +1,5 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
@ -12,7 +12,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// Contains the geth command usage template and generator. // Contains the geth command usage template and generator.
@ -22,7 +22,7 @@ import (
"io" "io"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/expanse-project/go-expanse/cmd/utils"
) )
// AppHelpTemplate is the test template for the default, global app help topic. // AppHelpTemplate is the test template for the default, global app help topic.
@ -59,7 +59,7 @@ type flagGroup struct {
// AppHelpFlagGroups is the application flags, grouped by functionality. // AppHelpFlagGroups is the application flags, grouped by functionality.
var AppHelpFlagGroups = []flagGroup{ var AppHelpFlagGroups = []flagGroup{
{ {
Name: "ETHEREUM", Name: "EXPANSE",
Flags: []cli.Flag{ Flags: []cli.Flag{
utils.DataDirFlag, utils.DataDirFlag,
utils.NetworkIdFlag, utils.NetworkIdFlag,

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// rlpdump is a pretty-printer for RLP data. // rlpdump is a pretty-printer for RLP data.
package main package main
@ -26,7 +26,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/ethereum/go-ethereum/rlp" "github.com/expanse-project/go-expanse/rlp"
) )
var ( var (

View file

@ -1,20 +1,20 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
// Package utils contains internal helper functions for go-ethereum commands. // Package utils contains internal helper functions for go-expanse commands.
package utils package utils
import ( import (
@ -26,13 +26,13 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/core" "github.com/expanse-project/go-expanse/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/expanse-project/go-expanse/core/types"
"github.com/ethereum/go-ethereum/eth" "github.com/expanse-project/go-expanse/exp"
"github.com/ethereum/go-ethereum/logger" "github.com/expanse-project/go-expanse/logger"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/expanse-project/go-expanse/logger/glog"
"github.com/ethereum/go-ethereum/rlp" "github.com/expanse-project/go-expanse/rlp"
"github.com/peterh/liner" "github.com/peterh/liner"
) )
@ -110,10 +110,10 @@ func Fatalf(format string, args ...interface{}) {
os.Exit(1) os.Exit(1)
} }
func StartEthereum(ethereum *eth.Ethereum) { func StartExpanse(expanse *exp.Expanse) {
glog.V(logger.Info).Infoln("Starting", ethereum.Name()) glog.V(logger.Info).Infoln("Starting", expanse.Name())
if err := ethereum.Start(); err != nil { if err := expanse.Start(); err != nil {
Fatalf("Error starting Ethereum: %v", err) Fatalf("Error starting Expanse: %v", err)
} }
go func() { go func() {
sigc := make(chan os.Signal, 1) sigc := make(chan os.Signal, 1)
@ -121,7 +121,7 @@ func StartEthereum(ethereum *eth.Ethereum) {
defer signal.Stop(sigc) defer signal.Stop(sigc)
<-sigc <-sigc
glog.V(logger.Info).Infoln("Got interrupt, shutting down...") glog.V(logger.Info).Infoln("Got interrupt, shutting down...")
go ethereum.Stop() go expanse.Stop()
logger.Flush() logger.Flush()
for i := 10; i > 0; i-- { for i := 10; i > 0; i-- {
<-sigc <-sigc

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package utils package utils
@ -44,7 +44,7 @@ func (self *DirectoryString) Set(value string) error {
} }
// Custom cli.Flag type which expand the received string to an absolute path. // Custom cli.Flag type which expand the received string to an absolute path.
// e.g. ~/.ethereum -> /home/username/.ethereum // e.g. ~/.expanse -> /home/username/.expanse
type DirectoryFlag struct { type DirectoryFlag struct {
cli.GenericFlag cli.GenericFlag
Name string Name string

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package utils package utils

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors // Copyright 2015 The go-expanse Authors
// This file is part of go-ethereum. // This file is part of go-expanse.
// //
// go-ethereum is free software: you can redistribute it and/or modify // go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// go-ethereum is distributed in the hope that it will be useful, // go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package utils package utils
@ -30,26 +30,26 @@ import (
"strconv" "strconv"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/ethereum/ethash" "github.com/expanse-project/ethash"
"github.com/ethereum/go-ethereum/accounts" "github.com/expanse-project/go-expanse/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/expanse-project/go-expanse/common"
"github.com/ethereum/go-ethereum/core" "github.com/expanse-project/go-expanse/core"
"github.com/ethereum/go-ethereum/core/vm" "github.com/expanse-project/go-expanse/core/vm"
"github.com/ethereum/go-ethereum/crypto" "github.com/expanse-project/go-expanse/crypto"
"github.com/ethereum/go-ethereum/eth" "github.com/expanse-project/go-expanse/exp"
"github.com/ethereum/go-ethereum/ethdb" "github.com/expanse-project/go-expanse/ethdb"
"github.com/ethereum/go-ethereum/event" "github.com/expanse-project/go-expanse/event"
"github.com/ethereum/go-ethereum/logger" "github.com/expanse-project/go-expanse/logger"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/expanse-project/go-expanse/logger/glog"
"github.com/ethereum/go-ethereum/metrics" "github.com/expanse-project/go-expanse/metrics"
"github.com/ethereum/go-ethereum/p2p/nat" "github.com/expanse-project/go-expanse/p2p/nat"
"github.com/ethereum/go-ethereum/params" "github.com/expanse-project/go-expanse/params"
"github.com/ethereum/go-ethereum/rpc/api" "github.com/expanse-project/go-expanse/rpc/api"
"github.com/ethereum/go-ethereum/rpc/codec" "github.com/expanse-project/go-expanse/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms" "github.com/expanse-project/go-expanse/rpc/comms"
"github.com/ethereum/go-ethereum/rpc/shared" "github.com/expanse-project/go-expanse/rpc/shared"
"github.com/ethereum/go-ethereum/rpc/useragent" "github.com/expanse-project/go-expanse/rpc/useragent"
"github.com/ethereum/go-ethereum/xeth" "github.com/expanse-project/go-expanse/xeth"
) )
func init() { func init() {
@ -107,7 +107,7 @@ var (
NetworkIdFlag = cli.IntFlag{ NetworkIdFlag = cli.IntFlag{
Name: "networkid", Name: "networkid",
Usage: "Network identifier (integer, 0=Olympic, 1=Frontier, 2=Morden)", Usage: "Network identifier (integer, 0=Olympic, 1=Frontier, 2=Morden)",
Value: eth.NetworkId, Value: exp.NetworkId,
} }
OlympicFlag = cli.BoolFlag{ OlympicFlag = cli.BoolFlag{
Name: "olympic", Name: "olympic",
@ -268,7 +268,7 @@ var (
RPCPortFlag = cli.IntFlag{ RPCPortFlag = cli.IntFlag{
Name: "rpcport", Name: "rpcport",
Usage: "HTTP-RPC server listening port", Usage: "HTTP-RPC server listening port",
Value: 8545, Value: 9656,
} }
RPCCORSDomainFlag = cli.StringFlag{ RPCCORSDomainFlag = cli.StringFlag{
Name: "rpccorsdomain", Name: "rpccorsdomain",
@ -312,7 +312,7 @@ var (
ListenPortFlag = cli.IntFlag{ ListenPortFlag = cli.IntFlag{
Name: "port", Name: "port",
Usage: "Network listening port", Usage: "Network listening port",
Value: 30303, Value: 42786,
} }
BootnodesFlag = cli.StringFlag{ BootnodesFlag = cli.StringFlag{
Name: "bootnodes", Name: "bootnodes",
@ -413,8 +413,8 @@ func MakeNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
return key return key
} }
// MakeEthConfig creates ethereum options from set command line flags. // MakeEthConfig creates expanse options from set command line flags.
func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config { func MakeEthConfig(clientID, version string, ctx *cli.Context) *exp.Config {
customName := ctx.GlobalString(IdentityFlag.Name) customName := ctx.GlobalString(IdentityFlag.Name)
if len(customName) > 0 { if len(customName) > 0 {
clientID += "/" + customName clientID += "/" + customName
@ -424,8 +424,9 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
if err != nil { if err != nil {
glog.V(logger.Error).Infoln("WARNING: No etherbase set and no accounts found as default") glog.V(logger.Error).Infoln("WARNING: No etherbase set and no accounts found as default")
} }
// Assemble the entire eth configuration and return
cfg := &eth.Config{ // Assemble the entire exp configuration and return
cfg := &exp.Config{
Name: common.MakeName(clientID, version), Name: common.MakeName(clientID, version),
DataDir: MustDataDir(ctx), DataDir: MustDataDir(ctx),
GenesisFile: ctx.GlobalString(GenesisFileFlag.Name), GenesisFile: ctx.GlobalString(GenesisFileFlag.Name),
@ -496,7 +497,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
cfg.Shh = true cfg.Shh = true
} }
if !ctx.GlobalIsSet(DataDirFlag.Name) { if !ctx.GlobalIsSet(DataDirFlag.Name) {
cfg.DataDir = os.TempDir() + "/ethereum_dev_mode" cfg.DataDir = os.TempDir() + "/expanse_dev_mode"
} }
cfg.PowTest = true cfg.PowTest = true
cfg.DevMode = true cfg.DevMode = true
@ -535,6 +536,7 @@ func SetupVM(ctx *cli.Context) {
vm.SetJITCacheSize(ctx.GlobalInt(VMJitCacheFlag.Name)) vm.SetJITCacheSize(ctx.GlobalInt(VMJitCacheFlag.Name))
} }
// MakeChain creates a chain manager from set command line flags. // MakeChain creates a chain manager from set command line flags.
func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database) { func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database) {
datadir := MustDataDir(ctx) datadir := MustDataDir(ctx)
@ -597,7 +599,7 @@ func IpcSocketPath(ctx *cli.Context) (ipcpath string) {
} else { } else {
ipcpath = common.DefaultIpcPath() ipcpath = common.DefaultIpcPath()
if ctx.GlobalIsSet(DataDirFlag.Name) { if ctx.GlobalIsSet(DataDirFlag.Name) {
ipcpath = filepath.Join(ctx.GlobalString(DataDirFlag.Name), "geth.ipc") ipcpath = filepath.Join(ctx.GlobalString(DataDirFlag.Name), "gexp.ipc")
} }
if ctx.GlobalIsSet(IPCPathFlag.Name) { if ctx.GlobalIsSet(IPCPathFlag.Name) {
ipcpath = ctx.GlobalString(IPCPathFlag.Name) ipcpath = ctx.GlobalString(IPCPathFlag.Name)
@ -607,15 +609,16 @@ func IpcSocketPath(ctx *cli.Context) (ipcpath string) {
return return
} }
func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error { func StartIPC(exp *exp.Expanse, ctx *cli.Context) error {
config := comms.IpcConfig{ config := comms.IpcConfig{
Endpoint: IpcSocketPath(ctx), Endpoint: IpcSocketPath(ctx),
} }
initializer := func(conn net.Conn) (comms.Stopper, shared.EthereumApi, error) {
fe := useragent.NewRemoteFrontend(conn, eth.AccountManager()) initializer := func(conn net.Conn) (comms.Stopper, shared.ExpanseApi, error) {
xeth := xeth.New(eth, fe) fe := useragent.NewRemoteFrontend(conn, exp.AccountManager())
apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec.JSON, xeth, eth) xeth := xeth.New(exp, fe)
apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec.JSON, xeth, exp)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
@ -625,17 +628,17 @@ func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
return comms.StartIpc(config, codec.JSON, initializer) return comms.StartIpc(config, codec.JSON, initializer)
} }
func StartRPC(eth *eth.Ethereum, ctx *cli.Context) error { func StartRPC(exp *exp.Expanse, ctx *cli.Context) error {
config := comms.HttpConfig{ config := comms.HttpConfig{
ListenAddress: ctx.GlobalString(RPCListenAddrFlag.Name), ListenAddress: ctx.GlobalString(RPCListenAddrFlag.Name),
ListenPort: uint(ctx.GlobalInt(RPCPortFlag.Name)), ListenPort: uint(ctx.GlobalInt(RPCPortFlag.Name)),
CorsDomain: ctx.GlobalString(RPCCORSDomainFlag.Name), CorsDomain: ctx.GlobalString(RPCCORSDomainFlag.Name),
} }
xeth := xeth.New(eth, nil) xeth := xeth.New(exp, nil)
codec := codec.JSON codec := codec.JSON
apis, err := api.ParseApiString(ctx.GlobalString(RpcApiFlag.Name), codec, xeth, eth) apis, err := api.ParseApiString(ctx.GlobalString(RpcApiFlag.Name), codec, xeth, exp)
if err != nil { if err != nil {
return err return err
} }

41
cmd/utils/legalese.go Normal file
View file

@ -0,0 +1,41 @@
// Copyright 2015 The go-expanse Authors
// This file is part of go-expanse.
//
// go-expanse is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// go-expanse is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package utils
const (
legalese = `
=======================================
Disclaimer of Liabilites and Warranties
=======================================
THE USER EXPRESSLY KNOWS AND AGREES THAT THE USER IS USING THE EXPANSE PLATFORM AT THE USERS SOLE
RISK. THE USER REPRESENTS THAT THE USER HAS AN ADEQUATE UNDERSTANDING OF THE RISKS, USAGE AND
INTRICACIES OF CRYPTOGRAPHIC TOKENS AND BLOCKCHAIN-BASED OPEN SOURCE SOFTWARE, EXP PLATFORM AND EXP.
THE USER ACKNOWLEDGES AND AGREES THAT, TO THE FULLEST EXTENT PERMITTED BY ANY APPLICABLE LAW, THE
DISCLAIMERS OF LIABILITY CONTAINED HEREIN APPLY TO ANY AND ALL DAMAGES OR INJURY WHATSOEVER CAUSED
BY OR RELATED TO RISKS OF, USE OF, OR INABILITY TO USE, EXP OR THE EXPANSE PLATFORM UNDER ANY CAUSE
OR ACTION WHATSOEVER OF ANY KIND IN ANY JURISDICTION, INCLUDING, WITHOUT LIMITATION, ACTIONS FOR
BREACH OF WARRANTY, BREACH OF CONTRACT OR TORT (INCLUDING NEGLIGENCE) AND THAT NEITHER STIFTUNG
EXPANSE NOR EXPANSE TEAM SHALL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR
CONSEQUENTIAL DAMAGES, INCLUDING FOR LOSS OF PROFITS, GOODWILL OR DATA. SOME JURISDICTIONS DO NOT
ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR CERTAIN
TYPES OF DAMAGES. THEREFORE, SOME OF THE ABOVE LIMITATIONS IN THIS SECTION MAY NOT APPLY TO A USER.
IN PARTICULAR, NOTHING IN THESE TERMS SHALL AFFECT THE STATUTORY RIGHTS OF ANY USER OR EXCLUDE
INJURY ARISING FROM ANY WILLFUL MISCONDUCT OR FRAUD OF STIFTUNG EXPANSE.
Do you accept this agreement?`
)

View file

@ -1,24 +1,26 @@
# common # common
[![Build [![Build
Status](https://travis-ci.org/ethereum/go-ethereum.png?branch=master)](https://travis-ci.org/ethereum/go-ethereum) Status](https://travis-ci.org/expanse/go-expanse.png?branch=master)](https://travis-ci.org/expanse/go-expanse)
The common package contains the ethereum utility library. The common package contains the expanse utility library.
# Installation # Installation
As a subdirectory the main go-ethereum repository, you get it with As a subdirectory the main go-expanse repository, you get it with
`go get github.com/ethereum/go-ethereum`. `go get github.com/expanse-project/go-expanse`.
# Usage # Usage
## RLP (Recursive Linear Prefix) Encoding ## RLP (Recursive Linear Prefix) Encoding
RLP Encoding is an encoding scheme used by the Ethereum project. It
encodes any native value or list to a string.
More in depth information about the encoding scheme see the RLP Encoding is an encoding scheme utilized by the Expanse project. It
[Wiki](http://wiki.ethereum.org/index.php/RLP) article. encodes any native value or list to string.
More in depth information about the Encoding scheme see the [Wiki](http://wiki.expanse.org/index.php/RLP)
article.
```go ```go
rlp := common.Encode("doge") rlp := common.Encode("doge")
@ -32,10 +34,11 @@ fmt.Println(decoded) // => ["dog" "cat"]
## Patricia Trie ## Patricia Trie
Patricie Tree is a merkle trie used by the Ethereum project. Patricie Tree is a merkle tree utilized by the Expanse project.
More in depth information about the (modified) Patricia Trie can be More in depth information about the (modified) Patricia Trie can be
found on the [Wiki](http://wiki.ethereum.org/index.php/Patricia_Tree). found on the [Wiki](http://wiki.expanse.org/index.php/Patricia_Tree).
The patricia trie uses a db as backend and could be anything as long as The patricia trie uses a db as backend and could be anything as long as
it satisfies the Database interface found in `common/db.go`. it satisfies the Database interface found in `common/db.go`.

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package common package common

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
package common package common

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors // Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// This file is part of the go-ethereum library. // This file is part of the go-expanse library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-expanse library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// The go-ethereum library is distributed in the hope that it will be useful, // The go-expanse library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-expanse library. If not, see <http://www.gnu.org/licenses/>.
// Package common contains various helper functions. // Package common contains various helper functions.
package common package common

Some files were not shown because too many files have changed in this diff Show more