Skip to content

Commit

Permalink
remove (issue cathayddt#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
kth-tw committed Jan 14, 2022
1 parent 5d19fb0 commit c2b4e80
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 233 deletions.
3 changes: 2 additions & 1 deletion cicd/test_script/steps/add-new-peer-org.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ sleep 5

# [orgnew] deploy chaincode
export_env 'peer' ${PEER_ORG_NAME_ORGNEW} ${PEER_ORG_DOMAIN_ORGNEW} 'peer0'
bdk chaincode deploy -C ${CHANNEL_NAME} -l ${CHAINCODE_LABEL} -I -a --orderer ${ORDERER_ORG_URL_ORG0_ORDERER0}
bdk chaincode install -l ${CHAINCODE_LABEL}
bdk chaincode approve -C ${CHANNEL_NAME} -l ${CHAINCODE_LABEL} -I --orderer ${ORDERER_ORG_URL_ORG0_ORDERER0}

# [orgnew] install only
export_env 'peer' ${PEER_ORG_NAME_ORGNEW} ${PEER_ORG_DOMAIN_ORGNEW} 'peer1'
Expand Down
6 changes: 4 additions & 2 deletions cicd/test_script/steps/chaincode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ bdk chaincode package -n fabcar -v 1 -p ./chaincode/fabcar/go

# deploy
export_env 'peer' ${PEER_ORG_NAME_ORG0} ${PEER_ORG_DOMAIN_ORG0} 'peer0'
bdk chaincode deploy -C ${CHANNEL_NAME} -l ${CHAINCODE_LABEL} -I -a --orderer ${ORDERER_ORG_URL_ORG0_ORDERER0}
bdk chaincode install -l ${CHAINCODE_LABEL}
bdk chaincode approve -C ${CHANNEL_NAME} -l ${CHAINCODE_LABEL} -I --orderer ${ORDERER_ORG_URL_ORG0_ORDERER0}
export_env 'peer' ${PEER_ORG_NAME_ORG0} ${PEER_ORG_DOMAIN_ORG0} 'peer1'
bdk chaincode install -l ${CHAINCODE_LABEL}
export_env 'peer' ${PEER_ORG_NAME_ORG0} ${PEER_ORG_DOMAIN_ORG0} 'peer2'
bdk chaincode install -l ${CHAINCODE_LABEL}

export_env 'peer' ${PEER_ORG_NAME_ORG1} ${PEER_ORG_DOMAIN_ORG1} 'peer0'
bdk chaincode deploy -C ${CHANNEL_NAME} -l ${CHAINCODE_LABEL} -I -a --orderer ${ORDERER_ORG_URL_ORG0_ORDERER0}
bdk chaincode install -l ${CHAINCODE_LABEL}
bdk chaincode approve -C ${CHANNEL_NAME} -l ${CHAINCODE_LABEL} -I --orderer ${ORDERER_ORG_URL_ORG0_ORDERER0}

export_env 'peer' ${PEER_ORG_NAME_ORG2} ${PEER_ORG_DOMAIN_ORG2} 'peer0'
bdk chaincode install -l ${CHAINCODE_LABEL}
Expand Down
17 changes: 0 additions & 17 deletions docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,6 @@ Description: 代表環境變數中 BDK_ORG_NAME 的 Peer org 發布 Chaincode
| --orderer | string | 選擇 Orderer 同意 Chaincode | |
| --peer-addresses | array | 需要簽名的 Peer address | |

### `bdk chaincode deploy`

Description: 部署 / 更新 Chaincode

| Options | Type | Description | Required | Default |
| --------------------- | :-----: | -------------------------------------- | :------: | ------- |
| --help | boolean | Show help | |
| --version | boolean | Show version number | |
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | |
| -C, --channel-id | string | 選擇欲部署 Chaincode 在的 Channel 名稱 | |
| -l, --chaincode-label | string | Chaincode package 的標籤名稱 | |
| -a, --approve-only | boolean | 是否只需要做到同意的步驟 | |
| -c, --commit-only | boolean | 是否只需要做到部署的步驟 | |
| -I, --init-required | boolean | Chaincode 是否需要初始化 | |
| --orderer | string | 選擇 Orderer 部署 Chaincode | |
| --peer-addresses | array | 需要簽名的 Peer address | |

### `bdk chaincode install`

Description: 安裝 Chaincode
Expand Down
11 changes: 7 additions & 4 deletions docs/EXAMPLE-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,16 @@ bdk chaincode package -n fabcar -v 1 -p ./chaincode/fabcar/go
# export BDK_HOSTNAME='peer0'

# Install and approve chaincode on peer0 in Org1
bdk chaincode deploy -C test -l fabcar_1 -I -a --orderer orderer0.example.com:7050
bdk chaincode install -l fabcar_1
bdk chaincode approve -C test -l fabcar_1 -I --orderer orderer0.example.com:7050

# export BDK_ORG_NAME='Org2'
# export BDK_ORG_DOMAIN='org2.example.com'
# export BDK_HOSTNAME='peer0'

# Install and approve chaincode on peer0 in Org2
bdk chaincode deploy -C test -l fabcar_1 -I -a --orderer orderer0.example.com:7050
bdk chaincode install -l fabcar_1
bdk chaincode approve -C test -l fabcar_1 -I --orderer orderer0.example.com:7050
```

### Step 3: Install chaincode on peer1 in Org1
Expand All @@ -245,7 +247,7 @@ Deploys the chaincode labelled *fabcar_1*. Parameter `-c` is passed to restrict
# export BDK_ORG_DOMAIN='org1.example.com'
# export BDK_HOSTNAME='peer0'

bdk chaincode deploy -C test -l fabcar_1 -I -c --orderer orderer0.example.com:7050 --peer-addresses peer0.org1.example.com:7051 --peer-addresses peer0.org2.example.com:7151
bdk chaincode commit -C test -l fabcar_1 -I --orderer orderer0.example.com:7050 --peer-addresses peer0.org1.example.com:7051 --peer-addresses peer0.org2.example.com:7151
```

### Step 5: Initial chaincode from Org1
Expand Down Expand Up @@ -513,7 +515,8 @@ Install and approve the chaincode named fabcar_1. Since we are using the blockch
# export BDK_HOSTNAME='peer0'

# Install and approve chaincode on peer0 of Org3
bdk chaincode deploy -C test -l fabcar_1 -I -a --orderer orderer0.example.com:7050
bdk chaincode install -l fabcar_1
bdk chaincode approve -C test -l fabcar_1 -I --orderer orderer0.example.com:7050

# export BDK_ORG_NAME='Org3'
# export BDK_ORG_DOMAIN='org3.example.com'
Expand Down
11 changes: 7 additions & 4 deletions docs/EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,16 @@ bdk chaincode package -n fabcar -v 1 -p ./chaincode/fabcar/go
# export BDK_HOSTNAME='peer0'

# Org1 的 peer0 安裝、同意 Chaincode
bdk chaincode deploy -C test -l fabcar_1 -I -a --orderer orderer0.example.com:7050
bdk chaincode install -l fabcar_1
bdk chaincode approve -C test -l fabcar_1 -I --orderer orderer0.example.com:7050

# export BDK_ORG_NAME='Org2'
# export BDK_ORG_DOMAIN='org2.example.com'
# export BDK_HOSTNAME='peer0'

# Org2 的 peer0 安裝、同意 Chaincode
bdk chaincode deploy -C test -l fabcar_1 -I -a --orderer orderer0.example.com:7050
bdk chaincode install -l fabcar_1
bdk chaincode approve -C test -l fabcar_1 -I --orderer orderer0.example.com:7050
```

### Step 3:Org1 的 peer1 安裝 Chaincode
Expand All @@ -245,7 +247,7 @@ bdk chaincode install -l fabcar_1
# export BDK_ORG_DOMAIN='org1.example.com'
# export BDK_HOSTNAME='peer0'

bdk chaincode deploy -C test -l fabcar_1 -I -c --orderer orderer0.example.com:7050 --peer-addresses peer0.org1.example.com:7051 --peer-addresses peer0.org2.example.com:7151
bdk chaincode commit -C test -l fabcar_1 -I --orderer orderer0.example.com:7050 --peer-addresses peer0.org1.example.com:7051 --peer-addresses peer0.org2.example.com:7151
```

### Step 5:Org1 初始化 Chaincode
Expand Down Expand Up @@ -513,7 +515,8 @@ bdk channel join -n test --orderer orderer0.example.com:7050
# export BDK_HOSTNAME='peer0'

# Org3 的 peer0 安裝、同意 Chaincode
bdk chaincode deploy -C test -l fabcar_1 -I -a --orderer orderer0.example.com:7050
bdk chaincode install -l fabcar_1
bdk chaincode approve -C test -l fabcar_1 -I --orderer orderer0.example.com:7050

# export BDK_ORG_NAME='Org3'
# export BDK_ORG_DOMAIN='org3.example.com'
Expand Down
183 changes: 0 additions & 183 deletions src/command/chaincode/deploy.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/command/chaincode/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const builder = (yargs: Argv<OptType>) => {
}

export const handler = async (argv: Arguments<OptType>) => {
logger.debug('exec chaincode deploy')
logger.debug('exec chaincode package')

const chaincode = new Chaincode(config)

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export {
export { AbstractService, ParserType } from './service/Service.abstract'

export { CaUpType, CaDownType, CaIntermediateType, CaCsrType, CaEnrollCommandTypeEnum, CaEnrollTypeEnum, CaRegisterTypeEnum, CaEnrollType, CaRegisterType, CaBasicType, CaCryptoType, CaSigningType } from './model/type/caService.type'
export { ChaincodePackageType, ChaincodeApproveType, ChaincodeCommitType, ChaincodeDeployType, ChaincodeQueryType, ChaincodeInvokeType, ChaincodeInstallType } from './model/type/chaincode.type'
export { ChaincodePackageType, ChaincodeApproveType, ChaincodeCommitType, ChaincodeQueryType, ChaincodeInvokeType, ChaincodeInstallType } from './model/type/chaincode.type'
export { PolicyTypeEnum, PolicyStyleEnum, ChannelPolicyType, ChannelCreateType, ChannelJoinType, ChannelUpdateAnchorPeerType, ConfigtxlatorEnum, ChannelCreateChannelConfigComputeType, ChannelCreateChannelConfigSignType, ChannelCreateChannelConfigUpdateType, ChannelConfigEnum, ChannelFetchBlockType, ChannelApproveType, ChannelUpdateType, DecodeEnvelopeType, EnvelopeTypeEnum, EnvelopeVerifyEnum as EnvelopeVerifyENum, DecodeEnvelopeReturnType } from './model/type/channel.type'
export { ConfigEnvType, ConfigSetType } from './model/type/config.type'
export { DiscoverPeersType, DiscoverChannelConfigType, DiscoverChaincodeEndorsersType, DiscoverPeersResultType, DiscoverChannelConfigResultType, DiscoverChaincodeEndorsersResultType } from './model/type/discover.type'
Expand Down
20 changes: 0 additions & 20 deletions src/model/type/chaincode.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,6 @@ export interface ChaincodeCommitType {
peerAddresses: string[]
}

/**
* @requires channelId - [string] channel 的名稱
* @requires label - [string] chaincode 的標籤名稱
* @requires approve - [boolean] 是否只做到同意的步驟
* @requires commit - [boolean] 是否只做到發布的步驟
* @requires initRequired - [boolean] 是否需要初始化 chaincode
* @requires orderer - [string] orderer 的 address 和 port
* @requires peerAddresses - [string array] peer address 和 port 的 array
*/
export interface ChaincodeDeployType {
channelId: string
chaincodeName: string
chaincodeVersion: number
approve: boolean
commit: boolean
initRequired: boolean
orderer: string
peerAddresses?: string[]
}

/**
* @requires channelId - [string] channel 的名稱
* @requires chaincodeName - [string] chaincode 的名稱
Expand Down

0 comments on commit c2b4e80

Please sign in to comment.