Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
fabric-chaincode-integration
Advanced tools
A tool for testing fabric chaincode implementations
This is a test tool specifically designed to ensure that Fabric chaincode/contract implementations in all languages are complete and consistent.
There are a set of different 'gherkin features' that drive tests for different aspects of the implementation. Each of these features will use one or more Fabric infrastructures and will use one or of required set of Chaincode and Contracts.
The Fabric infrastructure is supplied as part of the tool, the Chaincode and Contracts must be specified as these are the elements that are under test.
The tool is intended to be provided as an NPM module. Until release you can install it as follows:
curl -L https://raw.githubusercontent.com/hyperledger/fabric-test/master/tools/chaincode-integration/fabric-chaincode-integration-0.0.1.tgz
npm install -g fabric-chaincode-integration-0.0.1.tgz
The tool can then be run as follows
fabric-chaincode-integration run --chaincode-dir <PATH_TO_CHAINCODE> --language <CHAINCODE_LANGUAGE>
Option: --chaincode-directory
Alias: -d
This should be the path to the directory which contains all the required chaincodes for testing (unless using the --chaincode-overide
option). The directory provided should contain sub folders with the chaincode in where the folders are the name of the required chaincode e.g. simple
.
Option: --language
Alias: -l
Choices: golang | java | javascript | typescript
The language of the chaincode that is being provided to the tool.
Option: --chaincode-overide
This should be a JSON object where the keys are the name of chaincode and the values are the path to that specific chaincode e.g. {"simple": "/Users/users/chaincode/simple"}
. The chaincode used in this will be used instead of the chaincode in the chaincode directory for that key (if one exists).
Option: --logging-level
Choices: info | debug
Default: info
Set the level of detail for the logging output of the tool. Info provides a top level view of which tests have failed and which networks they are being run against. Debug provides a more in-depth breakdown of each action the tool is taking including which steps of the tests are running.
Option: --tags
Set which specific tests to run. Each of the features that describe the tests that this repo will run are tagged. You can limit which of these are run by specifying a cucumber tag expression. For example run only the feature testing basic checks by using --tags @basic-checks
.
To run the tool in its entirety (i.e. not tag limitted) the following chaincodes are required:
You can find schemas defining how each of these chaincodes should be written in the docs/schemas folder. This is structured such that each chaincode has its own json file named <CHAINCODE_NAME>.json
which contains a breakdown of the contracts that should make up the chaincode, their required transactions and what those transactions should do. It is important that chaincodes provided for use with this tool match exactly what is expected of them or tests will pass/fail when they shouldn't.
Note: All chaincode supplied should be written using the contract APIs for the given language.
Note: All chaincode supplied should output arrays and objects in a stringified JSON format.
You can use the following commands to see a list of the required chaincodes:
fabric-chaincode-integration contracts list
You can use the following command to get a more human readable (markdown) version of the schema JSON for a given contract:
fabric-chaincode-integration contracts details --chaincode <CONTRACT_NAME> --output <FILE_NAME>.md
FAQs
A tool for testing fabric chaincode implementations
We found that fabric-chaincode-integration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.