Skip to content

Commit

Permalink
Merge pull request #354 from VRamakrishna/main
Browse files Browse the repository at this point in the history
Data Sharing Protocol Bug Fixes and RFC Specification Improvements
  • Loading branch information
VRamakrishna authored Dec 29, 2022
2 parents aebfc9d + 292dac7 commit fc30dcb
Show file tree
Hide file tree
Showing 115 changed files with 612 additions and 367 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_asset-exchange-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:

asset-exchange-fabric:
if: ${{ false }}
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
working-directory: samples/fabric/fabric-cli

asset-exchange-fabric-local:
if: ${{ false }}
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_asset-transfer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ jobs:
working-directory: samples/fabric/fabric-cli

fabric-asset-transfer-local:
if: ${{ false }}
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_data-sharing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ jobs:
working-directory: samples/fabric/fabric-cli

data-sharing-docker-local:
if: ${{ false }}
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down Expand Up @@ -646,7 +646,7 @@ jobs:
cat tmp.out
# FABRIC2 - FABRIC1 - CONFIDENTIAL
sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"b\"/g" chaincode.json
sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"b\"/g" chaincode.json
./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network1:9080/network1/mychannel:simplestate:Read:b &> tmp.out
tail -n 1 tmp.out | grep "Args: b, Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
Expand All @@ -656,7 +656,7 @@ jobs:
cat tmp.out
# FABRIC1 - FABRIC2 - CONFIDENTIAL
sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json
sed -i "s/\"args\"\: \[\"b\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json
./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network2:9083/network2/mychannel:simplestate:Read:Betelgeuse &> tmp.out
tail -n 1 tmp.out | grep "Args: Betelgeuse, 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
Expand Down Expand Up @@ -699,7 +699,7 @@ jobs:
working-directory: samples/fabric/fabric-cli

data-sharing-local:
if: ${{ false }}
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:

jobs:
test_interopcc:
if: ${{ false }} # disable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion common/protos-go/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.5
1.5.6
90 changes: 37 additions & 53 deletions common/protos-go/fabric/view_data.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/protos-java-kt/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name=Interop Protos
group=com.weaver
version=1.5.5
version=1.5.6
kotlin.incremental=false
2 changes: 1 addition & 1 deletion common/protos-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger-labs/weaver-protos-js",
"version": "1.5.5",
"version": "1.5.6",
"description": "Interop protos for Node JS (Weaver)",
"main": "index.js",
"exports": {
Expand Down
7 changes: 1 addition & 6 deletions common/protos/fabric/view_data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/com
import "peer/proposal_response.proto";

message FabricView {
// `Response` from the peers
// https://github.com/hyperledger/fabric-protos-go/blob/master/peer/proposal_response.pb.go#L113
// We only need the `Payload` field though.
protos.Response response = 1;

message EndorsedProposalResponse {
// `ProposalResponsePayload` is the output produced by each peer and signed as a serialized blob
// https://github.com/hyperledger/fabric-protos-go/blob/master/peer/proposal_response.pb.go#L176
Expand All @@ -24,5 +19,5 @@ message FabricView {
// https://github.com/hyperledger/fabric-protos-go/blob/master/peer/proposal_response.pb.go#L242
protos.Endorsement endorsement = 2;
}
repeated EndorsedProposalResponse endorsed_proposal_responses = 2;
repeated EndorsedProposalResponse endorsed_proposal_responses = 1;
}
4 changes: 2 additions & 2 deletions core/drivers/corda-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ buildscript {
ext.corda_version = "4.8"
ext.corda_core_version = "4.8"
ext.arrow_version = "0.10.4"
ext.weaver_protos_version = "1.5.5"
ext.weaver_corda_version = "1.2.11"
ext.weaver_protos_version = "1.5.6"
ext.weaver_corda_version = "1.2.12"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion core/drivers/corda-driver/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlin.code.style=official
name=corda-driver
group=com.weaver.corda.driver
version=1.2.11
version=1.2.12
kotlin.incremental=false
2 changes: 1 addition & 1 deletion core/drivers/fabric-driver/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.5
1.5.6
14 changes: 7 additions & 7 deletions core/drivers/fabric-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ protos-js:
cp -r ../../../common/protos-js/relay ./protos-js/ && \
cp -r ../../../common/protos-js/package.json ./protos-js/

weaver-fabric-interop-sdk:
weaver-fabric-interop-sdk: protos-js
mkdir -p weaver-fabric-interop-sdk && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/build ./weaver-fabric-interop-sdk/ && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/index.js ./weaver-fabric-interop-sdk/ && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/package-local.json ./weaver-fabric-interop-sdk/package.json
cp -r ../../../sdks/fabric/interoperation-node-sdk/package.json ./weaver-fabric-interop-sdk/package.json

build-local: protos-js weaver-fabric-interop-sdk
(cp package.json package-remote.json && \
cp package-local.json package.json && \
npm install) || \
build-local: weaver-fabric-interop-sdk
cp package.json package-remote.json
cp package-local.json package.json
(npm install --unsafe-perm) || \
(mv package-remote.json package.json && exit 1) # Only if fails
mv package-remote.json package.json # Only if success
npm run build

build-image-local: protos-js weaver-fabric-interop-sdk
build-image-local: weaver-fabric-interop-sdk
cp package.json package-remote.json
cp package-local.json package.json
(docker build --build-arg BUILD_TAG="local" --build-arg GIT_URL=$(GIT_URL) -t ${DOCKER_IMAGE_NAME}:$(DOCKER_TAG) -f fabricDriver.dockerfile.local . ) || \
Expand Down
2 changes: 1 addition & 1 deletion core/drivers/fabric-driver/package-local.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fabric-driver",
"version": "1.5.4",
"version": "1.5.6",
"description": "",
"main": "out/server.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion core/drivers/fabric-driver/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fabric-driver",
"version": "1.5.4",
"version": "1.5.6",
"description": "",
"main": "out/server.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions core/drivers/fabric-driver/server/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,14 @@ async function writeExternalStateHelper(
const view: state_pb.View = viewPayload.getView();

const result = InteroperableHelper.getResponseDataFromView(view, keyCert.key.toBytes());
if (result.interopPayload.getConfidential()) {
viewContentsBase64.push(result.contents.toString("base64"));
if (result.contents) {
viewContentsBase64.push(result.contents);
} else {
viewContentsBase64.push("");
viewContentsBase64.push([]);
}

interopArgIndices.push(ctx.getReplaceArgIndex());
addresses.push(result.interopPayload.getAddress());
addresses.push(result.viewAddress);
viewsSerializedBase64.push(Buffer.from(viewPayload.getView().serializeBinary()).toString("base64"));

let ccArgsB64 = ctx.getArgsList();
Expand Down
7 changes: 0 additions & 7 deletions core/drivers/fabric-driver/server/fabric-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,6 @@ async function invoke(
//@ts-ignore
let endorsementCounter = 0;
proposalResponseResult.responses.forEach((response) => {
// Set single (last) InteropPayload as response
const currentResponse = new proposalResponse.Response();
currentResponse.setStatus(response.response.status);
currentResponse.setMessage(response.response.message);
currentResponse.setPayload(response.response.payload);
viewPayload.setResponse(currentResponse);

const endorsement = new proposalResponse.Endorsement();
endorsement.setSignature(response.endorsement.signature);
endorsement.setEndorser(response.endorsement.endorser);
Expand Down
2 changes: 1 addition & 1 deletion core/network/corda-interop-app/constants.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ slf4jVersion=1.7.25
nettyVersion=4.1.22.Final
arrowVersion=0.10.4

weaverVersion=1.5.5
weaverVersion=1.5.6
2 changes: 1 addition & 1 deletion core/network/corda-interop-app/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name=Interoperability CorDapp
group=com.weaver.corda.app.interop
version=1.2.11
version=1.2.12
kotlin.incremental=false
Loading

0 comments on commit fc30dcb

Please sign in to comment.