Questions tagged [chaincode]

Chain codes are an efficient encoding of binary objects in an image. Use this tag together with [image-processing].

Chain codes, first proposed by Freeman in the early 1960's, encode a binary image object's contour as a set of steps in one of eight directions. The whole object is thus encoded as a sequence of 3-bit values, one for each of the object's contour pixels.

164 questions
-1
votes
1 answer

Encountering the error "Error: chaincode argument error: invalid character ']' after object key"

I am trying to modify fabcar to test various data structures possible with it. I used the following command:peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C…
-1
votes
1 answer

Error to start a chaincode on hyperledger fabric

I am following the steps to use the Fabric test network from the hyperledger fabric, when I try to start the chaincode always have the following message: Error: failed to read chaincode package at 'basic.tar.gz': open basic.tar.gz: no such file or…
-1
votes
1 answer

Fabric Hyperledger Deploying Chaincode failed - javascript

I am trying to run fabric chaincode after network.ch up but the below error is coming, trying hard to find a solution, appreciate much for your help $ ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl…
-1
votes
2 answers

How to write a unit test for hyperledger/fabric-sdk-go?

How to write a unit test for the following code The GetBook function is a function in chaincode code func (svc *service) GetBook(_ context.Context, id string) (*Entity, error) { res, err := svc.contract.EvaluateTransaction("GetBook", id) if…
bardia
  • 1
  • 1
-1
votes
1 answer

Different value of sha256 on-chain than off-chain

I am using HFB 1.4.6, and I emit chaincode logs, which I capture one by one, to apply sha256 and base64 to each. However the sha256 result varies with respect to the sha256 off-chain verification. This is the chaincode output: enter image…
sfl0r3nz05
  • 547
  • 8
  • 14
-1
votes
2 answers

how to set offset and limit while fetching records from chaincode in hyperledger fabric v 1.4 using nodejs chaincode?

I have more than 500 records in my blockchain network and i want to write a chaincode for the pagination on frontend. I have used getQueryResultWithPagination and getStateByRangeWithPagination but my concern is that i want to fetch records starting…
-1
votes
2 answers

Hyperledger Fabric in Kubernetes: Not able to instantiate chaincode

Hello Everyone i am working on setup of fabric default first-network in kubernetes. But when i am instantiate the chaincode it gives me error. Please check below are my peer logs. 2019-07-22 07:25:02.134 UTC [endorser] SimulateProposal -> ERRO…
-1
votes
1 answer

Chaincode Error with go lang "no such file or directory"

I'm writing a chaincode where i need to read file in order to process the transaction but when my code tries to read a file from system it the error "no such file or directory". Even though that path is defined in the docker volumes. But if i try to…
-1
votes
1 answer

Chaincode PutState() and GetState() values do not match when used with RSA encryption

The following piece of code returns "does not match!" error: pub, priv := GenerateKeyPair(2048) ct1 := EncryptWithPublicKey([]byte("abc"), pub) err := stub.PutState("ct", ct1) ct2 := stub.GetState("ct") if string(ct1[:]) != string(ct2[:]) { …
-2
votes
2 answers

Not able to get the value of a custom attribute in hyperledger-fabric using cid.getAttributeValue function

Other than the 3 attributes hf.EnrollmentId, hf.type and hf.Affiliation, I've created a custom attribute named email and added it as attrs:[{name: 'email', value: rahul18@gmail.com, ecert: true}] and it was successfully added to the attribute…
-2
votes
1 answer

How to sort and recover datetime

I am sitting on a Go structure in which there is a date type among the variables. When applying an order to the structure using this date field, the date does not return, only the default value. I'm using hyperledger fabric to store the values ​​and…
-2
votes
1 answer

Cannot instantiate this java chaincode

I'm trying to deploy a Java based chaincode in "first-network" sample. The code is generated with IBM Blockchain Platform plugin for VSCode. It works in the local environment (Using the VSCode plugin to install, invoke,...), but when I try to test…
-2
votes
1 answer

Cannot use (type []map[string]interface {}) as type []string in field value

How to store Array of JSONs (in string format) in []string (individual JSON string in each index of string array) ? package main import ( "encoding/json" "fmt" ) type StructData struct { Data []string `json:"data"` } func main() { …
user12355116
1 2 3
10
11