This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (cci *PreciousCargoChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { | |
| function, args := stub.GetFunctionAndParameters() | |
| if function == "registerParticipant" { | |
| if len(args) != 1 { | |
| return shim.Error("expecting JSON input as first param") | |
| } | |
| // (1) parse input | |
| arg := struct { | |
| Name string `json:"name"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response { | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { | |
| ... | |
| } | |
| func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response { | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| */ | |
| package main | |
| import ( | |
| "encoding/json" | |
| "log" | |
| "os" | |
| "github.com/hyperledger/fabric/core/chaincode/shim" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ $# -ne 1 ]]; then | |
| echo 'Usage: cat inputdata.json | ./invoke.sh FUNCTIONNAME' | |
| exit 1 | |
| fi | |
| FUNCTION="$1" | |
| INPUTDATA0=`cat` | |
| INPUTDATA=$(echo $INPUTDATA0 | sed 's/\"/\\"/g') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "CN": "Test-Intermediate CA", | |
| "key": { | |
| "algo": "ecdsa", | |
| "size": 256 | |
| }, | |
| "names": [ | |
| { "C": "DE", "L": "Koenigswinter", "O": "aschmidt75", "OU": "Tesing Dptd" } | |
| ], | |
| "ca": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from action import Action | |
| from event import Event | |
| from property import Property | |
| from thing import Thing | |
| from value import Value | |
| import json | |
| import time | |
| import uuid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from action import Action | |
| from event import Event | |
| from property import Property | |
| from thing import Thing | |
| from value import Value | |
| class ThingMQTTBinding: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Generated by THNG:STRUCTION, provided as a Creative Commons 1.0 Universal (CC0 1.0) Public Domain Dedication. | |
| * | |
| * Code is as-is and without any warranty; without even the implied | |
| * warranty of merchantability or fitness for a particular purpose. | |
| * See LICENSE file or visit https://creativecommons.org/publicdomain/zero/1.0/deed.en | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ------------------------------------------------------------------------------------------------------------------ | |
| // Application Handlers | |
| // TODO: Implement application functionality here | |
| // ------------------------------------------------------------------------------------------------------------------ | |
| /** Pushes a new event to the event FIFO */ | |
| void wot_events_push(const char *name, const char *description, const char *time); | |
| /** TODO: Implement application-specific code here by filling the app_...(...) functions */ |