Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gochain-test-chaincode

A minimal Hyperledger Fabric external (chaincode-as-a-service, CCaaS) server, used as a test fixture for deploying a chaincode from a pre-built image.

  • main.go — a trivial chaincode server exposing three functions: ping (liveness), put (write a key) and get (read it back). It reads CHAINCODE_ID and CHAINCODE_SERVER_ADDRESS from the environment, as the CCaaS runtime sets them, and listens for a chaincode server connection on that address. TLS is disabled.
  • Dockerfile — builds the server into a small image.
  • build.sh — builds that image locally.

This is a standalone Go module: it is compiled inside a container image and is not intended to be linked into another Go build.

Build

Requires docker with buildx.

./build.sh

Override the image name or tag if needed:

IMAGE=goledger/gochain-test-chaincode TAG=1.0.0 ./build.sh

The script builds into the local Docker image store and does not push. Tag and push the result yourself if you want it in a registry.

Run

The CCaaS runtime starts the container with CHAINCODE_ID and CHAINCODE_SERVER_ADDRESS set and expects a chaincode server listening on that address:

docker run --rm \
  -e CHAINCODE_ID=mycc:1.0 \
  -e CHAINCODE_SERVER_ADDRESS=0.0.0.0:9999 \
  -p 9999:9999 \
  goledger/gochain-test-chaincode:1.0.0

About

Minimal Hyperledger Fabric chaincode-as-a-service (CCaaS) test image

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages