Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/settlemint/btp-chaincode-lifecycle


https://github.com/settlemint/btp-chaincode-lifecycle

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

# btp-chaincode-lifecycle

Scripts to manage the chaincode lifecycle on the BTP platform

```bash
Usage: ./chaincode.sh [options]
Commands:
peers : Query the peers on which we can install the chaincode
orderers : Query the orderers
nodes : Query all the nodes
channels : Query the channels
installed : Query installed chaincodes
approved : Query approved definition of chaincode
committed : Query commit definition of chaincode
commit-readiness : Checking commit readiness of chaincode
package : Package the chaincode
install : Install the chaincode
approve : Approve the chaincode
commit : Commit the chaincode
init : Initialize the chaincode
query [options] : Query the chaincode.
Options:
--arguments '["arg1", "arg2"]' : The regular arguments to pass to the function.
--channel : Optionally override the channel name.
Example: chaincode.sh query functionName --arguments '["arg1", "arg2"]'
invoke [options] : Invoke a transaction on the chaincode.
Options:
--arguments '["arg1", "arg2"]' : The regular arguments to pass to the function.
--transient '{"key": "value"}' : The transient data to pass the to the function.
--channel : Optionally override the channel name.
Example: chaincode.sh invoke functionName '["arg1", "arg2"]'
create-channel [options] : Create a channel with the given name and options
Options:
--endorsementPolicy : Endorsement policy for the channel (default: MAJORITY)
--batchTimeoutInSeconds : Batch timeout in seconds (default: 2)
--maxMessageCount : Maximum message count (default: 500)
--absoluteMaxMB : Absolute maximum bytes (default: 10)
--preferredMaxMB : Preferred maximum bytes (default: 2)
orderer-join-channel : Orderer joins a channel.
orderer-leave-channel : Orderer leaves a channel.
peer-join-channel : Peer joins a channel.
peer-leave-channel : Peer leaves a channel.
Options:
-h, --help : Display this help message
```

## Prerequisites

You will need following environment variables

```bash
export CC_RUNTIME_LANGUAGE=node # the runtime, right now only node is supported
export CC_SRC_PATH=./dist # the path where the builded chaincode is located, this is the path that will be packeged
export CC_NAME=chaincodeName # the name of the chaincode
export CC_VERSION=1.0 # the version of the chaincode
export CC_SEQUENCE=1 # the sequence number of the chaincode
```

Optionally, you can set the following environment variables

```bash
export CC_INIT_FCN=InitLedger # optional name of initialization function, if not set means no initialization is needed
export CC_INIT_ARGS="[]" # optional arguments for the initialization function
export CC_COLLECTIONS_CONFIG_PATH=./collections_config.json # optional path of the collections config, can be used to configure PDC
export CC_CHANNEL="mychannel" # optional override the channel to work on, by default this will be "default-channel"
```