Pre-Hackathon: What You Need Before You Go
Noobs: Come with questions
If you鈥檙e attending a hackathon to learn, it鈥檚 a totally fine and good thing if you鈥檙e discovering new tools the day of and asking for help with your setup. Hackathons will help you upskill rapidly. Make sure you ask a ton of questions and even prepare some questions in advance to get the most out of your time at the hackathon. Scan the list of workshops and speakers to identify the veteran developers who you feel can best answer your questions and make a plan for approaching them during the event.
Remember, it might take two to three hackathons to really understand certain development workflows and to identify the key factors you鈥檙e looking for in a team. Before you go, think about the experience you want to have. You don鈥檛 want to walk away from the hackathon regretting that you didn鈥檛 approach a badass dev. And plan around the basics: coffee, bathrooms, temperature, distractions. Don鈥檛 go out too hard the first night if you don鈥檛 want your terminal to look blurry the next morning. Or maybe you code better when you鈥檙e loose. The hackathon is about your journey as a dev, so make it yours.
Pros: Come with tools
Most in-person hackathons instruct participants to not work on their projects beforehand. However, before the hackathon, you should at least make sure that you can deploy a smart contract to your local blockchain and identify common bugs that could otherwise eat up your time during the event. So have all your tooling ready before the hackathon and get familiar with it. You should install and configure Git, Docker, homebrew, npm, chocolatey, node.js, react.js, and/or angular.js, and other tools you may need before the hackathon, so you don鈥檛 spend valuable time on basic setup. You don鈥檛 want to be discovering your new favorite tool in the midst of the hackathon if your intention is to win.
Quickstart
The fastest way to get started is to go through the ConsenSys 鈥淕etting Started with Ethereum鈥 three step guide. It will get you set up with all the necessary tools you need to succeed at your hackathon. If you need further details, check out the deep dive into tools we provide below.
Text Editors and Integrated Development Environments (IDEs)
Okay, you鈥檙e one week out from the hackathon. Now it鈥檚 time to download your tools and ensure that you have everything set up before you get to the hackathon. Start with your text editor or IDE. If you already have one you prefer, start by getting the Solidity linter. If you don鈥檛 have a preferred text editor, pick from the options below, and open Remix IDE in your browser.
Remix: an in-browser IDE. Whether or not you have a preferred text editor or IDE, you should use Remix at the start of the hackathon, since it鈥檚 useful for rapidly writing and testing your smart contract code. Use Remix to start your development鈥攜ou can move your code over to your favorite IDE/text editor once you feel you have worked out the initial bugs and are thinking about writing tests for your code.
Visual Studio Code: Microsoft鈥檚 code editor. Useful for those who are new to the Ethereum space AND do not already have a preferred text editor or IDE.
Atom text editor: a text editor created by GitHub. Useful for those who love the design of GitHub鈥檚 products. Has a teletype function, which allows you to collaborate in real-time with your team if you are all using Atom.
Sublime text editor: text editor with great search functionality (goto is the name of the function).
How to Run Ethereum on Your Machine: Local Chain, Clients, and APIs
You鈥檒l need to install the software that will allow you to run a blockchain locally on your computer or connect to a blockchain. Our recommendation is that you run a blockchain locally, since this is the easiest way to quickly build and iterate during the hackathon. Download Ganache the week before the hackathon and use that for running a blockchain on your machine. You should be comfortable using Ganache and getting things like account information. Once you do, you can聽save your workspace聽to save even more time and effort during the hackathon.
Ganache: a one-click blockchain from Truffle. Allows you to create a private Ethereum blockchain on your machine and has both a GUI-based application and a command line interface.
Go-Ethereum: an Ethereum client, often called 鈥淕eth,鈥 that can create a blockchain locally on your machine, connect to a testnet, create a private network, or connect to mainnet. Geth is the official Golang implementation of the Ethereum protocol. It has had hundreds of contributors since it was started in late 2013. Geth is battle-tested and important for you to know about, even if you do not use it in your hackathon.
Ethereum Smart Contract Development Framework
A week prior to the hackathon, you need to make sure that you download and set up your smart contract development framework. We recommend Truffle, which has become devs鈥 go-to environment, testing framework, and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM). Install using the instructions below, and then follow the Truffle Quickstart to ensure you understand the framework鈥檚 functionality.
Truffle: a comprehensive suite for writing, compiling, testing, and deploying smart contracts.
Also, you don鈥檛 have to reinvent the wheel when it comes to basic smart contracts. OpenZeppelin has an open source repository of audited smart contracts that you may find valuable.
How to Use Testnets and Get Test Ether
We recommend using Ganache to run a blockchain locally on your machine. Each account in Ganache comes pre-loaded with test Ether, so you鈥檙e all set from the start. If you are using a testnet instead of a blockchain deployed locally on your computer (again, for the sake of simplicity, we recommend just running the blockchain locally on your machine), you have to get test Ether beforehand, or else you will not be able to send transactions, which means you can鈥檛 deploy your smart contract and you鈥檒l be stuck in limbo during your hackathon. If you鈥檙e determined to use a testnet instead of a local deployment, here are a few faucets where you can request testnet Ether:
Also, check out this聽beginner鈥檚 guide聽from Compound on how to use an Ethereum test network.
How to Connect Your Front-End to the Back-End
So you can read data from and write data to the blockchain, you need to have either Web3.js or Ethers.js as part of your developer workflow before the hackathon. Regardless of whether you use Web3.js or Ethers.js, we highly recommend you set up MetaMask beforehand as well.
Web3.js: an Ethereum javascript API that connects to the blockchain on which you鈥檝e chosen to build your decentralized application. Web3.js allows you to read data from and write data to that blockchain.
Ethers.js: an Ethereum javascript API, similar to Web3.js, but is a smaller library.
For a comparison of Web3.js and Ethers.js, here鈥檚 a helpful聽Web3.js vs. Ethers.js cheatsheet with some sample front-ends. Infura has a useful two part series 鈥 Ethereum JavaScript Libraries: Web3.js vs Ethers.js Part I and Part II (tutorial)聽
MetaMask: allows you to run Ethereum dapps right in your browser without running a full node. MetaMask provides you with a secure identity vault and wallet for managing your identities across different sites and signing blockchain transactions. You can install the MetaMask add-on in Chrome, Firefox, Opera, and Brave.
Connecting It All: Double-check Your Environment
Alright, you鈥檝e downloaded everything you need and feel geared-up to hack. Now it鈥檚 time to take your tools for a spin by trying them out with a sample decentralized application. Go through Truffle鈥檚 tutorial on聽building an Ethereum Pet Shop application. This tutorial will ensure that you are able to successfully use your IDE/text editor, Truffle, Ganache, Web3.js, and MetaMask, and it will build your confidence that you can get up and running on the day of the hackathon.
Day of the Hackathon: 4 Pro Tips
It鈥檚 officially time to get hacking. You鈥檙e excited, a little nervous, and totally prepared. Make sure you arrive at the venue on the earlier side of registration so you can find out where the snacks and drinks are, locate the bathrooms (more important than you think), connect to the Internet, scope out the most comfortable locations to hack, and start meeting your fellow hackers and members of the community. Here are four specific pro tips to guide you on the day of:
Stay lightweight and account for connectivity
If you鈥檙e going to an in-person hackathon, think about Internet connectivity and the challenges that hacking over a public WiFi might mean for you. You should have already downloaded and installed all your tools, but if for some reason you need to redownload and install tools like Truffle or Ganache using npm, it will not be a huge issue. Installing an Ethereum client and syncing it with mainnet at a hackathon is a poor choice. We鈥檝e recommended tools and setups that are lightweight and let you focus on building quickly. However, every option has a cost in terms of time to install and usability, so think through the specific parameters of your hackathon and how the tools that you use could impact what you ship.
Keep any documentation you need at the ready
For whatever tools you choose to build with, keep the documentation open on a tab on your web browser. We designed this survival guide to be a quick-reference compilation of some key links you鈥檒l need.
The community is your friend
Can鈥檛 say it enough. Make sure you connect to the Discord, Gitter, and/or Slack channels of the tools that you end up using. The community often has helpful answers to any questions that you might have. Meet people on the ground, both to find potential teammates and to identify experts who can help you debug a smart contract when you run into issues.聽ConsenSys is running a help desk at ETHDenver, staffed with knowledgeable and friendly technical folks. Join our Discord and say hello before you run into an issue so they know who you are. We might even have a few surprises for you if you come talk to us in person!
Keep it simple
Hackathon winners are often able to create a proof-of-concept during their hackathon and limit themselves to that scope. Time limits mean that you won鈥檛 be able to sort out every detail or fix every bug. The simpler you keep the scope of your project, the more likely that you will be able to bring a version of it to life. Remember, for most hackathons, your app does not have to be ready to deploy out to the world.