jjzjj

go - 在启用安全和隐私的情况下开始对等时出错

coder 2024-07-08 原文

当我尝试使用

启动对等体时
peer node start

出现以下错误

hyperledger@linux-box:/opt/gopath/src/github.com/hyperledger/fabric$ peer node start
20:42:02.999 [crypto] main -> INFO 001 Log level recognized 'info', set to INFO
20:42:03.017 [main] serve -> INFO 002 Security enabled status: true
20:42:03.017 [main] serve -> INFO 004 Privacy enabled status: true
20:42:03.017 [crypto] func1 -> INFO 005 Registering validator [vp] with name [vp]...
20:42:03.017 [eventhub_producer] start -> INFO 003 event processor started
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x10 pc=0x8ad221]

goroutine 1 [running]:
panic(0xd43fe0, 0xc82000e120)
    /opt/go/src/runtime/panic.go:481 +0x3e6
github.com/hyperledger/fabric/core/crypto/utils.PEMtoPrivateKey(0x15409e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/crypto/utils/keys.go:117 +0x91
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).retrieveEnrollmentData(0xc820226630, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_eca.go:120 +0xe55
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).registerCryptoEngine(0xc820226630, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_crypto.go:49 +0x5d6
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).register(0xc820226630, 0x2, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, ...)
    /opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_impl.go:114 +0x5b8
github.com/hyperledger/fabric/core/crypto.(*peerImpl).register(0xc820242840, 0x2, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, ...)
    /opt/gopath/src/github.com/hyperledger/fabric/core/crypto/peer_impl.go:177 +0x20a
github.com/hyperledger/fabric/core/crypto.(*validatorImpl).register(0xc8201fd600, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, ...)
    /opt/gopath/src/github.com/hyperledger/fabric/core/crypto/validator_impl.go:147 +0x20a
github.com/hyperledger/fabric/core/crypto.RegisterValidator(0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, ...)
    /opt/gopath/src/github.com/hyperledger/fabric/core/crypto/validator.go:55 +0x55d
main.getSecHelper.func1()
    /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:360 +0x200
sync.(*Once).Do(0x1540ad8, 0xc8201fd768)
    /opt/go/src/sync/once.go:44 +0xe4
main.getSecHelper(0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:380 +0x7d
main.serve(0x15409e0, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:446 +0xc23
main.glob.func3(0x1503160, 0x15409e0, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:95 +0x41
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0x1503160, 0x15409e0, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:497 +0x62c
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(0x1502de0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:584 +0x46a
main.main()
    /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:314 +0x18d9

我的 core.yaml 包含默认内容,启用了安全和隐私。

这是一个错误吗?

最佳答案

好吧,我仍然认为我们 panic 的事实是一个错误,但我的猜测是您尚未构建和/或启动启用安全性时所需的成员(member)服务:https://github.com/hyperledger/fabric/blob/master/docs/API/SandboxSetup.md#security-setup-optional

编辑:我最初在上面的堆栈跟踪中遗漏了一些东西。看起来你正在运行一个非常旧版本的结构代码。例如 github.com/hyperledger/fabric/core/crypto/utils/keys.go 不再在当前代码中。我检查了你的 fork ,看来你还差得很远。不确定您是否正在构建您的分支,但看起来您肯定有旧代码并且需要拉下上游更改

关于go - 在启用安全和隐私的情况下开始对等时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37765837/

有关go - 在启用安全和隐私的情况下开始对等时出错的更多相关文章

  1. ruby - ECONNRESET (Whois::ConnectionError) - 尝试在 Ruby 中查询 Whois 时出错 - 2

    我正在用Ruby编写一个简单的程序来检查域列表是否被占用。基本上它循环遍历列表,并使用以下函数进行检查。require'rubygems'require'whois'defcheck_domain(domain)c=Whois::Client.newc.query("google.com").available?end程序不断出错(即使我在google.com中进行硬编码),并打印以下消息。鉴于该程序非常简单,我已经没有什么想法了-有什么建议吗?/Library/Ruby/Gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/base.

  2. ruby - 在 64 位 Snow Leopard 上使用 rvm、postgres 9.0、ruby 1.9.2-p136 安装 pg gem 时出现问题 - 2

    我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po

  3. ruby - 默认情况下使选项为 false - 2

    这是在Ruby中设置默认值的常用方法:classQuietByDefaultdefinitialize(opts={})@verbose=opts[:verbose]endend这是一个容易落入的陷阱:classVerboseNoMatterWhatdefinitialize(opts={})@verbose=opts[:verbose]||trueendend正确的做法是:classVerboseByDefaultdefinitialize(opts={})@verbose=opts.include?(:verbose)?opts[:verbose]:trueendend编写Verb

  4. ruby - 如何使用 Ruby aws/s3 Gem 生成安全 URL 以从 s3 下载文件 - 2

    我正在编写一个小脚本来定位aws存储桶中的特定文件,并创建一个临时验证的url以发送给同事。(理想情况下,这将创建类似于在控制台上右键单击存储桶中的文件并复制链接地址的结果)。我研究过回形针,它似乎不符合这个标准,但我可能只是不知道它的全部功能。我尝试了以下方法:defauthenticated_url(file_name,bucket)AWS::S3::S3Object.url_for(file_name,bucket,:secure=>true,:expires=>20*60)end产生这种类型的结果:...-1.amazonaws.com/file_path/file.zip.A

  5. ruby - 在没有 sass 引擎的情况下使用 sass 颜色函数 - 2

    我想在一个没有Sass引擎的类中使用Sass颜色函数。我已经在项目中使用了sassgem,所以我认为搭载会像以下一样简单:classRectangleincludeSass::Script::FunctionsdefcolorSass::Script::Color.new([0x82,0x39,0x06])enddefrender#hamlengineexecutedwithcontextofself#sothatwithintemlateicouldcall#%stop{offset:'0%',stop:{color:lighten(color)}}endend更新:参见上面的#re

  6. 使用 ACL 调用 upload_file 时出现 Ruby S3 "Access Denied"错误 - 2

    我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file

  7. ruby - 在不使用 RVM 的情况下在 Mac 上卸载和升级 Ruby - 2

    我最近决定从我的系统中卸载RVM。在thispage提出的一些论点说服我:实际上,我的决定是,我根本不想担心Ruby的多个版本。我只想使用1.9.2-p290版本而不用担心其他任何事情。但是,当我在我的Mac上运行ruby--version时,它告诉我我的版本是1.8.7。我四处寻找如何简单地从我的Mac上卸载这个Ruby,但奇怪的是我没有找到任何东西。似乎唯一想卸载Ruby的人运行linux,而使用Mac的每个人都推荐RVM。如何从我的Mac上卸载Ruby1.8.7?我想升级到1.9.2-p290版本,并且我希望我的系统上只有一个版本。 最佳答案

  8. ruby - 如何安全地删除文件? - 2

    在Ruby中是否有Gem或安全删除文件的方法?我想避免系统上可能不存在的外部程序。“安全删除”指的是覆盖文件内容。 最佳答案 如果您使用的是*nix,一个很好的方法是使用exec/open3/open4调用shred:`shred-fxuz#{filename}`http://www.gnu.org/s/coreutils/manual/html_node/shred-invocation.html检查这个类似的帖子:Writingafileshredderinpythonorruby?

  9. ruby-on-rails - 启用 Rack::Deflater 时 ETag 发生变化 - 2

    在启用Rack::Deflater来gzip我的响应主体时偶然发现了一些奇怪的东西。也许我遗漏了一些东西,但启用此功能后,响应被压缩,但是资源的ETag在每个请求上都会发生变化。这会强制应用程序每次都响应,而不是发送304。这在没有启用Rack::Deflater的情况下有效,我已经验证页面源没有改变。我正在运行一个使用thin作为Web服务器的Rails应用程序。Gemfile.lockhttps://gist.github.com/2510816有没有什么方法可以让我从Rack中间件获得更多的输出,这样我就可以看到发生了什么?提前致谢。 最佳答案

  10. Observability:从零开始创建 Java 微服务并监控它 (二) - 2

    这篇文章是继上一篇文章“Observability:从零开始创建Java微服务并监控它(一)”的续篇。在上一篇文章中,我们讲述了如何创建一个Javaweb应用,并使用Filebeat来收集应用所生成的日志。在今天的文章中,我来详述如何收集应用的指标,使用APM来监控应用并监督web服务的在线情况。源码可以在地址 https://github.com/liu-xiao-guo/java_observability 进行下载。摄入指标指标被视为可以随时更改的时间点值。当前请求的数量可以改变任何毫秒。你可能有1000个请求的峰值,然后一切都回到一个请求。这也意味着这些指标可能不准确,你还想提取最小/

随机推荐