npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

caliper-testing

v0.1.0

Published

Integration tests for Hyperledger Caliper

Downloads

6

Readme

Caliper local publishing and integration test guide

Welcome to the Caliper Integration test readme.

Once you performed the necessary steps to build Caliper, you can move on to publishing the npm packages locally, then installing the Caliper CLI to start your benchmarks.

The following steps must be performed to publish and install the CLI package:

  1. Start a local Verdaccio server to publish to
  2. Publish the packages from the Caliper repository to the Verdaccio server
  3. Install the CLI package from the Verdaccio server
  4. Run the integration tests or any sample benchmark

The following commands must be executed from the packages/caliper-tests-integration directory:

cd ./packages/caliper-tests-integration

If you don't care about the individual step descriptions, jump to the One-step install section.

Starting Verdaccio

To setup and start a local Verdaccio server, run the following npm command:

npm run start_verdaccio

In case of success, the output should resemble the following:

[PM2] Spawning PM2 daemon with pm2_home=.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /home/user/projects/caliper/packages/caliper-tests-integration/node_modules/.bin/verdaccio in fork_mode (1 instance)
[PM2] Done.
┌───────────┬────┬──────┬────────┬────────┬─────────┬────────┬─────┬───────────┬────────┬──────────┐
│ App name  │ id │ mode │ pid    │ status │ restart │ uptime │ cpu │ mem       │ user   │ watching │
├───────────┼────┼──────┼────────┼────────┼─────────┼────────┼─────┼───────────┼────────┼──────────┤
│ verdaccio │ 0  │ fork │ 115203 │ online │ 0       │ 0s     │ 3%  │ 25.8 MB   │ user   │ disabled │
└───────────┴────┴──────┴────────┴────────┴─────────┴────────┴─────┴───────────┴────────┴──────────┘
 Use `pm2 show <id|name>` to get more details about an app

Publishing the packages

Once Verdaccio is running, you can run the following command to publish the Caliper packages locally:

npm run publish_packages

Among the logs, you should see something similar at the end of every === Tarball Details === section: + caliper-<package>@0.1.0

Installing the CLI package

Once the packages are published locally, you can install the CLI package (and its dependencies):

npm run install_cli

The installation might take some time (you can ignore the warnings), but after a while you should see something like the following:

+ [email protected]
updated 1 package in 66.969s

Installed test package caliper-cli from local npm server (attempt 1/5)

Congratulations, at this point the caliper binary is globally installed on your machine!

You can confirm it by running caliper -v which should output v0.1.0.

Cleaning up Verdaccio

After you installed the Caliper CLI, you can stop the Verdaccio server and clean up after it:

npm run cleanup

One-step install

For those who would like to modify the codebase and run benchmarks against the new codebase (or just don't care about the individual steps of publishing), a single npm command is available to perform the first three steps:

npm run e2e_install

It is equivalent to running:

npm run cleanup && npm run start_verdaccio && npm run publish_packages && npm run install_cli && npm run cleanup

Running the integration tests

Once the CLI is installed, you can run the integration tests for a given platform.

  • For Fabric: BENCHMARK=fabric npm run run_tests
  • For Composer: BENCHMARK=composer npm run run_tests

As long as the script finishes, it should tidy up all the artifacts that are created during tests, but if it fails, then you may have to do a manual clean up (removing every running Docker container) executing the following commands:

docker ps -aq | xargs docker kill
docker rm $(docker ps -aq)

Alternatively, you can run any benchmark through the CLI, as described in the documentation

Troubleshooting

The general guidelines for building Caliper also applies here.

Moreover, permission denied issues can occur when installing the CLI globally, depending how the global install directory is configured for npm.

To query the global install directory of npm, run npm config get prefix

If your user cannot write this directory, then either grant the necessary permissions, or set an install directory that is accessible by your user, e.g.: npm config set prefix ~/.local

License

Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.