Skip to content

Commit

Permalink
FABN-1465 NodeSDK remove fabric-client (#110)
Browse files Browse the repository at this point in the history
Removed fabric-client package and all direct testing.
Referrences to the package were removed from the other packages.
fabric-client snapshot from npm will be used for the few tape
tests that are using fabric-client for channel create
and chaincode install and instantiate.

Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
  • Loading branch information
harrisob authored Feb 3, 2020
1 parent e00798d commit 9276072
Show file tree
Hide file tree
Showing 777 changed files with 275 additions and 512,798 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
docs/**
fabric-network/lib/**
fabric-protos/**
fabric-client/test/data/**
test/typescript/**
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ test/ts-fixtures/crypto-material/config-base/twoorgs.genesis.block
test/typescript/**/*.js
test/typescript/**/*.js.map

#fabric client
fabric-client/.DS_Store
fabric-client/node_modules/*
fabric-client/.nyc_output
fabric-client/test/data/java-contract/.gradle/*
fabric-client/test/data/java-contract/.settings/*
fabric-client/test/data/java-contract/build/*
fabric-client/test/data/javaWithFabricIgnores-contract/.gradle/*
fabric-client/test/data/javaWithFabricIgnores-contract/.settings/*
fabric-client/test/data/javaWithFabricIgnores-contract/build/*

#fabric-ca-client
fabric-ca-client/.DS_Store
fabric-ca-client/node_modules/*
Expand Down
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
The Hyperledger Fabric Client SDK makes it possible to use APIs to interact with a Hyperledger Fabric blockchain. This readme is directed towards a current or future contributor to this project, and gives an overview of setting up the project locally and running tests. For more information on the SDK, including features and an API reference, please visit the [SDK documentation](https://hyperledger.github.io/fabric-sdk-node/).

This project publishes the following npm packages:
* `fabric-client` - main client for the [Hyperledger Fabric](http://hyperledger-fabric.readthedocs.io/en/latest/). Applications can use this package to install and instantiate chaincodes, submit transactions and make queries against a Hyperledger Fabric-based blockchain network.
* `fabric-ca-client` - client for the optional component in Hyperledger Fabric, [fabric-ca](http://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html). The fabric-ca component allows applications to enroll Peers and application users to establish trusted identities on the blockchain network. It also provides support for pseudonymous transaction submissions with Transaction Certificates. If the target blockchain network is configured with standard Certificate Authorities for trust anchors, the application does not need to use this package.
* `fabric-common` - This package contains common codes shared by other packages
* `fabric-network` - This package encapsulates the APIs to connect to a Fabric network, submit transactions and perform queries against the ledger at a higher level of abstraction than through the `fabric-client`.
* `fabric-common`, encapsulates the common code used by all fabric-sdk-node packages supporting fine grain interactions with the Fabric network to send transaction invocations
* `fabric-network` - This package encapsulates the APIs to connect to a Fabric network, submit transactions and perform queries against the ledger at a higher level of abstraction than through the `fabric-common`.
* `fabric-protos` - This package encapsulates the protobuffers that are used to communicate over gRPC

## Build and Test
Expand Down Expand Up @@ -37,24 +36,12 @@ We have functional and scenario based tests that may be run via the following co
* end to end (tape) tests may be run via `npm run tapeIntegration`
* scenario (cucumber) tests may be run via `npm run cucumberScenario`
* You may run both integration test styles using `npm run tapeAndCucumber`
* All tests (unit and integration) may be run using the command `npm test`
* All tests (unit and integration) may be run using the command `npm test` or `npm run testNoHSM` when not using a HSM or HSM simulator

### Special Tests for Hardware Security Module support via PKCS #11 interface

The SDK has support for Hardware Security Module (HSM) via PKCS #11 interface. See the test [README](test/README.md) for details of how to run HSM tests locally.

### Hyperledger Fabric Client objects and reference documentation
The SDK has support for Java based Chaincode. To turn these tests off, set the environment variable "JAVA_TESTS" to false.

### Hyperledger Fabric Client objects
fabric-client and fabric-ca-client are written in CommonJS modules and take advantage of ECMAScript 2015 class syntax.

* The main top-level class is **Client**. The client's view of a fabric [channel] is the class **Channel**.
The SDK allows you to interact with multiple channels. A channel object can be configured with a different ordering service or share a common ordering service, depending on how the target blockchain network is set up. A client object has a _KeyValueStore_ to store private keys and certificates for authenticated users. Through the client object the application can perform
* The **KeyValueStore** is a very simple interface which SDK uses to store and retrieve all persistent data. This data includes private keys, so it is very important to keep this storage secure. The default implementation is a simple file-based version found in the _FileKeyValueStore_ class. The SDK also provides an implementation based on CouchDB which can be configured to use a local CouchDB database or a remote deployment including a Cloudant database.
* The **User** class represents an end user who transacts on the channel. The user object must have a valid enrollment configured in order to properly sign transaction requests. The enrollment materials can either be obtained from enrolling with fabric-ca or an external Certificate Authority.
* The **FabricCAClientImpl** class provides security and identity related features such as user registration and enrollment, transaction certificate issuance. The Hyperledger Fabric has a built-in implementation that issues _ECerts_ (enrollment certificates) and _TCerts_ (transaction certificates). ECerts are for enrollment identity and TCerts are for transactions.

### Pluggability
HFC defines the following abstract classes for application developers to supply extensions or alternative implementations. For each abstract class, a built-in implementation is included with the ability to load alternative implementations via designated environment variables:

Expand All @@ -66,7 +53,7 @@ HFC defines the following abstract classes for application developers to supply

### Continuous Integration

Our Continuous Integration is run using [Azure Pipelines](https://dev.azure.com/Hyperledger/Fabric-SDK-Node/_build). Builds are automatically triggered on opening pull requests.
Our Continuous Integration is run using [Azure Pipelines](https://dev.azure.com/Hyperledger/Fabric-SDK-Node/_build). Builds are automatically triggered on opening pull requests.

### Release notes

Expand Down
9 changes: 4 additions & 5 deletions fabric-ca-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

SDK for writing node.js applications to interact with [Hyperledger Fabric CA](http://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html).

This package encapsulates the APIs to interact with the Fabric CA to manage user certificates lifecycle such as register, enroll, renew and revoke.
This package encapsulates the APIs to interact with the Fabric CA to manage user certificates lifecycle such as register, enroll, renew and revoke.

Additional packages are also provided:
1. `fabric-client`, supporting fine grain interactions with Peers and Orders of the Fabric network to install and instantiate chaincodes, send transaction invocations and perform chaincode queries.
2. `fabric-network`, to provide APIs to connect to a Fabric network, submit transactions and perform queries against the ledger.
3. `fabric-common`, encapsulates the common code used by all fabric-sdk-node packages.
4. `fabric-protos`, encapsulates the Protocol Buffer files and generated JavaScript classes for Hyperledger Fabric
1. `fabric-network`, to provide APIs to connect to a Fabric network, submit transactions and perform queries against the ledger.
2. `fabric-common`, encapsulates the common code used by all fabric-sdk-node packages supporting fine grain interactions with the Fabric network to send transaction invocations
3. `fabric-protos`, encapsulates the Protocol Buffer files and generated JavaScript classes for Hyperledger Fabric

For application developer documentations, please visit [hyperledger.github.io/fabric-sdk-node/](https://hyperledger.github.io/fabric-sdk-node/)

Expand Down
2 changes: 1 addition & 1 deletion fabric-ca-client/lib/FabricCAServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const logger = utils.getLogger('FabricCAClientService.js');

// setup the location of the default config shipped with code
const default_config = path.resolve(__dirname, '../config/default.json');
config.reorderFileStores(default_config, true); // make sure this one is under the fabric-client
config.reorderFileStores(default_config, true); // make sure this one is under the fabric-common

/**
* @typedef {Object} TLSOptions
Expand Down
5 changes: 2 additions & 3 deletions fabric-ca-client/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
*/


import { ICryptoSuite, ICryptoKeyStore, IKeyValueStore, User } from "fabric-client";
import { BaseClient } from 'fabric-client/types/base';
import { ICryptoSuite, User } from "fabric-common";

declare class FabricCAServices extends BaseClient {
declare class FabricCAServices {
constructor(url: string | FabricCAServices.IFabricCAService, tlsOptions?: FabricCAServices.TLSOptions, caName?: string, cryptoSuite?: ICryptoSuite);
getCaName(): string;
register(req: FabricCAServices.IRegisterRequest, registrar: User): Promise<string>;
Expand Down
10 changes: 0 additions & 10 deletions fabric-client/.eslintignore

This file was deleted.

26 changes: 0 additions & 26 deletions fabric-client/.npmignore

This file was deleted.

26 changes: 0 additions & 26 deletions fabric-client/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions fabric-client/config/default.json

This file was deleted.

25 changes: 0 additions & 25 deletions fabric-client/index.js

This file was deleted.

Loading

0 comments on commit 9276072

Please sign in to comment.