Skip to content

Commit

Permalink
Update docs as follows (#1553)
Browse files Browse the repository at this point in the history
- prepare vNext for 0.5.1 release
- move all references of fabric to now demonstrate the `fabric-gateway`

Signed-off-by: Dave Kelsey <[email protected]>
  • Loading branch information
Dave Kelsey authored Apr 29, 2024
1 parent 107f0c6 commit a5e86fd
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 43 deletions.
16 changes: 8 additions & 8 deletions docs/vNext/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ Once Verdaccio is running, you can run the following command to publish every Ca
```console
user@ubuntu:~/caliper/packages/caliper-publish$ ./publish.js npm --registry "http://localhost:4873"
...
+ @hyperledger/[email protected].0-unstable-20220206065953
[PUBLISH] Published package @hyperledger/[email protected].0-unstable-20220206065953
+ @hyperledger/[email protected].1-unstable-20240422122901
[PUBLISH] Published package @hyperledger/[email protected].1-unstable-20240422122901
...
+ @hyperledger/[email protected].0-unstable-20220206065953
[PUBLISH] Published package @hyperledger/[email protected].0-unstable-20220206065953
+ @hyperledger/[email protected].1-unstable-20240422122901
[PUBLISH] Published package @hyperledger/[email protected].1-unstable-20240422122901
...
+ @hyperledger/[email protected].0-unstable-20220206065953
[PUBLISH] Published package @hyperledger/[email protected].0-unstable-20200206065953
+ @hyperledger/[email protected].1-unstable-20240422122901
[PUBLISH] Published package @hyperledger/[email protected].1-unstable-20240422122901
```

Take note of the dynamic version number you see in the logs, you will need it to install you modified Caliper version from Verdaccio (the `unstable` tag is also present on NPM, so Verdaccio would probably pull that version instead of your local one).
Expand All @@ -152,8 +152,8 @@ Once the packages are published to the local Verdaccio server, we can use the us

```console
user@ubuntu:~/caliper-benchmarks$ npm install --registry=http://localhost:4873 --only=prod \
@hyperledger/[email protected].0-unstable-20220206065953
user@ubuntu:~/caliper-benchmarks$ npx caliper bind --caliper-bind-sut fabric:2.2
@hyperledger/[email protected].1-unstable-20240422122901
user@ubuntu:~/caliper-benchmarks$ npx caliper bind --caliper-bind-sut fabric:fabric-gateway
user@ubuntu:~/caliper-benchmarks$ npx caliper launch manager \
--caliper-workspace . \
--caliper-benchconfig benchmarks/scenario/simple/config.yaml \
Expand Down
2 changes: 1 addition & 1 deletion docs/vNext/Caliper_FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The throughput is calculated by `Succ/(last committing time - first submitting t
**A:** You first need to deploy that chaincode to your Fabric network, then create your benchmark and workload files see the Caliper Fabric tutorial for further guidance.

**Q:** How can I use TLS communication?
**A:** Fabric supports secure communication between nodes and clients using TLS. TLS communication can use both one-way (server only) and two-way (server and client) authentication. You can refer to the [Fabric TLS configuration](https://hyperledger-fabric.readthedocs.io/en/release-2.2/enable_tls.html) page for server side settings. For Caliper-side settings, check the adapter documentation that details how to set the necessary credentials.
**A:** Fabric supports secure communication between nodes and clients using TLS. TLS communication can use both one-way (server only) and two-way (server and client) authentication. You can refer to the [Fabric TLS configuration](https://hyperledger-fabric.readthedocs.io/en/release-2.5/enable_tls.html) page for server side settings. For Caliper-side settings, check the adapter documentation that details how to set the necessary credentials.

**Q:** How can I monitor remote Docker containers?
**A:** If you need to access the Docker daemon remotely, you need to explicitly enable remote access. Beware that the default setup provides unencrypted and unauthenticated direct access to the Docker daemon. For details, refer to the official [Docker documentation](https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd).
Expand Down
18 changes: 12 additions & 6 deletions docs/vNext/Fabric_Configuration_New.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,30 @@ You must bind Caliper to a specific Fabric SDK to target the corresponding (or c

> * None of the Fabric bindings support administration actions. It it not possible to create/join channels nor deploy a chaincode. Consequently running caliper only facilitate operations using the `--caliper-flow-only-test` flag
### Binding with Fabric 1.4
### Binding with Fabric 1.4 Client SDK

It is confirmed that a 1.4 Fabric SDK is compatible with a Fabric 2.2 and later Fabric 2.x SUTs, therefore this binding can be used with later Fabric SUTs
To bind with this client sdk, use `fabric:1.4`.

It is confirmed that a 1.4 Fabric Client SDK is compatible with a Fabric 2.2 and later Fabric 2.x SUTs, therefore this binding can be used with later Fabric SUTs

Note that when using the binding target for the Fabric SDK 1.4 there are capability restrictions:
> * Currently setting `discover` to `true` in the network configuration file is not supported if you don't enable the `gateway` option (eg specifying --caliper-Fabric-gateway-enabled as a command line option)
> * Detailed execution data for every transaction is only available if you don't enable the `gateway` option
### Binding with Fabric 2.2
### Binding with Fabric 2.2 Client SDK

To bind with this client sdk, use `fabric:2.2`.

It is confirmed that a 2.2 Fabric SDK is compatible with 2.2 and later Fabric SUTs, therefore this binding can be used with 2.2 and later Fabric SUTs

> The following further restrictions exist for this binding
> * Detailed execution data for every transaction is not available.
### Binding with Fabric 2.4
### Binding with Fabric Gateway Client SDK

To bind with this client sdk, use `fabric:fabric-gateway`. This is now the preferred SDK to use given that Fabric 2.2 and earlier is now not in LTS and as such the Fabric 1.4 and 2.2 SDKs are now deprecated.

Only Fabric 2.4 and later with the Peer Gateway capability enabled (which is the default setting for a Fabric peer) can be used.
Only Fabric 2.4 and later with the Peer Gateway capability enabled (which is the default setting for a Fabric peer) can be used so for older versions of Hyperledger Fabric you cannot bind with this client SDK.

> The following further restrictions exist for this binding
> * Detailed execution data for every transaction is not available.
Expand Down Expand Up @@ -430,7 +436,7 @@ Each organization must have `mspid`, `identities` and either `connectionProfle`
* <details><summary markdown="span">__discover__
</summary>
_Optional. Boolean._ <br>
A value of `true` indicates that the connection profile is a dynamic connection profile and discovery should be used. If not specified then it defaults to `false`. For a Fabric 1.4 binding you can only set this value to true if you plan to use the `gateway` option
This does not need to be provided when binding to the `fabric-gateway` and will be ignored if provided and is relevant only for the 1.4 and 2.2 fabric bindings. A value of `true` indicates that the connection profile is a dynamic connection profile and discovery should be used. If not specified then it defaults to `false`. For a Fabric 1.4 binding you can only set this value to true if you plan to use the `gateway` option.

```yaml
organizations:
Expand Down
2 changes: 1 addition & 1 deletion docs/vNext/Getting_Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Sample benchmarks that may be used by Caliper are hosted on a companion [GitHub

Performance reports for the provided samples are hosted on the [documentation pages of the repository](https://hyperledger.github.io/caliper-benchmarks/).

> **Important:** make sure that the version/tag of the benchmark repository matches the version of Caliper you are using! For example, if you are using Caliper v0.5.0, then `checkout` the `v0.5.0` tag after cloning the benchmark repository. The `main` branch of the benchmark repository corresponds to the latest `unstable` Caliper version.
> **Important:** make sure that the version/tag of the benchmark repository matches the version of Caliper you are using! For example, if you are using Caliper v0.5.1, then `checkout` the `v0.5.1` tag after cloning the benchmark repository. The `main` branch of the benchmark repository corresponds to the latest `unstable` Caliper version.
## How to Contribute

Expand Down
36 changes: 18 additions & 18 deletions docs/vNext/Installing_Caliper.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The entry point of the CLI is the `caliper` binary. You can confirm whether the

```console
user@ubuntu:~/caliper-benchmarks$ npx caliper --version
v0.5.0-unstable-20220324180635
v0.5.1
```

The CLI provides multiple commands to perform different tasks. To check the available commands and their descriptions, execute:
Expand Down Expand Up @@ -88,7 +88,7 @@ To have a look at the help page of the command, execute:
```console
user@ubuntu:~/caliper-benchmarks$ npx caliper bind --help
Usage:
caliper bind --caliper-bind-sut fabric:2.2 --caliper-bind-cwd ./ --caliper-bind-args="-g"
caliper bind --caliper-bind-sut fabric:fabric-gateway --caliper-bind-cwd ./ --caliper-bind-args="-g"

Options:
--help, -h Show usage information [boolean]
Expand All @@ -101,15 +101,15 @@ Options:

The binding step technically consists of an extra `npm install` call with the appropriate packages and install settings, fully managed by the CLI. The following parameters can be set for the command:

* __SUT/platform name and SDK version:__ specifies the name of the target platform and its SDK version to install e.g., `fabric:2.2`
* __SUT/platform name and SDK version:__ specifies the name of the target platform and its SDK version to install e.g., `fabric:fabric-gateway`
* __Working directory:__ the directory from which the `npm install` command must be performed. Defaults to the current working directory
* __User arguments:__ additional arguments to pass to `npm install`, e.g., `--save`

The following SUT name and SDK version combinations are supported:

* **besu**: `1.3.2`, `1.3`, `1.4`
* **ethereum**: `1.2.1`, `1.3`
* **fabric**: `1.4`, `2.2`, `2.4`
* **fabric**: `1.4`, `2.2`, `fabric-gateway`
> __Note:__ Ensure that the SDK you are binding is compatible with the the SUT version that you intend to target.
The `bind` command is useful when you plan to run multiple benchmarks against the same SUT version. Bind once, then run different benchmarks without the need to bind again. As you will see in the next sections, the launcher commands for the manager and worker processes can also perform the binding step if the required parameter is present.
Expand Down Expand Up @@ -240,8 +240,8 @@ But why is all this important to you? Because Caliper is still in its pre-releas
Let's see the three types of version numbers you will encounter:

* `0.2.0`: Version numbers of this form denote releases deemed _stable_ by the maintainers. Such versions have a corresponding GitHub tag, both in the `caliper` and `caliper-benchmarks` repositories. Moreover, the latest stable version is documented by the matching version of the documentation page. So make sure to align the different versions if you run into some issue.
* `0.5.0-unstable-20220206065953`: Such version "numbers" denote _unstable_ releases that are published upon every merged pull request (hence the timestamp at the end), and eventually will become a stable version, e.g., `0.5.0`. This way you always have access to the NPM (and Docker) artifacts pertaining to the `main` branch of the repository. Let's find and fix the bugs of new features before they make it to the stable release!
* `unstable`: This is the very latest unstable release that has been published and would correspond to a version also published as `0.5.0-unstable-<some date>`. This lets you quickly work with the very latest code from the `main` branch.
* `0.5.1-unstable-20240422122901`: Such version "numbers" denote _unstable_ releases that are published upon every merged pull request (hence the timestamp at the end), and eventually will become a stable version, e.g., `0.5.1`. This way you always have access to the NPM (and Docker) artifacts pertaining to the `main` branch of the repository. Let's find and fix the bugs of new features before they make it to the stable release!
* `unstable`: This is the very latest unstable release that has been published and would correspond to a version also published as `0.5.1-unstable-<some date>`. This lets you quickly work with the very latest code from the `main` branch.

> __Note:__ The newest unstable release always corresponds to the up-to-date version of the related repositories, and the `vNext` version of the documentation page!
Expand All @@ -258,15 +258,15 @@ The following tools may be required depending on which SUT and version you bind

> __Note:__ this is the highly recommended way to install Caliper for your project. Keeping the project dependencies local makes it easier to setup multiple Caliper projects. Global dependencies would require re-binding every time before a new benchmark run (to ensure the correct global dependencies).
1. Install the Caliper CLI as you would any other NPM package. It is highly recommended to explicitly specify the version number, e.g., `@hyperledger/[email protected].0`
2. Bind the CLI to the required platform SDK (e.g., `fabric` with the `2.2` SDK).
1. Install the Caliper CLI as you would any other NPM package. It is highly recommended to explicitly specify the version number, e.g., `@hyperledger/[email protected].1`
2. Bind the CLI to the required platform SDK (e.g., `fabric` with the `fabric-gateway` SDK).
3. Invoke the local CLI binary (using [npx](https://www.npmjs.com/package/npx)) with the appropriate parameters. You can repeat this step for as many benchmarks as you would like.

Putting it all together:

```console
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/[email protected].0
user@ubuntu:~/caliper-benchmarks$ npx caliper bind --caliper-bind-sut fabric:2.2
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/[email protected].1
user@ubuntu:~/caliper-benchmarks$ npx caliper bind --caliper-bind-sut fabric:fabric-gateway
user@ubuntu:~/caliper-benchmarks$ npx caliper launch manager \
--caliper-workspace . \
--caliper-benchconfig benchmarks/scenario/simple/config.yaml \
Expand All @@ -276,9 +276,9 @@ user@ubuntu:~/caliper-benchmarks$ npx caliper launch manager \
We could also perform the binding automatically when launching the manager process (note the extra parameter for `caliper launch manager`):

```console
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/[email protected].0
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/[email protected].1
user@ubuntu:~/caliper-benchmarks$ npx caliper launch manager \
--caliper-bind-sut fabric:2.2 \
--caliper-bind-sut fabric:fabric-gateway \
--caliper-workspace . \
--caliper-benchconfig benchmarks/scenario/simple/config.yaml \
--caliper-networkconfig networks/fabric/test-network.yaml
Expand All @@ -300,7 +300,7 @@ There are some minor differences compared to the local install:
4. You can omit the `npx` command, since `caliper` will be in your `PATH`.

```console
user@ubuntu:~$ npm install -g --only=prod @hyperledger/[email protected].0
user@ubuntu:~$ npm install -g --only=prod @hyperledger/[email protected].1
user@ubuntu:~$ caliper bind --caliper-bind-sut fabric:2.2 --caliper-bind-args=-g
user@ubuntu:~$ caliper launch manager \
--caliper-workspace ~/caliper-benchmarks \
Expand Down Expand Up @@ -340,17 +340,17 @@ Parts of starting a Caliper container (following the recommendations above):
2. Mount your local working directory to a container directory
3. Set the required binding and run parameters

> __Note:__ the __latest__ (or any other) tag is __not supported__, i.e, you explicitly have to specify the image version you want: `hyperledger/caliper:0.5.0`, similar to the recommended approach for the [NPM packages](#versioning-semantics).
> __Note:__ the __latest__ (or any other) tag is __not supported__, i.e, you explicitly have to specify the image version you want: `hyperledger/caliper:0.5.1`, similar to the recommended approach for the [NPM packages](#versioning-semantics).
Putting it all together, split into multiple lines for clarity, and naming the container `caliper`:

```console
user@ubuntu:~/caliper-benchmarks$ docker run \
-v $PWD:/hyperledger/caliper/workspace \
-e CALIPER_BIND_SUT=fabric:2.2 \
-e CALIPER_BIND_SUT=fabric:fabric-gateway \
-e CALIPER_BENCHCONFIG=benchmarks/scenario/simple/config.yaml \
-e CALIPER_NETWORKCONFIG=networks/fabric/test-network.yaml \
--name caliper hyperledger/caliper:0.5.0 launch manager
--name caliper hyperledger/caliper:0.5.1 launch manager
```

### Using docker-compose
Expand All @@ -363,10 +363,10 @@ version: '2'
services:
caliper:
container_name: caliper
image: hyperledger/caliper:0.5.0
image: hyperledger/caliper:0.5.1
command: launch manager
environment:
- CALIPER_BIND_SUT=fabric:2.2
- CALIPER_BIND_SUT=fabric:fabric-gateway
- CALIPER_BENCHCONFIG=benchmarks/scenario/simple/config.yaml
- CALIPER_NETWORKCONFIG=networks/fabric/test-network.yaml
volumes:
Expand Down
Loading

0 comments on commit a5e86fd

Please sign in to comment.