Prerequisites
This page details the steps that need to be completed before working with =nil;.
Dependencies
Prior to working with =nil;, it is recommended to install the following:
- Nix
- Node.js > 18.0.0
- NPM
- Git
- Hardhat
To install Nix:
sh <(curl -L https://nixos.org/nix/install) --daemon
To install Node.js and NPM via NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install 20
npm install -g npm
To install Git:
apt-get install git
To install Hardhat:
- npm
- yarn
npm install hardhat
yarn add hardhat
The =nil; repository
The =nil; cluster, its developer tooling, and additional projects related to =nil; are stored in a monorepo that uses Nix for dependency and project management:
git clone https://github.com/NilFoundation/nil.git
cd nil
To enter the Nix development environment:
nix develop
To build all binaries:
make
Read this tutorial to learn more about running the cluster locally.
Nil.js
The =nil; client library is a TypeScript module that allows for interating with the cluster using JS classes and functions.
Get started with developing using Nil.js
.
The 'Reference' section contains descriptions of all essential classes and functions.
=nil; CLI
The =nil; CLI is an easy-to-use tool for interacting with the cluster from any shell: it supports all major operations and can be integrated into a CI/CD pipeline.
Get started with the =nil; CLI.
The 'Reference' section contains a full list of commands that can be used via the =nil; CLI.
When using the =nil; CLI, it is possible to switch between verbose and quiet outputs using the --quiet | -q
and --verbose | -v
flags. This documentation uses verbose outputs throughout.
Smart contracts package
The @nilfoundation/smart-contracts
NPM package contains the source code of all extension libraries and various Solidity contracts used inside =nil; (such as the basic smart account contract).
- npm
- yarn
npm -g install @nilfoundation/smart-contracts
yarn global add @nilfoundation/smart-contracts
Follow this explanation to learn more about the theory behind async execution.
JSON-RPC API
=nil; exposes a JSON-RPC API that supports several methods from regular Ethereum as well as some methods that are unique to the cluster.
Apart from the usual means of interacting with a JSON-RPC API (e.g., by sending CURL requests), the documentation portal provides an interactive API reference.
To use it, follow the link above, select a method, input the API endpoint in the form and fill the method parameters. Click on 'Send Request' to send the request.
The documentation portal will also generate a valid CURL script depending on the request params. This script can be used in CI pipelines or bash scripts.
Block explorer
The =nil; block explorer is a web app that tracks statistics about blocks, accounts, and transactions.
Information in the block explorer may update with a slight delay compared to the current state of the cluster.