Skip to content

Commit 9a4172e

Browse files
author
Jason Yellick
committed
[FAB-5687] Stub out configtxgen rscc_seed_data
There needs to be some initial values for the rscc_seed_data as output by configtxgen. This CR simply stubs in some example values (to be updated with the real values later) as an example for how this can be accomplished. Change-Id: Ia7be67601874cd0137a41070bf4b748652742155 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
1 parent 91155fb commit 9a4172e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

common/config/channel/template.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ package config
99
import (
1010
"fmt"
1111

12+
"github.com/hyperledger/fabric/common/cauthdsl"
1213
configmsp "github.com/hyperledger/fabric/common/config/channel/msp"
1314
"github.com/hyperledger/fabric/common/configtx"
1415
"github.com/hyperledger/fabric/common/policies"
1516
"github.com/hyperledger/fabric/common/util"
1617
"github.com/hyperledger/fabric/msp"
1718
cb "github.com/hyperledger/fabric/protos/common"
19+
pb "github.com/hyperledger/fabric/protos/peer"
1820
"github.com/hyperledger/fabric/protos/utils"
1921
)
2022

@@ -63,6 +65,38 @@ func (cct *channelCreationTemplate) Envelope(channelID string) (*cb.ConfigUpdate
6365
ChannelId: channelID,
6466
ReadSet: rSet,
6567
WriteSet: wSet,
68+
IsolatedData: map[string][]byte{
69+
pb.RSCCSeedDataKey: utils.MarshalOrPanic(&cb.Config{
70+
Type: int32(cb.ConfigType_RESOURCE),
71+
ChannelGroup: &cb.ConfigGroup{
72+
// All of the default seed data values would inside this ConfigGroup
73+
Values: map[string]*cb.ConfigValue{
74+
"QSCC.Example1": &cb.ConfigValue{
75+
Value: utils.MarshalOrPanic(&pb.Resource{
76+
PolicyRef: policies.ChannelApplicationAdmins,
77+
}),
78+
ModPolicy: policies.ChannelApplicationAdmins,
79+
},
80+
"QSCC.Example2": &cb.ConfigValue{
81+
Value: utils.MarshalOrPanic(&pb.Resource{
82+
PolicyRef: "Example",
83+
}),
84+
ModPolicy: policies.ChannelApplicationAdmins,
85+
},
86+
},
87+
Policies: map[string]*cb.ConfigPolicy{
88+
"Example": &cb.ConfigPolicy{
89+
Policy: &cb.Policy{
90+
Type: int32(cb.Policy_SIGNATURE),
91+
Value: utils.MarshalOrPanic(cauthdsl.AcceptAllPolicy),
92+
},
93+
ModPolicy: "Example",
94+
},
95+
},
96+
ModPolicy: policies.ChannelApplicationAdmins,
97+
},
98+
}),
99+
},
66100
}),
67101
}, nil
68102
}

0 commit comments

Comments
 (0)