Why am I receiving an "Argument list too long" error?

+1 vote
I am issuing this command so I can use the env variable $PDFHEX which holds the hex of a pdf file:

multichain-cli asset01 publish pdf_test vendor $PDFHEX

This is what gets returned:

-bash: /usr/local/bin/multichain-cli: Argument list too long

Any ideas what I've done wrong?
asked Oct 6, 2017 by CriticalMass

1 Answer

0 votes

This is an error from the bash command line or operating system stating that the length of the command you entered is too long, presumably because $PDFHEX contains a long hexadecimal string. For reference:

https://stackoverflow.com/questions/19354870/bash-command-line-and-input-limit

The multichain-cli executable does not yet support an 'input parameter from file' mode, so for this kind of case I'm afraid you will need to access MultiChain JSON-RPC API more directly, rather than from multichain-cli. For example you can build the JSON request in a file then use curl to HTTP POST that file to the API.

answered Oct 7, 2017 by MultiChain
Would be also great to pass a config file on multichain-util create because of the same issue.

So that it just accepts an incomplete params.dat and sets all the missing properties to default values.
Are you reaching the command length limit by passing non-default values as parameters on the command line for multichain-util?
Hi.

No. Only a convenient / cleaner way to do this. :-)
But no prio on this if the bash limit is enough to set all parameters.
...