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

6
.gitmodules vendored
View file

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

View file

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

View file

@ -13,7 +13,7 @@ before_script:
# - go vet ./...
# - go test -race ./...
script:
- make travis-test-with-coverage
- make gexp
after_success:
- bash <(curl -s https://codecov.io/bash)
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>
Alexandre Van de Sande <alex.vandesande@ethdev.com>
@ -10,8 +10,8 @@ Felix Lange <fjl@twurst.com>
Gustav Simonsson <gustav.simonsson@gmail.com>
Jae Kwon <jkwon.work@gmail.com>
Jason Carver <jacarver@linkedin.com>
Jeffrey Wilcke <jeffrey@ethereum.org>
Joseph Chow <ethereum@outlook.com>
Jeffrey Wilcke <jeffrey@expanse.org>
Joseph Chow <expanse@outlook.com>
Kobi Gurkan <kobigurk@gmail.com>
Maran Hidskes <maran.hidskes@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
are ignored (use gofmt!). If you send pull requests make absolute sure that you
commit on the `develop` branch and that you do not merge to master.
Commits that are directly based on master are simply ignored.
See [Developers' Guide](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
dependency management.

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
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
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",
"Packages": [
"./..."
@ -15,9 +15,9 @@
"Rev": "3e6e67c4dcea3ac2f25fd4731abc0e1deaf36216"
},
{
"ImportPath": "github.com/ethereum/ethash",
"Comment": "v23.1-238-g9401881",
"Rev": "9401881ab040d1a3b0ae9e4780a115bc284a8a1a"
"ImportPath": "github.com/expanse-project/ethash",
"Comment": "v23.1-238-g062e40a",
"Rev": "fe2794dd2a3b1425dc3e3cc7f15a1dd591422bf1"
},
{
"ImportPath": "github.com/fatih/color",

View file

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

View file

@ -6,12 +6,12 @@ before_install:
# for g++4.8 and C++11
- 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 install -yqq libgmp3-dev
- git clone --depth=10 https://github.com/ethereum/go-ethereum ${GOPATH}/src/github.com/ethereum/go-ethereum
# use canned dependencies from the go-ethereum repository
- export GOPATH=$GOPATH:$GOPATH/src/github.com/ethereum/go-ethereum/Godeps/_workspace/
- 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-expanse repository
- export GOPATH=$GOPATH:$GOPATH/src/github.com/expanse-project/go-expanse/Godeps/_workspace/
- echo $GOPATH
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)
# Ethash
For details on this project, please see the Ethereum wiki:
https://github.com/ethereum/wiki/wiki/Ethash
For details on this project, please see the Expanse wiki:
https://github.com/expanse-project/wiki/wiki/Ethash
### 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:

View file

@ -40,11 +40,11 @@ import (
"time"
"unsafe"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/pow"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/crypto"
"github.com/expanse-project/go-expanse/logger"
"github.com/expanse-project/go-expanse/logger/glog"
"github.com/expanse-project/go-expanse/pow"
)
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
happen if PoW is checked first due to parallel PoW checking.
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 {
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))
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 {
mixDigest = C.GoBytes(unsafe.Pointer(&ret.mix_hash), C.int(32))
atomic.AddInt32(&pow.hashRate, -previousHashrate)

View file

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

View file

@ -39,9 +39,9 @@ setup(
author_email="matthew.wampler.doty@gmail.com",
license='GPL',
version='0.1.23',
url='https://github.com/ethereum/ethash',
download_url='https://github.com/ethereum/ethash/tarball/v23',
description=('Python wrappers for ethash, the ethereum proof of work'
url='https://github.com/expanse-project/ethash',
download_url='https://github.com/expanse-project/ethash/tarball/v23',
description=('Python wrappers for ethash, the expanse proof of work'
'hashing function'),
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
the Free Software Foundation, either version 3 of the License, or
(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
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 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
* @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
the Free Software Foundation, either version 3 of the License, or
(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
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 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
* @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
the Free Software FoundationUUU,either version 3 of the LicenseUUU,or
(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
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 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

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
the Free Software Foundation, either version 3 of the License, or
(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
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 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
* @author Matthew Wampler-Doty <negacthulhu@gmail.com>

View file

@ -12,7 +12,7 @@
GNU General Public License for more details.
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
* @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)
// 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
// 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)
/// Possible return values of @see ethash_io_prepare
enum ethash_io_rc {
@ -80,7 +80,7 @@ enum ethash_io_rc {
* data directory. If it does not exist it's created.
* @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:
* 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
* file descriptor. User is responsible for closing it.
* 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
*
* 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
* 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
the Free Software Foundation, either version 3 of the License, or
(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
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 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
* @author Tim Hughes <tim@twistedfury.com>

View file

@ -172,7 +172,7 @@ mine(PyObject *self, PyObject *args) {
// TODO: Multi threading?
do {
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));
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) {
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, "DATASET_BYTES_INIT", (long) ETHASH_DATASET_BYTES_INIT);
PyModule_AddIntConstant(module, "DATASET_BYTES_GROWTH", (long) ETHASH_DATASET_BYTES_GROWTH);
@ -251,7 +251,7 @@ PyMODINIT_FUNC PyInit_pyethash(void) {
PyMODINIT_FUNC
initpyethash(void) {
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, "DATASET_BYTES_INIT", (long) ETHASH_DATASET_BYTES_INIT);
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__))
// 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::ostringstream ret;

View file

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

118
Makefile
View file

@ -2,110 +2,110 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.
.PHONY: geth geth-cross evm all test travis-test-with-coverage xgo clean
.PHONY: geth-linux geth-linux-arm geth-linux-386 geth-linux-amd64
.PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64
.PHONY: geth-windows geth-windows-386 geth-windows-amd64
.PHONY: geth-android geth-android-16 geth-android-21
.PHONY: gexp gexp-cross evm all test travis-test-with-coverage xgo clean
.PHONY: gexp-linux gexp-linux-arm gexp-linux-386 gexp-linux-amd64
.PHONY: gexp-darwin gexp-darwin-386 gexp-darwin-amd64
.PHONY: gexp-windows gexp-windows-386 gexp-windows-amd64
.PHONY: gexp-android gexp-android-16 gexp-android-21
GOBIN = build/bin
MODE ?= default
GO ?= latest
geth:
build/env.sh go install -v $(shell build/flags.sh) ./cmd/geth
gexp:
build/env.sh go install -v $(shell build/flags.sh) ./cmd/gexp
@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:"
@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:"
@ls -l $(GOBIN)/geth-linux-*
@ls -l $(GOBIN)/gexp-linux-*
geth-linux-386: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth
gexp-linux-386: xgo
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:"
@ls -l $(GOBIN)/geth-linux-* | grep 386
@ls -l $(GOBIN)/gexp-linux-* | grep 386
geth-linux-amd64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth
gexp-linux-amd64: xgo
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:"
@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:"
@ls -l $(GOBIN)/geth-linux-* | grep arm
@ls -l $(GOBIN)/gexp-linux-* | grep arm
geth-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
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/gexp
@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
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-6 -v $(shell build/flags.sh) ./cmd/geth
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/gexp
@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
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-7 -v $(shell build/flags.sh) ./cmd/geth
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/gexp
@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
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm64 -v $(shell build/flags.sh) ./cmd/geth
gexp-linux-arm64: xgo
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:"
@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:"
@ls -l $(GOBIN)/geth-darwin-*
@ls -l $(GOBIN)/gexp-darwin-*
geth-darwin-386: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth
gexp-darwin-386: xgo
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:"
@ls -l $(GOBIN)/geth-darwin-* | grep 386
@ls -l $(GOBIN)/gexp-darwin-* | grep 386
geth-darwin-amd64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth
gexp-darwin-amd64: xgo
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:"
@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:"
@ls -l $(GOBIN)/geth-windows-*
@ls -l $(GOBIN)/gexp-windows-*
geth-windows-386: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth
gexp-windows-386: xgo
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:"
@ls -l $(GOBIN)/geth-windows-* | grep 386
@ls -l $(GOBIN)/gexp-windows-* | grep 386
geth-windows-amd64: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth
gexp-windows-amd64: xgo
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:"
@ls -l $(GOBIN)/geth-windows-* | grep amd64
@ls -l $(GOBIN)/gexp-windows-* | grep amd64
geth-android: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=android/* -v $(shell build/flags.sh) ./cmd/geth
gexp-android: xgo
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:"
@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:"
@ls -l $(GOBIN)/geth-ios-*
@ls -l $(GOBIN)/gexp-ios-*
geth-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
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/gexp
@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
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=ios-7.0/arm64 -v $(shell build/flags.sh) ./cmd/geth
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/gexp
@echo "iOS ARM64 cross compilation done:"
@ls -l $(GOBIN)/geth-ios-* | grep arm64
@ls -l $(GOBIN)/gexp-ios-* | grep arm64
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
----------|---------|-----|-----|---------|------
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)
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)
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/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](
https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667
)](https://godoc.org/github.com/ethereum/go-ethereum)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Bugs](https://badge.waffle.io/expanse-project/go-expanse.png?label=bug&title=Bugs)](https://waffle.io/expanse/go-expanse)
[![Stories in Ready](https://badge.waffle.io/expanse-project/go-expanse.png?label=ready&title=Ready)](https://waffle.io/expanse/go-expanse)
[![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/expanse/go-expanse?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
## 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)
* Ubuntu
[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/)
* [Windows 64-bit](https://build.ethdev.com/builds/Windows%20Go%20develop%20branch/Geth-Win64-latest.zip)
* [ARM](https://build.ethdev.com/builds/ARM%20Go%20develop%20branch/geth-ARM-latest.tar.bz2)
* [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/gexp-ARM-latest.tar.bz2)
## Building the source
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.
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.
Once the dependencies are installed, run
make geth
make gexp
## Executables
Go Ethereum comes with several wrappers/executables found in
[the `cmd` directory](https://github.com/ethereum/go-ethereum/tree/develop/cmd):
Go Expanse comes with several wrappers/executables found in
[the `cmd` directory](https://github.com/expanse-project/go-expanse/tree/develop/cmd):
Command | |
----------|---------|
`geth` | Ethereum CLI (ethereum command line interface client) |
`bootnode` | runs a bootstrap node for the Discovery Protocol |
`ethtest` | test tool which runs with the [tests](https://github.com/ethereum/tests) suite: `/path/to/test.json > ethtest --test BlockTests --stdin`.
`evm` | is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas 10000 -price 0 -dump`. See `-h` for a detailed description. |
`disasm` | disassembles EVM code: `echo "6001" | disasm` |
`rlpdump` | prints RLP structures |
* `gexp` Expanse CLI (expanse command line interface client)
* `bootnode` runs a bootstrap node for the Discovery Protocol
* `exptest` test tool which runs with the [tests](https://github.com/expanse-project/tests) suite:
`/path/to/test.json > exptest --test BlockTests --stdin`.
* `evm` is a generic Expanse Virtual Machine: `evm -code 60ff60ff -gas
10000 -price 0 -dump`. See `-h` for a detailed description.
* `disasm` disassembles EVM code: `echo "6001" | disasm`
* `rlpdump` prints RLP structures
## 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:
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
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
are ignored (use gofmt!). If you send pull requests make absolute sure that you
commit on the `develop` branch and that you do not merge to master.
Commits that are directly based on master are simply ignored.
See [Developers' Guide](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
dependency management.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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
@ -22,7 +22,7 @@ import (
"io"
"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.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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
@ -25,8 +25,8 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/crypto"
)
const jsondata = `

View file

@ -1,23 +1,23 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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).
//
// 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
// to signed and visa versa. It does not handle slice casting such
// as unsigned slice to signed slice. Bit size type casting is also

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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
@ -20,7 +20,7 @@ import (
"math/big"
"reflect"
"github.com/ethereum/go-ethereum/common"
"github.com/expanse-project/go-expanse/common"
)
var big_t = reflect.TypeOf(&big.Int{})

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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
@ -22,7 +22,7 @@ import (
"regexp"
"strconv"
"github.com/ethereum/go-ethereum/common"
"github.com/expanse-project/go-expanse/common"
)
const (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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.
//
@ -31,8 +31,8 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/crypto"
)
var (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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
@ -22,7 +22,7 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/expanse-project/go-expanse/crypto"
)
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) {
d, err := ioutil.TempDir("", "eth-keystore-test")
d, err := ioutil.TempDir("", "exp-keystore-test")
if err != nil {
t.Fatal(err)
}

View file

@ -10,23 +10,23 @@ fi
# Create fake Go workspace if it doesn't exist yet.
workspace="$PWD/build/_workspace"
root="$PWD"
ethdir="$workspace/src/github.com/ethereum"
if [ ! -L "$ethdir/go-ethereum" ]; then
ethdir="$workspace/src/github.com/expanse-project"
if [ ! -L "$ethdir/go-expanse" ]; then
mkdir -p "$ethdir"
cd "$ethdir"
ln -s ../../../../../. go-ethereum
ln -s ../../../../../. go-expanse
cd "$root"
fi
# Set up the environment to use the workspace.
# 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"
export GOPATH GOBIN
# Run the command inside the workspace.
cd "$ethdir/go-ethereum"
PWD="$ethdir/go-ethereum"
cd "$ethdir/go-expanse"
PWD="$ethdir/go-expanse"
# Launch the arguments with the configured environment.
exec "$@"

View file

@ -60,13 +60,13 @@ var (
licenseCommentRE = regexp.MustCompile(`^//\s*(Copyright|This file is part of).*?\n(?://.*?\n)*\n*`)
// 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.
// its input is an info structure.
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}}.
//
// {{.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 {
if i.gpl() {
return "go-ethereum"
return "go-expanse"
}
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 {

View file

@ -1,20 +1,20 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-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
import (
@ -26,15 +26,15 @@ import (
"log"
"os"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/expanse-project/go-expanse/crypto"
"github.com/expanse-project/go-expanse/logger"
"github.com/expanse-project/go-expanse/p2p/discover"
"github.com/expanse-project/go-expanse/p2p/nat"
)
func main() {
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")
nodeKeyFile = flag.String("nodekey", "", "private key filename")
nodeKeyHex = flag.String("nodekeyhex", "", "private key as hex (for testing)")

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-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.
package main
@ -22,8 +22,8 @@ import (
"io/ioutil"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/core/vm"
)
func main() {

View file

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

View file

@ -1,20 +1,20 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-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
import (
@ -26,9 +26,9 @@ import (
"strings"
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/tests"
"github.com/expanse-project/go-expanse/core/vm"
"github.com/expanse-project/go-expanse/logger/glog"
"github.com/expanse-project/go-expanse/tests"
)
var (
@ -49,7 +49,7 @@ var (
Name: "file",
Usage: "Test file or directory. Directories are searched for .json files 1 level deep",
Value: defaultDir,
EnvVar: "ETHEREUM_TEST_PATH",
EnvVar: "EXPANSE_TEST_PATH",
}
ContinueOnErrorFlag = cli.BoolFlag{
Name: "continue",
@ -204,11 +204,11 @@ func main() {
glog.SetToStderr(true)
app := cli.NewApp()
app.Name = "ethtest"
app.Usage = "go-ethereum test interface"
app.Name = "exptest"
app.Usage = "go-expanse test interface"
app.Action = setupApp
app.Version = "0.2.0"
app.Author = "go-ethereum team"
app.Author = "go-expanse team"
app.Flags = []cli.Flag{
TestFlag,

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-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.
package main
@ -25,14 +25,14 @@ import (
"time"
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/expanse-project/go-expanse/cmd/utils"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/core"
"github.com/expanse-project/go-expanse/core/state"
"github.com/expanse-project/go-expanse/core/types"
"github.com/expanse-project/go-expanse/core/vm"
"github.com/expanse-project/go-expanse/ethdb"
"github.com/expanse-project/go-expanse/logger/glog"
)
var (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main
@ -21,10 +21,10 @@ import (
"os"
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/tests"
"github.com/expanse-project/go-expanse/cmd/utils"
"github.com/expanse-project/go-expanse/exp"
"github.com/expanse-project/go-expanse/ethdb"
"github.com/expanse-project/go-expanse/tests"
)
var blocktestCommand = cli.Command{
@ -56,7 +56,7 @@ func runBlockTest(ctx *cli.Context) {
file, testname = args[0], args[1]
rpc = true
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)
if err != nil {
@ -68,15 +68,15 @@ func runBlockTest(ctx *cli.Context) {
ecode := 0
for name, test := range bt {
fmt.Printf("----------------- Running Block Test %q\n", name)
ethereum, err := runOneBlockTest(ctx, test)
expanse, err := runOneBlockTest(ctx, test)
if err != nil {
fmt.Println(err)
fmt.Println("FAIL")
ecode = 1
}
if ethereum != nil {
ethereum.Stop()
ethereum.WaitForShutdown()
if expanse != nil {
expanse.Stop()
expanse.WaitForShutdown()
}
}
os.Exit(ecode)
@ -87,49 +87,53 @@ func runBlockTest(ctx *cli.Context) {
if !ok {
utils.Fatalf("Test file does not contain test named %q", testname)
}
ethereum, err := runOneBlockTest(ctx, test)
expanse, err := runOneBlockTest(ctx, test)
if err != nil {
utils.Fatalf("%v", err)
}
if rpc {
fmt.Println("Block Test post state validated, starting RPC interface.")
startEth(ctx, ethereum)
utils.StartRPC(ethereum, ctx)
ethereum.WaitForShutdown()
startEth(ctx, expanse)
utils.StartRPC(expanse, ctx)
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)
db, _ := ethdb.NewMemDatabase()
cfg.NewDB = func(path string) (ethdb.Database, error) { return db, nil }
cfg.MaxPeers = 0 // disable network
cfg.Shh = false // disable whisper
cfg.NAT = nil // disable port mapping
ethereum, err := eth.New(cfg)
expanse, err := exp.New(cfg)
if err != nil {
return nil, err
}
// import the genesis block
ethereum.ResetWithGenesisBlock(test.Genesis)
expanse.ResetWithGenesisBlock(test.Genesis)
// import pre accounts
_, err = test.InsertPreState(db, cfg.AccountManager)
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)
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()
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 {
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
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main
@ -24,13 +24,14 @@ import (
"time"
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/expanse-project/go-expanse/cmd/utils"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/core"
"github.com/expanse-project/go-expanse/core/state"
"github.com/expanse-project/go-expanse/core/types"
"github.com/expanse-project/go-expanse/ethdb"
"github.com/expanse-project/go-expanse/logger/glog"
)
var (
@ -66,7 +67,7 @@ if already existing.
Usage: `dump a specific block from storage`,
Description: `
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
// This file is part of go-ethereum.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main
@ -28,18 +28,18 @@ import (
"sort"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/common/registrar"
"github.com/ethereum/go-ethereum/eth"
re "github.com/ethereum/go-ethereum/jsre"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc/api"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
"github.com/ethereum/go-ethereum/rpc/shared"
"github.com/ethereum/go-ethereum/xeth"
"github.com/expanse-project/go-expanse/cmd/utils"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/common/natspec"
"github.com/expanse-project/go-expanse/common/registrar"
"github.com/expanse-project/go-expanse/exp"
re "github.com/expanse-project/go-expanse/jsre"
"github.com/expanse-project/go-expanse/rpc"
"github.com/expanse-project/go-expanse/rpc/api"
"github.com/expanse-project/go-expanse/rpc/codec"
"github.com/expanse-project/go-expanse/rpc/comms"
"github.com/expanse-project/go-expanse/rpc/shared"
"github.com/expanse-project/go-expanse/xeth"
"github.com/peterh/liner"
"github.com/robertkrimen/otto"
)
@ -77,13 +77,13 @@ func (r dumbterm) AppendHistory(string) {}
type jsre struct {
re *re.JSRE
ethereum *eth.Ethereum
expanse *exp.Expanse
xeth *xeth.XEth
wait chan *big.Int
ps1 string
atexit func()
corsDomain string
client comms.EthereumClient
client comms.ExpanseClient
prompter
}
@ -146,7 +146,9 @@ func apiWordCompleter(line string, pos int) (head string, completions []string,
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.wait = make(chan *big.Int)
js.client = client
@ -176,18 +178,22 @@ func newLightweightJSRE(docRoot string, client comms.EthereumClient, datadir str
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
js.corsDomain = corsDomain
if f == nil {
f = js
}
js.xeth = xeth.New(ethereum, f)
js.xeth = xeth.New(expanse, f)
js.wait = js.xeth.UpdateState()
js.client = client
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...))
}
}
@ -202,14 +208,14 @@ func newJSRE(ethereum *eth.Ethereum, docRoot, corsDomain string, client comms.Et
js.prompter = dumbterm{bufio.NewReader(os.Stdin)}
} else {
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)
js.loadAutoCompletion()
lr.SetWordCompleter(apiWordCompleter)
lr.SetTabCompletionStyle(liner.TabPrints)
js.prompter = lr
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()
close(js.wait)
}
@ -240,17 +246,19 @@ func (self *jsre) batch(statement string) {
self.re.Stop(false)
}
// show summary of current geth instance
// show summary of current gexp instance
func (self *jsre) welcome() {
self.re.Run(`
(function () {
console.log('instance: ' + web3.version.client);
console.log(' datadir: ' + admin.datadir);
console.log("coinbase: " + eth.coinbase);
var ts = 1000 * eth.getBlock(eth.blockNumber).timestamp;
console.log("at block: " + eth.blockNumber + " (" + new Date(ts) + ")");
})();
`)
(function () {
console.log('instance: ' + web3.version.client);
console.log(' datadir: ' + admin.datadir);
console.log("coinbase: " + exp.coinbase);
var ts = 1000 * exp.getBlock(exp.blockNumber).timestamp;
console.log("at block: " + exp.blockNumber + " (" + new Date(ts) + ")");
})();
`)
if modules, err := self.supportedApis(); err == nil {
loadedModules := make([]string, 0)
for api, version := range modules {
@ -276,7 +284,7 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
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 {
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)
}
err = js.re.Compile("ethereum.js", re.Web3_JS)
err = js.re.Compile("expanse.js", re.Web3_JS)
if err != nil {
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
shortcuts := "var eth = web3.eth; "
shortcuts := "var exp = web3.exp; "
for _, apiName := range apiNames {
if apiName == shared.Web3ApiName {
continue // manually mapped
@ -329,7 +337,9 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
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
}
@ -342,8 +352,9 @@ func (self *jsre) AskPassword() (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)
answer, _ := self.Prompt("Confirm Transaction [y/n]")
return strings.HasPrefix(strings.Trim(answer, " "), "y")
@ -359,7 +370,7 @@ func (self *jsre) UnlockAccount(addr []byte) bool {
return false
}
// 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
} else {
fmt.Println("Account is now unlocked for this session.")
@ -437,6 +448,7 @@ func mustLogInHistory(input string) bool {
!leadingSpace.MatchString(input)
}
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)
if err != nil {

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main
@ -28,18 +28,19 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/compiler"
"github.com/ethereum/go-ethereum/common/httpclient"
"github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/common/registrar"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
"github.com/expanse-project/go-expanse/accounts"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/common/compiler"
"github.com/expanse-project/go-expanse/common/httpclient"
"github.com/expanse-project/go-expanse/common/natspec"
"github.com/expanse-project/go-expanse/common/registrar"
"github.com/expanse-project/go-expanse/core"
"github.com/expanse-project/go-expanse/crypto"
"github.com/expanse-project/go-expanse/exp"
"github.com/expanse-project/go-expanse/ethdb"
"github.com/expanse-project/go-expanse/rpc/codec"
"github.com/expanse-project/go-expanse/rpc/comms"
)
const (
@ -66,7 +67,7 @@ type testjethre struct {
}
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 {
panic("unable to unlock")
}
@ -74,18 +75,18 @@ func (self *testjethre) UnlockAccount(acc []byte) 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)
}
return true
}
func testJEthRE(t *testing.T) (string, *testjethre, *eth.Ethereum) {
func testJEthRE(t *testing.T) (string, *testjethre, *exp.Expanse) {
return testREPL(t, nil)
}
func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth.Ethereum) {
tmp, err := ioutil.TempDir("", "geth-test")
func testREPL(t *testing.T, config func(*exp.Config)) (string, *testjethre, *exp.Expanse) {
tmp, err := ioutil.TempDir("", "gexp-test")
if err != nil {
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)})
ks := crypto.NewKeyStorePlain(filepath.Join(tmp, "keystore"))
am := accounts.NewManager(ks)
conf := &eth.Config{
conf := &exp.Config{
NodeKey: testNodeKey,
DataDir: tmp,
AccountManager: am,
@ -109,7 +110,7 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth
if config != nil {
config(conf)
}
ethereum, err := eth.New(conf)
expanse, err := exp.New(conf)
if err != nil {
t.Fatal("%v", err)
}
@ -129,21 +130,22 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth
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)
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
return tmp, tf, ethereum
return tmp, tf, expanse
}
func TestNodeInfo(t *testing.T) {
t.Skip("broken after p2p update")
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
tmp, repl, expanse := testJEthRE(t)
if err := expanse.Start(); err != nil {
t.Fatalf("error starting expanse: %v", err)
}
defer ethereum.Stop()
defer expanse.Stop()
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"}`
@ -151,15 +153,15 @@ func TestNodeInfo(t *testing.T) {
}
func TestAccounts(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
tmp, repl, expanse := testJEthRE(t)
if err := expanse.Start(); err != nil {
t.Fatalf("error starting expanse: %v", err)
}
defer ethereum.Stop()
defer expanse.Stop()
defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `eth.accounts`, `["`+testAddress+`"]`)
checkEvalJSON(t, repl, `eth.coinbase`, `"`+testAddress+`"`)
checkEvalJSON(t, repl, `exp.accounts`, `["`+testAddress+`"]`)
checkEvalJSON(t, repl, `exp.coinbase`, `"`+testAddress+`"`)
val, err := repl.re.Run(`personal.newAccount("password")`)
if err != nil {
t.Errorf("expected no error, got %v", err)
@ -169,26 +171,26 @@ func TestAccounts(t *testing.T) {
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) {
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
tmp, repl, expanse := testJEthRE(t)
if err := expanse.Start(); err != nil {
t.Fatalf("error starting expanse: %v", err)
}
defer ethereum.Stop()
defer expanse.Stop()
defer os.RemoveAll(tmp)
// 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 {
t.Errorf("expected no error, got %v", err)
}
beforeExport := val.String()
// do the export
extmp, err := ioutil.TempDir("", "geth-test-export")
extmp, err := ioutil.TempDir("", "gexp-test-export")
if err != nil {
t.Fatal(err)
}
@ -196,7 +198,7 @@ func TestBlockChain(t *testing.T) {
tmpfile := filepath.Join(extmp, "export.chain")
tmpfileq := strconv.Quote(tmpfile)
ethereum.BlockChain().Reset()
expanse.BlockChain().Reset()
checkEvalJSON(t, repl, `admin.exportChain(`+tmpfileq+`)`, `true`)
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.
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) {
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
tmp, repl, expanse := testJEthRE(t)
if err := expanse.Start(); err != nil {
t.Fatalf("error starting expanse: %v", err)
}
defer ethereum.Stop()
defer expanse.Stop()
defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `eth.mining`, `false`)
checkEvalJSON(t, repl, `exp.mining`, `false`)
}
func TestRPC(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err)
tmp, repl, expanse := testJEthRE(t)
if err := expanse.Start(); err != nil {
t.Errorf("error starting expanse: %v", err)
return
}
defer ethereum.Stop()
defer expanse.Stop()
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) {
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
// and i have no means to fix this, sorry - @obscuren
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err)
tmp, repl, expanse := testJEthRE(t)
if err := expanse.Start(); err != nil {
t.Errorf("error starting expanse: %v", err)
return
}
defer ethereum.Stop()
defer expanse.Stop()
defer os.RemoveAll(tmp)
repl.re.Run(`primary = "` + testAddress + `"`)
checkEvalJSON(t, repl, `eth.getBalance(primary)`, `"`+testBalance+`"`)
checkEvalJSON(t, repl, `exp.getBalance(primary)`, `"`+testBalance+`"`)
}
func TestSignature(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err)
tmp, repl, expanse := testJEthRE(t)
if err := expanse.Start(); err != nil {
t.Errorf("error starting expanse: %v", err)
return
}
defer ethereum.Stop()
defer expanse.Stop()
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
if err != nil {
@ -275,15 +277,15 @@ func TestSignature(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")
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.PowTest = true
})
if err := ethereum.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err)
if err := expanse.Start(); err != nil {
t.Errorf("error starting expanse: %v", err)
return
}
defer ethereum.Stop()
defer expanse.Stop()
defer os.RemoveAll(tmp)
reg := registrar.New(repl.xeth)
@ -321,7 +323,7 @@ func TestContract(t *testing.T) {
if err != nil {
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
}
if checkEvalJSON(t, repl, `source = "`+source+`"`, `"`+source+`"`) != nil {
@ -346,7 +348,7 @@ func TestContract(t *testing.T) {
t.Errorf("%v", err)
}
} 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
}
}
@ -357,7 +359,7 @@ func TestContract(t *testing.T) {
if checkEvalJSON(
t, repl,
`contractaddress = eth.sendTransaction({from: primary, data: contract.code})`,
`contractaddress = exp.sendTransaction({from: primary, data: contract.code})`,
`"0x46d69d55c3c4b86a924a92c9fc4720bb7bce1d74"`,
) != nil {
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"}]');
Multiply7 = eth.contract(abiDef);
Multiply7 = exp.contract(abiDef);
multiply7 = Multiply7.at(contractaddress);
`
_, err = repl.re.Run(callSetup)
@ -443,7 +445,7 @@ multiply7 = Multiply7.at(contractaddress);
}
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
}
@ -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)
return false
}
err = repl.ethereum.StartMining(runtime.NumCPU(), "")
err = repl.expanse.StartMining(runtime.NumCPU(), "")
if err != nil {
t.Errorf("unexpected error mining: %v", err)
return false
}
defer repl.ethereum.StopMining()
defer repl.expanse.StopMining()
timer := time.NewTimer(100 * time.Second)
height := new(big.Int).Add(repl.xeth.CurrentBlock().Number(), big.NewInt(1))

View file

@ -1,20 +1,20 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-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
import (
@ -29,25 +29,26 @@ import (
"time"
"github.com/codegangsta/cli"
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
"github.com/expanse-project/ethash"
"github.com/expanse-project/go-expanse/accounts"
"github.com/expanse-project/go-expanse/cmd/utils"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/core"
"github.com/expanse-project/go-expanse/core/types"
"github.com/expanse-project/go-expanse/exp"
"github.com/expanse-project/go-expanse/ethdb"
"github.com/expanse-project/go-expanse/logger"
"github.com/expanse-project/go-expanse/logger/glog"
"github.com/expanse-project/go-expanse/metrics"
"github.com/expanse-project/go-expanse/params"
"github.com/expanse-project/go-expanse/rlp"
"github.com/expanse-project/go-expanse/rpc/codec"
"github.com/expanse-project/go-expanse/rpc/comms"
)
const (
ClientIdentifier = "Geth"
ClientIdentifier = "Gexp"
Version = "1.3.4"
VersionMajor = 1
VersionMinor = 3
@ -67,7 +68,7 @@ func init() {
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.HideVersion = true // we have a command to print the version
app.Commands = []cli.Command{
@ -120,7 +121,7 @@ Runs quick benchmark on first GPU found.
{
Action: version,
Name: "version",
Usage: "print ethereum version numbers",
Usage: "print expanse version numbers",
Description: `
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",
Usage: "ethereum presale wallet",
Usage: "expanse presale wallet",
Subcommands: []cli.Command{
{
Action: importWallet,
Name: "import",
Usage: "import ethereum presale wallet",
Usage: "import expanse presale wallet",
},
},
Description: `
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
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.
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.
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",
Description: `
ethereum account new
expanse account new
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:
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
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",
Description: `
ethereum account update <address>
expanse account update <address>
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:
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,
changing your password is only possible interactively.
@ -241,7 +242,7 @@ changes.
Usage: "import a private key into a new account",
Description: `
ethereum account import <keyfile>
expanse account import <keyfile>
Imports an unencrypted private key from <keyfile> and creates a new account.
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:
ethereum --password <passwordfile> account import <keyfile>
expanse --password <passwordfile> account import <keyfile>
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
nodes.
`,
@ -267,30 +268,30 @@ nodes.
{
Action: console,
Name: "console",
Usage: `Geth Console: interactive JavaScript environment`,
Usage: `Gexp Console: interactive JavaScript environment`,
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.
See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console
See https://github.com/expanse-project/go-expanse/wiki/Javascipt-Console
`},
{
Action: attach,
Name: "attach",
Usage: `Geth Console: interactive JavaScript environment (connect to node)`,
Usage: `Gexp Console: interactive JavaScript environment (connect to node)`,
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.
See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console.
This command allows to open a console on a running geth node.
See https://github.com/expanse-project/go-expanse/wiki/Javascipt-Console.
This command allows to open a console on a running gexp node.
`,
},
{
Action: execJSFiles,
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: `
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.ExtraData = makeExtra(ctx)
ethereum, err := eth.New(cfg)
expanse, err := exp.New(cfg)
if err != nil {
utils.Fatalf("%v", err)
}
startEth(ctx, ethereum)
startEth(ctx, expanse)
// this blocks the thread
ethereum.WaitForShutdown()
expanse.WaitForShutdown()
}
func attach(ctx *cli.Context) {
var client comms.EthereumClient
var client comms.ExpanseClient
var err error
if ctx.Args().Present() {
client, err = comms.ClientFromEndpoint(ctx.Args().First(), codec.JSON)
@ -431,7 +432,7 @@ func attach(ctx *cli.Context) {
}
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(
@ -451,18 +452,19 @@ func attach(ctx *cli.Context) {
func console(ctx *cli.Context) {
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
cfg.ExtraData = makeExtra(ctx)
ethereum, err := eth.New(cfg)
expanse, err := exp.New(cfg)
if err != nil {
utils.Fatalf("%v", err)
}
client := comms.NewInProcClient(codec.JSON)
startEth(ctx, ethereum)
startEth(ctx, expanse)
repl := newJSRE(
ethereum,
expanse,
ctx.GlobalString(utils.JSpathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
client,
@ -477,21 +479,21 @@ func console(ctx *cli.Context) {
repl.interactive()
}
ethereum.Stop()
ethereum.WaitForShutdown()
expanse.Stop()
expanse.WaitForShutdown()
}
func execJSFiles(ctx *cli.Context) {
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
ethereum, err := eth.New(cfg)
expanse, err := exp.New(cfg)
if err != nil {
utils.Fatalf("%v", err)
}
client := comms.NewInProcClient(codec.JSON)
startEth(ctx, ethereum)
startEth(ctx, expanse)
repl := newJSRE(
ethereum,
expanse,
ctx.GlobalString(utils.JSpathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
client,
@ -502,8 +504,8 @@ func execJSFiles(ctx *cli.Context) {
repl.exec(file)
}
ethereum.Stop()
ethereum.WaitForShutdown()
expanse.Stop()
expanse.WaitForShutdown()
}
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())
}
func startEth(ctx *cli.Context, eth *eth.Ethereum) {
// Start Ethereum itself
utils.StartEthereum(eth)
func startEth(ctx *cli.Context, exp *exp.Expanse) {
// Start Expanse itself
utils.StartExpanse(exp)
am := eth.AccountManager()
am := exp.AccountManager()
account := ctx.GlobalString(utils.UnlockedAccountFlag.Name)
accounts := strings.Split(account, " ")
var passphrases []string
@ -577,17 +579,18 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
}
// Start auxiliary services if enabled.
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)
}
}
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)
}
}
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) {
err := eth.StartMining(
err := exp.StartMining(
ctx.GlobalInt(utils.MinerThreadsFlag.Name),
ctx.GlobalString(utils.MiningGPUFlag.Name))
if err != nil {
@ -709,7 +712,7 @@ func accountImport(ctx *cli.Context) {
func makedag(ctx *cli.Context) {
args := ctx.Args()
wrongArgs := func() {
utils.Fatalf(`Usage: geth makedag <block number> <outputdir>`)
utils.Fatalf(`Usage: gexp makedag <block number> <outputdir>`)
}
switch {
case len(args) == 2:
@ -736,7 +739,7 @@ func makedag(ctx *cli.Context) {
}
func gpuinfo(ctx *cli.Context) {
eth.PrintOpenCLDevices()
exp.PrintOpenCLDevices()
}
func gpubench(ctx *cli.Context) {
@ -750,9 +753,9 @@ func gpubench(ctx *cli.Context) {
if err != nil {
wrongArgs()
}
eth.GPUBench(n)
exp.GPUBench(n)
case len(args) == 0:
eth.GPUBench(0)
exp.GPUBench(0)
default:
wrongArgs()
}
@ -764,7 +767,7 @@ func version(c *cli.Context) {
if 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("Go Version:", runtime.Version())
fmt.Println("OS:", runtime.GOOS)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package main
@ -26,11 +26,11 @@ import (
"time"
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
"github.com/expanse-project/go-expanse/cmd/utils"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/rpc"
"github.com/expanse-project/go-expanse/rpc/codec"
"github.com/expanse-project/go-expanse/rpc/comms"
"github.com/gizak/termui"
)
@ -53,9 +53,9 @@ var (
monitorCommand = cli.Command{
Action: monitor,
Name: "monitor",
Usage: `Geth Monitor: node metrics monitoring and visualization`,
Usage: `Gexp Monitor: node metrics monitoring and visualization`,
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
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.
func monitor(ctx *cli.Context) {
var (
client comms.EthereumClient
client comms.ExpanseClient
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)
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()
@ -95,7 +95,7 @@ func monitor(ctx *cli.Context) {
if len(list) > 0 {
utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - "))
} 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)
@ -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.
func retrieveMetrics(xeth *rpc.Xeth) (map[string]interface{}, error) {
return xeth.Call("debug_metrics", []interface{}{true})

View file

@ -1,5 +1,5 @@
// 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
// it under the terms of the GNU General Public License as published by
@ -12,7 +12,7 @@
// GNU General Public License for more details.
//
// 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.
@ -22,7 +22,7 @@ import (
"io"
"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.
@ -59,7 +59,7 @@ type flagGroup struct {
// AppHelpFlagGroups is the application flags, grouped by functionality.
var AppHelpFlagGroups = []flagGroup{
{
Name: "ETHEREUM",
Name: "EXPANSE",
Flags: []cli.Flag{
utils.DataDirFlag,
utils.NetworkIdFlag,

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-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.
package main
@ -26,7 +26,7 @@ import (
"os"
"strings"
"github.com/ethereum/go-ethereum/rlp"
"github.com/expanse-project/go-expanse/rlp"
)
var (

View file

@ -1,20 +1,20 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-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
import (
@ -26,13 +26,13 @@ import (
"regexp"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/rlp"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/core"
"github.com/expanse-project/go-expanse/core/types"
"github.com/expanse-project/go-expanse/exp"
"github.com/expanse-project/go-expanse/logger"
"github.com/expanse-project/go-expanse/logger/glog"
"github.com/expanse-project/go-expanse/rlp"
"github.com/peterh/liner"
)
@ -110,10 +110,10 @@ func Fatalf(format string, args ...interface{}) {
os.Exit(1)
}
func StartEthereum(ethereum *eth.Ethereum) {
glog.V(logger.Info).Infoln("Starting", ethereum.Name())
if err := ethereum.Start(); err != nil {
Fatalf("Error starting Ethereum: %v", err)
func StartExpanse(expanse *exp.Expanse) {
glog.V(logger.Info).Infoln("Starting", expanse.Name())
if err := expanse.Start(); err != nil {
Fatalf("Error starting Expanse: %v", err)
}
go func() {
sigc := make(chan os.Signal, 1)
@ -121,7 +121,7 @@ func StartEthereum(ethereum *eth.Ethereum) {
defer signal.Stop(sigc)
<-sigc
glog.V(logger.Info).Infoln("Got interrupt, shutting down...")
go ethereum.Stop()
go expanse.Stop()
logger.Flush()
for i := 10; i > 0; i-- {
<-sigc

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
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.
// e.g. ~/.ethereum -> /home/username/.ethereum
// e.g. ~/.expanse -> /home/username/.expanse
type DirectoryFlag struct {
cli.GenericFlag
Name string

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package utils

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
// Copyright 2015 The go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// 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-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-expanse. If not, see <http://www.gnu.org/licenses/>.
package utils
@ -30,26 +30,26 @@ import (
"strconv"
"github.com/codegangsta/cli"
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc/api"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
"github.com/ethereum/go-ethereum/rpc/shared"
"github.com/ethereum/go-ethereum/rpc/useragent"
"github.com/ethereum/go-ethereum/xeth"
"github.com/expanse-project/ethash"
"github.com/expanse-project/go-expanse/accounts"
"github.com/expanse-project/go-expanse/common"
"github.com/expanse-project/go-expanse/core"
"github.com/expanse-project/go-expanse/core/vm"
"github.com/expanse-project/go-expanse/crypto"
"github.com/expanse-project/go-expanse/exp"
"github.com/expanse-project/go-expanse/ethdb"
"github.com/expanse-project/go-expanse/event"
"github.com/expanse-project/go-expanse/logger"
"github.com/expanse-project/go-expanse/logger/glog"
"github.com/expanse-project/go-expanse/metrics"
"github.com/expanse-project/go-expanse/p2p/nat"
"github.com/expanse-project/go-expanse/params"
"github.com/expanse-project/go-expanse/rpc/api"
"github.com/expanse-project/go-expanse/rpc/codec"
"github.com/expanse-project/go-expanse/rpc/comms"
"github.com/expanse-project/go-expanse/rpc/shared"
"github.com/expanse-project/go-expanse/rpc/useragent"
"github.com/expanse-project/go-expanse/xeth"
)
func init() {
@ -107,7 +107,7 @@ var (
NetworkIdFlag = cli.IntFlag{
Name: "networkid",
Usage: "Network identifier (integer, 0=Olympic, 1=Frontier, 2=Morden)",
Value: eth.NetworkId,
Value: exp.NetworkId,
}
OlympicFlag = cli.BoolFlag{
Name: "olympic",
@ -268,7 +268,7 @@ var (
RPCPortFlag = cli.IntFlag{
Name: "rpcport",
Usage: "HTTP-RPC server listening port",
Value: 8545,
Value: 9656,
}
RPCCORSDomainFlag = cli.StringFlag{
Name: "rpccorsdomain",
@ -312,7 +312,7 @@ var (
ListenPortFlag = cli.IntFlag{
Name: "port",
Usage: "Network listening port",
Value: 30303,
Value: 42786,
}
BootnodesFlag = cli.StringFlag{
Name: "bootnodes",
@ -413,8 +413,8 @@ func MakeNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
return key
}
// MakeEthConfig creates ethereum options from set command line flags.
func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
// MakeEthConfig creates expanse options from set command line flags.
func MakeEthConfig(clientID, version string, ctx *cli.Context) *exp.Config {
customName := ctx.GlobalString(IdentityFlag.Name)
if len(customName) > 0 {
clientID += "/" + customName
@ -424,8 +424,9 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
if err != nil {
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),
DataDir: MustDataDir(ctx),
GenesisFile: ctx.GlobalString(GenesisFileFlag.Name),
@ -496,7 +497,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
cfg.Shh = true
}
if !ctx.GlobalIsSet(DataDirFlag.Name) {
cfg.DataDir = os.TempDir() + "/ethereum_dev_mode"
cfg.DataDir = os.TempDir() + "/expanse_dev_mode"
}
cfg.PowTest = true
cfg.DevMode = true
@ -535,6 +536,7 @@ func SetupVM(ctx *cli.Context) {
vm.SetJITCacheSize(ctx.GlobalInt(VMJitCacheFlag.Name))
}
// MakeChain creates a chain manager from set command line flags.
func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database) {
datadir := MustDataDir(ctx)
@ -597,7 +599,7 @@ func IpcSocketPath(ctx *cli.Context) (ipcpath string) {
} else {
ipcpath = common.DefaultIpcPath()
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) {
ipcpath = ctx.GlobalString(IPCPathFlag.Name)
@ -607,15 +609,16 @@ func IpcSocketPath(ctx *cli.Context) (ipcpath string) {
return
}
func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
func StartIPC(exp *exp.Expanse, ctx *cli.Context) error {
config := comms.IpcConfig{
Endpoint: IpcSocketPath(ctx),
}
initializer := func(conn net.Conn) (comms.Stopper, shared.EthereumApi, error) {
fe := useragent.NewRemoteFrontend(conn, eth.AccountManager())
xeth := xeth.New(eth, fe)
apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec.JSON, xeth, eth)
initializer := func(conn net.Conn) (comms.Stopper, shared.ExpanseApi, error) {
fe := useragent.NewRemoteFrontend(conn, exp.AccountManager())
xeth := xeth.New(exp, fe)
apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec.JSON, xeth, exp)
if err != nil {
return nil, nil, err
}
@ -625,17 +628,17 @@ func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
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{
ListenAddress: ctx.GlobalString(RPCListenAddrFlag.Name),
ListenPort: uint(ctx.GlobalInt(RPCPortFlag.Name)),
CorsDomain: ctx.GlobalString(RPCCORSDomainFlag.Name),
}
xeth := xeth.New(eth, nil)
xeth := xeth.New(exp, nil)
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 {
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
[![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
As a subdirectory the main go-ethereum repository, you get it with
`go get github.com/ethereum/go-ethereum`.
As a subdirectory the main go-expanse repository, you get it with
`go get github.com/expanse-project/go-expanse`.
# Usage
## 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
[Wiki](http://wiki.ethereum.org/index.php/RLP) article.
RLP Encoding is an encoding scheme utilized by the Expanse project. It
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
rlp := common.Encode("doge")
@ -32,10 +34,11 @@ fmt.Println(decoded) // => ["dog" "cat"]
## 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
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
it satisfies the Database interface found in `common/db.go`.

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-ethereum Authors && Copyright 2015 go-expanse Authors
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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

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