Skip to content

Commit

Permalink
Merge pull request #942 from kaleido-io/dxdestination
Browse files Browse the repository at this point in the history
Advertise full node name (with suffix) to DX
  • Loading branch information
awrichar authored Aug 10, 2022
2 parents 5ede657 + 797da9f commit bd53159
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
8 changes: 2 additions & 6 deletions internal/dataexchange/ffdx/ffdx.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,7 @@ func (h *FFDX) checkInitialized(ctx context.Context) error {
}

func (h *FFDX) GetPeerID(peer fftypes.JSONObject) string {
id := peer.GetString("nodeID")
if id == "" {
id = peer.GetString("id")
}
return id
return peer.GetString("id")
}

func (h *FFDX) GetEndpointInfo(ctx context.Context, nodeName string) (peer fftypes.JSONObject, err error) {
Expand All @@ -270,7 +266,7 @@ func (h *FFDX) GetEndpointInfo(ctx context.Context, nodeName string) (peer fftyp
log.L(ctx).Errorf("Invalid DX info: %s", peer.String())
return nil, i18n.NewError(ctx, coremsgs.MsgDXInfoMissingID)
}
peer["nodeID"] = fmt.Sprintf("%s%s%s", id, DXIDSeparator, nodeName)
peer["id"] = fmt.Sprintf("%s%s%s", id, DXIDSeparator, nodeName)
return peer, nil
}

Expand Down
3 changes: 1 addition & 2 deletions internal/dataexchange/ffdx/ffdx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ func TestGetEndpointInfo(t *testing.T) {
peer, err := h.GetEndpointInfo(context.Background(), "node1")
assert.NoError(t, err)
assert.Equal(t, fftypes.JSONObject{
"nodeID": "peer1/node1",
"id": "peer1",
"id": "peer1/node1",
"endpoint": "https://peer1.example.com",
"cert": "cert data...",
}, peer)
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"dataexchange-https": {
"image": "ghcr.io/hyperledger/firefly-dataexchange-https",
"tag": "v1.0.0-20220801-11",
"sha": "f113ccbd1ad166c3a382ec744af93b0701e1741fc97be2f4c60c3edb29767570"
"tag": "v1.0.0-20220810-13",
"sha": "3d6ae0c37065c590ed872c96b004854fa1bf89c52b8a5c1fca676d6bb4bf31d6"
},
"tokens-erc1155": {
"image": "ghcr.io/hyperledger/firefly-tokens-erc1155",
Expand Down

0 comments on commit bd53159

Please sign in to comment.