Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to version3 #497

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Sanket-0510
Copy link
Contributor

I have successfully added the support for version 3, Right now the templates are updated and I am working over updating the test for version 3. Will update the tests in the next commit and it will be ready for merging.

{
"groupName": "group1",
"type": "raft",
"instances": 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add at least 3 raft nodes, and also verify them in logs (we need to be sure all raft nodes are able to support the channel)

@@ -213,20 +213,15 @@ export default class SetupDockerGenerator extends Generator {
}

_copyUtilityScripts(capabilities: Capabilities): void {
this.fs.copyTpl(this.templatePath("fabric-docker.sh"), this.destinationPath("fabric-docker.sh"));
this.fs.copyTpl(this.templatePath(`fabric-docker.sh`), this.destinationPath("fabric-docker.sh"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.fs.copyTpl(this.templatePath(`fabric-docker.sh`), this.destinationPath("fabric-docker.sh"));
this.fs.copyTpl(this.templatePath("fabric-docker.sh"), this.destinationPath("fabric-docker.sh"));

Comment on lines -20 to +24
FABRIC_JAVAENV_VERSION=<%= global.fabricJavaenvVersion %>
FABRIC_NODEENV_VERSION=<%= global.fabricNodeenvVersion %>
RECOMMENDED_NODE_VERSION=<%= global.fabricRecommendedNodeVersion %>


FABRIC_JAVAENV_VERSION=3.0-beta
FABRIC_NODEENV_VERSION=2.5
RECOMMENDED_NODE_VERSION=18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be taken from global.

Comment on lines +49 to +80
<% } else if (global.capabilities.isV3) { -%>
<% channels.forEach((channel) => { -%>
<% channel.orgs.forEach((org, orgNo) => { -%>
<% org.peers.forEach((peer, peerNo) => { -%>
<% if (orgNo == 0 && peerNo == 0) { -%>
printHeadline "Creating '<%= channel.name %>' on <%= org.name %>/<%= peer.name %>" "U1F63B"
<% if (!global.tls) { -%>
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; createChannelAndJoin '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' '<%= channel.ordererHead.address %>:<%= channel.ordererHead.adminPort %>';"
sleep 5
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; fetchChannelAndJoin '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' '<%= channel.ordererHead.fullAddress %>';"
<% } else { -%>
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; createChannelAndJoinTls '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' 'crypto/users/Admin@<%= org.domain %>/tls' 'crypto-orderer/tlsca.<%= channel.ordererHead.domain %>-cert.pem' '<%= channel.ordererHead.address %>:<%= channel.ordererHead.adminPort %>';"
sleep 5
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; fetchChannelAndJoinTls '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' 'crypto/users/Admin@<%= org.domain %>/tls' 'crypto-orderer/tlsca.<%= channel.ordererHead.domain %>-cert.pem' '<%= channel.ordererHead.fullAddress %>';"
<% } %>
<% } else { -%>
printItalics "Joining '<%= channel.name %>' on <%= org.name %>/<%= peer.name %>" "U1F638"
<% if (!global.tls) { -%>
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; fetchChannelAndJoin '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' '<%= channel.ordererHead.fullAddress %>';"
<% } else { -%>
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; fetchChannelAndJoinTls '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' 'crypto/users/Admin@<%= org.domain %>/tls' 'crypto-orderer/tlsca.<%= channel.ordererHead.domain %>-cert.pem' '<%= channel.ordererHead.fullAddress %>';"
<% } -%>
<% } -%>
<% }) -%>
<% }) -%>
<% }) -%>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it misses our changes with multiple orderers

Comment on lines -79 to -86
<% if (global.capabilities.isV2) { -%>
<% if (global.peerDevMode) { -%>
<%- include('commands-generated/chaincode-dev-v2.sh', { chaincode }); -%>
<% } else { -%>
local version="<%= chaincode.version %>"
<%- include('commands-generated/chaincode-install-v2.sh', { chaincode, global }); -%>
<% } -%>
<% } -%>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can decrease identation

Comment on lines 188 to 190
printHeadline "Creating new channel config blocks" "U1F537"
<% channels.forEach((channel) => { -%>
<% channel.orgs.forEach((org) => { -%>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep consistent indentation (increase)

Comment on lines +229 to +231
<% } else { %>
echo ""
<% } %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove any duplicated lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants