This commit is contained in:
Franko 2015-09-01 18:56:30 -04:00
commit 554f07b16e
8 changed files with 113 additions and 33 deletions

View file

@ -56,7 +56,6 @@ Go Expanse comes with several wrappers/executables found in
To get the options available:
<<<<<<< HEAD
geth help
For further details on options, see the [wiki](https://github.com/expanse-project/go-expanse/wiki/Command-Line-Options)

View file

@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -e
<<<<<<< HEAD
echo "" > coverage.txt
for d in $(find ./* -maxdepth 10 -type d -not -path "./build" -not -path "./Godeps/*" ); do

View file

@ -145,7 +145,7 @@ func apiWordCompleter(line string, pos int) (head string, completions []string,
return begin, completionWords, end
}
func newLightweightJSRE(libPath string, client comms.EthereumClient, interactive bool) *jsre {
func newLightweightJSRE(libPath string, client comms.ExpanseClient, interactive bool) *jsre {
js := &jsre{ps1: "> "}
js.wait = make(chan *big.Int)
js.client = client
@ -330,7 +330,7 @@ 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
}

View file

@ -518,12 +518,12 @@ func StartIPC(exp *exp.Expanse, ctx *cli.Context) error {
Endpoint: IpcSocketPath(ctx),
}
initializer := func(conn net.Conn) (shared.EthereumApi, error) {
initializer := func(conn net.Conn) (shared.ExpanseApi, error) {
fe := useragent.NewRemoteFrontend(conn, eth.AccountManager())
xeth := xeth.New(eth, fe)
xeth := xeth.New(exp, fe)
codec := codec.JSON
apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec, xeth, eth)
apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec, xeth, exp)
if err != nil {
return nil, err
}

View file

@ -370,14 +370,14 @@ func New(config *Config) (*Expanse, error) {
}
exp.txPool = core.NewTxPool(exp.EventMux(), exp.chainManager.State, exp.chainManager.GasLimit)
<<<<<<< HEAD
<<<<<<< HEAD:exp/backend.go
exp.blockProcessor = core.NewBlockProcessor(chainDb, exp.pow, exp.chainManager, exp.EventMux())
exp.chainManager.SetProcessor(exp.blockProcessor)
exp.protocolManager = NewProtocolManager(config.NetworkId, exp.eventMux, eth.txPool, exp.pow, exp.chainManager)
eth.miner = miner.New(eth, eth.EventMux(), eth.pow)
eth.miner.SetGasPrice(config.GasPrice)
eth.miner.SetExtra(config.ExtraData)
exp.miner = miner.New(eth, exp.EventMux(), exp.pow)
exp.miner.SetGasPrice(config.GasPrice)
exp.miner.SetExtra(config.ExtraData)
if config.Shh {
exp.whisper = whisper.New()
@ -531,7 +531,7 @@ func (s *Expanse) NetVersion() int { return s.netVersionId
func (s *Expanse) ShhVersion() int { return s.shhVersionId }
func (s *Expanse) Downloader() *downloader.Downloader { return s.protocolManager.downloader }
// Start the ethereum
// Start the expanse
func (s *Expanse) Start() error {
jsonlogger.LogJson(&logger.LogStarting{
ClientString: s.net.Name,

29
fdtrack/fdusage.go Normal file
View file

@ -0,0 +1,29 @@
// Copyright 2015 The go-expanse Authors
// This file is part of the go-expanse library.
//
// 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-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-expanse library. If not, see <http://www.gnu.org/licenses/>.
// +build !linux,!darwin
package fdtrack
import "errors"
func fdlimit() int {
return 0
}
func fdusage() (int, error) {
return 0, errors.New("not implemented")
}

53
fdtrack/fdusage_linux.go Normal file
View file

@ -0,0 +1,53 @@
// Copyright 2015 The go-expanse Authors
// This file is part of the go-expanse library.
//
// 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-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-expanse library. If not, see <http://www.gnu.org/licenses/>.
// +build linux
package fdtrack
import (
"io"
"os"
"syscall"
)
func fdlimit() int {
var nofile syscall.Rlimit
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &nofile); err != nil {
return 0
}
return int(nofile.Cur)
}
func fdusage() (int, error) {
f, err := os.Open("/proc/self/fd")
if err != nil {
return 0, err
}
defer f.Close()
const batchSize = 100
n := 0
for {
list, err := f.Readdirnames(batchSize)
n += len(list)
if err == io.EOF {
break
} else if err != nil {
return 0, err
}
}
return n, nil
}

View file

@ -3105,7 +3105,7 @@ SolidityEvent.prototype.types = function (indexed) {
};
/**
* Should be used to get event display name
* Exp methods and properties
*
* @method displayName
* @return {String} event display name
@ -4374,20 +4374,20 @@ module.exports = Iban;
},{"bignumber.js":"bignumber.js"}],33:[function(require,module,exports){
/*
This file is part of ethereum.js.
This file is part of expanse.js.
ethereum.js is free software: you can redistribute it and/or modify
expanse.js 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.
ethereum.js is distributed in the hope that it will be useful,
expanse.js 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 ethereum.js. If not, see <http://www.gnu.org/licenses/>.
along with expanse.js. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file ipcprovider.js
* @authors:
@ -4594,20 +4594,20 @@ module.exports = IpcProvider;
},{"../utils/utils":20,"./errors":26}],34:[function(require,module,exports){
/*
This file is part of ethereum.js.
This file is part of expanse.js.
ethereum.js is free software: you can redistribute it and/or modify
expanse.js 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.
ethereum.js is distributed in the hope that it will be useful,
expanse.js 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 ethereum.js. If not, see <http://www.gnu.org/licenses/>.
along with expanse.js. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file jsonrpc.js
* @authors:
@ -4687,20 +4687,20 @@ module.exports = Jsonrpc;
},{}],35:[function(require,module,exports){
/*
This file is part of ethereum.js.
This file is part of expanse.js.
ethereum.js is free software: you can redistribute it and/or modify
expanse.js 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.
ethereum.js is distributed in the hope that it will be useful,
expanse.js 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 ethereum.js. If not, see <http://www.gnu.org/licenses/>.
along with expanse.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file method.js
@ -4861,20 +4861,20 @@ module.exports = Method;
},{"../utils/utils":20,"./errors":26,"./requestmanager":43}],36:[function(require,module,exports){
/*
This file is part of ethereum.js.
This file is part of expanse.js.
ethereum.js is free software: you can redistribute it and/or modify
expanse.js 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.
ethereum.js is distributed in the hope that it will be useful,
expanse.js 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 ethereum.js. If not, see <http://www.gnu.org/licenses/>.
along with expanse.js. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file db.js
* @authors:
@ -4919,20 +4919,20 @@ module.exports = {
},{"../method":35}],37:[function(require,module,exports){
/*
This file is part of ethereum.js.
This file is part of expanse.js.
ethereum.js is free software: you can redistribute it and/or modify
expanse.js 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.
ethereum.js is distributed in the hope that it will be useful,
expanse.js 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 ethereum.js. If not, see <http://www.gnu.org/licenses/>.
along with expanse.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file eth.js