This Flogo activity contribution can be configured to update or list state-based endorsement policies.
This operation requires to configure the operation name as LIST
, and specify one or more state keys in the input data, e.g.,
"activity": {
"ref": "#endorsement",
"settings": {
"operation": "LIST"
},
"input": {
"keys": "=array.create(\"key1\", \"key2\")"
}
}
This example will return the state-based endorsement policies for the specified state keys, e.g.,
[
{
"key": "key1",
"policy": {
"orgs": ["org1.MEMBER", "org2.MEMBER"],
"rule": {
"outOf": 2,
"rules": [
{
"signedBy": 0
},
{
"signedBy": 1
}
]
}
}
},
{
"key": "key2",
"policy": {
"orgs": ["org1.MEMBER", "org2.MEMBER"],
"rule": {
"outOf": 2,
"rules": [
{
"signedBy": 0
},
{
"signedBy": 1
}
]
}
}
}
]
This operation requires to configure the operation name as SET
, and specify one or more state keys in the input data, as well as the endorsement policy, e.g.,
"activity": {
"ref": "#endorsement",
"settings": {
"operation": "SET"
},
"input": {
"keys": "key1",
"policy": "OutOf(2, 'org1.peer', 'org2.peer', 'org3.peer')"
}
}
This sample will set the state key key1
to require 2
of the 3 organizations to endorse the transaction.
This operation requires to configure the operation name as ADD
, and specify one or more state keys in the input data, as well as a list of organizations to add, e.g.,
"activity": {
"ref": "#endorsement",
"settings": {
"operation": "ADD",
"role": "PEER"
},
"input": {
"keys": "key1",
"organizations": "=array.create(\"org1\", \"org2\")"
}
}
This sample will add org1.PEER
and org2.PEER
to the endorsement policy for state key key1
. Note that it also makes all the original organizations required for endorsement. Even if originally, it requires only some participants to endorse the transaction, after the ADD
operation, all old and new organizations are required to endorse the transaction.
This operation requires to configure the operation name as DELETE
, and specify one or more state keys in the input data, as well as a list of organizations to remove, e.g.,
"activity": {
"ref": "#endorsement",
"settings": {
"operation": "DELETE"
},
"input": {
"keys": "key1",
"organizations": "org1"
}
}
This sample will remove org1
from the endorsement policy for state key key1
. Note that it also makes all the remaining organizations required for endorsement. Even if originally, it requires only some participants to endorse the transaction, after the DELETE
operation, all the remaining organizations are required to endorse the transaction.
This operation requires to specify the name of a private data collection, e.g.,
"activity": {
"ref": "#endorsement",
"settings": {
"operation": "SET"
},
"input": {
"keys": "key1",
"policy": "OutOf(2, 'org1.peer', 'org2.peer', 'org3.peer')",
"privateCollection": "_implicit"
}
}
This sample will set the endorsement policy for a key in th client's implicit private collection, i.e., _implicit_org_<mspid>
. All the above examples apply to private data collections, too.