-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAB-5408 Missing channel update method.
PS 3: No need wait on genesis / handled in seekBlock PS 4: remove hardcoded 200 for retry wait time PS 5: rename upgrade to update, fix some typos. PS 6: Default logging to INFO PS 7: Add configtxlator to docker-compose for testing update. PS 8: Update READM.md for latest date PS 10: Full update channel test. PS 11: Clean up UpdateChannelIT add comments. PS 12: Clean up. Use common method for channel updating. PS 13: Clean up unnecessary logic Change-Id: I1d45faed6bb9e0ceb7ab9bcb0b487bef11f8a90b Signed-off-by: rickr <cr22rc@gmail.com>
- Loading branch information
Showing
20 changed files
with
772 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/main/java/org/hyperledger/fabric/sdk/UpdateChannelConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* | ||
* Copyright 2016,2017 DTCC, Fujitsu Australia Software Technology, IBM - All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.hyperledger.fabric.sdk; | ||
|
||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import org.apache.commons.io.IOUtils; | ||
|
||
/** | ||
* A wrapper for the Hyperledger Channel update configuration | ||
*/ | ||
public class UpdateChannelConfiguration { | ||
private byte[] configBytes = null; | ||
|
||
/** | ||
* The constructor for the UpdateChannelConfiguration wrapper. You will | ||
* need to use the {@link Channel#updateChannelConfiguration(UpdateChannelConfiguration, byte[]...)} method to | ||
* populate the update channel configuration | ||
*/ | ||
public UpdateChannelConfiguration() { | ||
} | ||
|
||
/** | ||
* constructs a UpdateChannelConfiguration object with the actual configuration gotten from the file system | ||
* | ||
* @param configFile The file containing the channel configuration. | ||
* @throws IOException | ||
*/ | ||
public UpdateChannelConfiguration(File configFile) throws IOException { | ||
InputStream is = new FileInputStream(configFile); | ||
configBytes = IOUtils.toByteArray(is); | ||
} | ||
|
||
/** | ||
* constructs a UpdateChannelConfiguration object | ||
* | ||
* @param configAsBytes the byte array containing the serialized channel configuration | ||
*/ | ||
public UpdateChannelConfiguration(byte[] configAsBytes) { | ||
this.configBytes = configAsBytes; | ||
} | ||
|
||
/** | ||
* sets the UpdateChannelConfiguration from a byte array | ||
* | ||
* @param updateChannelConfigurationAsBytes the byte array containing the serialized channel configuration | ||
*/ | ||
public void setUpdateChannelConfiguration(byte[] updateChannelConfigurationAsBytes) { | ||
this.configBytes = updateChannelConfigurationAsBytes; | ||
} | ||
|
||
/** | ||
* @return the channel configuration serialized per protobuf and ready for inclusion into channel configuration | ||
*/ | ||
public byte[] getUpdateChannelConfigurationAsBytes() { | ||
return this.configBytes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.