How to retrieve an asset and update one value of a field

+2 votes
Dear All,

{
    "result": [
        {
            "name": "implant4",
            "issuetxid": "e1d22d16bfd92468e9497ac33bf3fd321838cfd787ff75fc5c946b380d938d85",
            "assetref": "134-267-53985",
            "multiple": 1,
            "units": 1,
            "open": true,
            "details": {
                "Inventory No": "SPS0025",
                "Order No": "ORD0001",
                "Value": "154",
                "Currency": "USD",
                "LOT No": "3456",
                "Status": "In transit",
                "Partner": "Distributor"
            },
            "issueqty": 300,
            "issueraw": 300,
            "subscribed": true,
            "synchronized": true,
            "transactions": 10,
            "confirmed": 10
        }
    ],
    "error": null,
    "id": null
}
Its created successfully. Now I want to change the partner name with some other participant in the multichain network.
 
Means Other user fetch the asset and change the value of Partner filed.  The asset creator has given the permission to other user.

Please give some sample example. I am unable to understand the parameters in multichain Json-rpc command page.

 I have used the below code to update a created asset in multichain

{

"method": "issuemore",

"params": ["1PeM6q5ZSbne5SuLPFLD3zcPWcKke9MBiKT1Ln",

"implant4",0,0,

{

"Partner": "Manufacturer",

"Status":"Delivered"

}]

}

It is not updating the asset with given address.

Thanks

suva
asked Aug 28, 2018 by anonymous
edited Aug 29, 2018

1 Answer

0 votes

When you say "not updating the asset" I assume you mean the top-level details structure in the result of listassets has not changed. This is indeed the expected behavior since details contains the original issuance details only. You would need to calculate the up-to-date version of what you're looking for at the application level, using listassets with verbose=true to get the full history of issuances.

Alternatively, use MultiChain 2.0 (alpha) with a stream to represent the asset details, with each set of details in a JSON item, and use liststreamkeysummary to get the up-to-date version of what you're looking for.

answered Aug 29, 2018 by MultiChain
...