From 7366f33410e276bfa6c87d783fece5f3e7a22640 Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Wed, 24 Nov 2021 10:41:15 -0400 Subject: [PATCH 1/8] Update README.md --- README.md | 382 +++++++++++++----------------------------------------- 1 file changed, 93 insertions(+), 289 deletions(-) diff --git a/README.md b/README.md index 331a883e9..8bbd4993d 100644 --- a/README.md +++ b/README.md @@ -1,289 +1,93 @@ -## Webchaind - -Official Go language implementation of the MintMe.com Coin daemon. - -## Install Webchaind - -### :gift: Official Releases -Regular releases will be published on the [release page](https://github.com/webchain-network/webchaind/releases). Binaries will be provided for all releases that are considered fairly stable. - -### :hammer: Building the source -If your heart is set on the bleeding edge, install from source. However, please be advised that you may encounter some strange things, and we can't prioritize support beyond the release versions. Recommended for developers only. - -#### Dependencies -Building webchaind requires both Go `>=1.12` and a C compiler; building with SputnikVM additionally requires Rust. On Linux systems, a `C` compiler can, for example, be installed with `sudo apt-get install build-essential`. On Mac: `xcode-select --install`. For Rust, please use [Rustup](https://rustup.rs/) by executing `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`. - -#### Build using `make` -With [Go modules](https://github.com/golang/go/wiki/Modules), dependencies will be downloaded and cached when running build or test commands automatically. - -Clone the repository: - -``` -git clone https://github.com/webchain-network/webchaind.git && cd webchaind -``` - -Build all executables: - -``` -make build -``` - -Build just webchaind: -``` -make cmd/webchaind -``` - -For further `make` information, use `make help` to see a list and description of available make commands. - -#### Build using `go` -The following commands work starting with Go version 1.12+; for Go version 1.11, prepend the commands with `GO111MODULE=on` to enable Go modules. Older Go versions are no longer supported. - -```shell -mkdir -p ./bin - -go build -o ./bin/webchaind -ldflags "-X main.Version="`git describe --tags` -tags="netgo" ./cmd/geth -go build -o ./bin/abigen ./cmd/abigen -go build -o ./bin/bootnode ./cmd/bootnode -go build -o ./bin/disasm ./cmd/disasm -go build -o ./bin/ethtest ./cmd/ethtest -go build -o ./bin/evm ./cmd/evm -go build -o ./bin/gethrpctest ./cmd/gethrpctest -go build -o ./bin/rlpdump ./cmd/rlpdump -``` - -## :tv: Executables -This repository includes several wrappers/executables found in the `cmd` directory. - -| Command | Description | -|:----------:|-------------| -| **`webchaind`** | The main MintMe Coin command-line client. It is the entry point into the MintMe Coin network (main-, test-, or private networks), capable of running as a full node (default) archive node (retaining all historical states) or a light node (retrieving data live). It can be used by other processes as a gateway into the MintMe Coin via JSON-RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transport layers. Please see our [Command Line Options](https://github.com/ethereumproject/go-ethereum/wiki/Command-Line-Options) wiki page for details. | -| `abigen` | Source code generator to convert MintMe Coin contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereumproject/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/ethereumproject/go-ethereum/wiki/Native-DApps-in-Go) wiki page for details. | -| `bootnode` | Stripped down version of our MintMe Coin 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. | -| `disasm` | Bytecode disassembler to convert EVM (Ethereum Virtual Machine) bytecode into more user friendly assembly-like opcodes (e.g. `echo "6001" | disasm`). For details on the individual opcodes, please see pages 22-30 of the [Ethereum Yellow Paper](http://gavwood.com/paper.pdf). | -| `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 insolated, fine graned debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). | -| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/etclabscore/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereumproject/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/etclabscore/rpc-tests/blob/master/README.md) for details. | -| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereumproject/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`). | - -## :green_book: Getting started with MintMe Coin - -### Data directory -By default, webchaind will store all node and blockchain data in a parent directory depending on your OS: - -- Linux: `$HOME/.webchain/` -- Mac: `$HOME/Library/Webchain/` -- Windows: `$HOME/AppData/Roaming/Webchain/` - -You can specify this directory with `--data-dir=$HOME/id/rather/put/it/here`. - -Within this parent directory, webchaind will use a `/subdirectory` to hold data for each network you run. The defaults are: - - - `/mainnet` for the Mainnet - - `/morden` for the Morden Testnet - -### Run a full node -``` -$ webchaind -``` - -It's that easy! This will establish a WEB blockchain node, download, and verify the full blocks for the entirety of the WEB blockchain. However, before you go ahead with plain ol' `webchaind`, we would encourage reviewing the following section. - -### :speedboat: Fast Synchronization -The most common scenario is users wanting to simply interact with the Webchain network: create accounts; transfer funds; deploy and interact with contracts, and mine. For this particular use-case the user doesn't care about years-old historical data, so we can _fast-sync_ to the current state of the network. To do so: - -``` -$ webchaind --fast -``` - -Using webchaind in fast sync mode causes it to download only block _state_ data -- leaving out bulky transaction records -- which avoids a lot of CPU and memory intensive processing. - -Fast sync will be automatically disabled (and full sync enabled) when: - -- your chain database contains *any* full blocks -- your node has synced up to the current head of the network blockchain - -In case of using `--mine` together with `--fast`, webchaind will operate as described; syncing in fast mode up to the head, and then begin mining once it has synced its first full block at the head of the chain. - -*Note:* To further increase webchaind performace, you can use a `--cache=2054` flag to bump the memory allowance of the database (e.g. 2054MB) which can significantly improve sync times, especially for HDD users. This flag is optional and you can set it as high or as low as you'd like, though we'd recommend the 1GB - 2GB range. - -### Create and manage accounts -Webchaind is able to create, import, update, unlock, and otherwise manage your private (encrypted) key files. Key files are in JSON format and, by default, stored in the respective chain folder's `/keystore` directory; you can specify a custom location with the `--keystore` flag. - -``` -$ webchaind account new -``` - -This command will create a new account and prompt you to enter a passphrase to protect your account. It will return output similar to: -``` -Address: {52a8029355231d78099667a95d5875fab0d4fc4d} -``` -So your address is: 0x52a8029355231d78099667a95d5875fab0d4fc4d - -Other `account` subcommands include: -``` -SUBCOMMANDS: - - list print account addresses - new create a new account - update update an existing account - import import a private key into a new account - -``` - -Learn more at the [Accounts Wiki Page](https://github.com/webchain-network/webchaind/wiki/Managing-Accounts). If you're interested in using webchaind to manage a lot (~100,000+) of accounts, please visit the [Indexing Accounts Wiki page](https://github.com/webchain-network/webchaind/wiki/Indexing-Accounts). - - -### Fast synchronisation - -Webchaind syncs with the network automatically after start. However, this method is very slow. Alternatively, you can download blockchain file here: https://webchain.network/blockchain.raw and import it by executing: -``` -$ webchaind --fakepow import /blockchain.raw -``` - - -### Interact with the Javascript console -``` -$ webchaind console -``` - -This command will start up webchaind built-in interactive [JavaScript console](https://github.com/webchain-network/webchaind/wiki/JavaScript-Console), through which you can invoke all official [`web3` methods](https://github.com/ethereumproject/wiki/wiki/JavaScript-API) as well as webchaind own [management APIs](https://github.com/webchain-network/webchaind/wiki/Management-APIs). This too is optional and if you leave it out you can always attach to an already running webchaind instance with `webchaind attach`. - -Learn more at the [Javascript Console Wiki page](https://github.com/webchain-network/webchaind/wiki/JavaScript-Console). - - -### And so much more! - -For a comprehensive list of command line options, please consult our [CLI Wiki page](https://github.com/webchain-network/webchaind/wiki/Command-Line-Options). - -## :orange_book: Webchaind: developing and advanced useage - -### Morden Testnet -If you'd like to play around with creating Webchain contracts, you almost certainly would like to do that without any real money involved until you get the hang of the entire system. In other words, instead of attaching to the main network, you want to join the **test** network with your node, which is fully equivalent to the main network, but with play-WEB only. - -``` -$ webchaind --chain=morden --fast console -``` - -The `--fast` flag and `console` subcommand have the exact same meaning as above and they are equally useful on the testnet too. Please see above for their explanations if you've skipped to here. - -Specifying the `--chain=morden` flag will reconfigure your webchaind instance a bit: - - - As mentioned above, webchaind will host its testnet data in a `morden` subfolder (`~/.webchain/morden`). - - Instead of connecting the main Webchain network, the client will connect to the test network, which uses different P2P bootnodes, different network IDs and genesis states. - -You may also optionally use `--testnet` or `--chain=testnet` to enable this configuration. - -> *Note: Although there are some internal protective measures to prevent transactions from crossing over between the main network and test network (different starting nonces), you should make sure to always use separate accounts for play-money and real-money. Unless you manually move accounts, webchaind -will by default correctly separate the two networks and will not make any accounts available between them.* - -### Programatically interfacing webchaind nodes -As a developer, sooner rather than later you'll want to start interacting with webchaind and the Webchain network via your own programs and not manually through the console. To aid this, webchaind has built in support for a JSON-RPC based APIs ([standard APIs](https://github.com/ethereumproject/wiki/wiki/JSON-RPC) and -[Webchaind specific APIs](https://github.com/ethereumproject/go-ethereum/wiki/Management-APIs)). These can be exposed via HTTP, WebSockets and IPC (unix sockets on unix based platroms, and named pipes on Windows). - -The IPC interface is enabled by default and exposes all the APIs supported by webchaind, whereas the HTTP and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. These can be turned on/off and configured as you'd expect. - -HTTP based JSON-RPC API options: - - * `--rpc` Enable the HTTP-RPC server - * `--rpc-addr` HTTP-RPC server listening interface (default: "localhost") - * `--rpc-port` HTTP-RPC server listening port (default: 8545) - * `--rpc-api` API's offered over the HTTP-RPC interface (default: "eth,net,web3") - * `--rpc-cors-domain` Comma separated list of domains from which to accept cross origin requests (browser enforced) - * `--ws` Enable the WS-RPC server - * `--ws-addr` WS-RPC server listening interface (default: "localhost") - * `--ws-port` WS-RPC server listening port (default: 8546) - * `--ws-api` API's offered over the WS-RPC interface (default: "eth,net,web3") - * `--ws-origins` Origins from which to accept websockets requests - * `--ipc-disable` Disable the IPC-RPC server - * `--ipc-api` API's offered over the IPC-RPC interface (default: "admin,debug,eth,miner,net,personal,shh,txpool,web3") - * `--ipc-path` Filename for IPC socket/pipe within the datadir (explicit paths escape it) - -You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect via HTTP, WS or IPC to a webchaind node configured with the above flags and you'll need to speak [JSON-RPC](http://www.jsonrpc.org/specification) on all transports. You can reuse the same connection for multiple requests! - -> Note: Please understand the security implications of opening up an HTTP/WS based transport before doing so! Further, all browser tabs can access locally running webservers, so malicious webpages could try to subvert locally available APIs!* - -### Operating a private/custom network -You are now able to configure a private chain by specifying an __external chain configuration__ JSON file, which includes necessary genesis block data as well as feature configurations for protocol forks, bootnodes, and chainID. - -Please find full [example external configuration files representing the Mainnet and Morden Testnet specs in the /config subdirectory of this repo](). You can use either of these files as a starting point for your own customizations. - -It is important for a private network that all nodes use compatible chains. In the case of custom chain configuration, the chain configuration file (`chain.json`) should be equivalent for each node. - -#### Define external chain configuration -Specifying an external chain configuration file will allow fine-grained control over a custom blockchain/network configuration, including the genesis state and extending through bootnodes and fork-based protocol upgrades. - -```shell -$ webchaind --chain=morden dump-chain-config /customnet/chain.json -$ sed s/mainnet/customnet/ /customnet/chain.json -$ vi /customnet/chain.json # make your custom edits -$ webchaind --chain=customnet [--flags] [command] -``` - -The external chain configuration file specifies valid settings for the following top-level fields: - -| JSON Key | Notes | -| --- | --- | -| `chainID` | Chain identity. Determines local __/subdir__ for chain data, with required `chain.json` located in it. It is required, but must not be identical for each node. Please note that this is _not_ the chainID validation introduced in _EIP-155_; that is configured as a protocal upgrade within `forks.features`. | -| `name` | _Optional_. Human readable name, ie _Webchain Mainnet_, _Morden Testnet._ | -| `state.startingNonce` | _Optional_. Initialize state db with a custom nonce. | -| `network` | Determines Network ID to identify valid peers. | -| `consensus` | _Optional_. Proof of work algorithm to use, either "lyra2v2" | -| `genesis` | Determines __genesis state__. If running the node for the first time, it will write the genesis block. If configuring an existing chain database with a different genesis block, it will overwrite it. | -| `chainConfig` | Determines configuration for fork-based __protocol upgrades__, ie _EIP-150_, _EIP-155_, _EIP-160_, _ECIP-1010_, etc ;-). Subkeys are `forks` and `badHashes`. | -| `bootstrap` | _Optional_. Determines __bootstrap nodes__ in [enode format](https://github.com/ethereumproject/wiki/wiki/enode-url-format). | -| `include` | _Optional_. Other configuration files to include. Paths can be relative (to the config file with `include` field, or absolute). Each of configuration files has the same structure as "main" configuration. Included files are processed after the "main" configuration in the same order as specified in the array; values processed later overwrite the previously defined ones. | - -*Fields `name`, `state.startingNonce`, and `consensus` are optional. Webchaind will panic if any required field is missing, invalid, or in conflict with another flag. This renders `--chain` __incompatible__ with `--testnet`. It remains __compatible__ with `--data-dir`.* - -To learn more about external chain configuration, please visit the [External Command Line Options Wiki page](https://github.com/ethereumproject/go-ethereum/wiki/Command-Line-Options). - -##### Create the rendezvous point -Once all participating nodes have been 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: - -``` -$ bootnode --genkey=boot.key -$ bootnode --nodekey=boot.key -``` - -With the bootnode online, it will display an `enode` URL 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 Webchaind node as a bootnode, but it's the less recommended way.* - -To learn more about enodes and enode format, visit the [Enode Wiki page](https://github.com/ethereumproject/wiki/wiki/enode-url-format). - -##### Starting up your member nodes -With the bootnode operational and externally reachable (you can try `telnet ` to ensure it's indeed reachable), start every subsequent webchaind node pointed to the bootnode for peer discovery via the `--bootnodes` flag. It will probably be desirable to keep private network data separate from defaults; to do so, specify a custom `--datadir` and/or `--chain` flag. - -``` -$ webchaind --datadir=path/to/custom/data/folder \ - --chain=kittynet \ - --bootnodes= -``` - -*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 -In a private network setting, 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 webchaind instance for mining, run it with all your usual flags, extended by: - -``` -$ webchaind --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`). - -For more information about managing accounts, please see the [Managing Accounts Wiki page](https://github.com/ethereumproject/go-ethereum/wiki/Managing-Accounts). - -## :muscle: Contribution -Thank you for considering to help out with the source code! - -The core values of democratic engagement, transparency, and integrity run deep with us. We welcome contributions from everyone, and are grateful for even the smallest of fixes. :clap: - -If you'd like to contribute to webchaind, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. - -Please see the [Wiki](https://github.com/webchain-network/webchaind/wiki) for more details on configuring your environment, managing project dependencies, and testing procedures. - -## :love_letter: License - -The webchaind library (i.e. all code outside of the `cmd` directory) is licensed under the [GNU Lesser General Public License v3.0](http://www.gnu.org/licenses/lgpl-3.0.en.html), also included in our repository in the `COPYING.LESSER` file. - -The webchaind binaries (i.e. all code inside of the `cmd` directory) is licensed under the [GNU General Public License v3.0](http://www.gnu.org/licenses/gpl-3.0.en.html), also included in our repository in the `COPYING` file. +## CoreGeth: An Ethereum Protocol Provider + +> An [ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) downstream effort to make the Ethereum Protocol accessible and extensible for a diverse ecosystem. + +Priority is given to reducing opinions around chain configuration, IP-based feature implementations, and API predictability. +Upstream development from [ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) is merged to this repository regularly, + usually at every upstream tagged release. Every effort is made to maintain seamless compatibility with upstream source, including compatible RPC, JS, and CLI + APIs, data storage locations and schemas, and, of course, interoperable node protocols. Applicable bug reports, bug fixes, features, and proposals should be + made upstream whenever possible. + +[![OpenRPC](https://img.shields.io/static/v1.svg?label=OpenRPC&message=1.14.0&color=blue)](#openrpc-discovery) +[![API Reference](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667)](https://godoc.org/github.com/etclabscore/core-geth) +[![Go Report Card](https://goreportcard.com/badge/github.com/etclabscore/core-geth)](https://goreportcard.com/report/github.com/etclabscore/core-geth) +[![Travis](https://travis-ci.org/etclabscore/core-geth.svg?branch=master)](https://travis-ci.org/etclabscore/core-geth) +[![Gitter](https://badges.gitter.im/core-geth/community.svg)](https://gitter.im/core-geth/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +## Network/provider comparison + +Networks supported by the respective go-ethereum packaged `geth` program. + +| Ticker | Consensus | Network | core-geth | ethereum/go-ethereum | +| --- | --- | --- | --- | --- | +| ETC | :zap: | Ethereum Classic | :heavy_check_mark: | | +| ETH | :zap: | Ethereum (Foundation) | :heavy_check_mark: | :heavy_check_mark: | +| - | :zap: :handshake: | Private chains | :heavy_check_mark: | :heavy_check_mark: | +| | :zap: | Mordor (Geth+Parity ETH PoW Testnet) | :heavy_check_mark: | | +| | :zap: | Morden (Geth+Parity ETH PoW Testnet) | | | +| | :zap: | Ropsten (Geth+Parity ETH PoW Testnet) | :heavy_check_mark: | :heavy_check_mark: | +| | :handshake: | Rinkeby (Geth-only ETH PoA Testnet) | :heavy_check_mark: | :heavy_check_mark: | +| | :handshake: | Goerli (Geth+Parity ETH PoA Testnet) | :heavy_check_mark: | :heavy_check_mark: | +| | :handshake: | Kotti (Geth+Parity ETC PoA Testnet) | :heavy_check_mark: | | +| | :handshake: | Kovan (Parity-only ETH PoA Testnet) | | | +| | | Tobalaba (EWF Testnet) | | | +| | | Ephemeral development PoA network | :heavy_check_mark: | :heavy_check_mark: | +| MINTME | :zap: | MintMe.com Coin | :heavy_check_mark: | | + +- :zap: = __Proof of Work__ +- :handshake: = __Proof of Authority__ + +1: This is originally an [Ellaism +Project](https://github.com/ellaism). However, A [recent hard +fork](https://github.com/ellaism/specs/blob/master/specs/2018-0003-wasm-hardfork.md) +makes Ellaism not feasible to support with go-ethereum any more. Existing +Ellaism users are asked to switch to +[Parity](https://github.com/paritytech/parity). + +2: Network not supported by default, but network configuration is possible. Make a PR! + +## Documentation + +- CoreGeth documentation is available [here](https://etclabscore.github.io/core-geth). + + Getting Started [Installation](https://etclabscore.github.io/core-geth/getting-started/installation) and [CLI](https://etclabscore.github.io/core-geth/getting-started/run-cli) + + [JSONRPC API](https://etclabscore.github.io/core-geth/apis/jsonrpc-apis) + + [Developers](https://etclabscore.github.io/core-geth/developers/build-from-source) + + [Tutorials](https://etclabscore.github.io/core-geth/tutorials/private-network) +- Further [ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) documentation about can be found [here](https://geth.ethereum.org/docs/). +- Documentation about documentation lives [here](./docs/developers/documentation.md). + +## 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 core-geth, 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/etclabscore/core-geth) +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/ethereum/go-ethereum/wiki/Developers'-Guide) +for more details on configuring your environment, managing project dependencies, and +testing procedures. + +## License + +The core-geth 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 core-geth 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. From e25c09845e30b6d0b90d1f84c6f20c6a855948a7 Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Wed, 24 Nov 2021 11:16:07 -0400 Subject: [PATCH 2/8] Update README.md Added Mining Documentation --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8bbd4993d..775ac4ae8 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ Please see the [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/ for more details on configuring your environment, managing project dependencies, and testing procedures. +## Mining + +IN PROGRESS + ## License The core-geth library (i.e. all code outside of the `cmd` directory) is licensed under the From 9873e3ba59e63b13d06afd692c091148738753dd Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Fri, 26 Nov 2021 12:44:56 -0400 Subject: [PATCH 3/8] Update README.md --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 775ac4ae8..19dfcec5d 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,29 @@ testing procedures. ## Mining -IN PROGRESS +Mining is the process through which new blocks are created. Geth actually creates new blocks all the time, but these blocks need to be secured through proof-of-work so they will be accepted by other nodes. Mining is all about creating these proof-of-work values. + +The proof-of-work computation can be performed in multiple ways. Geth includes a CPU miner, which does mining within the geth process. We discourage using the CPU miner with the Ethereum mainnet. If you want to mine real ether, use GPU mining. Your best option for doing that is the ethminer software. + +Always ensure your blockchain is fully synchronised with the chain before starting to mine, otherwise you will not be mining on the correct chain and your block rewards will not be valueable. + +## GPU mining + +The ethash algorithm is memory hard and in order to fit the DAG into memory, it needs 1-2GB of RAM on each GPU. If you get ``Error GPU mining. GPU memory fragmentation?`` you don’t have enough memory. + +## Installing ethminer + +To get ethminer, you need to install the ethminer binary package or build it from source. See https://github.com/ethereum-mining/ethminer/#build for the official ethminer build/install instructions. At the time of writing, ethminer only provides a binary for Microsoft Windows. + +## Using ethminer with geth + +First create an account to hold your block rewards. + +`geth account new` + +Follow the prompts and enter a good password. **DO NOT FORGET YOUR PASSWORD**. Also take note of the public Ethereum address which is printed at the end of the account creation process. In the following examples, we will use 0xC95767AC46EA2A9162F0734651d6cF17e5BfcF10 as the example address. + +Now start geth and wait for it to sync the blockchain. This will take quite a while. ## License From a38e040f20044fce7f6b3372a276d65c2e9cd452 Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Fri, 26 Nov 2021 12:50:49 -0400 Subject: [PATCH 4/8] Update README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 19dfcec5d..e61c3c51d 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,33 @@ Follow the prompts and enter a good password. **DO NOT FORGET YOUR PASSWORD**. A Now start geth and wait for it to sync the blockchain. This will take quite a while. +`geth --http --miner.etherbase 0xC95767AC46EA2A9162F0734651d6cF17e5BfcF10` + +To monitor the syncing, in another terminal you can attach the geth JavaScript console to the running node like so: + +`geth attach https://127.0.0.1:8545` + +and then at the > prompt type + +`eth.syncing` + +You’ll see something like the example output below – it’s a two stage process as described in much more detail in our FAQ. In the first stage, the difference between the “currentBlock” and the “highestBlock” will decrease until they are almost equal. It will then look stuck and appear as never becoming equal. But you should see “pulledStates” rising to equal “knownStates.” When both are equal, you are synced. + +Example output of first stage of block downloading: + +```{ + currentBlock: 10707814, + highestBlock: 13252182, + knownStates: 0, + pulledStates: 0, + startingBlock: 3809258 }``` + +You will import up to the highestBlock and knownStates. Block importing will stop ~64 blocks behind head and finish importing states. + +Once all states are downloaded, geth will switch into a full node and sync the remaining ~64 blocks fully, as well as new ones. In this context, eth.syncing returns false once synced. + +Now we’re ready to start mining. In a new terminal session, run ethminer and connect it to geth: + ## License The core-geth library (i.e. all code outside of the `cmd` directory) is licensed under the From 950e50fd6dfa90e8aa2c4d430f00e61da9e8aac9 Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Fri, 26 Nov 2021 12:52:11 -0400 Subject: [PATCH 5/8] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e61c3c51d..08f0db0d3 100644 --- a/README.md +++ b/README.md @@ -122,12 +122,14 @@ You’ll see something like the example output below – it’s a two stage proc Example output of first stage of block downloading: -```{ +``` +{ currentBlock: 10707814, highestBlock: 13252182, knownStates: 0, pulledStates: 0, - startingBlock: 3809258 }``` + startingBlock: 3809258 } +``` You will import up to the highestBlock and knownStates. Block importing will stop ~64 blocks behind head and finish importing states. From f56c852b9da999b9bbeba9cfd02d168a91d94b17 Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Fri, 26 Nov 2021 14:00:24 -0400 Subject: [PATCH 6/8] Update README.md --- README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/README.md b/README.md index 08f0db0d3..9ad894634 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,88 @@ Once all states are downloaded, geth will switch into a full node and sync the r Now we’re ready to start mining. In a new terminal session, run ethminer and connect it to geth: +OpenCL + +`ethminer -G -P http://127.0.0.1:8545` + +CUDA + +`ethminer -U -P http://127.0.0.1:8545` + +ethminer communicates with geth on port 8545 (the default RPC port in geth). You can change this by giving the --http.port option to geth. Ethminer will find geth on any port. You also need to set the port on ethminer with -P http://127.0.0.1:3301. Setting up custom ports is necessary if you want several instances mining on the same computer. If you are testing on a private cluster, we recommend you use CPU mining instead. + +If the default for ethminer does not work try to specify the OpenCL device with: --opencl-device X where X is 0, 1, 2, etc. + +## CPU Mining with Geth + +When you start up your ethereum node with geth it is not mining by default. To start it in mining mode, you use the --mine command-line flag. The --miner.threads parameter can be used to set the number parallel mining threads (defaulting to the total number of processor cores). + +`geth --mine --miner.threads=4` + +You can also start and stop CPU mining at runtime using the console. miner.start takes an optional parameter for the number of miner threads. +``` +> miner.start(8) +true +> miner.stop() +true +``` + +Note that mining for real ether only makes sense if you are in sync with the network (since you mine on top of the consensus block). Therefore the eth blockchain downloader/synchroniser will delay mining until syncing is complete, and after that mining automatically starts unless you cancel your intention with miner.stop(). + +In order to earn ether you must have your etherbase (or coinbase) address set. This etherbase defaults to your primary account. If you don’t have an etherbase address, then geth --mine will not start up. + +You can set your etherbase on the command line: + +`geth --miner.etherbase '0xC95767AC46EA2A9162F0734651d6cF17e5BfcF10' --mine 2>> geth.log` + +You can reset your etherbase on the console too: + +`> miner.setEtherbase(eth.accounts[2])` + +Note that your etherbase does not need to be an address of a local account, just an existing one. + +There is an option to add extra data (32 bytes only) to your mined blocks. By convention this is interpreted as a unicode string, so you can set your short vanity tag. + +`> miner.setExtra("ΞTHΞЯSPHΞЯΞ")` + +You can check your hashrate with miner.hashrate, the result is in H/s (Hash operations per second). + +``` +> eth.hashrate +712000 +``` + +After you successfully mined some blocks, you can check the ether balance of your etherbase account. Now assuming your etherbase is a local account: + +``` +> eth.getBalance(eth.coinbase).toNumber(); +'34698870000000' +``` + +You can check which blocks are mined by a particular miner (address) with the following code snippet on the console: +``` +> function minedBlocks(lastn, addr) { + addrs = []; + if (!addr) { + addr = eth.coinbase + } + limit = eth.blockNumber - lastn + for (i = eth.blockNumber; i >= limit; i--) { + if (eth.getBlock(i).miner == addr) { + addrs.push(i) + } + } + return addrs +} +// scans the last 1000 blocks and returns the blocknumbers of blocks mined by your coinbase +// (more precisely blocks the mining reward for which is sent to your coinbase). +> minedBlocks(1000, eth.coinbase) +[352708, 352655, 352559] +``` +Note that it will happen often that you find a block yet it never makes it to the canonical chain. This means when you locally include your mined block, the current state will show the mining reward credited to your account, however, after a while, the better chain is discovered and we switch to a chain in which your block is not included and therefore no mining reward is credited. Therefore it is quite possible that as a miner monitoring their coinbase balance will find that it may fluctuate quite a bit. + +The logs show locally mined blocks confirmed after 5 blocks. At the moment you may find it easier and faster to generate the list of your mined blocks from these logs. + ## License The core-geth library (i.e. all code outside of the `cmd` directory) is licensed under the From d1a75bd8ea829606a5a5d7a269392ce4f61e47a8 Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Mon, 29 Nov 2021 12:16:39 -0400 Subject: [PATCH 7/8] Update README.md --- README.md | 130 +++++++++++++++++++++++++++++------------------------- 1 file changed, 70 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 9ad894634..35007e199 100644 --- a/README.md +++ b/README.md @@ -90,66 +90,7 @@ The proof-of-work computation can be performed in multiple ways. Geth includes a Always ensure your blockchain is fully synchronised with the chain before starting to mine, otherwise you will not be mining on the correct chain and your block rewards will not be valueable. -## GPU mining - -The ethash algorithm is memory hard and in order to fit the DAG into memory, it needs 1-2GB of RAM on each GPU. If you get ``Error GPU mining. GPU memory fragmentation?`` you don’t have enough memory. - -## Installing ethminer - -To get ethminer, you need to install the ethminer binary package or build it from source. See https://github.com/ethereum-mining/ethminer/#build for the official ethminer build/install instructions. At the time of writing, ethminer only provides a binary for Microsoft Windows. - -## Using ethminer with geth - -First create an account to hold your block rewards. - -`geth account new` - -Follow the prompts and enter a good password. **DO NOT FORGET YOUR PASSWORD**. Also take note of the public Ethereum address which is printed at the end of the account creation process. In the following examples, we will use 0xC95767AC46EA2A9162F0734651d6cF17e5BfcF10 as the example address. - -Now start geth and wait for it to sync the blockchain. This will take quite a while. - -`geth --http --miner.etherbase 0xC95767AC46EA2A9162F0734651d6cF17e5BfcF10` - -To monitor the syncing, in another terminal you can attach the geth JavaScript console to the running node like so: - -`geth attach https://127.0.0.1:8545` - -and then at the > prompt type - -`eth.syncing` - -You’ll see something like the example output below – it’s a two stage process as described in much more detail in our FAQ. In the first stage, the difference between the “currentBlock” and the “highestBlock” will decrease until they are almost equal. It will then look stuck and appear as never becoming equal. But you should see “pulledStates” rising to equal “knownStates.” When both are equal, you are synced. - -Example output of first stage of block downloading: - -``` -{ - currentBlock: 10707814, - highestBlock: 13252182, - knownStates: 0, - pulledStates: 0, - startingBlock: 3809258 } -``` - -You will import up to the highestBlock and knownStates. Block importing will stop ~64 blocks behind head and finish importing states. - -Once all states are downloaded, geth will switch into a full node and sync the remaining ~64 blocks fully, as well as new ones. In this context, eth.syncing returns false once synced. - -Now we’re ready to start mining. In a new terminal session, run ethminer and connect it to geth: - -OpenCL - -`ethminer -G -P http://127.0.0.1:8545` - -CUDA - -`ethminer -U -P http://127.0.0.1:8545` - -ethminer communicates with geth on port 8545 (the default RPC port in geth). You can change this by giving the --http.port option to geth. Ethminer will find geth on any port. You also need to set the port on ethminer with -P http://127.0.0.1:3301. Setting up custom ports is necessary if you want several instances mining on the same computer. If you are testing on a private cluster, we recommend you use CPU mining instead. - -If the default for ethminer does not work try to specify the OpenCL device with: --opencl-device X where X is 0, 1, 2, etc. - -## CPU Mining with Geth +## Solo mining When you start up your ethereum node with geth it is not mining by default. To start it in mining mode, you use the --mine command-line flag. The --miner.threads parameter can be used to set the number parallel mining threads (defaulting to the total number of processor cores). @@ -219,6 +160,75 @@ Note that it will happen often that you find a block yet it never makes it to th The logs show locally mined blocks confirmed after 5 blocks. At the moment you may find it easier and faster to generate the list of your mined blocks from these logs. +## Pool mining + +We download miner binary for your system from here https://github.com/webchain-network/webchain-miner/releases + +Then unpack it and in dir of unpacked miner we see file config.json , which is our miner configuration file, which contains main mining setting, like wallet number, threads , max-cpu-usage , etc. + +The main thing we need to do is to set your wallet number where we will get reward to config.json + +So we put our wallet number created by webchaind to "user" field of config.json, it shoud be set like this: + +"user": "0x918e173c8426593bd37d5bc7d03f17dcc154cd5b", + +Now we can save config.json , start mining and get rewards + +We ready to start miner, it done by command: ./webchain-miner (Linux) or webchain-miner.exe (Windows) + +Now we will see screen like that: + +`./webchain-miner` + + VERSIONS: webchain-miner/2.6.2 libuv/1.20.3-dev gcc/6.3.0 + CPU: Intel(R) Xeon(R) CPU D-1521 @ 2.40GHz (1) x64 AES-NI + CPU L2/L3: 1.0 MB/6.0 MB + THREADS: 5, cryptonight-webchain, av=1, donate=5% + POOL #1: pool2.webchain.network:2222 + COMMANDS: hashrate, pause, resume [2018-05-10 16:54:36] use pool pool2.webchain.network:2222 212.32.255.73 [2018-05-10 16:54:36] new job from pool2.webchain.network:2222 diff 5000 algo cn-web/1 [2018-05-10 16:54:36] READY (CPU) threads 5(5) huge pages 0/5 0% memory 10.0 MB [2018-05-10 23:26:02] speed 2.5s/60s/15m 14.6 14.8 13.6 H/s max: 20.3 H/s [2018-05-10 23:26:23] accepted (1/0) diff 5000 (170 ms) + +Short description: + +Pool is service which devide block finding task from webchain network between all miners in pool and also divide reward based on miners hashrate + +Job is mining block finding task from network H/s is how much hashes in second your CPU can generate to find correct solution of block task accepted means your CPU found correct solution of task , send it to pool and it can be one of multiply correct block solution for what network will reward pool by 50 WEB, which will divide between miners based on their hasrate + +So all you need is to run miner and wait some time (maybe 5 min, maybe 1 hour) when your miner find accepted shares and pool will give some part of reward coins to your account. + +Step 4. Pool and payments + +Currently we have official pool - pool.webchain.network:3333 + +So we start mining and then open https://pool.webchain.network/ in search string below "Your Stats & Payment History" we put our wallet number: `0x918e173c8426593bd37d5bc7d03f17dcc154cd5b` + +and after miner send his first accepted share we will see realtime stats on top of page + +First of all you will get coins in Immature Balance, it means you got coins from network, but they need confirmation. Pending Balance is your money already which wait pool payment schedule to pay to your wallet Total Paid: is how much money already sent from pool to your wallet Last Share Submitted means how much time ago your miner(s) submit accepted share to pool Workers Online means how much computers mine with the same wallet Hashrate (30m) and (3h) shows your common average from all your computers where you mining with this wallet number Blocks Found means how much block was found by your share solution Total payments means how much payment schedules was completed from pool with payment to your wallet Your round share is how much job of block solution your miner(s) do in comparison with all miners in pool + +So when you will see some amount in Total paid, you can go back to your webchaind console and write command again: + +`web3.fromWei(webchain.getBalance(webchain.coinbase), "ether")` + +`5` + +You will see other amount then 5 but it will be different from 0 + +If not, there can be some reason. First - your webchaind not synchronizing with network. So you need some time to wait (maybe about 1 hour) Also you can try to run + +`webchaind --fast console` + +or you can download blockchain file here: https://webchain.network/blockchain.raw and import it by executing: + +`$ webchaind --fakepow import /blockchain.raw` + +and retry to get balance, or wait some time and try again + +Second - your local time is not correct Check please your OS for how to resync your clock (example `sudo ntpdate -s time.nist.gov`) because even 12 seconds too fast can lead to 0 peers. + +Also you can see your real time balance of coins at https://explorer.webchain.network, enter you wallet number at the right top of page and you will how much coins you have for now + +How to transer funds you can see at https://github.com/mintme-com/webchaind/wiki/Transfers + ## License The core-geth library (i.e. all code outside of the `cmd` directory) is licensed under the From a9e6cb0f64f3f6f779d5a62b6c288fffce9eeb67 Mon Sep 17 00:00:00 2001 From: rhcamilex Date: Tue, 30 Nov 2021 10:36:50 -0400 Subject: [PATCH 8/8] Update README.md --- README.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 35007e199..2da3cc548 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ Then unpack it and in dir of unpacked miner we see file config.json , which is o The main thing we need to do is to set your wallet number where we will get reward to config.json -So we put our wallet number created by webchaind to "user" field of config.json, it shoud be set like this: +So we put our wallet number created by mintme to "user" field of config.json, it shoud be set like this: "user": "0x918e173c8426593bd37d5bc7d03f17dcc154cd5b", @@ -205,23 +205,15 @@ and after miner send his first accepted share we will see realtime stats on top First of all you will get coins in Immature Balance, it means you got coins from network, but they need confirmation. Pending Balance is your money already which wait pool payment schedule to pay to your wallet Total Paid: is how much money already sent from pool to your wallet Last Share Submitted means how much time ago your miner(s) submit accepted share to pool Workers Online means how much computers mine with the same wallet Hashrate (30m) and (3h) shows your common average from all your computers where you mining with this wallet number Blocks Found means how much block was found by your share solution Total payments means how much payment schedules was completed from pool with payment to your wallet Your round share is how much job of block solution your miner(s) do in comparison with all miners in pool -So when you will see some amount in Total paid, you can go back to your webchaind console and write command again: +So when you will see some amount in Total paid, you can go back to your mintme console and write command again: -`web3.fromWei(webchain.getBalance(webchain.coinbase), "ether")` +`web3.fromWei(eth.getBalance(eth.coinbase), "ether")` `5` You will see other amount then 5 but it will be different from 0 -If not, there can be some reason. First - your webchaind not synchronizing with network. So you need some time to wait (maybe about 1 hour) Also you can try to run - -`webchaind --fast console` - -or you can download blockchain file here: https://webchain.network/blockchain.raw and import it by executing: - -`$ webchaind --fakepow import /blockchain.raw` - -and retry to get balance, or wait some time and try again +If not, there can be some reason. First - your mintme not synchronizing with network. So you need some time to wait (maybe about 1 hour) Second - your local time is not correct Check please your OS for how to resync your clock (example `sudo ntpdate -s time.nist.gov`) because even 12 seconds too fast can lead to 0 peers.