Open devender-yadav opened 6 years ago
id
returned by https://test.bigchaindb.com/api/v1/assets?search=<text>
is transaction id.
Hi,
I am not sure this is relevant.
From the documentation:
https://docs.bigchaindb.com/projects/js-driver/en/latest/usage.html#asset-creation
"In the assets search the call returns the asset id which is the same id of the transaction that created the asset."
Thanks,
Alex Donnini
Hi,
I also looked through the code and could not find an instance where asset id was set/generated in the process of building a transaction.
The test app seems to be old. It does include code to set asset id.
One could certainly include asset id a field in the asset data included in a transaction.
Thanks,
Alex
Hi,
Sorry for this third comment.
I tried:
Transaction transaction2 = new Transaction();
Asset asset = new Asset();
asset.setId("MobilityAsset001");
Log.i(TAG, " - SendTransaction - doInBackground - asset.getId() - " + asset.getId());
transaction2.setAsset(asset);
The log statement reported the asset id as being "MobilityAsset001"
However, when I tried to retrieve the asset id after processing transaction2, the asset id returned was still null
Thanks,
Alex Donnini
Hi @adonnini,
Thanks for the documentation link. Null asset id seems like a bug to me.
-Dev
Can user set asset id while adding asset for CREATE transaction?
I can see Asset.java with a setter for Id.
But
addAssets( Object assets, Class assetsDataClass )
ofBigchainDbTransactionBuilder.Builder()
takes asset data & class and there is no way of supplying Asset id.Even if it's not, I want to get bigchaindb generated asset id.
I sent a transaction. Sample code:
And I waited till
StatusCode.VALID
But
transaction.getAsset().getId()
is null.And
https://test.bigchaindb.com/api/v1/assets?search=India
returning bothdata
andid
Sample response: