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

@gala-games/chain-cli

v0.4.37

Published

CLI tool for Gala chaincode

Downloads

5

Readme

galachain

CLI tool for Gala chaincode

oclif CircleCI GitHub license

Usage

$ npm install -g @gala-games/chain-cli
$ galachain COMMAND
running command...
$ galachain (--version)
@gala-games/chain-cli/0.4.37 linux-x64 node-v16.20.2
$ galachain --help [COMMAND]
USAGE
  $ galachain COMMAND
...

Commands

galachain dto-sign KEY DATA

DTO (Data Transfer Object) signing.

USAGE
  $ galachain dto-sign KEY DATA [--json] [--log-level debug|info|warn|error] [-o <value>] [-d] [-s]

ARGUMENTS
  KEY   Private key string or path to the private key file.
  DATA  Data representing an unsigned DTO object you wish to sign. Provide a JSON string or a path to a valid JSON file.

FLAGS
  -d, --derSignature        (optional) If provided, the signature will be used as DER format. It's useful for signing
                            data with users which were registered with SavePublicKey.
  -o, --outputFile=<value>  (optional) File path to an output directory where the signed DTO JSON file will be written.
                            If not provided, signed DTO will be printed to stdout.
  -s, --onlySignature       (optional) If provided, only the signature will be printed to stdout or written to a file.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  DTO (Data Transfer Object) signing.

ALIASES
  $ galachain dto:sign

EXAMPLES
  $ galachain dto:sign -o=output/path ./testkey '{
        "tokenClass": {
          "collection": "CLITest",
          "category": "Currency",
        }
      }'

  $ galachain dto:sign ./testkey dto.json -o=output/path

  $ galachain dto:sign ./testkey dto.json -d

  $ galachain dto:sign 04ea7e8e14f2a0 dto.json -s -o=output/path -d

galachain dto-verify KEY DATA

It verifies the signature in the DTO using the public key.

USAGE
  $ galachain dto-verify KEY DATA [--json] [--log-level debug|info|warn|error]

ARGUMENTS
  KEY   File path to the public key.
  DATA  Data representing an signed DTO object you wish to verify. Provide a JSON string or a path to a valid JSON file.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  It verifies the signature in the DTO using the public key.

ALIASES
  $ galachain dto:verify

EXAMPLES
  $ galachain dto:verify ./publicKey '{
        "tokenClass": {
          "collection": "CLITest",
          "category": "Currency",
        },
        "signature": "/fYYooumRdFFrL4U3Nzwuf2uzBZAxKv4WrnMjLnbnJFU+Z6lQe2X/CCcLhRqq67jUDEFvOdky0g5D4sRCExXyBw=",
      }'

  $ galachain dto:verify ./publicKey dto.json

galachain dto:sign KEY DATA

DTO (Data Transfer Object) signing.

USAGE
  $ galachain dto:sign KEY DATA [--json] [--log-level debug|info|warn|error] [-o <value>] [-d] [-s]

ARGUMENTS
  KEY   Private key string or path to the private key file.
  DATA  Data representing an unsigned DTO object you wish to sign. Provide a JSON string or a path to a valid JSON file.

FLAGS
  -d, --derSignature        (optional) If provided, the signature will be used as DER format. It's useful for signing
                            data with users which were registered with SavePublicKey.
  -o, --outputFile=<value>  (optional) File path to an output directory where the signed DTO JSON file will be written.
                            If not provided, signed DTO will be printed to stdout.
  -s, --onlySignature       (optional) If provided, only the signature will be printed to stdout or written to a file.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  DTO (Data Transfer Object) signing.

ALIASES
  $ galachain dto:sign

EXAMPLES
  $ galachain dto:sign -o=output/path ./testkey '{
        "tokenClass": {
          "collection": "CLITest",
          "category": "Currency",
        }
      }'

  $ galachain dto:sign ./testkey dto.json -o=output/path

  $ galachain dto:sign ./testkey dto.json -d

  $ galachain dto:sign 04ea7e8e14f2a0 dto.json -s -o=output/path -d

galachain dto:verify KEY DATA

It verifies the signature in the DTO using the public key.

USAGE
  $ galachain dto:verify KEY DATA [--json] [--log-level debug|info|warn|error]

ARGUMENTS
  KEY   File path to the public key.
  DATA  Data representing an signed DTO object you wish to verify. Provide a JSON string or a path to a valid JSON file.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  It verifies the signature in the DTO using the public key.

ALIASES
  $ galachain dto:verify

EXAMPLES
  $ galachain dto:verify ./publicKey '{
        "tokenClass": {
          "collection": "CLITest",
          "category": "Currency",
        },
        "signature": "/fYYooumRdFFrL4U3Nzwuf2uzBZAxKv4WrnMjLnbnJFU+Z6lQe2X/CCcLhRqq67jUDEFvOdky0g5D4sRCExXyBw=",
      }'

  $ galachain dto:verify ./publicKey dto.json

galachain help [COMMANDS]

Display help for galachain.

USAGE
  $ galachain help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for galachain.

See code: @oclif/plugin-help

galachain init PATH

Initialize a project template with Chain CLI.

USAGE
  $ galachain init PATH [--json] [--log-level debug|info|warn|error]

ARGUMENTS
  PATH  Output path for project template.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  Initialize a project template with Chain CLI.

EXAMPLES
  $ galachain init ./linux-mac-path/my-project-name

  $ galachain init windows-path\my-project-name

galachain keygen FILE

Generate a Public / Private key signing pair for Chain DTO (Data Transfer Object) signatures. Uses @noble/secp256k1 npm library under-the-hood. Always handle private keys with the utmost care.

USAGE
  $ galachain keygen FILE [--json] [--log-level debug|info|warn|error]

ARGUMENTS
  FILE  Output file path for private key. Public key will be written alongside it with ".pub" suffix.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  Generate a Public / Private key signing pair for Chain DTO (Data Transfer Object) signatures. Uses `@noble/secp256k1`
  npm library under-the-hood. Always handle private keys with the utmost care.

EXAMPLES
  $ galachain keygen data/user1

galachain network-prune

Removes the network entirely.

USAGE
  $ galachain network-prune [--json] [--log-level debug|info|warn|error] [-r <value>]

FLAGS
  -r, --fabloRoot=<value>  [default: ./test-network] Root directory of target network. By default './test-network' is
                           used.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  Removes the network entirely.

ALIASES
  $ galachain network:prune

EXAMPLES
  $ galachain network:prune -r=./dir-target-netowrk

galachain network-up

Start the chaincode in dev-mode and browser-api.

USAGE
  $ galachain network-up -C <value> -t curator|partner -n <value> [--json] [--log-level debug|info|warn|error]
    [-d <value>] [-r <value>] [-e <value>] [--devMode]

FLAGS
  -C, --channel=<value>...        (required) Channel name.
  -d, --chaincodeDir=<value>...   [default: .] Root directory of chaincode source, relative to fabloRoot. By default '.'
                                  is used.
  -e, --envConfig=<value>         Path to .env file to be used for chaincodes.
  -n, --chaincodeName=<value>...  (required) Chaincode name.
  -r, --fabloRoot=<value>         [default: ./test-network] Root directory of target network. Should not be the same as
                                  chaincodeDir and should not be a child of chaincodeDir. By default './test-network' is
                                  used.
  -t, --channelType=<option>...   (required) Channel type. Can be "curator" or "partner". It means whether this is a
                                  chaincode managed by CuratorOrg or PartnerOrg.
                                  <options: curator|partner>
  --[no-]devMode                  Starts network in a dev mode (live chaincode reload).To disable the dev mode, use
                                  --no-devMode.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  Start the chaincode in dev-mode and browser-api.

ALIASES
  $ galachain network:up

EXAMPLES
  $ galachain network:up -C=product-channel -t=curator -n=basic-product -d=./ --envConfig=./.dev-env

  $ galachain network:up -C=product-channel -t=curator -n=basic-product -d=./ --envConfig=./.dev-env --no-devMode

galachain network:prune

Removes the network entirely.

USAGE
  $ galachain network:prune [--json] [--log-level debug|info|warn|error] [-r <value>]

FLAGS
  -r, --fabloRoot=<value>  [default: ./test-network] Root directory of target network. By default './test-network' is
                           used.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  Removes the network entirely.

ALIASES
  $ galachain network:prune

EXAMPLES
  $ galachain network:prune -r=./dir-target-netowrk

galachain network:up

Start the chaincode in dev-mode and browser-api.

USAGE
  $ galachain network:up -C <value> -t curator|partner -n <value> [--json] [--log-level debug|info|warn|error]
    [-d <value>] [-r <value>] [-e <value>] [--devMode]

FLAGS
  -C, --channel=<value>...        (required) Channel name.
  -d, --chaincodeDir=<value>...   [default: .] Root directory of chaincode source, relative to fabloRoot. By default '.'
                                  is used.
  -e, --envConfig=<value>         Path to .env file to be used for chaincodes.
  -n, --chaincodeName=<value>...  (required) Chaincode name.
  -r, --fabloRoot=<value>         [default: ./test-network] Root directory of target network. Should not be the same as
                                  chaincodeDir and should not be a child of chaincodeDir. By default './test-network' is
                                  used.
  -t, --channelType=<option>...   (required) Channel type. Can be "curator" or "partner". It means whether this is a
                                  chaincode managed by CuratorOrg or PartnerOrg.
                                  <options: curator|partner>
  --[no-]devMode                  Starts network in a dev mode (live chaincode reload).To disable the dev mode, use
                                  --no-devMode.

GLOBAL FLAGS
  --json                Format output as json.
  --log-level=<option>  Specify level for logging.
                        <options: debug|info|warn|error>

DESCRIPTION
  Start the chaincode in dev-mode and browser-api.

ALIASES
  $ galachain network:up

EXAMPLES
  $ galachain network:up -C=product-channel -t=curator -n=basic-product -d=./ --envConfig=./.dev-env

  $ galachain network:up -C=product-channel -t=curator -n=basic-product -d=./ --envConfig=./.dev-env --no-devMode