This file contains 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
type User struct { | |
ID string `json:"id"` | |
Email string `json:"email"` | |
Name string `json:"name"` | |
Mobile string `json:"mobile"` | |
Age string `json:"age"` | |
} |
This file contains 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
type Financial struct { | |
ID string `json:"id"` | |
BankName string `json:"bankName"` | |
IFSCCode string `json:"ifscCode"` | |
AccNumber string `json:"accNumber"` | |
CreatedDate string `json:"createdDate"` | |
} |
This file contains 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
syntax="proto3"; | |
package main; | |
message Financial { | |
string bankName = 1; | |
string ifscCode = 2; | |
string accNumber = 3; | |
string createdDate = 4; | |
} |
This file contains 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
// Code generated by protoc-gen-go. DO NOT EDIT. | |
// source: financial.proto | |
package main | |
import ( | |
fmt "fmt" | |
proto "github.com/golang/protobuf/proto" | |
math "math" | |
) |
This file contains 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
type User struct { | |
ID string `json:"id"` | |
Email string `json:"email"` | |
Name string `json:"name"` | |
Mobile string `json:"mobile"` | |
Age string `json:"age"` | |
Financial string `json:"financial"` | |
} |
This file contains 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
financial := &Financial { | |
ID: "F1", | |
BankName: "Hellenic Bank", | |
IFSCCode: "1234", | |
AccNumber: "8765", | |
CreatedDate : "12/12/08, | |
} |
This file contains 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 ( | |
"fmt" | |
"log" | |
"github.com/golang/protobuf/proto" | |
) | |
func main() { |
This file contains 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
financialByteData, err := proto.Marshal(financialData) | |
if err != nil { | |
log.Fatal("marshaling error: ", err) | |
} | |
//Parsing the financial byte data | |
financial := &Financial{} | |
err = proto.Unmarshal(financialByteData, financial) | |
if err != nil { | |
log.Fatal("unmarshaling error: ", err) |
This file contains 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
// Code generated by protoc-gen-go. DO NOT EDIT. | |
// source: financial.proto | |
package main | |
import ( | |
fmt "fmt" | |
proto "github.com/golang/protobuf/proto" | |
math "math" | |
) |
This file contains 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
req := resmgmt.SaveChannelRequest{ | |
ChannelID: "multiorgledger", | |
ChannelConfigPath: os.os.Getenv("GOPATH")+"/multiorgledger.channel.tx", | |
SigningIdentities: []msp.SigningIdentity{Org1SignIdentity, Org2SignIdentity, Org3SignIdentity, Org4SignIdentity}, | |
} | |
txID, err := s.Resmgmt.SaveChannel( | |
req, resmgmt.WithOrdererEndpoint(Orderer.OrdererID)) | |
if err != nil || txID.TransactionID == "" { | |
return errors.WithMessage(err, "failed to save anchor channel for - "+s.OrgName) | |
} |
OlderNewer