# Disable invocation parameters
By default, blockchain invocation parameters are instrumented and made available on the transaction view. They provide valuable information for developers to perform problem determination and root cause analysis. However, invocation parameters are recommended to be disabled in production environment. To disable invocation parameters, use disableParam attribute when initalizing the data collector. When disableParam is true, all invocation parameters will not be instrumented or captured at the data collector level, thus no such data will be transmitted to Ravenpod management platform.
Futhermore, you can define which attributes in the parameters as exceptions by using disableParamExceptions attribute. In that case, all invocations parameters are not instrumented EXCEPT the attribute names in the exception list. This is useful for securing sensitive data while choosing the appropriate set of attributes to be made available for problem determination purposes.
Please note disableParam and disableParamExceptions are aviable in both Data Collector for Web App and Data Collector for Chaincode. We recommend they apply the same disableParam & disableParamExceptions settings.
# Data Collector for Web App
const express = require("express");
const app = express();
// Enable Ravenpod
require('@ravenpod/ravenpod-web-dc')(app,
{
accessKey: 'YOUR ACCESS KEY',
secretAccessKey: 'YOUR SECRET ACCESS KEY',
disableParam: true,
disableParamExceptions: ["lot_id", "rec_id", "status"]
}
);
# Data Collector for Chaincode
For Javascript or TypeScript:
'use strict';
require('@ravenpod/ravenpod-cc-dc')(
['vaccine'], // Array of chaincode contract filename to be instrumented
{
accessKey: 'YOUR ACCESS KEY',
secretAccessKey: 'YOUR SECRET ACCESS KEY',
disableParam: true,
disableParamExceptions: ["lot_id", "rec_id", "status"]
}
)
const Vaccine = require('./lib/vaccine');
module.exports.Vaccine = Vaccine;
module.exports.contracts = [ Vaccine ];
For Go:
Please note DisableParam & DisableParamExceptions are in captial letters. For DisableParamExceptioins, its value is an array of string and each element is the path syntax to the data structure. Regarding the path syntax, refer to this documentation (opens new window) for more examples and details.
// Ravenpod
contract := chaincode.SmartContract{}
rpDC := contractapi.NewDataCollector(
"[YOUR ACCESS KEY]",
"[YOUR SECRET ACCESS KEY]",
contractapi.DCOptions{
DisableParam: true,
DisableParamExceptions: []string{"Owner", "Size"},
},
)
contract.RpDataCollector = rpDC
contract.BeforeTransaction = rpDC.RpBeforeHook
contract.AfterTransaction = rpDC.RpAfterHook
assetChaincode, err := contractapi.NewChaincode(&contract)
// Ravenpod