cars

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 6 Imported by: 6

README

Cars registration Hyperledger Fabric chaincode

Car registration chaincode use simple golang structure with json marshalling. Example with protobuf base chaincode schema is here.

source code, tests

Documentation

Overview

Simple CRUD chaincode for store information about cars

Simple CRUD chaincode for store information about cars

Index

Constants

View Source
const CarEntity = `CAR`
View Source
const CarRegisteredEvent = `CAR_REGISTERED`

Variables

View Source
var Payloads = []*Car{{
	Id:    `A777MP77`,
	Title: `BMW`,
	Owner: `victor-nosov`,
}, {
	Id:    `O888OO77`,
	Title: `TOYOTA`,
	Owner: `alexander`,
}, {
	Id:    `O222OO177`,
	Title: `Lambo`,
	Owner: `hodl`,
}, {
	Id:    `E333KX177`,
	Title: `Aurus`,
	Owner: `bigboss`,
}}

Functions

func New

func New() *router.Chaincode

func NewProxy added in v0.4.4

func NewProxy(carsChannel, carsChaincode string) *router.Chaincode

NewProxy created chaincode, related to cars chaincode

func NewWithoutAccessControl

func NewWithoutAccessControl() *router.Chaincode

Types

type Car

type Car struct {
	Id    string
	Title string
	Owner string

	UpdatedAt time.Time // set by chaincode method
}

Car struct for chaincode state

func (Car) Key

func (c Car) Key() ([]string, error)

Key for car entry in chaincode state

type CarPayload

type CarPayload struct {
	Id    string
	Title string
	Owner string
}

CarPayload chaincode method argument

Directories

Path Synopsis
bin

Jump to

Keyboard shortcuts

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