Noobs: Come with questions
Note: If you have any questions during these tutorials reach out to us directly to the ConsenSys Discord in the right channels.
If you’re attending a hackathon to learn, it’s a totally fine and good thing if you’re 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’re looking for in a team. If you wish to learn about a useful workflow, see these tips. Before you go, think about the experience you want to have. You don’t want to walk away from the hackathon regretting that you didn’t approach a badass dev. Plan around the basics: coffee, bathrooms, temperature, distractions. Don’t go out too hard the first night if you don’t want your terminal to look blurry the next morning. Or maybe you code better when you’re 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 for version control and uploading to Github.
- homebrew – A package manager for Mac OS users.
- chocolatey – A package manager for windows users.
Once you have the basic setup, for your frontend you can use either of these:
- ReactJS – The leading front end library for building scalable application front end
- web-3 react – An easy way to connect to React. See docs on how to connect via various means. Requires a Connector listed in docs.
- VueJS – An alternative popular front end library for building scalable application front end
There could be other tools you may need before the hackathon, so you don’t spend valuable initial time on basic setup. Prior to the hackathon, explore the tools you wish to use, what prizes you want to compete for and set up accordingly. You don’t want to be discovering your new favorite tool in the midst of the hackathon if your intention is to win.
The fastest way to get started is to go through the ConsenSys “Getting 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’re one week out from the hackathon. Now it’s 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 (integrated development environment).
The most widely used IDE is Visual Studio Code from Microsoft. It’s well supported, has lots of plugins and is useful for those who are new to the Ethereum space AND do not already have a preferred text editor or IDE.
- Solidity linter. The Solidity linter for VS code is very opinionated, so keep that in mind if you choose VS code.
- Vyper linter – provides syntax highlighting for Vyper in VS Code. Vyper is Python-like smart contract programming language for Ethereum.
- MythX for VS code – is a smart contract security tool. Think of it like a linter that checks for common security issues.
- Scribble for VS Code – Scribble syntax highlighting is a specification language for writing properties for fuzzing.
Remix: an in-browser IDE. Remix is used for rapid prototyping. Use Remix to start your development. Eventually, you will move your code over to your favorite IDE/text editor for submission. Remix is useful for rapidly testing things, but not production or for submissions.
How to Run Ethereum on Your Machine: Local Chain, Clients, and APIs
You’ll 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 local 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.
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 tool for building DApps on Ethereum Virtual Machine based blockchains. Install using the instructions below, and then follow the Truffle Quickstart to ensure you understand the framework’s functionality.
Truffle: a comprehensive suite for writing, compiling, testing, and deploying smart contracts.
- Truffle Installation Instructions
- Truffle Quickstart gets you using a pre-built smart contract to understand its functionality
- Truffle Documentation for understanding the features of Truffle
- Truffle boxes are boilerplates that contain pre-written smart contracts, pre-loaded libraries, and pre-built front-ends. Downloading a Truffle box can help you maximize the time you have at your hackathon by building off of the work that has already been done for you by the Truffle box.truffle compile
- Truffle Discord is a great place to interact with other users of Truffle and ask for help
- Truffle GitHub for the source code. We are looking for contributors! <3
Also, you don’t 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. It saves you time, integrates well with other contracts and is more secure.
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’re all set from the start. However if you are using a testnet, you have to get test Ether beforehand. It is required so that you can send transactions and deploy your smart contract. To get testnet ETH you need a faucet, which is a program that gives a small amount of tokens. Remember, testnet ETH is NOT real money.
Here are a few faucets where you can request testnet Ether:
Also, check out this beginner’s guide from Compound on how to use an Ethereum test network.
How to Connect Your Front-End to the Back-End
In order toread and write data from the blockchain, you need to use Web3.js or Ethers.js. These are libraries for interacting with the Ethereum Blockchain and its ecosystem in an easy way. Regardless of whether you use Web3.js or Ethers.js, we highly recommend you set up MetaMask beforehand as well.
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’ve downloaded everything you need and feel geared-up to hack. Now it’s time to take your tools for a spin by trying them out with a sample decentralized application. Go through Truffle’s 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’s officially time to get hacking. You’re 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’re 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 re-download and install tools like Truffle or Ganache using npm, it will not be a huge issue.
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’ll need.
Refer to the docs to save on issues. If you can’t find answer, well you are in a room full of developers. Ask someone and make a new friend!
The community is your friend
We can’t say it enough. Make sure you connect to the Discord, 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 often runs a help desk at events 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’t 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.