What is Eth-Docker? | Eth-Docker Setup Highlight
EthStaker Special Events · November 2020 · 9:48
An EthStaker community walkthrough introduces Eth-Docker, a Docker Compose based tool built to run Ethereum execution and consensus clients together for solo staking. It explains what the setup automates for someone running a validator, offering it as an alternative to configuring node software by hand on bare metal.
Speakers
Topics
From EthStaker Special Events, hosted by Eth Staker.
Transcript
we are here today to do something extremely exciting uh we're gonna talk about eth docker um or as the repo is called eth dash docker um and that is a product developed by our own york down or thurston barons um what is eath docker yeah it's really exciting if you're an uber geek otherwise maybe not so much so ether is a way to run ethereum clients and do that quickly and easily how did it come about in 2020 i think now mid-2020 i became aware that ethereum proof of stake was a thing i became aware that
was i made darsha testnet i wanted to geek out because i was bored so i looked at somewhere asad's guide that guide was excellent i got it all up and running in two hours and then i decided two hours is way too long i'm not doing that again i want this in something that takes under 10 minutes and that says darker so what it does is it takes all the all the little things you have to do like i need this version of go and i need a java etc and as as docker does it encapsulates all that so it doesn't matter what's on your machine it matters what's in what's known as a container the which you can think of as a very sophisticated zip file
which contains absolutely everything the program needs to run okay so that's uh i i agreed to ask the dumb questions i think you jumped ahead to tell us what docker is right what is what is docker like i so i hear of docker all the time and i know that all of the cool people use it but i don't know how to what is docker so when you when you come to this without knowledge right um the first thing you might think is oh docker is too complicated for me right i'm not a programmer but that's the same attitude people have towards the command line in general like i can't program you know i don't know who has to use nano until you explain nano is a text editor just on
text not on you know there's no window as such but it's a text editor you know so all the same things apply and so the first thing i would say is don't be afraid of docker it's actually probably easier to get this going than it is to follow something like a soma guide although it will take you more effort to dig down because now it's up and running and you don't have any reason anymore to understand everything to the nth degree right so what is docker it is a tool that is designed to take a um what you might call a runtime environment what i called earlier a sophisticated zip right basically everything the program needs grab it from something called docker hub
or build it locally and then run it so if i have a program like i have say lighthouse i get that off pre-packaged run that on my machine and all i need is any kind of linux really and it is up and running it does use the linux underneath this is not a virtual machine but as far as the as lighthouse is concerned it lives in its own little world it doesn't see the rest of the machine a few background things about docker um there is a learning curve to docker if you've never used it before it will feel frustrating for the first couple of hours but the benefit kind of like
thorson said once you get the basics of docker it really opens up a lot of new possibilities that you didn't know existed before which really means taking things like eat stalker and spinning up um a validator note in minutes with a few commands rather than a lot of instructions and to make this easier a docker comes with a shell wrapper something called sd it's a little script that does all that for you so while you can get smart about what is a docker in the first place you don't strictly speaking have to one of the things when i first learned docker that was frustrating to me is not really knowing what was going on in the
background like right when i start a program i like to see terminal output um and docker kind of abstracts all of that away are you going to show us ways that we can actually look inside that docker container and know what's happening yes i will and this is very similar to running things in system d like you do with um with so much stuff right when you run it as a service in systemd like you follow a soma isaac guide i'm going to show that guy relentlessly because i like his guides you don't see the output either until you type journal ctl right and then you get the logs this is similar here just
in instead of journalctl you type fdlog so if you want to be closer to the to the metal you would type docker compose logs right so it's it's very similar in that way and how you interact with it you can also interact with it if you just want to see it run there's a run command so you can just see it run and output to the screen right away of course in that moment the moment you stop the run it's stopped again right the same way as if you did a lighthouse on the cli directly instead of running it as a service in systemd and because we like things to be up for months without worrying about them of course we have them as a service so you can think of this as very similar
to the systemd stuff just more automated i would maintain easier to update uh you know easier to not worry about what my build environment looks like like oh you lighthouse didn't run yeah you needed the new version of rust the what in the what now right so i don't i don't have to worry about that anymore that's all that's all containerized for me packaged abstracted away packaged in my uh zip on steroids that's a container one of the one of the ways i want to help people conceptualize what docker is is you probably run a lot of your systems now as system services and people may be familiar with setting up system services that's how um submers and coin cashews
guide they show you how to set up system services when you're running under docker um you're no longer using system services um docker has its own upstart and so uh when you're choosing how to set up your node you're really going to choose either a system service or docker you're not going to use both they while they don't do all of the same things when it comes to running a node you can essentially think of it as an either or because in that case they provide the same service correct okay so um i have a little bit of a documentation site i'd start sharing and maybe we just look at a picture first and then we can go into okay how do you spin it actually up and uh
have questions along the way how's that sound all right i'm gonna start sharing the entire screen i will no doubt um you just see uh height floating meeting controls that sounds good that can go okay so we can see this okay so this is at fdaca.net which has all kinds of documentation it starts with this overview here right so there's your linux server the same thing that you would always use whatever that is that can be a physical machine in your home right that's what it should be or it could be a vps in the cloud
then inside this is a docker compose stack and we'll show you how to do that and that runs a consensus client like a lighthouse or a nimbus or whatever and an execution client like a geth or narragon or a besu or a nethermind a validator client in earth docker that is typically the same as the same team as the consensus client i haven't gone crazy here while you can theoretically mix and match these we don't um a reporting package which is optional like a grafana prometheus then of course you need keys in production these keys would be generated outside in an air-gapped and then
you would deposit against them on launchpad and then bring them in to your validator client by bringing them over to your linux machine and importing them so this is this should all feel pretty familiar this is the same components that you have um whenever you run an ethereum node right there are components in each docker that go deeper than what we've shown here and that we will probably not get into um such as it can actually build the clients from source if that is so desired that's by design so it's good for testing if you need to build a client from source you have something you want to try and their current development branch if docker supports that there's a little file called um source there's two variables one a
source target and i think the other one is docker file so instead of docker file binary it would be docker file source and then set the source target and do a docker compose build and it will compile from source right fully supported in this thing it can also be used to run rpc nodes um i'm actually doing that for my own business i'm using this thing to to run api rpc nodes that do not validate