diff --git a/README.md b/README.md index 06557fe3be..7be16315d4 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/build/test-global-coverage.sh b/build/test-global-coverage.sh index 227cd1287d..a51b6a9e57 100755 --- a/build/test-global-coverage.sh +++ b/build/test-global-coverage.sh @@ -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 diff --git a/cmd/gexp/js.go b/cmd/gexp/js.go index 860cd36faa..65a1c28b39 100644 --- a/cmd/gexp/js.go +++ b/cmd/gexp/js.go @@ -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 } diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index bfbc99bf59..4e583d56c5 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -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 } diff --git a/exp/backend.go b/exp/backend.go index e1982794ec..fe607f64ec 100644 --- a/exp/backend.go +++ b/exp/backend.go @@ -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, diff --git a/fdtrack/fdusage.go b/fdtrack/fdusage.go new file mode 100644 index 0000000000..0e0df6da7f --- /dev/null +++ b/fdtrack/fdusage.go @@ -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 . + +// +build !linux,!darwin + +package fdtrack + +import "errors" + +func fdlimit() int { + return 0 +} + +func fdusage() (int, error) { + return 0, errors.New("not implemented") +} diff --git a/fdtrack/fdusage_linux.go b/fdtrack/fdusage_linux.go new file mode 100644 index 0000000000..e5e16f3a00 --- /dev/null +++ b/fdtrack/fdusage_linux.go @@ -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 . + +// +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 +} diff --git a/jsre/ethereum_js.go b/jsre/ethereum_js.go index e28bc02fc3..ab77132d60 100644 --- a/jsre/ethereum_js.go +++ b/jsre/ethereum_js.go @@ -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 . + along with expanse.js. If not, see . */ /** @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 . + along with expanse.js. If not, see . */ /** @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 . + along with expanse.js. If not, see . */ /** * @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 . + along with expanse.js. If not, see . */ /** @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 . + along with expanse.js. If not, see . */ /** * @file eth.js