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

@gridgain/thin-client

v1.2.0

Published

NodeJS Client for Gridgain Community Edition

Downloads

54

Readme

Node.js Client for GridGain

Installation

Node.js version 8 or higher is required. Either download the Node.js pre-built binary for the target platform, or install Node.js via package manager.

Once node and npm are installed, you can use one of the following installation options.

Installation via npm

This is a recommended way for users. Execute the following command to install the Node.js Thin Client package:

npm install -g @gridgain/thin-client

Installation from Sources

This way is more suitable for developers or if you install client from zip archive. If you want to install the Thin Client library from GridGain sources, please follow the steps:

  1. Download and/or unzip Node.js GridGain client sources to nodejs-thin-client
  2. Go to nodejs-thin-client folder
  3. Execute npm link command
  4. Execute npm link @gridgain/thin-client command
cd nodejs-thin-client
npm link
npm link @gridgain/thin-client #linking examples (optional)

Updating from older version

If you installed GridGain client globally, run the following command:

npm update -g @gridgain/thin-client

If you installed GridGain client locally, follow the following instruction:

  1. Navigate to the nodejs-thin-client
  2. In project root directory, run the npm update command
  3. To test the update, run the npm outdated command. There should not be any output
cd nodejs-thin-client
npm update
npm outdated

Tests

Node.js Client for GridGain contains Jasmine tests to check the behavior of the client. the tests include:

  • functional tests which cover all API methods of the client
  • examples executors which run all examples except AuthTlsExample
  • AuthTlsExample executor

Tests Installation

Tests are installed along with the client. Follow the Installation instructions.

Tests Running

  1. Run GridGain server locally or remotely with default configuration.
  2. Set the environment variable:
    • IGNITE_HOME - Home of the GridGain. It is needed for tests to know how to start testing nodes.
    • GRIDGAIN_CLIENT_DEBUG - (optional) if true, tests will display additional output for clients (default: false).
    • GRIDGAIN_SERVER_DEBUG - (optional) if true, tests will display additional output for servers (default: false).
  3. Alternatively, instead of the environment variables setting, you can directly specify the values of the corresponding variables in nodejs-thin-client/spec/config.js file.
  4. Run the tests:

Run Functional Tests

Call npm test command from nodejs-thin-client folder.

Run Examples Executors

Call npm run test:examples command from nodejs-thin-client folder.

Run AuthTlsExample Executor

Active GridGain server node with non-default configuration is required (authentication and TLS switched on).

If the server runs locally:

  • setup the server to accept TLS. During the setup use keystore.jks and truststore.jks certificates from nodejs-thin-client/examples/certs/ folder. Password for the files: 123456
  • switch on the authentication on the server. Use the default username/password.

If the server runs remotely, and/or other certificates are required, and/or non-default username/password is required - see this instruction.

Call npm run test:auth_example command from nodejs-thin-client folder.

Additional Setup for AuthTlsExample

  1. Obtain certificates required for TLS:
  • either use pre-generated certificates provided in the examples/certs folder. Password for the files: 123456. Note, these certificates work for an GridGain server installed locally only.

  • or obtain other existing certificates applicable for a concrete GridGain server.

  • or generate new certificates applicable for a concrete GridGain server.

  • The following files are needed:

    • keystore.jks, truststore.jks - for the server side
    • client.key, client.crt, ca.crt - for the client side
  1. Place client.key, client.crt and ca.crt files somewhere locally, eg. into the examples/certs folder.

  2. If needed, modify TLS_KEY_FILE_NAME, TLS_CERT_FILE_NAME and TLS_CA_FILE_NAME constants in the example source file. The default values point to the files in the examples/certs folder.

  3. Setup GridGain server to accept TLS - see appropriate GridGain documentation. Provide the obtained keystore.jks and truststore.jks certificates during the setup.

  4. Switch on and setup authentication in GridGain server - see appropriate GridGain documentation.

  5. If needed, modify USER_NAME and PASSWORD constants in the example source file. The default values are the default GridGain username/password.

Additional Setup for FailoverExample

  1. Start three GridGain server nodes.

  2. If needed, modify ENDPOINT1, ENDPOINT2, ENDPOINT2 constants in an example source file - GridGain node endpoints. Default values are localhost:10800, localhost:10801, localhost:10802 respectively.

  3. Run an example by calling node FailoverExample.js.

  4. Shut down the node the client is connected to (you can find it out from the client logs in the console).

  5. From the logs, you will see that the client automatically reconnects to another node which is available.

  6. Shut down all the nodes. You will see the client being stopped after failing to connect to each of the nodes.


API spec generation: instruction

It should be done if a public API class/method has been changed.

  1. Execute npm install -g jsdoc to install jsdoc (https://www.npmjs.com/package/jsdoc)
  2. Go to nodejs-thin-client/api_spec
  3. Execute jsdoc -c conf.json --readme index.md command.

Note: nodejs-thin-client/api_spec/conf.json is a file with jsdoc configuration.

For more information, see GridGain Node.js Thin Client documentation.