Hyperledger Fabric chaincode 開發(疑難解答)

Q&A

Q1: 使用fabric release 1.2 進行golang chaincode開發時報錯:html

..\..\hyperledger\fabric\vendor\github.com\docker\docker\pkg\archive\archive.go:364:5: hdr.Format undefined (type *tar.Header has no field or method Format)
..\..\hyperledger\fabric\vendor\github.com\docker\docker\pkg\archive\archive.go:364:15: undefined: tar.FormatPAX
..\..\hyperledger\fabric\vendor\github.com\docker\docker\pkg\archive\archive.go:1166:7: hdr.Format undefined (type *tar.Header has no field or method Format)
..\..\hyperledger\fabric\vendor\github.com\docker\docker\pkg\archive\archive.go:1166:17: undefined: tar.FormatPAX

A1: 這是由於在go 小於1.10的版本中自帶的tar package中 Header結構體中不包含 FormatPAX屬性,其解決方案以下:
1. 升級到1.10以上版本,但須要注意的是,在升級到1.10以上版本可能會遇到一些問題
2. 從官網下載 archive 包放在 fabric/vendor/ 文件夾下面。git

相關文章
相關標籤/搜索