mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Merge branch 'release-1.4' into release-1.4
This commit is contained in:
commit
99657d19c7
15 changed files with 190 additions and 9 deletions
12
SECURITY.md
Normal file
12
SECURITY.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Hyperledger Security Policy
|
||||
|
||||
## Reporting a Security Bug
|
||||
|
||||
If you think you have discovered a security issue in any of the Hyperledger projects, we'd love to hear from you. We will take all security bugs seriously and if confirmed upon investigation we will patch it within a reasonable amount of time and release a public security bulletin discussing the impact and credit the discoverer.
|
||||
|
||||
There are two ways to report a security bug. The easiest is to email a description of the flaw and any related information (e.g. reproduction steps, version) to [security at hyperledger dot org](mailto:security@hyperledger.org).
|
||||
|
||||
The other way is to file a confidential security bug in our [JIRA bug tracking system](https://jira.hyperledger.org). Be sure to set the “Security Level” to “Security issue”.
|
||||
|
||||
The process by which the Hyperledger Security Team handles security bugs is documented further in our [Defect Response page](https://wiki.hyperledger.org/display/HYP/Defect+Response) on our [wiki](https://wiki.hyperledger.org).
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ group 'org.hyperledger.fabric.samples'
|
|||
version '1.0-SNAPSHOT'
|
||||
|
||||
dependencies {
|
||||
implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.0.0-SNAPSHOT'
|
||||
implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:1.4.3'
|
||||
implementation 'com.owlike:genson:1.5'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
|
||||
testImplementation 'org.assertj:assertj-core:3.11.1'
|
||||
|
|
|
|||
51
ci/azure-pipelines.yml
Normal file
51
ci/azure-pipelines.yml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
trigger:
|
||||
- master
|
||||
- release-1.4
|
||||
|
||||
jobs:
|
||||
- job: fabcar_go
|
||||
displayName: FabCar (Go)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-go.yml
|
||||
- job: fabcar_java
|
||||
displayName: FabCar (Java)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-java.yml
|
||||
- job: fabcar_javascript
|
||||
displayName: FabCar (JavaScript)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-javascript.yml
|
||||
- job: fabcar_typescript
|
||||
displayName: FabCar (TypeScript)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-typescript.yml
|
||||
|
||||
|
||||
8
ci/fabcar-go.yml
Normal file
8
ci/fabcar-go.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh go
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
14
ci/fabcar-java.yml
Normal file
14
ci/fabcar-java.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh java
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- mvn dependency:go-offline
|
||||
workingDirectory: fabcar/java
|
||||
displayName: Install FabCar application dependencies
|
||||
- script: mvn test
|
||||
workingDirectory: fabcar/java
|
||||
displayName: Run FabCar application
|
||||
19
ci/fabcar-javascript.yml
Normal file
19
ci/fabcar-javascript.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh javascript
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- npm install
|
||||
workingDirectory: fabcar/javascript
|
||||
displayName: Install FabCar application dependencies
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollAdmin
|
||||
node registerUser
|
||||
node invoke
|
||||
node query
|
||||
workingDirectory: fabcar/javascript
|
||||
displayName: Run FabCar application
|
||||
22
ci/fabcar-typescript.yml
Normal file
22
ci/fabcar-typescript.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh typescript
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- npm install
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Install FabCar application dependencies
|
||||
- script: npm run build
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Build FabCar application
|
||||
- script: |
|
||||
set -ex
|
||||
node dist/enrollAdmin
|
||||
node dist/registerUser
|
||||
node dist/invoke
|
||||
node dist/query
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Run FabCar application
|
||||
7
ci/install-deps.yml
Normal file
7
ci/install-deps.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry"
|
||||
displayName: Install retry CLI
|
||||
34
ci/install-fabric.yml
Normal file
34
ci/install-fabric.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set -ex
|
||||
mvn dependency:get -DremoteRepositories=https://nexus.hyperledger.org/content/repositories/snapshots -Dartifact=org.hyperledger.fabric:hyperledger-fabric-1.4.4-stable:linux-amd64.1.4.4-stable-SNAPSHOT:tar.gz
|
||||
mvn dependency:copy -Dartifact=org.hyperledger.fabric:hyperledger-fabric-1.4.4-stable:linux-amd64.1.4.4-stable-SNAPSHOT:tar.gz -DoutputDirectory=/tmp
|
||||
cd /usr/local
|
||||
sudo tar xzvf /tmp/hyperledger-fabric-1.4.4-stable-linux-amd64.1.4.4-stable-SNAPSHOT.tar.gz
|
||||
displayName: Download Fabric CLI
|
||||
- script: |
|
||||
set -ex
|
||||
mvn dependency:get -DremoteRepositories=https://nexus.hyperledger.org/content/repositories/snapshots -Dartifact=org.hyperledger.fabric-ca:hyperledger-fabric-ca-1.4.4-stable:linux-amd64.1.4.4-stable-SNAPSHOT:tar.gz
|
||||
mvn dependency:copy -Dartifact=org.hyperledger.fabric-ca:hyperledger-fabric-ca-1.4.4-stable:linux-amd64.1.4.4-stable-SNAPSHOT:tar.gz -DoutputDirectory=/tmp
|
||||
cd /usr/local
|
||||
sudo tar xzvf /tmp/hyperledger-fabric-ca-1.4.4-stable-linux-amd64.1.4.4-stable-SNAPSHOT.tar.gz
|
||||
displayName: Download Fabric CA CLI
|
||||
- script: |
|
||||
set -ex
|
||||
for i in ca ccenv javaenv peer orderer tools; do
|
||||
docker pull nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-1.4.4-stable
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-1.4.4-stable hyperledger/fabric-$i:amd64-1.4.4-stable
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-1.4.4-stable hyperledger/fabric-$i:amd64-1.4.4
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-1.4.4-stable hyperledger/fabric-$i:1.4.4
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-1.4.4-stable hyperledger/fabric-$i:latest
|
||||
done
|
||||
for i in couchdb; do
|
||||
docker pull nexus3.hyperledger.org:10001/hyperledger/fabric-$i:0.4.15
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:0.4.15 hyperledger/fabric-$i:0.4.15
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:0.4.15 hyperledger/fabric-$i:latest
|
||||
done
|
||||
displayName: Pull Fabric Docker images
|
||||
4
fabcar/java/.gitignore
vendored
4
fabcar/java/.gitignore
vendored
|
|
@ -2,4 +2,6 @@
|
|||
/target/
|
||||
.settings/
|
||||
.classpath
|
||||
.project
|
||||
.project
|
||||
wallet
|
||||
!wallet/.gitkeep
|
||||
|
|
@ -19,16 +19,16 @@
|
|||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>hyperledger</id>
|
||||
<name>Hyperledger Nexus</name>
|
||||
<url>https://nexus.hyperledger.org/content/repositories/snapshots</url>
|
||||
<id>oss-sonatype</id>
|
||||
<name>OSS Sonatype</name>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hyperledger.fabric-gateway-java</groupId>
|
||||
<groupId>org.hyperledger.fabric</groupId>
|
||||
<artifactId>fabric-gateway-java</artifactId>
|
||||
<version>1.4.0-SNAPSHOT</version>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ import org.hyperledger.fabric.gateway.Wallet;
|
|||
|
||||
public class ClientApp {
|
||||
|
||||
static {
|
||||
System.setProperty("org.hyperledger.fabric.sdk.service_discovery.as_localhost", "true");
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Load a file system based wallet for managing identities.
|
||||
Path walletPath = Paths.get("wallet");
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ import org.hyperledger.fabric_ca.sdk.HFCAClient;
|
|||
|
||||
public class EnrollAdmin {
|
||||
|
||||
static {
|
||||
System.setProperty("org.hyperledger.fabric.sdk.service_discovery.as_localhost", "true");
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// Create a CA client for interacting with the CA.
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ import org.hyperledger.fabric_ca.sdk.RegistrationRequest;
|
|||
|
||||
public class RegisterUser {
|
||||
|
||||
static {
|
||||
System.setProperty("org.hyperledger.fabric.sdk.service_discovery.as_localhost", "true");
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// Create a CA client for interacting with the CA.
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ function askProceed() {
|
|||
# Obtain CONTAINER_IDS and remove them
|
||||
# TODO Might want to make this optional - could clear other containers
|
||||
function clearContainers() {
|
||||
CONTAINER_IDS=$(docker ps -a | awk '($2 ~ /dev-peer.*.mycc.*/) {print $1}')
|
||||
CONTAINER_IDS=$(docker ps -a | awk '($2 ~ /dev-peer.*/) {print $1}')
|
||||
if [ -z "$CONTAINER_IDS" -o "$CONTAINER_IDS" == " " ]; then
|
||||
echo "---- No containers available for deletion ----"
|
||||
else
|
||||
|
|
@ -104,7 +104,7 @@ function clearContainers() {
|
|||
# specifically the following images are often left behind:
|
||||
# TODO list generated image naming patterns
|
||||
function removeUnwantedImages() {
|
||||
DOCKER_IMAGE_IDS=$(docker images | awk '($1 ~ /dev-peer.*.mycc.*/) {print $3}')
|
||||
DOCKER_IMAGE_IDS=$(docker images | awk '($1 ~ /dev-peer.*/) {print $3}')
|
||||
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" == " " ]; then
|
||||
echo "---- No images available for deletion ----"
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue