Closed bestatigen closed 2 years ago
It's 100 Tgas
now; increasing to 300
should fix for now.
I don't think this is still a problem. I executed nft_tokens
as a view method, it returns all NFTs (9 in total) and it doesn't even use any gas
Command tested:
near view 0.share-nft.testnet nft_tokens
Just tried the same command @achrafismyname:
near view 0.share-nft.testnet nft_tokens
and the result points out to not enough gas:
View call: 0.share-nft.testnet.nft_tokens()
An error occured
Error: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(HostError(GasLimitExceeded)).
{
"block_hash": "4qFDb5927AjHnkuBrZ7hj7CQWSf74BPAwXMKV7eoWuaE",
"block_height": 71459760,
"error": "wasm execution failed with error: FunctionCallError(HostError(GasLimitExceeded))",
"logs": []
}
Hey @devey, I forgot to mention this I found the limit to be 8. It was working before without limit because there was less than 9 NFTs in the contract. Try this and it will work
near view 0.share-nft.testnet nft_tokens '{"from_index":"0","limit":8}'
How many NFTs per call would be good enough for our projects?
@achrafismyname I think we'll be able to have more once we separate storage of Metadata
from storage of Tokens
. Wrote it down in #135. Will close this.
I noticed that if I was trying to fetch too many
NFTs
I would get an error about exceeding the allowed gas amount. Besides paging, which has to be implemented anyway at some point, I would rather take this occasion to figure out if I'm packing too much data in oneNFT
and if that should be separated from theNFT
details, so that you can retrieve more objects with one request and fetch the otherMetadata
details only if necessary.