How To Setup a xDai Node for Dark Forst
EthStaker Workshops and Technical Guides · January 2021 · 15:10
This EthStaker workshop walks through setting up an xDai node for Dark Forest, a zero-knowledge space strategy game built on Ethereum, covering the infrastructure players need to explore the game's map. The session frames node setup within the broader onchain games landscape.
Topics
From EthStaker Workshops and Technical Guides, hosted by Eth Staker.
Transcript
hello i'm superfiz i'm here with my good buddy michael i'm michael how are we doing um you may remember us from our eatstaker days but we're a progressive group and now we've moved on to dark forest not really forever just for a minute i should eat my cheese or stop eating my cheese as i'm talking what should i do i i i don't know put your answers up on the ether dot io stop eating cheese or continue eating cheese that's a good one okay i'm out one more fruit i'm done okay so
um we've been playing dark force actually i'm trying to stop i was gonna say playing is probably putting it nicely i'd say obsessing but you know that's what i do though yeah that's who i am okay so um hold on eat my shoes okay back to the story so we've been playing with dark forest and dark forest relies on transactions uh on the xdi network and um as we've kind of suggested like the way to maximize the game is to automate a lot of things and sometimes when you automate you end up batching a lot of transactions and so i've had cases where i've
sent a thousand transactions at one time uh for better or for worse that would be when i crawl all level zero planets from all the planets that i have right yeah so anyway um even if you're not doing a ton of transactions you can still experience lag by interacting with um the standard x-dinode and so one of the things that we can do to speed up the interaction is to run a local x die node so then you're part of the network and you're not just depending on someone else's uh node so to do that where's i have a um you're gonna find some directions down
below michael and i are gonna walk through that real quick nothing is ever real quick uh this is relatively easy i think um i will say that it's the yeah this was very easy this is the first time i've set up an xdinode um i've used so it's based on what we used to know as parity that's now open ethereum and the only kind of hang up i ran into is that you have to have an account before the chain will start running and so i'm not suggesting that i'm that i did this right but uh i used my private key
from oh from dark forest i was gonna say open bizarre um i used my private key from dark forest to generate a key that i imported into uh the x-dinode to run my my client now i don't think you have to do that in fact i'm very fairly confident you don't have to do that because the transactions are actually signed in your browser um but for the sake of this tutorial and because it's not really that difficult and you might accidentally learn something we're just going to do it the way that worked and then we'll go from there and so michael's going to begin at
xdaychain.com developer slash install x client slash parity okay parody is a really interesting company is it it is i it so i'm not going to talk about it i was going to i was going to give my feel about parody but i have a lot of mixed feelings and so it's better that i just smile and not um okay and so there are a um this big warning up here don't use the latest version of open ethereum 3.1 plus uh instead use
um so go to that download binaries thing that link in the middle in the in the uh the link in the above the github open ethereum parity ethereum releases in the orange caution window yes okay and from there um the 3.0.1 is a valid release for x-die so you can select the binary for linux so you'll probably want to backspace on that right click and save link as or copy link to
what is that called copy link address yeah and now you'll go to a terminal window and you'll w get that i would not pseudo it because it'll it'll jank up the permissions on me okay that is interesting okay so go back and um i noticed that when you did it manually but uh so go back and at the bottom
or down lower where it says releases there's an actual link and just right click and copy the link to the linux one the top the top uh yeah it was weird that that did not and so just try and w get that and see if it works okay yeah that's weird but cool hey okay so we are downloading the open ethereum uh eth1 client uh it used to be called parity parity gave it up and the community adopted it and now they maintain it um the x die chain runs
using the parity client um so we're really just going to end up specifying a flag so you should be able to unzip that all right just unzip and then open space tab whatever you probably have to install unzip but we'll see i would try it before you install anything sure just just hit uh o and then tab yeah yep yep and you're gonna have to install zip awesome sauce and i'll do a lis ls dash
long beautiful okay so we're gonna need to um change the permissions on that to change mod plus x open ethereum [Music] i want to do that as sudo and it's just the the one executable file yeah and hit enter now do ls again perfect okay so i i added a bunch of parameters there that you'll want to uh so you can just try it first to see if it works
um and so let's run through these parameters real quickly these are gonna open up this node to anyone on your local network and if you pull if you forward ports uh from the outside it will also make this node available to other people outside i would not suggest opening this node up or ports to this up to the outside if you're just doing it as a single use thing for dark forest so you're going to run dot slash open ethereum and then dash chain is x die and so this is actually uh using the client
to download a completely different chain than ethereum dash dash rpc that's a remote procedure call and dash dash json rpc apis are all and this is literally just opening the instance up for anything that connects to it to use it am i just doing that whole thing that'll work and when you get to json rpc interface you're going to use uh this machine if it's the same one we use yesterday was 1.34 you're just gonna use that address to call it uh yeah that was
and i think when you do that for me it it complained um did you change your ip from yesterday yeah there's a different machine okay so it threw an error reading node key no keys found i'm not sure that that's the end of the world no okay it's syncing so um for me that was just a learning step i didn't really need to import a key but i thought i did so this is going to be a ton easier than i thought it was going to be at this moment you have an x die node
running i know right um and so now we're going to switch to your local terminal okay and we're going to attempt to connect to that port port 8545 is the default rpc port um and an rpc port is like what lets an an external machine connect to that instance of the chain and interact with it and so we're just testing that it's going to let us connect great so we're in so you can control c there oh my gosh this video is going to be like four minutes um
and now you're going to open up your dark forest instance in the browser yes okay uh let's go here let's just switch a couple things around quick when i did it like i saw the error and normally air errors are fatal and so you have to resolve them somehow really it's just error reading a key it's not a executable error so i um ended up using geth to take my dark force private key to create an importable uh key format and then i imported it into parody
there's absolutely no reason to do all that silliness don't be me all right so are we headed chrome oh right i forgot i'm sharing the wrong screen yes i am currently signing in let me just switch over so you can see it here we go awesome possum okay great and now you're going to go to
settings and scroll down where it says current rpc endpoint and change our pc part url uh yeah i guess yeah i think you can type in that space now it's going to do this this good and funny thing it's going to test the rpc connection and it's not going to let you change it until it verifies that it's a good connection which is good because it means that noobs are not going to get kicked off a usable network okay um but the funny thing that happened is i actually had to try three or four times before it actually
said okay this is legit so you're going to change that to http colon 192.168.1. whatever your oops okay uh colon eight thousand uh colon 8545 and now so go ahead before you hit anything copy that because there's a 83 chance it's going overwrite that okay so hit change yep yeah and so keep trying it a few times i think it's going to wait for your chain to be completely synced but it does eventually okay at least it will eventually take
uh and we know that because we verified that we can connect to that port um as long as your ip is correct which i do not recall um it will eventually pick it up i will double check to be certain but and the fact that your note is still i'm sorry i see what you're saying nope sorry i was just thinking out loud i did have the incorrect go ahead and copy that again because it's oh okay so we we've switched over which it is so neat like i'm glad they coded it that way um but you can see now your current rpc endpoint is that remote client on your local
network um and now you're not going to be um vying with a thousand people to get access to the same rpc uh you're going to be a member a full-fledged member of the xdi network and you can submit transactions um as a full member without having to um fight for uh rpc space that's so cool that was too easy what's that like seven minutes