I'm following this guide https://github.com/rohitadivi/Reconfigure-BYFN/blob/master/New-channel-Org3.md to add a third organization to the consortium of the system config of my ./byfn Hyperledger Fabric network. However, when I get to the "Sending config update to orderer" step, I am getting the error Error: Invalid channel create transaction : bad header
Here is my sys_config_update.json
{
"payload": {
"header": {
"channel_header": {
"channel_id": "mychannel",
"type": 2
}
},
"data": {
"config_update": {
"channel_id": "mychannel",
"read_set": {
"groups": {
"Application": {
"mod_policy": "",
"version": "1"
},
"Orderer": {
"mod_policy": "",
"version": "0"
}
},
"mod_policy": "",
"policies": {
"Admins": {
"mod_policy": "",
"version": "0"
},
"Readers": {
"mod_policy": "",
"version": "0"
},
"Writers": {
"mod_policy": "",
"version": "0"
}
},
"values": {
"BlockDataHashingStructure": {
"mod_policy": "",
"version": "0"
},
"Capabilities": {
"mod_policy": "",
"version": "0"
},
"Consortium": {
"mod_policy": "",
"version": "0"
},
"HashingAlgorithm": {
"mod_policy": "",
"version": "0"
},
"OrdererAddresses": {
"mod_policy": "",
"version": "0"
}
},
"version": "0"
},
"write_set": {
"groups": {
"Application": {
"mod_policy": "",
"version": "1"
},
"Consortiums": {
"groups": {
"SampleConsortium": {
"groups": {
"Org3MSP": {
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org3MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org3MSP",
"role": "MEMBER"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org3MSP",
"role": "MEMBER"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
}
},
"values": {
"MSP": {
"mod_policy": "Admins",
"value": {
"config": {
"admins": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNLakNDQWRHZ0F3SUJBZ0lSQU5Ua1NVZFg5T0RJRllxUTAzVktGOEl3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpNdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaek11WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd3T1RFNE1UZzFOelUzV2hjTk1qZ3dPVEUxTVRnMU56VTMKV2pCc01Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFUE1BMEdBMVVFQ3hNR1kyeHBaVzUwTVI4d0hRWURWUVFEREJaQlpHMXBia0J2CmNtY3pMbVY0WVcxd2JHVXVZMjl0TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFdTNDTGhtQysKaWtmRDdBT2J6OWk1SFhBZEQ0OXFXYklDUVU4bkw5RTZaQ1doMzVDY1NIS2F1UjFMaW05UmxpS1Vva3pSYVBNQgpmSkV2a0kyd3YrcGNLYU5OTUVzd0RnWURWUjBQQVFIL0JBUURBZ2VBTUF3R0ExVWRFd0VCL3dRQ01BQXdLd1lEClZSMGpCQ1F3SW9BZ2NkOTdQbFdQZ3JRNTZaYVBSTVFJdFBqSitPWnpPajI3R05XOVBkYSsrbE13Q2dZSUtvWkkKemowRUF3SURSd0F3UkFJZ0d3MW1uSElSZGc1NlVnTVZ5Z1IzUytJYUYwdGNzQTZoMS8yc3R4UlZGZ01DSUQzUQpjZllSdnY5OXZpZjdqVm52MTJHSjdoNEtXRWw0UGtlMUJndHpWa2RqCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
],
"crypto_config": {
"identity_identifier_hash_function": "SHA256",
"signature_hash_family": "SHA2"
},
"fabric_node_ous": {
"client_ou_identifier": {
"certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRakNDQWVtZ0F3SUJBZ0lRZDBIazFTcUg2YURPd1Q0SkhsS3BrakFLQmdncWhrak9QUVFEQWpCek1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTXk1bGVHRnRjR3hsTG1OdmJURWNNQm9HQTFVRUF4TVRZMkV1CmIzSm5NeTVsZUdGdGNHeGxMbU52YlRBZUZ3MHhPREE1TVRneE9EVTNOVGRhRncweU9EQTVNVFV4T0RVM05UZGEKTUhNeEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUlFd3BEWVd4cFptOXlibWxoTVJZd0ZBWURWUVFIRXcxVApZVzRnUm5KaGJtTnBjMk52TVJrd0Z3WURWUVFLRXhCdmNtY3pMbVY0WVcxd2JHVXVZMjl0TVJ3d0dnWURWUVFECkV4TmpZUzV2Y21jekxtVjRZVzF3YkdVdVkyOXRNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUKbXE0VCtaSGpIWGFqZ0ljU2pRWjhGZFVYWXZsU2NaSjFNcmtyUzg4dTVYRWw1djc4Y2ptdENWdDlyZysrclBXVwpxNkdDV1JsQzQzUkw5dVBaYXdZQ1pxTmZNRjB3RGdZRFZ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FlURVdNQlFHQTFVRQpCeE1OVTJGdUlFWnlZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTXk1bGVHRnRjR3hsTG1OdmJURWZNQjBHCkExVUVBeE1XZEd4elkyRXViM0puTXk1bGVHRnRjR3hsTG1OdmJUQlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDkKQXdFSEEwSUFCRjM5aXpMWWZHamk4RlVNQ2tlY3BycVRJdTlXY0J2NTBNdTZsVjBxcHJ5N2hNN1RJRkxVSjJhRQpLTU9tTDRqNWlSckYwaEtpMkhHaWhqTEtiWkNnRUZDalh6QmRNQTRHQTFVZER3RUIvd1FFQXdJQnBqQVBCZ05WCkhTVUVDREFHQmdSVkhTVUFNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdLUVlEVlIwT0JDSUVJRGlEenA1djZMRUkKanRNSUtRV0N4a1hGamlwYnBOaFdTeG5peUJHdk05UmJNQW9HQ0NxR1NNNDlCQU1DQTBnQU1FVUNJUUR3dlNPagpSVTFTQmdTQTVHQWxIREtDWmV6NFZxMEpmWVFZMkdhaVlBaXdjQUlnWG1OVDVhK095emIyOWdNOUdxUmVLbVF1CjBXMGUzMGRxQjZvTHh0enRmNHM9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
]
},
"type": 0
},
"version": "0"
}
},
"version": "0"
}
},
"mod_policy": "",
"version": "0"
}
},
"mod_policy": "",
"version": "0"
},
"Orderer": {
"mod_policy": "",
"version": "0"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "",
"version": "0"
},
"Readers": {
"mod_policy": "",
"version": "0"
},
"Writers": {
"mod_policy": "",
"version": "0"
}
},
"values": {
"BlockDataHashingStructure": {
"mod_policy": "",
"version": "0"
},
"Capabilities": {
"mod_policy": "",
"version": "0"
},
"Consortium": {
"mod_policy": "",
"version": "0"
},
"HashingAlgorithm": {
"mod_policy": "",
"version": "0"
},
"OrdererAddresses": {
"mod_policy": "",
"version": "0"
}
},
"version": "1"
}
}
}
}
}
And the configuration update step I am using is this:
/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel update -f sys_config_update_in_envelope.pb -c mychannel -o orderer.example.com:7050 --tls true --cafile $ORDERER_CA
How do I resolve this?
i just ran into this, i'm not sure if this'll help you but it turned out i was running a fabric-tools:1.2.0 on a x86_64-1.1.0 orderer. I versioned them together and it worked for me
Related
I have a document like this:
I have a schema design like this, I'm using mongoose-paginate-v2:
const options = {
select: 'files',
lean: true,
offset,
limit
};
const data = Message.paginate(
{ conversation_id: conversationId, 'files.category': { "$in" : category } },
options,
);
return data;
This is my response data:
[
{
"_id": "628472b3ef39fbb8bb655317",
"files": [
{
"src": "U21102500080/2022/5/images/1652847282675-pexels_02.jpeg",
"name": "pexels_02.jpeg",
"extension": "jpeg",
"size": 25708,
"category": "image",
"_id": "628472b3ef39fbb8bb655318"
},
{
"src": "U21102500080/2022/5/images/1652847282704-pexels_03.jpeg",
"name": "pexels_03.jpeg",
"extension": "jpeg",
"size": 107748,
"category": "image",
"_id": "628472b3ef39fbb8bb655319"
},
{
"src": "U21102500080/2022/5/images/1652847282704-pexels_01.jpeg.jpeg",
"name": "pexels_01.jpeg.jpeg",
"extension": "jpeg",
"size": 22364,
"category": "image",
"_id": "628472b3ef39fbb8bb65531a"
}
],
"id": "628472b3ef39fbb8bb655317"
},
{
"_id": "628702c293b660628e95124d",
"files": [
{
"src": "c6ed8c14-bcec-4739-bdf2-2392c7d15318/2022/5/images/1653015230055-pexels-photo-11427585.jpeg",
"name": "pexels-photo-11427585.jpeg",
"extension": "jpeg",
"size": 17000,
"category": "image",
"_id": "628702c293b660628e95124e"
},
{
"src": "c6ed8c14-bcec-4739-bdf2-2392c7d15318/2022/5/images/1653015230098-chen-sithyfong-1fSRYz5QpSE-unsplash.jpeg",
"name": "chen-sithyfong-1fSRYz5QpSE-unsplash.jpeg",
"extension": "jpeg",
"size": 174722,
"category": "image",
"_id": "628702c293b660628e95124f"
},
{
"src": "c6ed8c14-bcec-4739-bdf2-2392c7d15318/2022/5/images/1653015230098-screen-post-EC5kTElGfNs-unsplash.jpeg",
"name": "screen-post-EC5kTElGfNs-unsplash.jpeg",
"extension": "jpeg",
"size": 160266,
"category": "image",
"_id": "628702c293b660628e951250"
}
],
"id": "628702c293b660628e95124d"
},
{
"_id": "628702fa93b660628e951275",
"files": [
{
"src": "U21102500080/2022/5/images/1653015288963-2022-01-26 16.58.29.jpg",
"name": "2022-01-26 16.58.29.jpg",
"extension": "jpg",
"size": 34576,
"category": "image",
"_id": "628702fa93b660628e951276"
},
{
"src": "U21102500080/2022/5/images/1653015288968-2022-01-26 16.58.20.jpg",
"name": "2022-01-26 16.58.20.jpg",
"extension": "jpg",
"size": 31982,
"category": "image",
"_id": "628702fa93b660628e951277"
},
{
"src": "U21102500080/2022/5/images/1653015288968-2022-01-26 16.58.24.jpg",
"name": "2022-01-26 16.58.24.jpg",
"extension": "jpg",
"size": 119198,
"category": "image",
"_id": "628702fa93b660628e951278"
}
],
"id": "628702fa93b660628e951275"
},
]
But I want this response data:
[
{
"src": "",
"name": "",
"extension": "",
"size": 0,
"category": "",
"_id": "628472b3ef39fbb8bb655318"
},
{
"src": "",
"name": "",
"extension": "",
"size": 0,
"category": "",
"_id": "628472b3ef39fbb8bb655319"
},
{
"src": "",
"name": "",
"extension": "",
"size": 0,
"category": "",
"_id": "628472b3ef39fbb8bb65531a"
},
{
"src": "",
"name": "",
"extension": "",
"size": 0,
"category": "",
"_id": "628702c293b660628e95124e"
}
]
const options = {
select: 'files',
lean: true,
offset,
limit
};
let data = Message.paginate(
{ conversation_id: conversationId, 'files.category': { "$in" : category } },
options,
);
data = data.reduce((prev,curr) => [...prev.files, ...curr.files], [] )
return data;
Tested on Shopware 6.3.5.1:
I'm trying to create a product via API together with its parent. That is necessary, because I can only iterate over variants in the other system.
As far as I can tell there's no conflict with the IDs or duplicates. Neither the product nor its parent already exist.
But when I do this:
POST https://somedomain.de/api/v3/_action/sync
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{auth_token}}
{
"7508d64f832fb06b8f82f78963b280ab": {
"action": "upsert",
"entity": "product",
"payload": [
{
"id": "7508d64f832fb06b8f82f78963b280ab",
"__code": "1111111189",
"stock": 99,
"taxId": "d390c2f211144543845dbf76fa69d17a",
"cmsPageId": null,
"deliveryTimeId": null,
"manufacturerId": null,
"visibilities": [
{
"id": "e24f994426246015347bba784ac69a97",
"productId": "7508d64f832fb06b8f82f78963b280ab",
"salesChannelId": "8e7c11e2540b4c71b521d5a59920e142",
"visibility": 30
}
],
"unitId": null,
"price": [
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 25,
"gross": 29.75,
"linked": true
}
],
"productNumber": "1111111189",
"coverId": null,
"translations": {
"ce1df85b5f1c4eedbc532cbd34c57df6": {
"name": "Converse black",
"description": "Converse black"
},
"2fbb5fe2e29a4d70aa5854ce7ce3e20b": {
"name": "Converse black",
"description": "Converse black"
}
},
"categories": [
{
"id": "e90cf50735a0d6f69b2dbf599caa4954"
},
{
"id": "a5b4753f41c8f4bedba1bf5954c961cb"
}
],
"properties": [
{
"id": "a01a0380ca3c61428c26a231f0e49a09"
}
],
"media": [
{
"id": "cb9a886400616c215a588b13cb7c662b",
"mediaId": "a7aabb5ff4dc3c99ba45724ec7477ffe"
}
],
"parent": {
"id": "7a788255eab96bf51002829b3a6becf2",
"__code": "1111111189",
"stock": 99,
"taxId": "d390c2f211144543845dbf76fa69d17a",
"cmsPageId": null,
"deliveryTimeId": null,
"manufacturerId": null,
"visibilities": [
{
"id": "8d5a7e2b2c02986a924eaf3d9504413c",
"productId": "7a788255eab96bf51002829b3a6becf2",
"salesChannelId": "8e7c11e2540b4c71b521d5a59920e142",
"visibility": 30
}
],
"unitId": null,
"price": [
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 25,
"gross": 29.75,
"linked": true
}
],
"productNumber": "converseblack",
"coverId": null,
"translations": {
"ce1df85b5f1c4eedbc532cbd34c57df6": {
"name": "Converse black",
"description": "Converse black"
},
"2fbb5fe2e29a4d70aa5854ce7ce3e20b": {
"name": "Converse black",
"description": "Converse black"
}
},
"categories": [
{
"id": "e90cf50735a0d6f69b2dbf599caa4954"
},
{
"id": "a5b4753f41c8f4bedba1bf5954c961cb"
}
],
"properties": [
{
"id": "a01a0380ca3c61428c26a231f0e49a09"
}
],
"media": [
{
"id": "cb9a886400616c215a588b13cb7c662b",
"mediaId": "a7aabb5ff4dc3c99ba45724ec7477ffe"
}
],
"configuratorSettings": [
{
"optionId": "a01a0380ca3c61428c26a231f0e49a09",
"id": "db3787abb8d6372e1997c144031ef1e2"
}
]
},
"parentId": "7a788255eab96bf51002829b3a6becf2",
"options": [
{
"id": "a01a0380ca3c61428c26a231f0e49a09"
}
]
}
]
}
}
I get as a response that the integrity constraint productId X saleschannelId in visibilities gets violated:
{
"success": false,
"data": {
"7508d64f832fb06b8f82f78963b280ab": {
"result": [
{
"entities": [],
"errors": [
{
"code": "0",
"status": "500",
"title": "Internal Server Error",
"detail": "An exception occurred while executing 'INSERT INTO `product_visibility` (`id`, `product_id`, `product_version_id`, `sales_channel_id`, `visibility`, `created_at`) VALUES (?, ?, ?, ?, ?, ?)' with params [\"\\x8d\\x5a\\x7e\\x2b\\x2c\\x02\\x98\\x6a\\x92\\x4e\\xaf\\x3d\\x95\\x04\\x41\\x3c\", \"\\x7a\\x78\\x82\\x55\\xea\\xb9\\x6b\\xf5\\x10\\x02\\x82\\x9b\\x3a\\x6b\\xec\\xf2\", \"\\x0f\\xa9\\x1c\\xe3\\xe9\\x6a\\x4b\\xc2\\xbe\\x4b\\xd9\\xce\\x75\\x2c\\x34\\x25\", \"\\x8e\\x7c\\x11\\xe2\\x54\\x0b\\x4c\\x71\\xb5\\x21\\xd5\\xa5\\x99\\x20\\xe1\\x42\", 30, \"2021-02-22 11:36:18.099\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'zx\\x82U\\xEA\\xB9k\\xF5\\x10\\x02\\x82\\x9B:k\\xEC\\xF2-\\x0F\\xA9\\x1C\\x...' for key 'uniq.product_id__sales_channel_id'"
}
]
}
],
"extensions": []
}
},
"extensions": []
}
I just figured out, that it's possible to extract the nested entities into separate actions (that works):
{
"7508d64f832fb06b8f82f78963b280ab": {
"action": "upsert",
"entity": "product",
"payload": [
{
"id": "7508d64f832fb06b8f82f78963b280ab",
"__code": "1111111189",
"stock": 99,
"taxId": "d390c2f211144543845dbf76fa69d17a",
"cmsPageId": null,
"deliveryTimeId": null,
"manufacturerId": null,
"unitId": null,
"price": [
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 25,
"gross": 29.75,
"linked": true
}
],
"productNumber": "1111111189",
"coverId": null,
"translations": {
"ce1df85b5f1c4eedbc532cbd34c57df6": {
"name": "Converse black",
"description": "Converse black"
},
"2fbb5fe2e29a4d70aa5854ce7ce3e20b": {
"name": "Converse black",
"description": "Converse black"
}
},
"categories": [
{
"id": "e90cf50735a0d6f69b2dbf599caa4954"
},
{
"id": "a5b4753f41c8f4bedba1bf5954c961cb"
}
],
"properties": [
{
"id": "a01a0380ca3c61428c26a231f0e49a09"
}
],
"media": [
{
"id": "cb9a886400616c215a588b13cb7c662b",
"mediaId": "a7aabb5ff4dc3c99ba45724ec7477ffe"
}
],
"parent": {
"id": "7a788255eab96bf51002829b3a6becf2",
"__code": "1111111189",
"stock": 99,
"taxId": "d390c2f211144543845dbf76fa69d17a",
"cmsPageId": null,
"deliveryTimeId": null,
"manufacturerId": null,
"unitId": null,
"price": [
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 25,
"gross": 29.75,
"linked": true
}
],
"productNumber": "converseblack",
"coverId": null,
"translations": {
"ce1df85b5f1c4eedbc532cbd34c57df6": {
"name": "Converse black",
"description": "Converse black"
},
"2fbb5fe2e29a4d70aa5854ce7ce3e20b": {
"name": "Converse black",
"description": "Converse black"
}
},
"categories": [
{
"id": "e90cf50735a0d6f69b2dbf599caa4954"
},
{
"id": "a5b4753f41c8f4bedba1bf5954c961cb"
}
],
"properties": [
{
"id": "a01a0380ca3c61428c26a231f0e49a09"
}
],
"media": [
{
"id": "cb9a886400616c215a588b13cb7c662b",
"mediaId": "a7aabb5ff4dc3c99ba45724ec7477ffe"
}
],
"configuratorSettings": [
{
"optionId": "a01a0380ca3c61428c26a231f0e49a09",
"id": "db3787abb8d6372e1997c144031ef1e2"
}
]
},
"parentId": "7a788255eab96bf51002829b3a6becf2",
"options": [
{
"id": "a01a0380ca3c61428c26a231f0e49a09"
}
]
}
]
},
"e24f994426246015347bba784ac69a97": {
"action": "upsert",
"entity": "product_visibility",
"payload": [
{
"id": "e24f994426246015347bba784ac69a97",
"productId": "7508d64f832fb06b8f82f78963b280ab",
"salesChannelId": "8e7c11e2540b4c71b521d5a59920e142",
"visibility": 30
}
]
},
"8d5a7e2b2c02986a924eaf3d9504413c": {
"action": "upsert",
"entity": "product_visibility",
"payload": [
{
"id": "8d5a7e2b2c02986a924eaf3d9504413c",
"productId": "7a788255eab96bf51002829b3a6becf2",
"salesChannelId": "8e7c11e2540b4c71b521d5a59920e142",
"visibility": 30
}
]
}
}
I want to add a new Organization to an existing Channel in Hyperledger Fabric.
First I obtain the channel configuration in JSON format using the following code snippet:
byte[] configBytes = channel.getChannelConfigurationBytes();
String configtxlator = props.getProperty("configtxlator");
HttpPost httppost = new HttpPost(configtxlator + "/protolator/decode/common.Config");
httppost.setEntity(new ByteArrayEntity(configBytes));
HttpClient httpclient = HttpClients.createDefault();
HttpResponse response = httpclient.execute(httppost);
int statuscode = response.getStatusLine().getStatusCode();
if (statuscode == 200) {
return EntityUtils.toString(response.getEntity());
} else {
return "";
}
The result is the following JSON string:
{
"channel_group": {
"groups": {
"Application": {
"groups": {
"Org1MSP": {
"groups": {},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "PEER"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "CLIENT"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
},
{
"signed_by": 1
},
{
"signed_by": 2
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "CLIENT"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
},
{
"signed_by": 1
}
]
}
},
"version": 0
}
},
"version": "0"
}
},
"values": {
"AnchorPeers": {
"mod_policy": "Admins",
"value": {
"anchor_peers": [
{
"host": "peer1.org1.isprint.com",
"port": 7051
},
{
"host": "peer2.org1.isprint.com",
"port": 7051
}
]
},
"version": "0"
},
"MSP": {
"mod_policy": "Admins",
"value": {
"config": {
"admins": [],
"crypto_config": {
"identity_identifier_hash_function": "SHA256",
"signature_hash_family": "SHA2"
},
"fabric_node_ous": {
"admin_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "admin"
},
"client_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "client"
},
"enable": true,
"orderer_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "orderer"
},
"peer_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "peer"
}
},
"intermediate_certs": [],
"name": "Org1MSP",
"organizational_unit_identifiers": [],
"revocation_list": [],
"root_certs": [
"..."
],
"signing_identity": null,
"tls_intermediate_certs": [],
"tls_root_certs": [
"..."
]
},
"type": 0
},
"version": "0"
}
},
"version": "1"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "MAJORITY",
"sub_policy": "Admins"
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Readers"
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
}
},
"values": {
"Capabilities": {
"mod_policy": "Admins",
"value": {
"capabilities": {
"V1_4_2": {}
}
},
"version": "0"
}
},
"version": "1"
},
"Orderer": {
"groups": {
"OrdererOrg": {
"groups": {},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "OrdererMSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "OrdererMSP",
"role": "MEMBER"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "OrdererMSP",
"role": "MEMBER"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
}
},
"values": {
"MSP": {
"mod_policy": "Admins",
"value": {
"config": {
"admins": [],
"crypto_config": {
"identity_identifier_hash_function": "SHA256",
"signature_hash_family": "SHA2"
},
"fabric_node_ous": {
"admin_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "admin"
},
"client_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "client"
},
"enable": true,
"orderer_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "orderer"
},
"peer_ou_identifier": {
"certificate": "...",
"organizational_unit_identifier": "peer"
}
},
"intermediate_certs": [],
"name": "OrdererMSP",
"organizational_unit_identifiers": [],
"revocation_list": [],
"root_certs": [
"..."
],
"signing_identity": null,
"tls_intermediate_certs": [],
"tls_root_certs": [
"..."
]
},
"type": 0
},
"version": "0"
}
},
"version": "0"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "MAJORITY",
"sub_policy": "Admins"
}
},
"version": "0"
},
"BlockValidation": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Readers"
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
}
},
"values": {
"BatchSize": {
"mod_policy": "Admins",
"value": {
"absolute_max_bytes": 103809024,
"max_message_count": 100,
"preferred_max_bytes": 524288
},
"version": "0"
},
"BatchTimeout": {
"mod_policy": "Admins",
"value": {
"timeout": "30s"
},
"version": "0"
},
"Capabilities": {
"mod_policy": "Admins",
"value": {
"capabilities": {
"V1_4_2": {}
}
},
"version": "0"
},
"ChannelRestrictions": {
"mod_policy": "Admins",
"value": null,
"version": "0"
},
"ConsensusType": {
"mod_policy": "Admins",
"value": {
"metadata": {
"consenters": [
{
"client_tls_cert": "...",
"host": "orderer1.isprint.com",
"port": 7050,
"server_tls_cert": "..."
},
{
"client_tls_cert": "...",
"host": "orderer2.isprint.com",
"port": 7050,
"server_tls_cert": "..."
},
{
"client_tls_cert": "...",
"host": "orderer3.isprint.com",
"port": 7050,
"server_tls_cert": "..."
}
],
"options": {
"election_tick": 10,
"heartbeat_tick": 1,
"max_inflight_blocks": 5,
"snapshot_interval_size": 20971520,
"tick_interval": "500ms"
}
},
"state": "STATE_NORMAL",
"type": "etcdraft"
},
"version": "0"
}
},
"version": "0"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "MAJORITY",
"sub_policy": "Admins"
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Readers"
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
}
},
"values": {
"BlockDataHashingStructure": {
"mod_policy": "Admins",
"value": {
"width": 4294967295
},
"version": "0"
},
"Capabilities": {
"mod_policy": "Admins",
"value": {
"capabilities": {
"V1_4_3": {}
}
},
"version": "0"
},
"Consortium": {
"mod_policy": "Admins",
"value": {
"name": "SampleConsortium"
},
"version": "0"
},
"HashingAlgorithm": {
"mod_policy": "Admins",
"value": {
"name": "SHA256"
},
"version": "0"
},
"OrdererAddresses": {
"mod_policy": "/Channel/Orderer/Admins",
"value": {
"addresses": [
"orderer1.isprint.com:7050",
"orderer2.isprint.com:7050",
"orderer3.isprint.com:7050"
]
},
"version": "0"
}
},
"version": "0"
},
"sequence": "2"
}
I have written a code snippet using JsonPath:
DocumentContext context = JsonPath.parse(json);
String pathOrg1MSP = "$.channel_group.groups.Application.groups.Org1MSP";
Map<String,Object> mapOrg1MSP = context.read(pathOrg1MSP);
Map<String,Object> mapOrg2MSP = new LinkedHashMap<String,Object>();
mapOrg1MSP.forEach((k,v) -> {
mapOrg2MSP.put(k, v);
});
String pathOrg2MSP = "$.channel_group.groups.Application.groups";
context.put(pathOrg2MSP, "Org2MSP", mapOrg2MSP);
The intention is to create an exact clone first, then change whatever values need to be changed (peers, certs etc), and then splice it into the original Json.
Would this achieve what I intend to do?
What values would I need to change to prevent any possible conflicts with existing organizations?
Generate crypto materials for Org2
Generate Org2-specific configuration materials
Fetch the latest config block from orderer, trim it down and convert it to JSON (I believe u have done this step already)
Add Org2-specific configuration materials to the JSON
Convert original JSON and newly edited JSON to protobuf format
Compute difference between the new and original block (.pb files)
Convert it to JSON format and add back header
Convert it to protobuf format
Sign transaction by Org1
For the detailed commands, you can refer to this official documentation. https://hyperledger-fabric.readthedocs.io/en/release-1.4/channel_update_tutorial.html
Getting error while deploying App gateway waf_v2 with more then one listener. For single listner it is working fine.
Error :
{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n "error": {\r\n "code": "ApplicationGatewayHttpListenersUsingSameFrontendPortAndFrontendIpConfig",\r\n "message": "Two Http Listeners of Application Gateway journal-listner and attachmentmgmt-listner are using the same Frontend Port /subscriptions/77585cb5-cc1b-47a6-b60d-4c1ec4b078fc/resourceGroups/drgr001appgatewaydevtest-au/providers/Microsoft.Network/applicationGateways/bo-appgw-waf-v2-entdev1/frontendPorts/frontendPorts and FrontendIpConfiguration /subscriptions/77585cb5-cc1b-47a6-b60d-4c1ec4b078fc/resourceGroups/drgr001appgatewaydevtest-au/providers/Microsoft.Network/applicationGateways/bo-appgw-waf-v2-entdev1/frontendIPConfigurations/PrivateFrontendIp.",\r\n "details": []\r\n }\r\n}"}]}
template code :
// Application Gateway
{
"name": "[parameters('applicationGatewayName')]",
"type": "Microsoft.Network/applicationGateways",
"apiVersion": "2020-03-01",
"location": "[parameters('location')]",
"zones": "[parameters('availabilityZones')]",
"properties": {
"sku": {
"name": "WAF_v2",
"tier": "WAF_v2",
"capacity": "[parameters('capacity')]"
},
"sslCertificates": [
{
"name": "[parameters('certName')]",
"properties": {
"data": "[parameters('certData')]",
"password": "[parameters('certPassword')]"
}
}
],
"gatewayIPConfigurations": [
{
"name": "gatewayIp",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
],
"trustedRootCertificates": "[parameters('trustedRootCertificates')]",
"frontendIPConfigurations": [
{
"name": "PublicFrontendIp",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[parameters('publicIpResourceId')]"
}
}
},
{
"name": "PrivateFrontendIp",
"properties": {
"privateIPAddress": "[parameters('privateIPAddress')]",
"privateIPAllocationMethod": "Static",
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
],
"frontendPorts": [
{
"name": "frontendPorts",
"properties": {
"Port": 443
}
}
],
"backendAddressPools": "[parameters('backendAddressPools')]",
"probes": "[parameters('probes')]",
"copy": [
{
"name": "backendHttpSettingsCollection",
"count": "[length(parameters('backendHttpSettings'))]",
"input": {
"name": "[parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].name]",
"properties": {
"port": 443,
"pickHostNameFromBackendAddress": true,
"protocol": "Https",
"probeEnabled": "[parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].probeEnabled]",
"probe": {
"id": "[resourceId('Microsoft.Network/applicationGateways/probes', parameters('applicationGatewayName'), parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].probe)]"
}
}
}
},
{
"name": "httpListeners",
"count": "[length(parameters('httpListeners'))]",
"input": {
"name": "[parameters('httpListeners')[copyIndex('httpListeners')].name]",
"properties": {
"protocol": "Https",
// Set hostname if it exists
"hostName": "[if(contains(parameters('httpListeners')[copyIndex('httpListeners')], 'hostName'), parameters('httpListeners')[copyIndex('httpListeners')].hostName, '')]",
"sslCertificate": {
"id": "[concat(variables('applicationGatewayId'), '/sslCertificates/',parameters('httpListeners')[copyIndex('httpListeners')].sslCertificateName)]"
},
"frontendIPConfiguration": {
"id": "[concat(variables('applicationGatewayId'), '/frontendIPConfigurations/PrivateFrontendIp')]"
},
"frontendPort": {
"id": "[concat(variables('applicationGatewayId'), '/frontendPorts/frontendPorts')]"
}
}
}
},
{
"name": "requestRoutingRules",
"count": "[length(parameters('requestRoutingRules'))]",
"input": {
"name": "[parameters('requestRoutingRules')[copyIndex('requestRoutingRules')].name]",
"properties": {
"ruleType": "Basic",
"backendAddressPool": {
"id": "[concat(variables('applicationGatewayId'), '/backendAddressPools/',parameters('requestRoutingRules')[copyIndex('requestRoutingRules')].backendpoolName)]"
},
"backendHttpSettings": {
"id": "[concat(variables('applicationGatewayId'), '/backendHttpSettingsCollection/',parameters('requestRoutingRules')[copyIndex('requestRoutingRules')].backendHttpSetting)]"
},
"httpListener": {
"id": "[concat(variables('applicationGatewayId'), '/httpListeners/',parameters('requestRoutingRules')[copyIndex('requestRoutingRules')].httpListener)]"
}
}
}
}
],
"redirectConfigurations": "[parameters('redirectConfigurations')]",
"enableHttp2": "[parameters('enableHttp2')]",
"webApplicationFirewallConfiguration": "[variables('webApplicationFirewallConfiguration')]",
"urlPathMaps": "[parameters('urlPathMaps')]",
"authenticationCertificates": "[parameters('authenticationCertificates')]",
"sslPolicy": {
"policyType": "Predefined",
"policyName": "AppGwSslPolicy20170401S"
},
"rewriteRuleSets": "[parameters('rewriteRuleSets')]"
}
}
Parameter used :
"backendHttpSettings": {
"value": [
{
"name": "https-attachment",
"probeEnabled": true,
"probe": "attachment-probe"
},
{
"name": "https-journal",
"probeEnabled": true,
"probe": "journal-probe"
}
]
},
"backendAddressPools": {
"value": [
{
"name": "AttachmentServicePool",
"properties": {
"backendAddresses": [
{
"fqdn": "attachmentmgmt-svc-api-dev-euw.aseentdev.sys.dom"
}
]
}
},
{
"name": "journalServicePool",
"properties": {
"backendAddresses": [
{
"fqdn": "journalmgmt-svc-api-dev-euw.aseentdev.sys.dom"
}
]
}
}
]
},
"availabilityZones": {
"value": [
1,
2
]
},
"probes": {
"value": [
{
"name": "attachment-probe",
"properties": {
"protocol": "Https",
"PickHostNameFromBackendHttpSettings": true,
"path": "/index.htm",
"interval": 5,
"timeout": 10,
"match": {
"statusCodes": [
200
],
"body": "SUCCESS"
}
}
},
{
"name": "journal-probe",
"properties": {
"protocol": "Https",
"PickHostNameFromBackendHttpSettings": true,
"path": "/index.htm",
"interval": 5,
"timeout": 10,
"match": {
"statusCodes": [
200
],
"body": "SUCCESS"
}
}
}
]
},
"httpListeners": {
"value": [
{
"name": "attachmentmgmt-listner",
"sslCertificateName": "abc"
},
{
"name": "journal-listner",
"sslCertificateName": "abc"
}
]
},
"urlPathMaps": {
"value": []
},
"requestRoutingRules": {
"value": [
{
"name": "attachment-routing-rule",
"backendpoolName": "AttachmentServicePool",
"backendHttpSetting": "https-attachment",
"httpListener": "attachmentmgmt-listner"
},
{
"name": "journal-routing-rule",
"backendpoolName": "journalServicePool",
"backendHttpSetting": "https-journal",
"httpListener": "journal-listner"
}
]
},
You can't create two basic listeners on the same port. Either use different ports or two different hostnames with Multi site listener.
change in parameter file with passing host name for httplistner worked fine.
"httpListeners": {
"value": [
{
"name": "listner1",
"sslCertificateName": "ABC",
"hostName": "wb.abc.dom"
},
{
"name": "listner2",
"sslCertificateName": "ABC",
"hostName": "wb1.abc.dom"
}
]
}
I have this endpoint with powerState and connectivity properties both retrievable:
{
"endpointId": "123",
"manufacturerName": "abc",
"friendlyName": "lamp",
"description": "lamp",
"displayCategories": [
"LIGHT"
],
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [{
"name": "powerState"
}],
"retrievable": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.EndpointHealth",
"version": "3",
"properties": {
"supported": [{
"name": "connectivity"
}],
"retrievable": true
}
}
],
"cookie": {}
}
I respond to ReportState request by sending the state of both properties:
{
"context": {
"properties": [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2019-01-10T10:17:19.99Z",
"uncertaintyInMilliseconds": 50
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2019-01-10T10:17:19.90Z",
"uncertaintyInMilliseconds": 50
}
]
},
"event": {
"header": {
"namespace": "Alexa",
"name": "StateReport",
"payloadVersion": "3",
"messageId": "cde",
"correlationToken": "efg123"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "ab123"
},
"endpointId": "123",
"cookie": {}
},
"payload": {}
}
}
And I send the same context in the PowerController response.
In the Alexa app I can see my device, turn it on and off and view its state rightly. I can ask Alexa to turn on and off my device and the response in "OK", but if I try to ask:** "Is my device turned on?" ** Alexa answers that this device doesn't support that.
The skill language is Italian and PowerController documentation https://developer.amazon.com/it/docs/device-apis/alexa-powercontroller.html says that query is supported.
What am I missing?