Dark Forest: Setting up a remote explore (Part 1)

EthStaker Workshops and Technical Guides · January 2021 · 30:00

This EthStaker workshop begins setting up a remote explorer for Dark Forest, a zero-knowledge space strategy game built on Ethereum, walking through the initial configuration steps. The session situates the setup within the broader onchain games landscape supporting the game's community.

Topics

From EthStaker Workshops and Technical Guides, hosted by Eth Staker.

Transcript

and we are recording hey i'm superfiz i have been patiently waiting for the past 72 hours as michael set up a test box uh we want to demonstrate the installation of the remote miner in dark forest this comes with a big announcement from eath staker that we are rebranding we are now east staker and dark forest uh so we feel like we've we've kind of maxed out our potential in east acre and we're ready for something with new horizons and dark forest

seems like the solution i'm full of crap by the way but at least i'm having fun hey michael just thinking like po-op designs then just like a dark forest meets east stake or po-op somehow yeah yeah just fit it all together i mean if we were to talk about what's really most important in our lives like right now it's dark forest i mean i mean sure there's all this promise of like not having to work and collecting returns and inheritance for our children but right now it's dark forest so um here's what we know uh in dark forest there is a

native minor it's called it's it's on the lower left it's called explore it turns on by default when you launch the browser um and i never want to say a product sucks because somebody wrote this and like they put their time into it and if it didn't exist we wouldn't have anything but it's it's a relatively underpowered miner oh hashes caught your first leg did i laugh yeah you lagged i am keeping that in the editor oh oh okay well so the nick at least i know it's not that nick yeah uh well but it has been a while though yeah um so anyway i call this a minor because

it does a hash and it does provide a result and that result ends up being uh space and planets and all that gobbledygook um but what we know is that the native browser miner is really weak or i'm gonna say it's weak i mean it's just it is what it is but you can mine a whole lot faster by using a command line browser um even doing that on a remote crawler so i don't actually do any crawling on the machine i'm playing with because the game already gets really intensive and right now my map is like 120 megs and it kind of lags my browser pretty

hard so i actually mine on a couple other computers and we're gonna go through the setup for that with michael the pre-pre-requisites the pre-requisites for that are um kind of some kind of linux distribution i always like linux server i'm sorry ubuntu server and um a browser you ready i think we document this i guess you'll put it in the comments right yeah yeah yeah okay so we should start really in chrome if you'll pull up chrome real fast the browser you're actually playing from all right and because of i think it's hardware acceleration is the reason that

chrome natively runs this explorer faster um it runs the browser brace based explorer faster are you going to share that uh oh yeah you want me to do a visual i'm sure not a problem because the first thing we have to do and this is the thing that um the first time you do it it's going to aggravate you because it seems like your minor's not working so begin with this go click on that lock up there beside the url and choose site settings and scroll down to allow uh mixed content or something scroll down now go uh

insecure content allow okay now you're gonna have to start your browser for that to actually kick in like close yeah and so what this does uh it allows you to connect your browser session to that miner um without it you will spin forever and never actually hash now it still looks okay uh that lock go ahead and get into your game because that lock suggests that it's still enabled okay that's fine ignore me oh no that's

just https log i'm just i'll stop okay um well because mine actually shows up saying not secure um that's this one yep okay so we did step one we enabled insecure content that did not change like i thought it would i thought that it would would show the hazard sign with the not secure but if we run into a problem with that later we'll work on it okay second thing is

stop the native hasher because it um it slows christmas and it's just gonna end up slowing your browser down um okay so now we have disabled the local miner and we have uh allowed insecure content now we want to go to the remote server the one where you're actually going to be mining from okay so let me okay uh this is the remote server

awesome um okay so there do you have the directions that i pasted to you in discord or do you want me to read them out loud uh let me pop discord up real quick so you're gonna begin with installing some bare minimums and that is build essential screen and git if you did an actual server install you probably already have screen and git but it never hurts those aren't installed by default on ubuntu desktop but they are installed by default on the server okay am i doing the uh screenshot first

or the uh text that you sent first uh they're the same are they okay yeah one of them is formatted and one of them isn't so sudo apt install uh y just means do it without asking for approval build essential is some tools uh for building software screen is called this uh like a session manager that will allow us to pop into different sessions so when you close this it will still run and git is going to let us clone the repo so let's run that you

all right all right so now we're going to clone this repo that jacob rosenthal has it's my mc fast i do not know what mimc stands for i haven't really been worried about it yet all right and we're going to cd into that now before we install that we need to install rust and we're just going to copy the one liner rust installer and this really um wow you can do that by hand this i'll check it for accuracy this comes from

um the rust site it's just a standard uh quick and easy rest installer usually you copy paste it but michael is a i feel i feel like i'm getting simultaneously roasted uh while doing this you made me wait uh nine so michael actually agreed to do this like an hour ago and he was like okay i need ten minutes and i was like okay okay i'm there yeah and so i came and i was like all right and i have been waiting and so then finally we entered a screen session i'm just watching him type forever and i'm oh not not his fault like there is set

up to do i'm just uh i'm just high strung just hit one okay all right all right um and so that copy that line can you no you don't have copy paste stability right now do you i should be able to go down so um

for cargo to run correct i'm sorry yeah for cargo rust whatever to run correctly um you need to source the home directory um what happened no because uh the way i'm recording i can't see you when i'm sharing so i'm just cutting to you quick so oh but i can't see the screen okay so this uh we need to source the home environment and so that source dollar sign home slash dot cargo slash env needs to you can run it now and you need to store it in your profile so when you reboot that it's still there so go ahead and type that copy that line in into the terminal right now yeah and it oh you do have copy paste

okay hit enter and now do nano space tilde slash dot profit profile so you've sourced the home direct or the cargo directory once but in order for you to be able to reboot and have the same thing you need to also add it to your profile so scroll to the bottom oh it's already there beautiful um we needed that but we're great okay so now we can install rust and so you'll do rust up install actually rust was already installed but we need to switch to the nightly um build yeah this is actually like so simple once you get it it's like three seconds of copy

paste done um but getting familiar with it like anything takes a few minutes okay great now the next thing we're going to do is start a screen session and the purpose of this is to allow the miner to run in the background when you disconnect from the server there are a lot of ways to do this like you could do it as a as a system demon but screen is just simple so screen dash capital s and then whatever you want to call that screen session

and then we're going to run it and it is now going to wait for connections as soon as it gets up and running one of my favorite things to say is this is so easy i can do it that's fine i was i was just staring at the dark forest map and i'm it's just funny compared to the call you had with with preston seeing his map and what he's got outlined through the fog and then like i got my little cube it's like oh man i can't wait to get uh some of this cleared up yeah if you throw if you throw a lot of

cores at it it will expand very quickly and so there's actually a trick to it um you really want rather than many in parallel you really want a couple really powerful ones so um a lot of little ones end up tripping over themselves but if you throw like amd 5950 at it it will uh some ryzen it it just zooms through it chews through it no no joke i'm probably going to build another computer so i can play um dark force more effectively i hate waiting sorry god

we have this uh east chicago thing tonight i will probably be playing during that as well so that's fair somehow like that gives me a sense of calm actually almost there it takes a hundred to kick that let's see how strong that planet is if we have time i'd love to pick your brain with some new questions okay and i'm not really an expert um i okay so we're ready on this yep um i'll tell you my actual interest in a

little while why i let myself keep playing uh so you can uh control a d out of this to exit the screen session or you can leave it running and switch something else whatever it might help to leave it up just in case we need to look at some output so you're on your local box now right okay so now we want to test that we can connect to that okay oh i thought i had a do i know what port that's running on it's running on port 8000 yeah so um do this do uh telnet space and the ad the address to that box uh i don't remember

and then space 8000 enter yep okay so this is not connecting to that box for some reason okay let me check something out real quick it's the longest password i've ever heard makes me feel better when it's uh well you know they have uh algorithms that can listen to the keystrokes

and no it's not i mean it's for real no i know that's okay uh it's something that uh i've thought about recently god damn it i you know i don't i wasn't doing the telnet thing to just kind of be fancy for like i know some people are going to have trouble checking it so it should be a ssh port screw it let's hm i'm thinking that port should have connected and i don't always do it on my own but i do believe that it yeah it does connect online so you sh

so what i was trying to say is this this guarantees that you actually have an open connection because a lot of times when you get into your browser and you're trying to establish the connection and it doesn't work you don't know where it didn't work so by doing this test it tells us that telnet from the local computer can actually connect to that port on the remote host but we're stuck we don't know we don't have ideas yeah i want to check the um parts real quick one second one second if all that sells and you decide to cut

the video you can just cut from like or not i mean it's it's always good entertainment i don't so oh are you up

drop that trash man drop that ufw okay see that ufw disabled okay so don't listen to me you should never ever drop your firewall um but what you could do is uh add a rule for port 8000 from anywhere maybe we should do that maybe we should tell people how to do that all right one second i just assumed that ufw was not running so what i'm going to do here is with this command i'm checking the whoops i thought i enabled that

so ufw is uncomplicated firewall michael had it running and i was not aware that it was running what it does is block ports and so the reason we couldn't connect to port 8000 from the remote machine is because it was blocked by ufw so we're going to add a firewall rule to enable connections to port 8000 it should be something like studio ufw allow all from yeah he's just trying to i don't know if it's going to take with uh with it being down with what oh yeah he's still right yeah but it's not is it gonna enforce though

yeah oh well when we enable it i mean honestly i don't really run a firewall on this kind of stuff because there's nothing valuable on it uh and it's in my local network there we go so we're we're good now or at least the port's up so now if we do the uh uh the well so you know yeah okay so we're in you can control c that that means that we can connect from

your local instance to that port on the remote instance and now you can head to your browser browser browser oh okay all right so now you need to go to plugins.zka.me ckga.me and you're gonna grab um crawl planets nope wrong one scroll down

remote explorer and just tap where it says raw down what yeah right there do a control a control c and then go up to your plugins box uh the plugin icon in the top five yeah and you're gonna add a plugin and click a times and add plugin again and so name it uh remote crawler love it okay and so do control a control

v so we're gonna clear that old stuff out paste the new stuff in and save it and now you're going to hey let me wait before you do that let's let's uh hmm let me think yep let's do it this way um uh nope i need to show you how to run it natively and then we'll make it easier so um first let's run it natively does that mean here yep hit run okay we're gonna tweak this to make it a little easier to use but we'll wait until we okay so go ahead and type in http colon slash flash 192.168.1.34 colon 8000 slash mine do a control a control c of that so you

have it in your buffer for in a minute okay because we're going to paste it somewhere else now hit explore and we're just going to wait a minute it should fire up if you slide that to the right all right you're getting 89.72 uh slide that window to the right and you should see your uh your little icon or maybe you have to oh i see what you're saying okay so you you need to go ahead and set it so click the targeter and i would put it in the uh it's not this one we're not using this one at all anymore uh i'm pointing with my finger you can't see can i get rid of this somehow this

window or not no i i don't i mean i'm sure there's a way to but i have i i'm stuck with it okay um i usually cover it up with a planet view so you want to click the targeter in the in the remote crawls box oh right yes that targeter and you want to drop it in the center of your existing box because that's going to um you're actually in a good location because you're right near the edge of the universe that's going to crawl around the perimeter of your existing box okay and so it's about right now it's about 10 times faster than your other minor if you give it a minute it will bounce yep to the outside and if you want to zoom you can see that you're probably getting blocks that were a little bigger than you were getting

before oh yeah yeah well so it is actually bigger um it's about five times the width of your old band when it gets to a new row it's going to uh you'll see that it's a much bigger swath i like that word swath okay uh so i want to show you a problem and a solution so when you x out of remote crawls about the whole the whole window close the plug-in and so now when you reopen the plug-in

your stuff is gone gotcha and so to simplify finding that x out one more time we're gonna add it to the plugin directly so go to edit and scroll down until you see the zero zero zero zero it's near the bottom okay i saw it stop okay and so replace that replace that ip with your 192.168.1.34 okay and so you're eventually gonna add a bunch more miners and when you do that uh

just for demo uh start a new line underneath that and i think what works is if you do this dot id equals one the the row above that you're creating a new element oh i suggest id equals one semicolon and then copy this add minor and add a new instance of a new miner with a different ip and you can iterate all over that so if you have 10 miners they would be one two three four five six or eight on ten but that was just for demo so you can go and hit save now can i leave the one it needs to be there okay what was it zero before yeah

oh yeah the first one the first element is zero what's it zero or one it was there's an element of an array always zero what it i mean it were i i had to change it to one that was originally zero okay well so let me be clear then if we're adding another minor you're gonna you're going to create another line that says this dot underneath that you're going to create this dot id equals one and oh is that all yeah but so you're gonna have another this id before that oh it happened yeah number two i know okay so i'm gonna

save this all right i'm done trying all right save and now when you run the plugin you're gonna see your miner there nice nice nice nice and you can target it so it looks like oh maybe not um i don't know the logic that determines whether it it automatically finds its location or not sometimes they just i call them they sort of heat up like that one's not actually running yet oh there we go okay and so the gotchas here the real big gotcha is oh and you'll see now that switch to not secure content because you have insecure content loading on the

page um the the first thing that my other buddy who was setting it up he just he said he had done it he forgot like he just i guess he took it for granted um and he was like it's not working it's not working um but that is probably the only gotcha in all of this setup okay this is awesome though i could see now it's it's feeding into the addiction one of the other um one of the other things i've discovered is if you have multiple remote miners remote crawlers um you don't really want them tripping over each other because they in

many cases appear to be processing the same space over and over so as in if there are five following the appearance and that another reality but the appearance is that they just follow in line and reprocess the same space over and over so you want to stagger them somehow so i would maybe run one like way over here or something yeah uh something like that okay that's pretty cool though i think that's it that's awesome i also want to do one um this might be more useful to the world