Contra Moxie - Ethereum Full Node
Moxie Marlinspike is a Web3 skeptical. Though Marlinspike is no click-bait pundit, having helped deliver tremendous value to the world through Signal, he’s missing technical details of NFTs, and I believe his first premise (“people don’t want to run their own servers”) is not generally true.
Communication technologies like email and Signal have stringent availability requirements, and are consequently high maintenance. Nobody wants to miss an important interview invitation or argue with their ISP about SLAs at 3 AM while the household frets. Conversely, many tech-savvy nodes in my social network have a NAS, generally with underutilized compute resources. Many host personal websites and video game servers. People do this for the intellectual challenge, the practical education, and the sense of personal agency.
The key requirement is the ability to tolerate faults. If your uptime interferes with your sleep cycle, don’t self-host. Occasional outages must be acceptable.
Ethereum full nodes fall squarely in this fault-tolerant, low-maintenance category. If my node goes offline for hours with a failed RAID array, the network won’t blink. No data will be lost. Setup is straightforward for folks with basic Linux sysadmin skills, as evidenced by the following tutorial.
Judging by the number of folks employed by major tech companies, there are probably 100s of thousands with access to these requirements. Only a subset of that population will care to participate, perhaps 10s of thousands. The number of active full nodes currently ranges around 5,000, per https://ethernodes.org/history.
Ethereum Full Node Requirements
- Recent CPU, 16 GB of RAM, 500+ GB SSD (1 TB recommended)
- As of this writing, an SSD is a hard requirement. HDDs aren’t fast enough.
- Stable Internet connection with unlimited bandwidth or a large bandwidth cap
- Basic Linux sysadmin skills
Create user and enable user service lingering:
sudo adduser geth sudo loginctl enable-linger geth
Configure firewall to allow internode communication:
sudo ufw allow 30303
Login as the
suis not sufficient)
Download and deploy geth:
mkdir -p /home/geth/.local/bin/ && cd /home/geth/.local/bin/ wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.15-8be800ff.tar.gz tar xvzf geth-linux-amd64-1.10.15-8be800ff.tar.gz ln -sf geth-linux-amd64-1.10.15-8be800ff/geth geth
Configure service file
# /home/geth/.config/systemd/user/geth.service [Unit] Description=Ethereum Go client [Service] Type=simple ExecStart=/home/geth/.local/bin/geth --http --http.corsdomain "chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn,https://localhost:3000,https://www.example.com/geth" [Install] WantedBy=default.target
This service setup enables the HTTP RPC and configures CORS to support Metamask, local Node apps, and requests proxied by the server for
systemctl --user enable geth.service systemctl --user start geth.service
Monitor sync progress, which usually takes several hours to download the blockchain state and heal its state:
journalctl --user -u geth.service -f
Reverse Proxy Configuration
Enable proxy modules
sudo a2enmod proxy sudo a2enmod proxy_http
Configure geth proxy:
# /etc/apache2/sites-enabled/000-default.conf ... <VirtualHost *:443> ServerName www.example.com ... <!-- geth proxy --> ProxyPass /geth http://127.0.0.1:8545 ProxyPassReverse /geth http://127.0.0.1:8545 ... </VirtualHost>
sudo service apache2 restart
In Metamask’s Settings, go to the Network section and click
Add a network.
Any sufficiently descriptive value for the Network Name will do, but Chain ID must
the RPC URL must point to the server’s geth URL, e.g.
Check the Apache access logs to make sure Metamask is using the local node. For example:
sudo tail -f /var/log/apache2/www.example.com.log ... <ip address> - - [29/Jan/2022:18:14:57 -0000] "POST /geth HTTP/1.1" 200 519 "-" <UA string> ...
Transfer a small amount of ETH between accounts when gas prices are low. This transfer should be logged in the geth service log.
References and Further Reading
If you enjoyed this post and would like to support more of the same, contribute ETH to 0xf7318Ac0253B14f703D969483fF2908b42b261cc.