How hyperledger-labs/cc-tools works
CC Tools is a Go library for building Hyperledger Fabric chaincode. Its principal workflow accepts a named transaction and arguments, validates them, applies access checks, runs a transaction routine, and returns a response; asset routines manipulate ledger data through the stub wrapper. The graph also preserves the documented dynamic asset-type, event, and custom-transaction capabilities. Edges use README or source-index evidence; several package internals were not sampled, so undocumented links are omitted.
Main entry points: stubWrapper.go Fabric stub wrapper · run.go Transaction dispatch · getArgs.go Argument validation · createAsset.go Asset CRUD
Components 19
Transaction runtime
- Transaction dispatch
transactions/run.go - Argument validation
transactions/getArgs.go - Transaction definitions
transactions/transaction.go - Asset CRUD
transactions/createAsset.go - Asset search
transactions/search.go - Asset history
transactions/readAssetHistory.go - Schema transactions
transactions/updateAssetType.go - Transaction metadata
transactions/getTx.go - Chaincode errors
errors/errors.go
Assets and schema
- Asset model
assets/asset.go - Asset types and properties
assets/assetType.go - Property datatypes
assets/dataType.go - Asset ledger operations
assets/put.go
Ledger access
- Fabric stub wrapper
stubwrapper/stubWrapper.go
Event handling
- Event definitions
events/event.go - Event transactions
transactions/executeEvent.go
Access control
- Caller authorization
accesscontrol/allowCaller.go
Other components
- Chaincode caller
- Fabric ledger
Connections 22
- Chaincode caller → Transaction dispatch: invokes
README.md - Transaction dispatch → Argument validation: validates arguments
transactions/run.go - Transaction dispatch → Caller authorization: checks caller
transactions/run.go - Transaction dispatch → Transaction definitions: uses definitions
transactions/run.go - Transaction dispatch → Asset CRUD: runs routine
transactions/run.go - Asset CRUD → Asset ledger operations: manages assets
transactions/createAsset.go - Asset CRUD → Fabric stub wrapper: accesses ledger
transactions/createAsset.go - Asset search → Asset ledger operations: queries assets
transactions/search.go - Asset search → Fabric stub wrapper: queries ledger
transactions/search.go - Asset history → Asset model: uses asset key
transactions/readAssetHistory.go - Asset history → Fabric stub wrapper: reads history
transactions/readAssetHistory.go - Schema transactions → Asset types and properties: updates definitions
transactions/updateAssetType.go - Schema transactions → Fabric stub wrapper: queries assets
transactions/updateAssetType.go - Transaction metadata → Transaction definitions: lists definitions
transactions/getTx.go - Argument validation → Asset model: builds keys and assets
transactions/getArgs.go - Argument validation → Property datatypes: parses values
transactions/getArgs.go - Caller authorization → Fabric ledger: reads identity
accesscontrol/allowCaller.go - Fabric stub wrapper → Fabric ledger: reads and writes
stubwrapper/stubWrapper.go - Fabric stub wrapper → Chaincode errors: wraps failures
stubwrapper/stubWrapper.go - Event definitions → Fabric stub wrapper: sets event
events/event.go - Event transactions → Event definitions: executes events
transactions/executeEvent.go - Event transactions → Fabric stub wrapper: uses wrapper
transactions/executeEvent.go