Invalid custom fields, too long

+1 vote

Hi,

I am saving JSON data in the stream and one of the keys in my JSON contains long text (around 4000 characters)

when I save using raw txn i started getting an error which looks like this 

code=-8   message=Invalid custom fields, too long

what does that mean ? how can i get past that
asked Aug 2, 2018 by anshuman

1 Answer

0 votes
Yes, there is currently a limit of around 4 kb on the total size of the metadata for asset issuance and stream creation.

In this case your workaround would be to put the metadata into a stream item, and then reference the txid of that stream item from the asset metadata. Can that work for you?
answered Aug 2, 2018 by MultiChain
i was saving in a stream item only but still got an error

 createRawSendFrom({
          from: 'fromAddress',
          amounts:{},
          data:
            [{"for":streamName,"key":streamKey,"data":hex}],
          action: 'send'
        });


still getting same error
if i didn't understand clearly so can you please give me a code sample on how to put the metadata into a stream item
is that 4kb is the maximum size of my json that i want save in stream item or its maximum size of any key-value pair in my json
The 4kb is the maximum total size of metadata attached to an asset or stream issuance, i.e. passed in the issue/issuemore/create stream command.

The easiest way to publish data in a stream is to use the publish/publishfrom API.
...