Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mordor Mining Guide #588

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion docs/developers/build-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ Recommended:

## Dependencies

- Make sure your system has __Go 1.16+__ installed. https://golang.org/doc/install
Make sure your system has __Go 1.19+__ installed. https://golang.org/doc/install

Step-by-step Instructions to install Go on Ubuntu. https://www.linuxtechi.com/install-go-golang-on-ubuntu-linux/

```shell
$ sudo apt update
$ wget https://go.dev/dl/go1.21.4.linux-amd64.tar.gz # Update to the most current release version
$ sudo tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz # Update to the most current release version
$ ls /usr/local/go
$ nano ~/.bash_profile # PASTE the following, then SAVE: export PATH=$PATH:/usr/local/go/bin
$ source ~/.bash_profile
$ go version
```

Copy link
Member

@meowsbits meowsbits Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three of these paragraphs are Go installation instructions. I'd prefer to defer simply to one -- the official Go docs -- rather than provide 3 redundant options which will need updating. The important part here -- and thanks for updating it :) -- is the minimum Go version.

- Make sure your system has a C compiler installed. For example, with Linux Ubuntu:

```shell
Expand Down
21 changes: 19 additions & 2 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,31 @@ title: Installation
---

!!! tip "Build from Source"
Instructions to build from source can be found [here](core-geth/developers/build-from-source/).
Instructions to build from source can be found [here](https://etclabscore.github.io/core-geth/developers/build-from-source/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it work to use a relative path instead? That'd be a little less brittle.

Suggested change
Instructions to build from source can be found [here](https://etclabscore.github.io/core-geth/developers/build-from-source/)
Instructions to build from source can be found [here](./core-geth/developers/build-from-source/)


## Pre-built executable

If you just want to download and run `geth` or any of the other tools here, this is the quickest and simplest way.
If you just want to download and run `geth --classic` or any of the other tools here, this is the quickest and simplest way.

Binary archives are published at https://github.com/etclabscore/core-geth/releases. Find the latest one for your OS, download it, (check the SHA sum), unarchive it, and run!

Tip: When running Core-geth use `--classic` flag for Ethereum Classic mainnet.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we use the markdown !!! tips instead for these Tip:s?

Suggested change
Tip: When running Core-geth use `--classic` flag for Ethereum Classic mainnet.
!!! tip "Run Ethereum Classic"
When running Core-geth use `--classic` flag for Ethereum Classic mainnet.


```shell
$ wget https://github.com/etclabscore/core-geth/releases/download/v1.12.17/core-geth-linux-v1.12.17.zip # Update to the most current release version
$ sudo unzip core-geth-linux-v1.12.17.zip -d /bin/ # Update to the most current release version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally the best place for user-installed programs is in /usr/local/bin.

https://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux

Suggested change
$ sudo unzip core-geth-linux-v1.12.17.zip -d /bin/ # Update to the most current release version
$ sudo unzip core-geth-linux-v1.12.17.zip -d /usr/local/bin # Update to the most current release version

Here and other places.

$ geth --help # Lists available options
$ geth --classic # Runs Ethereum Classic mainnet
```

Tip: Here is how you make an address and keystore file with core-geth. You'll be able to mine to this address and import the keystore file into wallets like MetaMask.

```shell
$ geth --classic account new # Creates a new account with a public address and keystore file
$ geth --classic account list
$ geth --classic # Runs Ethereum Classic mainnet
```

## With Docker

All runnable examples below are for images limited to `geth`. For images including the full suite of
Expand Down
98 changes: 98 additions & 0 deletions docs/getting-started/mordor-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Mordor Testnet Guide
---

!!! tip "Mordor Testnet"
Mordor is a PoW Ethereum Classic testnet. A testnet allows developers to perform specific tests. Developers may want to test protocol changes, test a smart contract, or interact with the network in anyway that does not require real EthClassic (ETC)—just don’t test on mainnet, mainnet is for production.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Mordor is a PoW Ethereum Classic testnet. A testnet allows developers to perform specific tests. Developers may want to test protocol changes, test a smart contract, or interact with the network in anyway that does not require real EthClassic (ETC)—just don’t test on mainnet, mainnet is for production.
Mordor is a PoW Ethereum Classic testnet. A testnet allows developers to test transactions before deploying them with real value on the mainnet. Developers may want to test protocol changes, test a smart contract, or interact with the network in any way that does not require real EthClassic (ETC)—just don’t test on mainnet, mainnet is for production.


## Summary:

+ Install Core-geth https://etclabscore.github.io/core-geth/getting-started/installation/
+ Create an account on --mordor
+ Run --mordor with --mine enabled
+ Create a Script to mine Mordor METC

## Install Core-geth

https://etclabscore.github.io/core-geth/getting-started/installation/

## Mordor Testnet Mining Guide

You can visit the Core-geth documentation for more installation options. I’m using Ubuntu 22.04 LTS.

If you just want to download and run `geth --mordor` or any of the other tools here, this is the quickest and simplest way.

Binary archives are published at https://github.com/etclabscore/core-geth/releases. Find the latest one for your OS, download it, (check the SHA sum), unarchive it, and run!

When running Core-geth use `--mordor` flag for Ethereum Classic testnet.

```shell
$ wget https://github.com/etclabscore/core-geth/releases/download/v1.12.17/core-geth-linux-v1.12.17.zip # Update to the most current release version
$ sudo unzip core-geth-linux-v1.12.17.zip -d /bin/ # Update to the most current release version
$ geth --help # Lists available options
$ geth --mordor # Runs Ethereum Classic's testnet Mordor
```

## Account Creation

You'll need an account with an address (0x...) to receive your mETC mining rewards. Here is how you make an address and keystore file with core-geth. You'll be able to import the keystore file into wallets like MetaMask. Backup this file. You'll mine your mordor rewards to it.

```shell
$ geth --mordor account new # Creates a new account with a public address and keystore file
$ geth --mordor account list
$ geth --mordor # Runs Ethereum Classic's testnet Mordor
```

You’ll notice listing the account will print the keystore file location.For example:keystore:///home/USER/.ethereum/mordor/keystore/UTC...

## Run Mordor with Mining Enable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Run Mordor with Mining Enable
## Run Mordor with Mining Enabled


```shell
$ geth --mordor --mine --minerthreads 1 --miner.etherbase 0x_INSERT_YOUR_ADDRESS_HERE_3a087
```

Check Mordor Balance on Blockscout

So, you’re running a Mordor node and mining testnet mETC. Woohoo! An easy way to double check you’re actually growing a Mordor testnet balance is on [Blockscout](https://etc-mordor.blockscout.com). Just search the account address you created earlier.

## Add your Mordor Account to a Wallet?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Add your Mordor Account to a Wallet?
## Add your Mordor Account to a Wallet (Optional)


You can use your keystore file to import your wallet into a wallet application such as MetaMask. In MetaMask

* Add the Ethereum Classic mainnet to your MetaMask by visiting https://chainlist.org/chain/61 and clicking the "Add to MetaMask" button.
* Add the Mordor testnet to your MetaMask by visiting https://chainlist.org/chain/63 and clicking the "Add to MetaMask" button.
* Under your account profile select import account > select type (JSON) > upload your keystore file. You may need to enter the account password.

## Mordor Mining Script

One way to avoid typing or copy and pasting this same text block is creating a shell script file.

```shell
$ geth --mordor --mine --minerthreads 1 --miner.etherbase 0x_INSERT_YOUR_ADDRESS_HERE_3a087
```

Enter the following in a new terminal window (ctrl + alt + t):

```shell
touch start-mordor.sh && echo "geth --mordor --mine --minerthreads 1 --miner.etherbase 0x_INSERT_YOUR_ADDRESS_HERE_3a087" >start-mordor.sh && chmod +x start-mordor.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> will create (and truncate) the file if it does not already exist.

Suggested change
touch start-mordor.sh && echo "geth --mordor --mine --minerthreads 1 --miner.etherbase 0x_INSERT_YOUR_ADDRESS_HERE_3a087" >start-mordor.sh && chmod +x start-mordor.sh
echo "geth --mordor --mine --minerthreads 1 --miner.etherbase 0x_INSERT_YOUR_ADDRESS_HERE_3a087" >start-mordor.sh && chmod +x start-mordor.sh

```

touch start-mordor.sh to create the file && echo “the contents” into the shell script file && add chmod executable+x permissions to the file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
touch start-mordor.sh to create the file && echo the contents” into the shell script file && add chmod executable+x permissions to the file.
Create or truncate the script file and echo the command into it, then make it executable.


Enter the following in a new terminal window (ctrl + alt + t):

```shell
./start-mordor.sh
```

Great job! You are mining on Ethereum Classic's testnet.

## Donate Mined mETC to a Community Faucet for Pubic Use

https://faucet.mordortest.net

A faucet is a developer tool that gives users testnet tokens to use when testing smart contracts or interacting with DApps on test networks. https://faucet.mordortest.net gives Mordor testnet ETC to test smart contracts before pushing them to production on the Ethereum Classic mainnet. Faucets like this allow network users and developers to interact with the Mordor network without the prerequisite of mining mETC via a client node. To donate mETC to this public faucet, please send your mETC to address `0x51Cb0EA27f03e56d84E9EB1879F131393a6769bA`.

## Video Mordor Guide

https://www.youtube.com/watch?v=0hutSdb-dV8