Documentation ¶
Index ¶
- Constants
- type ChaincodeMetadata
- type ChaincodePackage
- type ChaincodePackageMetadata
- type ChaincodePackageParser
- type CodePackageNotFoundErr
- type FilesystemIO
- func (f *FilesystemIO) ReadDir(dirname string) ([]os.FileInfo, error)
- func (f *FilesystemIO) ReadFile(filename string) ([]byte, error)
- func (f *FilesystemIO) Remove(name string) error
- func (f *FilesystemIO) Stat(name string) (os.FileInfo, error)
- func (f *FilesystemIO) WriteFile(filename string, data []byte, perm os.FileMode) error
- type IOReadWriter
- type LegacyPackageProvider
- type PackageParser
- type PackageProvider
- type Store
- func (s *Store) GetChaincodeInstallPath() string
- func (s *Store) ListInstalledChaincodes() ([]chaincode.InstalledChaincode, error)
- func (s *Store) Load(hash []byte) (ccInstallPkg []byte, name, version string, err error)
- func (s *Store) LoadMetadata(path string) (name, version string, err error)
- func (s *Store) RetrieveHash(name string, version string) ([]byte, error)
- func (s *Store) Save(name, version string, ccInstallPkg []byte) ([]byte, error)
- type StorePackageProvider
Constants ¶
View Source
const (
ChaincodePackageMetadataFile = "Chaincode-Package-Metadata.json"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChaincodeMetadata ¶
chaincodemetadata保存chaincode的名称和版本
type ChaincodePackage ¶
type ChaincodePackage struct { Metadata *ChaincodePackageMetadata CodePackage []byte }
chaincode package表示chaincode包的非tar ed格式。
type ChaincodePackageMetadata ¶
chaincodepackagemetata包含理解所需的信息 嵌入的代码包。
type ChaincodePackageParser ¶
type ChaincodePackageParser struct{}
func (ChaincodePackageParser) Parse ¶
func (ccpp ChaincodePackageParser) Parse(source []byte) (*ChaincodePackage, error)
解析将一组字节解析为链码包 并将解析后的包作为结构返回
type CodePackageNotFoundErr ¶
codePackageNotFounderr是当代码包无法 在持久性存储中找到
func (*CodePackageNotFoundErr) Error ¶
func (e *CodePackageNotFoundErr) Error() string
type FilesystemIO ¶
type FilesystemIO struct { }
filesystemio是iowriter接口的生产实现
func (*FilesystemIO) ReadDir ¶
func (f *FilesystemIO) ReadDir(dirname string) ([]os.FileInfo, error)
readdir从文件系统读取目录
func (*FilesystemIO) ReadFile ¶
func (f *FilesystemIO) ReadFile(filename string) ([]byte, error)
readfile从文件系统读取文件
func (*FilesystemIO) Remove ¶
func (f *FilesystemIO) Remove(name string) error
删除从文件系统中删除一个文件-用于回滚正在运行的文件 失败时保存操作
type IOReadWriter ¶
type IOReadWriter interface { ReadDir(string) ([]os.FileInfo, error) ReadFile(string) ([]byte, error) Remove(name string) error Stat(string) (os.FileInfo, error) WriteFile(string, []byte, os.FileMode) error }
ioreadwriter定义读取、写入、删除和 检查是否存在指定的文件
type LegacyPackageProvider ¶
type LegacyPackageProvider interface { GetChaincodeCodePackage(name, version string) (codePackage []byte, err error) ListInstalledChaincodes(dir string, de ccprovider.DirEnumerator, ce ccprovider.ChaincodeExtractor) ([]chaincode.InstalledChaincode, error) }
来自chaincodedeploymentspec的代码包
type PackageParser ¶
type PackageParser interface {
Parse(data []byte) (*ChaincodePackage, error)
}
type PackageProvider ¶
type PackageProvider struct { Store StorePackageProvider Parser PackageParser LegacyPP LegacyPackageProvider }
PackageProvider保留获取代码所需的依赖项 链码的包字节
func (*PackageProvider) GetChaincodeCodePackage ¶
func (p *PackageProvider) GetChaincodeCodePackage(name, version string) ([]byte, error)
名称和版本。它首先搜索 chaincodeinstallpackages,然后返回搜索 链码部署规范
func (*PackageProvider) ListInstalledChaincodes ¶
func (p *PackageProvider) ListInstalledChaincodes() ([]chaincode.InstalledChaincode, error)
在对等机上安装的每个链码
type Store ¶
type Store struct { Path string ReadWriter IOReadWriter }
存储区保存保持chaincode安装包所需的信息
func (*Store) GetChaincodeInstallPath ¶
getchaincodeinstallpath返回链码所在的路径 安装
func (*Store) ListInstalledChaincodes ¶
func (s *Store) ListInstalledChaincodes() ([]chaincode.InstalledChaincode, error)
持久性存储中安装的链代码
func (*Store) LoadMetadata ¶
loadMetadata加载存储在指定路径上的链码元数据
func (*Store) RetrieveHash ¶
retrievehash检索给定 链码的名称和版本
type StorePackageProvider ¶
type StorePackageProvider interface { GetChaincodeInstallPath() string ListInstalledChaincodes() ([]chaincode.InstalledChaincode, error) Load(hash []byte) (codePackage []byte, name, version string, err error) RetrieveHash(name, version string) (hash []byte, err error) }
StorePackageProvider是检索 来自chaincodeinstallpackage的代码包
Directories ¶
Path | Synopsis |
---|---|
此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 伪造者生成的代码。
|
此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 伪造者生成的代码。 |
Click to show internal directories.
Click to hide internal directories.