NEAR Lake indexer basic tutorial
Source code for the tutorial
near-examples/near-lake-raw-printer-js
: source code for the tutorial on how to create an indexer that prints block height and number of shards
Recently we have published a JavaScript version of the NEAR Lake Framework on npmjs.org
We want to empower you with a basic tutorial on how to use the JavaScript Library. Let's get started!
Requirements
Before we get started, please, ensure you have:
- nodejs installed
Create a project
Create an indexer project:
mkdir near-lake-raw-printer-js && cd near-lake-raw-printer-js
Now we're going to call npm init
, we can continue with the default values pressing Enter on every question in the interactive mode:
npm init
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/near/projects/near-lake-raw-printer-js/package.json:
{
"name": "near-lake-raw-printer-js",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this OK? (yes)
package.json
is ready. Let's install near-lake-framework
Install dependencies
Install near-lake-framework
npm install near-lake-framework --save
Install typescript
as dev dependency
npm install typescript --save-dev