commands

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	CarRecordKeyPrefix         = "car~"
	MintRequestRecordKeyPrefix = "mint-request~"
)
View Source
const CarDBName = "carDB"

Variables

This section is empty.

Functions

func Generate

func Generate(demoDir string) error

Generate demo materials: crypto under demoDir/crypto server config under demoDir/config server db dir under demoDir/database server replication dir under demoDir/replication transactions dir under demoDir/txs

func Init

func Init(demoDir string, lg *logger.SugarLogger) error

Init the server, load users, create databases, set permissions

func ListCar

func ListCar(demoDir, userID, carRegistration string, provenance bool, lg *logger.SugarLogger) (out string, err error)

func MintApprove

func MintApprove(demoDir, dmvID, mintReqRecordKey string, lg *logger.SugarLogger) (out string, err error)

MintApprove the dmv reviews and approves the mint-request. creates a car record in the database with the dealer as owner.

func MintRequest

func MintRequest(demoDir, dealerID, carRegistration string, lg *logger.SugarLogger) (out string, err error)

MintRequest a dealer issues a mint-request for a car.

func Transfer

func Transfer(demoDir, dmvID, seller, buyer, carReg string, lg *logger.SugarLogger) (out string, err error)

func VerifyEvidence

func VerifyEvidence(demoDir, userID, txID string, lg *logger.SugarLogger) (out string, err error)

Types

type CarRecord

type CarRecord struct {
	Owner           string
	CarRegistration string
}

func (*CarRecord) Key

func (r *CarRecord) Key() string

func (*CarRecord) String

func (r *CarRecord) String() string

type MintRequestRecord

type MintRequestRecord struct {
	Dealer          string
	CarRegistration string
}

func (*MintRequestRecord) Key

func (r *MintRequestRecord) Key() string

func (*MintRequestRecord) RequestID

func (r *MintRequestRecord) RequestID() string

Jump to

Keyboard shortcuts

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