项目作者: artus

项目描述 :
BigchainDB Load Tester
高级语言: TypeScript
项目地址: git://github.com/artus/bltjs.git
创建时间: 2018-03-29T12:13:27Z
项目社区:https://github.com/artus/bltjs

开源协议:

下载


BigchainDB Load Tester

Build Status

What is blt.js?

blt.js is an npm package that can be used to load-test a BigchainDB node/network. It can be used for running daily jobs that will help you asses the efficiency of your BigchainDB network or to see if changes and/or updates have impacted its performance.

Installation

  1. npm install bltjs

Usage

1. Initialization

  1. const bltjs = require("../dist/Blt.js");
  2. // Initialize a new blt.js instance that will connect to the BigchainDB node on https://your.bigchaindb.host:8080
  3. let newBlt = new bltjs.Blt("https", "your.bigchaindb.host", "8080");

2. Testing CREATE-transactions

You can test the speed of a supplied amount of CREATE-transactions running in parallel. You supply a string that contains an identifier for the test, and the amount of CREATE-transactions to perform.

You should provide a clear and logical test identifier, as the CREATE-transactions will be issued on your live blockchain network. By using a logical test identifier you can filter the test-transactions in the future.

  1. newBlt.testCreateTransactions("some_test_identifier", 500).then(result => {
  2. // The result will be an object containing information about the test.
  3. console.log(result);
  4. }).catch( error => {
  5. console.log(error);
  6. })

3. Testing TRANSFER-transactions

Testing a chain of TRANSFER-transactions will always happen in series, as they build upon eachother. You issue them in relatively the same way as the chain of CREATE-transactions: you supply a test identifier and the amount of TRANSFER-transactions that should be chained.

  1. newBlt.testTransferTransactions("some_test_identifier", 500).then(result => {
  2. console.log(result);
  3. }).catch(error => {
  4. console.log(error);
  5. });