Rootstock Hackathon Dev Starter
The hackathon dev starter guide details the necessary tools and resources for developing on the Rootstock blockchain. It includes setup instructions for essential Dev tools such as Hardhat, and RSKj, wallets, ensuring developers have a clear path to prepare their environment for developing on Rootstock, whether for local development, testing, or for deployment.
Quick start setup
This section includes setup instructions for the Quick Start Guide on Rootstock using Hardhat.
- A. Installing Node.js and NPM
- Using Node Version Manager (recommended)
- Version:
- 12 or later.
- For installation, use NVM install script.
- Version:
- For Windows
-
- Download the Node.js Installer from Node.js Downloads.
- Run the installer and follow the on-screen instructions.
- Open Command Prompt or PowerShell and check versions with
node -v
andnpm -v
.
-
- For MacOS
- Install Homebrew (if not installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)```
- Install Node.js and npm with
brew install node
- Check versions in Terminal with
node -v
andnpm -v
- Install Homebrew (if not installed):
- For Linux
- Open a terminal.
- Update package manager with sudo apt update
- Install Node.js and npm with sudo apt install nodejs npm
- Check versions in the terminal with
node -v
andnpm -v
- Using Node Version Manager (recommended)
- B. OpenZeppellin
- To install OpenZeppelin:
npm install @openzeppelin/cli
- To install OpenZeppelin:
- C. RSKj
- To install RSKj. See Node Setup.
Make sure to adapt the commands based on your system and preferences. Always refer to the official documentation for the latest and most accurate information: Node.js Downloads and npm documentation.
RSKj Node Setup
- Ensure your system meets the following minimum specifications:
- Node requirements
- Operating Systems
- Installing RSKj
- RSKj allows you to run a Rootstock node, crucial for local development and testing. It supports connections to Regtest (local), Testnet (testing), and Mainnet (production).
- Downloading RSKj:
- Visit the official RSKj GitHub repository to download the latest stable release.
- Running RSKj:
- For local testing with Regtest, use the command:
Replacejava -jar rskj-core-<version>.jar --regtest
<version>
with the actual version number of your RSKj jar file. This command starts a local Rootstock node for development and testing.- Note: Ensure your development environment has sufficient storage and memory, as connecting to Testnet or Mainnet requires downloading the blockchain.
- RPC
- Remote procedure calls (JSON-RPC) are the primary interface through which Rootstock nodes communicate over the network.
- JSON-RPC is available over two network transport protocols: HTTP and WebSockets
- Configuring and using RPC over HTTP
- See Configuring and using RPC over WebSockets
- See RSKj for Developers
Note that Rootstock public nodes do not expose WebSockets, they are HTTP only. To work around this, you may either run your own Rootstock node, or use a third-party node provider, such as Getblock or NowNodes.
Command Line Tools
POSIX Compliant Shell
- macOS/Linux
- Standard terminal.
- Windows
- Standard terminals like
cmd
or PowerShell may not support some commands. We recommended installing Git for Windows for Git Bash, which provides a more UNIX-like experience. Here's a tutorial on Git Bash.
- Standard terminals like
Dev Tools
- Tools Overview
- Wallets
- Hardhat
- Core tool for smart contract development on Rootstock.
- Install:
npm install --save-dev hardhat
- See Rootstock Quick start Guide using Hardhat