New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Camron G. Levanger: Treating Swarm as a Project Dependency

SwarmWed, Oct 9, 2019, 12:00 AM

Camron G. Levanger: Treating Swarm as a Project Dependency Working with a team of engineers in the same codebase can be problematic when it comes to project dependencies. While this is a problem that has been solved many times in various ways, here we will introduce a tool and methodology for treating Swarm as a dev dependency in your project. - A simple command line tool and YAML file in your project will help make sure all engineers are developing against the same version of Swarm. - Pin specific commits/tags/branches to specific versions of Swarm to cut out potential confusion from your workflows. - Learn how to integrate these tools into CI/CD pipelines. - Run multiple instances of any version of Swarm on any machine with a single, short command. - Potential strategies for using the same tools to distribute your software built using Swarm. About Camron Camron is a blockchain/decentralization advocate and currently working as a Senior Architect at Mainframe. A professional musician, competitive marksman, and avid outdoorsman. Well versed in communications and telephony, Camron was focused for many years on high-volume systems performance, building systems capable of handling billions of transactions per day in real-time. Eventually moving into systems architectures and managing devops teams at various start up ventures, Camron brings unique real-world experience to the decentralized space.

Transcript

hello again I'm Cameron you might remember me from earlier when my live terraform demo failed let's see alright so I'm gonna be really quick we just want to show a little tool we built for treating swarm as a project dependency like like mueller's touched on this earlier you know swarm right now is moving really fast not afraid to make breaking changes and that's awesome but when when you're dealing with is you know DAP developers people who are mainly JavaScript and front-end developers getting them to you know having to get swarm and bills form and runs form and not just that but understand like oh you know which version of gift do I need to check out to get a specific version of swarm and as that version of swarm the the right version for the branch of this DAP that I happen to be working on right now and so after you know a couple of times of helping some DAP developers track down what we thought was a problem and come to find out that it was just an incompatibility like they're running you know too old of a version of swarm and the SD caves for a newer version of swarm we just ended up building a little tool it's called swarm er it's open source it's on the mainframe HQ github and what it does is it allows you to just describe like the version of swarm and the options you need to start swarm up within a Yamma file and then you can keep that ammo file just checked in with your DAP or whatever project you're using that depends on swarm right now swarmer it's super early in development it's just something that I wrote and some developers that mainframe use so to install you do need it you need go lang you just go get you know github mainframe HQ swarmer so that's how you install it so hopefully in the future would just be some binaries that you can install through various methods or whatever but if you keep that swarmer die animal version control then no matter what version of the project you check out and you're working on the swarm or die animal also versioned and you'll be able to start up the proper version of swarm and it makes it so developers that really shouldn't need to be worrying about that can just do their job and I'll show you I just kind of started these things before I came up here so we could be quick so this warmer demo directory I've got right here is that large enough that alright so if we just pretend that this warmer demo is some some code or pasta git repository you're working on there that relies on swarm like you need swarm to to develop against and test against you see I've listed the directory here it's not a real project obviously so I've just got the swarm Adamo in there and my bash history is not doing great but if we do if we look at this warmer yeah well there we go I have a giant u Max configuration I'm sorry ok here we go so this isn't all of the options and not all of these options are required is just kind of a base thing to look at the repo here I mean obvious obvious you're just telling it you know we're go with areum is check out is which version of go aetherium to check out that can be a tag a hash branch you know it whatever you need and then here in the near future when swarm releases can get split away and you don't need to even have go aetherium possibly then we'll change something and make it make it very obvious what you do another cool thing about swarm are two especially just like for a JavaScript developer you can call out the number of nodes you want to run so like for locally testing communications or something you can say hey I need three swarm nodes or four swarm notes and it'll fire up three swarm nodes in a container it will go in and automatically appear them they'll all be paired together they'll fire up and they're running and ready to go you can either use guest or you can you know you inferior whatever you need for your ENS API if you need that if you don't you don't have to call it out it will also run guess if you wanted to or you don't need to you know you can call that I think it's false by default this ad directive it will actually add any directory you want into each swarm container case you need files in a swarm container for some reason the logs you just an you're basically naming the logs and it will put them in standard place and another directory named after the container it spins up if you don't want log files and you would rather just see the output when you're going for more you can set follow to true and they'll just follow the swarm logs if you run just one node so when you start swarmer it with everything will be on default ports the ports will be mapped so it's spinning up dr containers if it's one node then you know the gateways on 8,500 you don't need to worry about where things are i started yeah here we go i started three nodes right before i came up and so the initial output just shows you information you might need to know about each node it started up for example you know the gate here's the gateway port for this particular node and so you can go i should have already done this sorry and so all three of those nodes are accessible just like you'd expect so that JSON output you get is also really handy for like C ICD processes where you might need to do some integration tests so your your C ICD scripts can grab that JSON and know how to contact every one of those knows and you can run you know Comus integration tests or whatever it is you need to do so just a simple go tool simplifies development at least for the people in our office that's been really handy and I mean really that's it I mean there's not a lot more to demo yeah I mean it's pre-alpha is super early but does work if you end up using it and you like it please contribute any features you want to see or any bugs you find currently it only works on Mac OS and Linux it's not working on Windows yet because I don't and never have on the Windows machine to even test that on so if you like Windows please make it work on windows or test it on Windows and help us out help us make it a really cool so now questions for me though sure about airboats Shane about mainframe OS and I'll answer anything you want to know about swarmer

Automatic transcript — names and jargon may be misspelled.