ledgercheck

package
v0.0.0-...-a51d5c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LocalUrl  string
	ServerUrl string
	VerifyUrl string
	RandomUrl string
	RegUrl    string
)

Functions

This section is empty.

Types

type ApplicationConfig

type ApplicationConfig struct {
	ApplicationOrgs map[string]*ApplicationOrgConfig
	Protos          *channelconfig.ApplicationProtos
}

ApplicationConfig implements the Application interface

func NewApplicationConfig

func NewApplicationConfig(appGroup *common.ConfigGroup, mspConfig *channelconfig.MSPConfigHandler) (*ApplicationConfig, error)

NewApplicationConfig creates config from an Application config group

type ApplicationOrgConfig

type ApplicationOrgConfig struct {
	*OrganizationConfig
	// contains filtered or unexported fields
}

ApplicationOrgConfig defines the configuration for an application org

func NewApplicationOrgConfig

func NewApplicationOrgConfig(id string, orgGroup *common.ConfigGroup, mspConfig *channelconfig.MSPConfigHandler) (*ApplicationOrgConfig, error)

NewApplicationOrgConfig creates a new config for an application org

type BlockData

type BlockData struct {
	VerifyInfo
	Height uint64
	Txs    []TxData
}

type ChannelInfo

type ChannelInfo struct {
	Protos            *channelconfig.ChannelProtos
	MspManager        fabricmsp.MSPManager
	AppConfig         *ApplicationConfig
	OrdererConfig     *OrdererConfig
	ConsortiumsConfig *ConsortiumsConfig
}

type CheckRequest

type CheckRequest struct {
	CompanyName string
	CompanyID   string
	CheckType   int
	Data        []byte
}

type CheckResponse

type CheckResponse struct {
	Status int
	Result FabricCheckResult
}

type ConsortiumConfig

type ConsortiumConfig struct {
	Protos *channelconfig.ConsortiumProtos
	Orgs   map[string]*OrganizationConfig
}

ConsortiumConfig holds the consoritums configuration information

func NewConsortiumConfig

func NewConsortiumConfig(consortiumGroup *common.ConfigGroup, mspConfig *channelconfig.MSPConfigHandler) (*ConsortiumConfig, error)

NewConsortiumConfig creates a new instance of the consoritums config

type ConsortiumsConfig

type ConsortiumsConfig struct {
	Consortiums map[string]*ConsortiumConfig
}

ConsortiumsConfig holds the consoritums configuration information

func NewConsortiumsConfig

func NewConsortiumsConfig(consortiumsGroup *common.ConfigGroup, mspConfig *channelconfig.MSPConfigHandler) (*ConsortiumsConfig, error)

NewConsortiumsConfig creates a new instance of the consoritums config

type Endorser

type Endorser struct {
	VerifyInfo
	Name string
}

type FabricCheckResult

type FabricCheckResult struct {
	OtherResult     []byte
	SignatureResult VerifyResponse
}

type FabricResp

type FabricResp struct {
	LedgerDetail []byte
	RandomDetail []byte
}

type LedgerData

type LedgerData struct {
	ChannelID    string
	ConsusType   string
	OrdererAddr  string
	BlockTime    string
	TxCount      uint32
	TxMaxSize    uint32
	BlockSize    uint32
	Blocks       []BlockData
	RandomResult []byte
	Err          string
}

func AnalyzeChannelLedger

func AnalyzeChannelLedger(ledgerBytes []byte) (*LedgerData, error)

func GetLedgerInfo

func GetLedgerInfo(rawBlock *common.Block) (*LedgerData, error)

type OrdererConfig

type OrdererConfig struct {
	Protos       *channelconfig.OrdererProtos
	Orgs         map[string]*OrganizationConfig
	BatchTimeout time.Duration
}

OrdererConfig holds the orderer configuration information

func NewOrdererConfig

func NewOrdererConfig(ordererGroup *common.ConfigGroup, mspConfig *channelconfig.MSPConfigHandler) (*OrdererConfig, error)

NewOrdererConfig creates a new instance of the orderer config

type OrgAndAnchors

type OrgAndAnchors struct {
	Name    string
	Anchors []*peer.AnchorPeer
}

type OrganizationConfig

type OrganizationConfig struct {
	Protos *channelconfig.OrganizationProtos

	MspConfigHandler *channelconfig.MSPConfigHandler
	Msp              fabricmsp.MSP
	MspID            string
	Name             string
}

OrganizationConfig stores the configuration for an organization

func NewOrganizationConfig

func NewOrganizationConfig(name string, orgGroup *common.ConfigGroup, mspConfigHandler *channelconfig.MSPConfigHandler) (*OrganizationConfig, error)

NewOrganizationConfig creates a new config for an organization

type RandomRequest

type RandomRequest struct {
	RandomCheckType int
	RandomData      []byte
}

type RegisterReq

type RegisterReq struct {
	ServerType    int
	ServerAddress string
}

type RegisterResp

type RegisterResp struct {
	Status int
}

type SourceData

type SourceData struct {
	LedgerData []byte
	RandomData []byte
}

type TxData

type TxData struct {
	VerifyInfo
	TxID      string
	Endorsers []Endorser
}

type VerifyInfo

type VerifyInfo struct {
	SignAlgo string
	HashAlgo string
	PubAlgo  string
	PubCurve string
	VerifyOk bool
}

func CheckDataSignature

func CheckDataSignature(crt *x509.Certificate, rawBytes, signature []byte) (vi VerifyInfo, err error)

type VerifyRespFromServer

type VerifyRespFromServer struct {
	VerifySuccess bool
}

type VerifyResponse

type VerifyResponse struct {
	VerifySuccess bool
	PublicKeyAlgo string
	SignatureAlgo string
}

type VerifySignature

type VerifySignature struct {
	PublicKey     []byte
	Signature     []byte
	PlainText     []byte
	SignatureAlgo asn1.ObjectIdentifier
	PublicAlgo    asn1.ObjectIdentifier
	Curve         asn1.ObjectIdentifier
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL