我启动了Hyperledger Composer的业务网络,但是在链码容器日志中看到错误:
Error: Object with ID 'Asset:org.hyperledger.composer.system.AssetRegistry' in collection with ID '$sysregistries' does not exist
2018-09-20T10:24:55.295Z [5570f8fe] ERROR :NodeDataCollection :get() Error: Object with ID 'Asset:org.hyperledger.composer.system.ParticipantRegistry' in collection with ID '$sysregistries' does not exist
2018-09-20T10:24:55.312Z [5570f8fe] ERROR :NodeDataCollection :get() Error: Object with ID 'Asset:org.hyperledger.composer.system.TransactionRegistry' in collection with ID '$sysregistries' does not exist
...
model.cto
namespace data.ru
transaction Transfer {
o Double amount
o String from
o String to
o String coin
o String description
}
logic.js
/**
* Track the token of a token from Project budget to workerWallet
* @param {data.ru.Transfer} tx - the trade to be processed
* @transaction
*/
async function Transfer(tx) {
let foo = 'lol'
}
permissions.acl
rule NetworkAdminUser {
description: "Grant business network administrators full access to user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}
rule GrantSysAccess {
description: "Grant access to all Participants to target system registries"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
发生了什么事?
版本: 我尝试了Fabric v1.1 + Composer v0.19.4,Fabric v1.2 + Composer v0.20.0,Fabric v1.2 + Composer v0.20.1
REST服务器未启动,并且composer network ping
引发错误。
UPD2: CouchDB容器具有以下状态读取错误:
****************************************************
WARNING: CouchDB is running in Admin Party mode.
This will allow anyone with access to the
CouchDB port to access your database. In
Docker's default configuration, this is
effectively any other container on the same
system.
Use "-e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password"
to set it in "docker run".
****************************************************
[os_mon] cpu supervisor port (cpu_sup): Error writing to Erlang
[info] 2018-09-25T18:05:05.018712Z nonode@nohost <0.7.0> -------- Application couch_log started on node nonode@nohost
[info] 2018-09-25T18:05:05.048838Z nonode@nohost <0.7.0> -------- Application folsom started on node nonode@nohost
[info] 2018-09-25T18:05:05.272179Z nonode@nohost <0.7.0> -------- Application couch_stats started on node nonode@nohost
[info] 2018-09-25T18:05:05.276028Z nonode@nohost <0.7.0> -------- Application khash started on node nonode@nohost
[info] 2018-09-25T18:05:05.312633Z nonode@nohost <0.7.0> -------- Application couch_event started on node nonode@nohost
[info] 2018-09-25T18:05:05.359547Z nonode@nohost <0.7.0> -------- Application ibrowse started on node nonode@nohost
[info] 2018-09-25T18:05:05.394067Z nonode@nohost <0.7.0> -------- Application ioq started on node nonode@nohost
[info] 2018-09-25T18:05:05.394480Z nonode@nohost <0.7.0> -------- Application mochiweb started on node nonode@nohost
[info] 2018-09-25T18:05:05.468773Z nonode@nohost <0.195.0> -------- Apache CouchDB 2.1.1 is starting.
2018-09-25T18:05:05.473169200Z
[info] 2018-09-25T18:05:05.468889Z nonode@nohost <0.196.0> -------- Starting couch_sup
[notice] 2018-09-25T18:05:05.994312Z nonode@nohost <0.82.0> -------- config: [couchdb] uuid set to 06fcb3139f2556dea3ecb459701ef841 for reason nil
[info] 2018-09-25T18:05:06.196057Z nonode@nohost <0.201.0> -------- open_result error {not_found,no_db_file} for _users
[info] 2018-09-25T18:05:06.666443Z nonode@nohost <0.195.0> -------- Apache CouchDB has started. Time to relax.
2018-09-25T18:05:06.666743100Z
[info] 2018-09-25T18:05:06.666589Z nonode@nohost <0.195.0> -------- Apache CouchDB has started on http://127.0.0.1:5986/
[info] 2018-09-25T18:05:06.667295Z nonode@nohost <0.7.0> -------- Application couch started on node nonode@nohost
[info] 2018-09-25T18:05:06.667862Z nonode@nohost <0.7.0> -------- Application ets_lru started on node nonode@nohost
[info] 2018-09-25T18:05:06.787977Z nonode@nohost <0.7.0> -------- Application rexi started on node nonode@nohost
[info] 2018-09-25T18:05:06.924139Z nonode@nohost <0.201.0> -------- open_result error {not_found,no_db_file} for _nodes
[warning] 2018-09-25T18:05:06.924214Z nonode@nohost <0.269.0> -------- creating missing database: _nodes
[info] 2018-09-25T18:05:07.123007Z nonode@nohost <0.201.0> -------- open_result error {not_found,no_db_file} for _dbs
[warning] 2018-09-25T18:05:07.123047Z nonode@nohost <0.282.0> -------- creating missing database: _dbs
[warning] 2018-09-25T18:05:07.123103Z nonode@nohost <0.281.0> -------- creating missing database: _dbs
[info] 2018-09-25T18:05:07.197369Z nonode@nohost <0.7.0> -------- Application mem3 started on node nonode@nohost
[info] 2018-09-25T18:05:07.198244Z nonode@nohost <0.7.0> -------- Application fabric started on node nonode@nohost
[info] 2018-09-25T18:05:07.341215Z nonode@nohost <0.7.0> -------- Application chttpd started on node nonode@nohost
[notice] 2018-09-25T18:05:07.437433Z nonode@nohost <0.318.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:403) <= mem3_shards:load_shards_from_disk/1(line:378) <= mem3_shards:load_shards_from_disk/2(line:407) <= mem3_shards:for_docid/3(line:91) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2018-09-25T18:05:07.438260Z nonode@nohost emulator -------- Error in process <0.319.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,403}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,378}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,407}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,91}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
2018-09-25T18:05:07.438932100Z
[info] 2018-09-25T18:05:07.463182Z nonode@nohost <0.7.0> -------- Application couch_index started on node nonode@nohost
[info] 2018-09-25T18:05:07.463880Z nonode@nohost <0.7.0> -------- Application couch_mrview started on node nonode@nohost
[info] 2018-09-25T18:05:07.465702Z nonode@nohost <0.7.0> -------- Application couch_plugins started on node nonode@nohost
[notice] 2018-09-25T18:05:07.727972Z nonode@nohost <0.82.0> -------- config: [features] scheduler set to true for reason nil
[info] 2018-09-25T18:05:07.878473Z nonode@nohost <0.201.0> -------- open_result error {not_found,no_db_file} for _replicator
[notice] 2018-09-25T18:05:07.895340Z nonode@nohost <0.335.0> -------- creating replicator ddoc <<"_replicator">>
[info] 2018-09-25T18:05:07.946918Z nonode@nohost <0.7.0> -------- Application couch_replicator started on node nonode@nohost
[info] 2018-09-25T18:05:08.054017Z nonode@nohost <0.7.0> -------- Application couch_peruser started on node nonode@nohost
[info] 2018-09-25T18:05:08.158935Z nonode@nohost <0.7.0> -------- Application ddoc_cache started on node nonode@nohost
[info] 2018-09-25T18:05:08.277989Z nonode@nohost <0.7.0> -------- Application global_changes started on node nonode@nohost
[info] 2018-09-25T18:05:08.278081Z nonode@nohost <0.7.0> -------- Application jiffy started on node nonode@nohost
[info] 2018-09-25T18:05:08.332579Z nonode@nohost <0.7.0> -------- Application mango started on node nonode@nohost
[info] 2018-09-25T18:05:08.385098Z nonode@nohost <0.7.0> -------- Application setup started on node nonode@nohost
[info] 2018-09-25T18:05:08.385467Z nonode@nohost <0.7.0> -------- Application snappy started on node nonode@nohost
[notice] 2018-09-25T18:05:11.575347Z nonode@nohost <0.408.0> 6e22d58556 prod.couchdb0:5984 172.19.0.18 undefined GET / 200 ok 360
[notice] 2018-09-25T18:05:11.595380Z nonode@nohost <0.408.0> 5c382d8031 prod.couchdb0:5984 172.19.0.18 undefined GET /_users 404 ok 18
[notice] 2018-09-25T18:05:11.861220Z nonode@nohost <0.408.0> 1442f9e149 prod.couchdb0:5984 172.19.0.18 undefined PUT /_users 201 ok 262
[notice] 2018-09-25T18:05:11.878138Z nonode@nohost <0.408.0> 95214ad958 prod.couchdb0:5984 172.19.0.18 undefined GET /_replicator 404 ok 10
[notice] 2018-09-25T18:05:11.972074Z nonode@nohost <0.408.0> 166c792292 prod.couchdb0:5984 172.19.0.18 undefined PUT /_replicator 201 ok 93
[notice] 2018-09-25T18:05:11.977357Z nonode@nohost <0.408.0> b382ab14e2 prod.couchdb0:5984 172.19.0.18 undefined GET /_global_changes 404 ok 0
[notice] 2018-09-25T18:05:12.069778Z nonode@nohost <0.408.0> d418e5618a prod.couchdb0:5984 172.19.0.18 undefined PUT /_global_changes 201 ok 91
[notice] 2018-09-25T18:05:12.602754Z nonode@nohost <0.339.0> -------- couch_replicator_clustering : cluster stable
[notice] 2018-09-25T18:05:12.654492Z nonode@nohost <0.355.0> -------- Started replicator db changes listener <0.621.0>
[notice] 2018-09-25T18:05:12.812625Z nonode@nohost <0.621.0> -------- creating replicator ddoc <<"shards/80000000-9fffffff/_replicator.1537898711">>
[notice] 2018-09-25T18:05:36.789649Z nonode@nohost <0.259.0> -------- rexi_server : cluster stable
[notice] 2018-09-25T18:05:36.789816Z nonode@nohost <0.262.0> -------- rexi_buffer : cluster stable
[info] 2018-09-25T18:05:58.633694Z nonode@nohost <0.47.0> -------- alarm_handler: {set,{system_memory_high_watermark,[]}}
[notice] 2018-09-25T18:06:06.666377Z nonode@nohost <0.408.0> 95867339bc prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_ 404 ok 1
[notice] 2018-09-25T18:06:06.686838Z nonode@nohost <0.408.0> bea30c73cc prod.couchdb0:5984 172.19.0.18 undefined PUT /innochannel_ 201 ok 19
[notice] 2018-09-25T18:06:06.709583Z nonode@nohost <0.408.0> 71afb691d1 prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_ 200 ok 6
[notice] 2018-09-25T18:06:06.724057Z nonode@nohost <0.408.0> 872d7415cf prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_all_docs?include_docs=true 200 ok 11
[notice] 2018-09-25T18:06:06.756062Z nonode@nohost <0.408.0> 6056d80f3e prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_bulk_docs 201 ok 24
[notice] 2018-09-25T18:06:06.762868Z nonode@nohost <0.408.0> 400e31e2d1 prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_ensure_full_commit 201 ok 0
[notice] 2018-09-25T18:06:06.768360Z nonode@nohost <0.408.0> cfee83e5b5 prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_/statedb_savepoint?attachments=true 404 ok 2
[notice] 2018-09-25T18:06:06.780689Z nonode@nohost <0.408.0> a1b02dc611 prod.couchdb0:5984 172.19.0.18 undefined PUT /innochannel_/statedb_savepoint 201 ok 2
[notice] 2018-09-25T18:06:06.803853Z nonode@nohost <0.408.0> 9edfa0853e prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_/resourcesconfigtx.CHANNEL_CONFIG_KEY?attachments=true 200 ok 18
[notice] 2018-09-25T18:06:06.893056Z nonode@nohost <0.1497.0> 7db3f676ba prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_/_index/ 200 ok 124
[notice] 2018-09-25T18:06:48.139490Z nonode@nohost <0.1497.0> 4da3570f28 prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_all_docs?include_docs=true 200 ok 3
[notice] 2018-09-25T18:06:48.165927Z nonode@nohost <0.1497.0> a72ed4fa85 prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_bulk_docs 201 ok 5
[notice] 2018-09-25T18:06:48.207188Z nonode@nohost <0.408.0> 73d435932b prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_/_index/ 200 ok 1
[notice] 2018-09-25T18:06:48.222438Z nonode@nohost <0.1497.0> 1f62357270 prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_ensure_full_commit 201 ok 35
[notice] 2018-09-25T18:06:48.232136Z nonode@nohost <0.1497.0> f11bc6bcbc prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_/statedb_savepoint?attachments=true 200 ok 8
[notice] 2018-09-25T18:06:48.253684Z nonode@nohost <0.1497.0> 49ddf1aa8f prod.couchdb0:5984 172.19.0.18 undefined PUT /innochannel_/statedb_savepoint 201 ok 19
[notice] 2018-09-25T18:06:58.500154Z nonode@nohost <0.1497.0> 2b3ee9a234 prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_all_docs?include_docs=true 200 ok 2
[notice] 2018-09-25T18:06:58.510611Z nonode@nohost <0.1497.0> 95e5445017 prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_bulk_docs 201 ok 3
[notice] 2018-09-25T18:06:58.513963Z nonode@nohost <0.1497.0> 6495673a8b prod.couchdb0:5984 172.19.0.18 undefined POST /innochannel_/_ensure_full_commit 201 ok 0
[notice] 2018-09-25T18:06:58.517361Z nonode@nohost <0.1497.0> 5a1d2cf955 prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_/_index/ 200 ok 1
[notice] 2018-09-25T18:06:58.519305Z nonode@nohost <0.408.0> ebbe7dcb7f prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_/statedb_savepoint?attachments=true 200 ok 2
[notice] 2018-09-25T18:06:58.521894Z nonode@nohost <0.408.0> 38f093125c prod.couchdb0:5984 172.19.0.18 undefined PUT /innochannel_/statedb_savepoint 201 ok 1
[notice] 2018-09-25T18:07:41.238723Z nonode@nohost <0.408.0> 10fa822614 prod.couchdb0:5984 172.19.0.18 undefined GET /innochannel_lscc 404 ok 1
[notice] 2018-09-25T18:07:41.304338Z nonode@nohost <0.408.0> c3b163c2c4 prod.couchdb0:5...
答案 0 :(得分:1)
在您的Permissions.acl中添加以下内容
Allow network admins bound to NetworkAdmin participants have access to target resources
rule NetworkAdminUser {
description: "Grant business network administrators full access to user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}
以下访问控制规则将使所有参与者都可以访问业务网络中的所有操作和命令,包括网络访问和业务网络访问。
rule GrantSysAccess {
description: "Grant access to all Participants to target system registries"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
答案 1 :(得分:0)
@david_k是正确的,您不能在chaincode容器中注意此类错误。 REST服务器未启动,因为有必要替换REST使用的connection.json中的 url 键的值(在REST卡中)。