diff --git a/README.md b/README.md index fdc0bf331cf721daaf2556f04f992d7a74079034..6e9beb9be4bc4d4be14a298a91dc01d9c9d8fc27 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ archives are published at https://geth.ethereum.org/downloads/. For prerequisites and detailed build instructions please read the [Installation Instructions](https://github.com/maticnetwork/bor/wiki/Building-Ethereum) on the wiki. -Building `geth` requires both a Go (version 1.10 or later) and a C compiler. You can install +Building `bor` requires both a Go (version 1.10 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run ```shell -make geth +make bor ``` or, to build the full suite of utilities: @@ -32,22 +32,22 @@ make all The go-ethereum project comes with several wrappers/executables found in the `cmd` directory. -| Command | Description | -| :-----------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`geth`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default), archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `geth --help` and the [CLI Wiki page](https://github.com/maticnetwork/bor/wiki/Command-Line-Options) for command line options. | +| Command | Description | +| :-----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **`bor`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default), archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `geth --help` and the [CLI Wiki page](https://github.com/maticnetwork/bor/wiki/Command-Line-Options) for command line options. | | `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/maticnetwork/bor/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) wiki page for details. | -| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. | -| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). | -| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereum/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/ethereum/rpc-tests/blob/master/README.md) for details. | -| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). | -| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. | +| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. | +| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). | +| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereum/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/ethereum/rpc-tests/blob/master/README.md) for details. | +| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). | +| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. | -## Running `geth` +## Running `bor` Going through all the possible command line flags is out of scope here (please consult our -[CLI Wiki page](https://github.com/maticnetwork/bor/wiki/Command-Line-Options)), +[CLI Wiki page](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options)), but we've enumerated a few common parameter combos to get you up to speed quickly -on how you can run your own `geth` instance. +on how you can run your own `bor` instance. ### Full node on the main Ethereum network @@ -65,9 +65,9 @@ This command will: - Start `geth` in fast sync mode (default, can be changed with the `--syncmode` flag), causing it to download more data in exchange for avoiding processing the entire history of the Ethereum network, which is very CPU intensive. -- Start up `geth`'s built-in interactive [JavaScript console](https://github.com/maticnetwork/bor/wiki/JavaScript-Console), +- Start up `geth`'s built-in interactive [JavaScript console](https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console), (via the trailing `console` subcommand) through which you can invoke all official [`web3` methods](https://github.com/ethereum/wiki/wiki/JavaScript-API) - as well as `geth`'s own [management APIs](https://github.com/maticnetwork/bor/wiki/Management-APIs). + as well as `geth`'s own [management APIs](https://github.com/ethereum/go-ethereum/wiki/Management-APIs). This tool is optional and if you leave it out you can always attach to an already running `geth` instance with `geth attach`. @@ -104,63 +104,30 @@ use separate accounts for play-money and real-money. Unless you manually move accounts, `geth` will by default correctly separate the two networks and will not make any accounts available between them._ -### Full node on the Rinkeby test network - -The above test network is a cross-client one based on the ethash proof-of-work consensus -algorithm. As such, it has certain extra overhead and is more susceptible to reorganization -attacks due to the network's low difficulty/security. Go Ethereum also supports connecting -to a proof-of-authority based test network called [_Rinkeby_](https://www.rinkeby.io) -(operated by members of the community). This network is lighter, more secure, but is only -supported by go-ethereum. - -```shell -$ geth --rinkeby console -``` - ### Configuration -As an alternative to passing the numerous flags to the `geth` binary, you can also pass a +As an alternative to passing the numerous flags to the `bor` binary, you can also pass a configuration file via: ```shell -$ geth --config /path/to/your_config.toml +$ bor --config /path/to/your_config.toml ``` To get an idea how the file should look like you can use the `dumpconfig` subcommand to export your existing configuration: ```shell -$ geth --your-favourite-flags dumpconfig +$ bor --your-favourite-flags dumpconfig ``` _Note: This works only with `geth` v1.6.0 and above._ -#### Docker quick start - -One of the quickest ways to get Ethereum up and running on your machine is by using -Docker: - -```shell -docker run -d --name ethereum-node -v /Users/alice/ethereum:/root \ - -p 8545:8545 -p 30303:30303 \ - ethereum/client-go -``` - -This will start `geth` in fast-sync mode with a DB memory allowance of 1GB just as the -above command does. It will also create a persistent volume in your home directory for -saving your blockchain as well as map the default ports. There is also an `alpine` tag -available for a slim version of the image. - -Do not forget `--rpcaddr 0.0.0.0`, if you want to access RPC from other containers -and/or hosts. By default, `geth` binds to the local interface and RPC endpoints is not -accessible from the outside. - -### Programmatically interfacing `geth` nodes +### Programmatically interfacing `bor` nodes As a developer, sooner rather than later you'll want to start interacting with `geth` and the Ethereum network via your own programs and not manually through the console. To aid this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://github.com/ethereum/wiki/wiki/JSON-RPC) -and [`geth` specific APIs](https://github.com/maticnetwork/bor/wiki/Management-APIs)). +and [`bor` specific APIs](https://github.com/maticnetwork/bor/wiki/Management-APIs)). These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based platforms, and named pipes on Windows). @@ -196,148 +163,12 @@ Ethereum nodes with exposed APIs! Further, all browser tabs can access locally running web servers, so malicious web pages could try to subvert locally available APIs!** -### Operating a private network - -Maintaining your own private network is more involved as a lot of configurations taken for -granted in the official networks need to be manually set up. - -#### Defining the private genesis state - -First, you'll need to create the genesis state of your networks, which all nodes need to be -aware of and agree upon. This consists of a small JSON file (e.g. call it `genesis.json`): - -```json -{ - "config": { - "chainId": 0, - "homesteadBlock": 0, - "eip155Block": 0, - "eip158Block": 0 - }, - "alloc": {}, - "coinbase": "0x0000000000000000000000000000000000000000", - "difficulty": "0x20000", - "extraData": "", - "gasLimit": "0x2fefd8", - "nonce": "0x0000000000000042", - "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": "0x00" -} -``` - -The above fields should be fine for most purposes, although we'd recommend changing -the `nonce` to some random value so you prevent unknown remote nodes from being able -to connect to you. If you'd like to pre-fund some accounts for easier testing, you can -populate the `alloc` field with account configs: - -```json -"alloc": { - "0x0000000000000000000000000000000000000001": { - "balance": "111111111" - }, - "0x0000000000000000000000000000000000000002": { - "balance": "222222222" - } -} -``` - -With the genesis state defined in the above JSON file, you'll need to initialize **every** -`geth` node with it prior to starting it up to ensure all blockchain parameters are correctly -set: - -```shell -$ geth init path/to/genesis.json -``` - -#### Creating the rendezvous point - -With all nodes that you want to run initialized to the desired genesis state, you'll need to -start a bootstrap node that others can use to find each other in your network and/or over -the internet. The clean way is to configure and run a dedicated bootnode: - -```shell -$ bootnode --genkey=boot.key -$ bootnode --nodekey=boot.key -``` - -With the bootnode online, it will display an [`enode` URL](https://github.com/ethereum/wiki/wiki/enode-url-format) -that other nodes can use to connect to it and exchange peer information. Make sure to -replace the displayed IP address information (most probably `[::]`) with your externally -accessible IP to get the actual `enode` URL. - -_Note: You could also use a full-fledged `geth` node as a bootnode, but it's the less -recommended way._ - -#### Starting up your member nodes - -With the bootnode operational and externally reachable (you can try -`telnet <ip> <port>` to ensure it's indeed reachable), start every subsequent `geth` -node pointed to the bootnode for peer discovery via the `--bootnodes` flag. It will -probably also be desirable to keep the data directory of your private network separated, so -do also specify a custom `--datadir` flag. - -```shell -$ geth --datadir=path/to/custom/data/folder --bootnodes=<bootnode-enode-url-from-above> -``` - -_Note: Since your network will be completely cut off from the main and test networks, you'll -also need to configure a miner to process transactions and create new blocks for you._ - -#### Running a private miner - -Mining on the public Ethereum network is a complex task as it's only feasible using GPUs, -requiring an OpenCL or CUDA enabled `ethminer` instance. For information on such a -setup, please consult the [EtherMining subreddit](https://www.reddit.com/r/EtherMining/) -and the [Genoil miner](https://github.com/Genoil/cpp-ethereum) repository. - -In a private network setting, however a single CPU miner instance is more than enough for -practical purposes as it can produce a stable stream of blocks at the correct intervals -without needing heavy resources (consider running on a single thread, no need for multiple -ones either). To start a `geth` instance for mining, run it with all your usual flags, extended -by: - -```shell -$ geth <usual-flags> --mine --minerthreads=1 --etherbase=0x0000000000000000000000000000000000000000 -``` - -Which will start mining blocks and transactions on a single CPU thread, crediting all -proceedings to the account specified by `--etherbase`. You can further tune the mining -by changing the default gas limit blocks converge to (`--targetgaslimit`) and the price -transactions are accepted at (`--gasprice`). - -## Contribution - -Thank you for considering to help out with the source code! We welcome contributions -from anyone on the internet, and are grateful for even the smallest of fixes! - -If you'd like to contribute to go-ethereum, please fork, fix, commit and send a pull request -for the maintainers to review and merge into the main code base. If you wish to submit -more complex changes though, please check up with the core devs first on [our gitter channel](https://gitter.im/ethereum/go-ethereum) -to ensure those changes are in line with the general philosophy of the project and/or get -some early feedback which can make both your efforts much lighter as well as our review -and merge procedures quick and simple. - -Please make sure your contributions adhere to our coding guidelines: - -- Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) - guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). -- Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) - guidelines. -- Pull requests need to be based on and opened against the `master` branch. -- Commit messages should be prefixed with the package(s) they modify. - - E.g. "eth, rpc: make trace configs optional" - -Please see the [Developers' Guide](https://github.com/maticnetwork/bor/wiki/Developers'-Guide) -for more details on configuring your environment, managing project dependencies, and -testing procedures. - ## License -The go-ethereum library (i.e. all code outside of the `cmd` directory) is licensed under the +The bor library (i.e. all code outside of the `cmd` directory) is licensed under the [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html), also included in our repository in the `COPYING.LESSER` file. -The go-ethereum binaries (i.e. all code inside of the `cmd` directory) is licensed under the +The bor binaries (i.e. all code inside of the `cmd` directory) is licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html), also included in our repository in the `COPYING` file. diff --git a/build/ci.go b/build/ci.go index 274bdd45ff7416346e5883e8b2b67087e3232f24..cec9b00a0aa12fb5b5e8a8c813f55f3fd8c48776 100644 --- a/build/ci.go +++ b/build/ci.go @@ -66,7 +66,7 @@ var ( // Files that end up in the geth*.zip archive. gethArchiveFiles = []string{ "COPYING", - executablePath("geth"), + executablePath("bor"), } // Files that end up in the geth-alltools*.zip archive. @@ -75,7 +75,7 @@ var ( executablePath("abigen"), executablePath("bootnode"), executablePath("evm"), - executablePath("geth"), + executablePath("bor"), executablePath("puppeth"), executablePath("rlpdump"), executablePath("wnode"), @@ -97,7 +97,7 @@ var ( Description: "Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode.", }, { - BinaryName: "geth", + BinaryName: "bor", Description: "Ethereum CLI client.", }, { diff --git a/cmd/bor/main.go b/cmd/bor/main.go index 6c25578489b8a088985a57cf2dc8312c93a5ef06..d187f40d71e375adae7dec25172af5b86cad2dec 100644 --- a/cmd/bor/main.go +++ b/cmd/bor/main.go @@ -46,7 +46,7 @@ import ( ) const ( - clientIdentifier = "geth" // Client identifier to advertise over the network + clientIdentifier = "bor" // Client identifier to advertise over the network ) var ( diff --git a/eth/backend.go b/eth/backend.go index ce5d2a9dc63a38a6c788d30317e371062ab92910..ac5b3ba9aa3c9dd72044d8a87ba5822d7b005b2d 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -236,7 +236,7 @@ func makeExtraData(extra []byte) []byte { // create default extradata extra, _ = rlp.EncodeToBytes([]interface{}{ uint(params.VersionMajor<<16 | params.VersionMinor<<8 | params.VersionPatch), - "geth", + "bor", runtime.Version(), runtime.GOOS, }) diff --git a/miner/stress_clique.go b/miner/stress_clique.go index 89c9101d555da7984f9b56850c9065d549222fa0..27a6d258dd66bc64f1fc93650738f2096cae1ef1 100644 --- a/miner/stress_clique.go +++ b/miner/stress_clique.go @@ -175,7 +175,7 @@ func makeSealer(genesis *core.Genesis) (*node.Node, error) { datadir, _ := ioutil.TempDir("", "") config := &node.Config{ - Name: "geth", + Name: "bor", Version: params.Version, DataDir: datadir, P2P: p2p.Config{ diff --git a/miner/stress_ethash.go b/miner/stress_ethash.go index 32107ca83f5fd754c81196d44d3686190925bddd..92d93b815e977ea2909464e6a96414efc34b44de 100644 --- a/miner/stress_ethash.go +++ b/miner/stress_ethash.go @@ -153,7 +153,7 @@ func makeMiner(genesis *core.Genesis) (*node.Node, error) { datadir, _ := ioutil.TempDir("", "") config := &node.Config{ - Name: "geth", + Name: "bor", Version: params.Version, DataDir: datadir, P2P: p2p.Config{ diff --git a/node/config.go b/node/config.go index 07f97a72c0473563095518a7f43510f28b52b47b..9f8806599b0773a495b552977560933e8c3458b5 100644 --- a/node/config.go +++ b/node/config.go @@ -287,8 +287,8 @@ func (c *Config) ExtRPCEnabled() bool { func (c *Config) NodeName() string { name := c.name() // Backwards compatibility: previous versions used title-cased "Geth", keep that. - if name == "geth" || name == "geth-testnet" { - name = "Geth" + if name == "bor" || name == "bor-testnet" { + name = "Bor" } if c.UserIdent != "" { name += "/" + c.UserIdent @@ -333,7 +333,7 @@ func (c *Config) ResolvePath(path string) string { // by geth 1.4 are used if they exist. if warn, isOld := isOldGethResource[path]; isOld { oldpath := "" - if c.name() == "geth" { + if c.name() == "bor" { oldpath = filepath.Join(c.DataDir, path) } if oldpath != "" && common.FileExist(oldpath) {