Hive Developer logo

Hive Developer Portal

JS: Getting Started

Prepare your development environment to use Javascript with the Hive blockchain.

Full, runnable src of these tutorials can be downloaded as part of: tutorials/javascript (or download just the JavaScript tutorials: devportal-master-tutorials-javascript.zip).

For Javascript tutorials, we will use the opensource library @hivechain/dhive.

Node.js

To get the most out of these tutorials, you should be familiar with Node.js, ES6 aka es2015, the DOM, and modern Javascript programming practices. You can still learn a lot of these if they aren’t in your base skill-set; it’ll be much easier if they are.

Your Dev Environment

These tutorials require Node.js 8.7+. Yarn is nice, but not required. Runnable versions of the tutorials are located in this github repo. If you haven’t chosen an editor, you can use Atom, Sublime, Intellij, Vi, etc.

If you want to keep multiple versions of Node on your system try Node Version Manager.

Running a typical Tutorial

Let’s say you wanted to run the very first tutorial, 01_blog_feed. Here’s how you’d do it:

From Bash:

git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/javascript/01_blog_feed
npm i
npm run dev-server

Then open http://localhost:3000/ in your web browser.

Github

If you’d rather clone projects in a windowed environment rather than the terminal, consider Github Desktop.