Skip to content

Instantly share code, notes, and snippets.

@yorickdowne
Last active July 24, 2024 20:58
Show Gist options
  • Save yorickdowne/966b62e49b54310e6ea937e5974f74e8 to your computer and use it in GitHub Desktop.
Save yorickdowne/966b62e49b54310e6ea937e5974f74e8 to your computer and use it in GitHub Desktop.
Get that sweet Sepolia ETH

Sepolia is now on PoS

As of 2022/7/6, Sepolia has switched to PoS. The window to do some mining has closed.

Testnets after merge (original, old content from here)

It's mid 2022, Ethereum is still PoW and motoring towards merge / PoS. Surviving testnets will be Sepolia - currently PoW - and Goerli. Ropsten will be merged and then deprecated, Rinkeby and Kovan won't be merged.

I want to "get ready" for some Sepolia testing pre- and post-merge. Sepolia will not have a public validator set; testing post-merge will be limited to running applications on it. As Sepolia is PoW, I can actually go mine myself some SepplETH. Here's how.

Components

  • Geth on Sepolia, Linux. This could absolutely be Windows, I just happen to have Linux tooling I like
  • ethminer or t-rex, Windows, with an NVidia or AMD GPU. Mostly because the only GPU I have that can mine is in my Windows box

Set up Geth

I'm using eth-docker for this.

Get prereqs: sudo apt update && sudo apt install -y docker-compose

Make your user part of the docker group so you don't need sudo for docker commands: sudo usermod -aG docker MYUSERNAME && newgrp docker

Clone eth-docker: git clone https://github.com/eth-educators/eth-docker.git sepolia && cd sepolia

Configure eth-docker for this: cp default.env .env, then nano .env and set

  • COMPOSE_FILE=geth.yml:el-shared.yml
  • EL_NETWORK=sepolia

Save and close.

Get the ETH address you want the Sepolia mining rewards to be sent to. Anything created in Metamask will do.

A few changes for Geth so it can mine. nano geth.yml and change the entrypoint. Enable the miner API, and append to it:

    entrypoint:
      - geth
      .... existing entries, leave those be
      - --http.api
      - web3,eth,net,miner
      .... existing entries, leave those be
      - --pprof.addr
      - 0.0.0.0
      - --mine
      - --miner.etherbase
      - "0xMYETHADDRESS"

You need the quotes around the address, and 0xMYETHADDRESS is going to be your actual address.

Start it: ./ethd up, and look at the logs with ./ethd logs -f execution. It should sync the chain in minutes and then be ready for mining.

Firewalling

If your Linux boxen is on the Internet, not in your home network, and only then, you'll want to firewall the RPC port 8545 and WS port 8546, which are both exposed now. Follow instructions to place ufw "in front of" docker, get the public IP your Windows box uses with something like whatismyip and create a simple policy along these lines:

sudo ufw allow OpenSSH
sudo ufw allow proto tcp from MYPUBLICIP to any port 8545
sudo ufw deny 8545
sudo ufw deny 8546

And finally sudo ufw enable. Adjust the policy to your own needs if you already had ufw running.

Connect Metamask to Sepolia

In Metamask, go to Settings, Network, Add Network and create a new custom network.

Call it Sepolia Test Network, set the New RPC URL to your Sepolia Geth as http://IP-OF-GETH-BOX:8545, Chain ID 11155111, currency symbol SepplETH and Explorer to https://sepolia.etherscan.io.

Windows mining

Your AntiVirus and browser will likely quarantine these as cryptominers, because they are. You'll need to allow-list them.

Grab ethminer. It's open source, but doesn't work with newer-generation cards. A PR that enables CUDA11 and thus RTX 3000 series does exist, but there are no ready-made executables for it.

Extract that somewhere, get into a PowerShell or create a bat file, then start it like so: For NVidia, .\ethminer.exe -U -P getwork://IP-OF-GETH-BOX:8545 or for AMD, .\ethminer.exe -G -P getwork://IP-OF-GETH-BOX:8545.

You can get help with .\ethminer.exe --help.

An alternative is t-rex, which is closed-source. It takes a 1% dev cut, and supports newer-generation cards. Download it, then run it in PowerShell or via bat as .\t-rex.exe -a ethash -o http://IP-OF-GETH-BOX:8545.

You can get help with .\t-rex.exe --help.

In my testing both ethminer and t-rex get almost the same hashrate from GTX 1080 and GTX 1070, with T-Rex ahead by maybe 5%. T-Rex does have a nice UI.

Done

In your Geth logs, you should see 🔨 mined potential block and 🔗 block reached canonical chain as well as the occasional ⑂ block became an uncle, and in ethminer you should see Job: and **Accepted messages.

Enjoy the feeling of early Ethereum mining. Difficulty on Sepolia is low, you should see rewards come in steadily.

@Hua-Yen
Copy link

Hua-Yen commented Jul 13, 2022

新的 Sepolia Faucet 現在在哪邊呢?
https://sepoliafaucet.net/
https://faucet.sepolia.dev/
這二個水龍頭目前失效。

@yorickdowne
Copy link
Author

@Hua-Yen As far as I know, there is currently no reliable Sepolia Faucet. ethstaker Discord will run one, but we need Infura to offer a Sepolia endpoint, first. The ethstaker faucet will be protected by BrightID for Sybil resistance. It is incredibly hard to operate a faucet and keep it operational, because bots will attempt to drain it.

@yorickdowne
Copy link
Author

There was likely a mistake when updating geth.yml. git restore geth.yml and then just ./ethd config to run an RPC node on Sepolia. Sepolia mining is no longer possible, nor is validating.

@matewilk
Copy link

matewilk commented Nov 2, 2022

Hey, is it possible to run it on a Mac?

I'm trying to run it on MacOS but getting the following error:

$ ./ethd install
./ethd: line 1526: syntax error near unexpected token `&'
./ethd: line 1526: `            ;;&'

@avdheshcharjan
Copy link

same here

@qjawe
Copy link

qjawe commented Nov 6, 2022

I can't run ./ethd install neither ./ethd up
It shows this error

./ethd install
./ethd: line 1548: syntax error near unexpected token `&'
./ethd: line 1548: `            ;;&'

@avdheshcharjan
Copy link

Using MacBook Air M1 and having the same issue!

I can't run ./ethd install or ./ethd up
It shows this error

./ethd install
./ethd: line 1548: syntax error near unexpected token &' ./ethd: line 1548: ;;&'

@yorickdowne
Copy link
Author

There are faucets for Sepolia ETH, see https://faucetlink.to

As for Mac M1 and eth-docker: eth-docker uses some bash-isms and gets tested on Linux. I don't have a Mac to test on, alas, so it working on Mac is more miss than hit.

@qjawe
Copy link

qjawe commented Nov 29, 2022

faucets for Sepolia ETH, see https://faucetlink.to/ could not get more than 100 of SepoliaETH faucet

@yorickdowne
Copy link
Author

Which is more than enough. Gas on Sepolia is cheap. That's enough for a ton of contract deployments and testing.

@0xolishell
Copy link

0xolishell commented Mar 6, 2023

[March 2023 Update] Here is Alchemy's Sepolia faucet – https://sepoliafaucet.com. It's free and you can get more every day if you need. Adding b/c I'm seeing people posting about needing Sepolia ETH

@IkemNwodo
Copy link

Hey @yorickdowne,
Does this still work please? I am in urgent need of a good amount of Sepolia ETH that the available faucets can't meet

@TobiWo
Copy link

TobiWo commented Mar 11, 2024

Hi @IkemNwodo ,

no, this does not work anymore since Sepolia switched to PoS a long time ago.

Best,
Tobias

@IkemNwodo
Copy link

Okay, thank you @TobiWo
Please, any other alternatives aside from the available faucets?

@TobiWo
Copy link

TobiWo commented Mar 11, 2024

You could reach out in the ethstaker discord. That's the best way to start at least. How much Sepolia ETH do you need?

@IkemNwodo
Copy link

Okay. Like a hundred Sepolia ETH @TobiWo

@TobiWo
Copy link

TobiWo commented Mar 11, 2024

Ok, I can send you these as well 🙂 . Please drop me a message with your address where you want to get the ETH to on Discord.

@IkemNwodo
Copy link

Okay. Thank you so much, @TobiWo

@GoranBosevski
Copy link

Ok, I can send you these as well 🙂 . Please drop me a message with your address where you want to get the ETH to on Discord (handle tobiwo).

Hi can i get a 150? Thank you

@ghost-lolade
Copy link

Hi guys, I tried this set up and it required over 100gb of docker space... I would appreciate if anyone can spare sepolia eth. I need quite a lot but I'd appreciate whatever I can get

@Jiangzy520
Copy link

好的,我也可以给你发这些 🙂 。 请在 Discord 上给我留言并附上您想要获取 ETH 的地址(处理 tobiwo)。

0x4877465DA5357B1D95704EBC1787b7F2a442A042 Sepolia Hope you can help me. Thank you.

@OrePrima
Copy link

Hi guys, I tried this set up and it required over 100gb of docker space... I would appreciate if anyone can spare sepolia eth. I need quite a lot but I'd appreciate whatever I can get

As per the message above it is not working anymore since Ethereum is now a Pos protocol.

@gamedust-ph
Copy link

anyalternative and steps we can work with POS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment