# Data Collector for Web App
Here's how you can quickly get started capturing and analyzing your blockchain applications:
- If you don't have a Ravenpod account, sign up at ravenpod.com (opens new window). It's free!
- Follow the steps below to install Data Collector for Web App & Data Collector for Chaincode.
- Once you have data coming into Ravenpod, check out the dashboard (opens new window).
# NodeJS
# Hyperledger Fabric 2.x or above
# Requirements
- Hyperledger Fabric SDK for Node.js 2.x (opens new window)
- Express (opens new window) for Node.js v4.x or above
# Installation
- Using npm:
npm install @ravenpod/ravenpod-web-dc
- Enable data collector in Express
//
// IMPORTANT
//
// Data collector's instrumentation can be overwritten by some middleware npm,
// e.g. body-parser
// Make sure you enable the data collector AFTER your middleware initialization
//
const express = require("express");
const app = express();
// Enable Ravenpod
require('@ravenpod/ravenpod-web-dc')(app,
{
accessKey: 'YOUR ACCESS KEY',
secretAccessKey: 'YOUR SECRET ACCESS KEY'
}
);
# Hyperledger Fabric 1.4.x
# Requirements
- Hyperledger Fabric SDK for Node.js 1.4.x (opens new window)
- Express (opens new window) for Node.js v4.x or above
# Installation
- Using npm:
npm install @ravenpod/ravenpod-web-dc@fabric14
- Enable data collector in Express
//
// IMPORTANT
//
// Data collector's instrumentation can be overwritten by some middleware npm,
// e.g. body-parser
// Make sure you enable the data collector AFTER your middleware initialization
//
const express = require("express");
const app = express();
// Enable Ravenpod
require('@ravenpod/ravenpod-web-dc')(app,
{
accessKey: 'YOUR ACCESS KEY',
secretAccessKey: 'YOUR SECRET ACCESS KEY'
}
);
# TypeScript
# Hyperledger Fabric 2.x or above
# Requirements
- Hyperledger Fabric SDK for Node.js 2.x (opens new window)
- Express (opens new window) for Node.js v4.x or above
# Installation
- Using npm:
npm install @ravenpod/ravenpod-web-dc
- Enable data collector in Express
import express from 'express';
import ravenpod = require('@ravenpod/ravenpod-web-dc');
const app = express();
// Enable Ravenpod
//
// IMPORTANT
//
// Data collector's instrumentation can be overwritten by some middleware npm,
// e.g. body-parser
// Make sure you enable the data collector AFTER your middleware initialization
//
ravenpod(
app,
{
accessKey: 'YOUR ACCESS KEY',
secretAccessKey: 'YOUR SECRET ACCESS KEY'
}
);
# Hyperledger Fabric 1.4.x
# Requirements
- Hyperledger Fabric SDK for Node.js 1.4.x (opens new window)
- Express (opens new window) for Node.js v4.x or above
# Installation
- Using npm:
npm install @ravenpod/ravenpod-web-dc@fabric14
- Enable data collector in Express
import express from 'express';
import ravenpod = require('@ravenpod/ravenpod-web-dc');
const app = express();
// Enable Ravenpod
//
// IMPORTANT
//
// Data collector's instrumentation can be overwritten by some middleware npm,
// e.g. body-parser
// Make sure you enable the data collector AFTER your middleware initialization
//
ravenpod(
app,
{
accessKey: 'YOUR ACCESS KEY',
secretAccessKey: 'YOUR SECRET ACCESS KEY'
}
);
# Java
# Hyperledger Fabric 1.4.x
# Requirements
# Installation
- Download the data collector JAR file (opens new window)
- At the Spring Boot root directory, which is usually the same directory as pom.xml (e.g. ~/my-rest-service), create a file
ravenpod.propertieswith the following content:
ACCESS_KEY=YOUR_ACCESS_KEY
SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
- Start your Spring Boot application with Ravenpod Crystal enabled by using the flag
-javaagent. For example:
java -javaagent:/path_to_ravenpod/ravenpod-web-dc-java-1.0.jar -jar my-rest-service.jar