按照https://fabric-composer.github.io/start/getting-started-rest-api.html的说明,测试生成的 api
curl -X GET --header "Accept: application/json" "http://0.0.0.0:3000/api/net.biz.digitalPropertyNetwork.LandTitle"
生成以下错误
{
"error": {
"statusCode": 500,
"name": "Error",
"message": "No registered namespace for type net_biz_digitalPropertyNetwork_LandTitle",
"stack": "Error: No registered namespace for type net_biz_digitalPropertyNetwork_LandTitle\n at ModelManager.getType (/Users/matt/Documents/workspaces/blockchain/src/github.com/fabric-composer/sample-applications/node_modules/composer-common/lib/modelmanager.js:265:23)\n at ensureConnected.then (/Users/matt/Documents/workspaces/blockchain/src/github.com/fabric-composer/sample-applications/node_modules/composer-loopback-connector/lib/businessnetworkconnector.js:198:53)\n at process._tickDomainCallback (internal/process/next_tick.js:129:7)"
}
}
我看到引导脚本将点换成下划线,这可能在其他地方也需要吗?
// this is required because LoopBack doesn't like dots in model schema names
modelSchema.name = modelSchema.plural.replace(/\./g, '_');
供参考,这是我的环回包的节点依赖项
"dependencies": {
"composer-loopback-connector": "^0.4.0",
"compression": "^1.0.3",
"cors": "^2.5.2",
"helmet": "^1.3.0",
"loopback": "^2.22.0",
"loopback-boot": "^2.6.5",
"loopback-component-explorer": "^2.4.0",
"loopback-connector-composer": "^0.4.1",
"loopback-datasource-juggler": "^2.39.0",
"serve-favicon": "^2.0.1",
"strong-error-handler": "^1.0.1"
}