I tried editing the chaincode based on the Marbles Demo project. For example, the original project would send a marble struct with 4 attributes {name, size, color, user} to the chaincode and put this information into the blockchain. I changed the struct from 4 attributes to 5: {name, size, color, user, price}.
After I changed related codes in "marbles_chaincode.go" file and related javascript files or jade files, I found the project failed to connect to the blockchain network. It seemed that the project could not read any data from the original network or write anything into it.
I guess maybe it is because the blockchain network does not allow me to change the structure of data that is stored in it. Do I have to rebuild a blockchain network which is different from the orignal one if I want to create my own chaincode? If yes, How to do this? Thanks!
I tried editing the chaincode based on the Marbles Demo project. For example, the original project would send a marble struct with 4 attributes {name, size, color, user} to the chaincode and put this information into the blockchain. I changed the struct from 4 attributes to 5: {name, size, color, user, price}. After I changed related codes in "marbles_chaincode.go" file and related javascript files or jade files, I found the project failed to connect to the blockchain network. It seemed that the project could not read any data from the original network or write anything into it. I guess maybe it is because the blockchain network does not allow me to change the structure of data that is stored in it. Do I have to rebuild a blockchain network which is different from the orignal one if I want to create my own chaincode? If yes, How to do this? Thanks!