Test.js fails in alpha29 with updated node API

+2 votes
Can you please look at the following issue and provide a fix.. this looks like some parameters mismatch between the API and chain commands. I am running this in Windows 8.1 OS, with alpha 29 and latest API updated with npm before running this test.. (test.js)

TEST: CREATE MULTI SIG
TEST: CREATE STREAM
TEST: CREATE STREAM FROM
TEST: LIST STREAMS
TEST: SUBSCRIBE STREAM
TEST: PUBLISH STREAM
TEST: PUBLISH FROM
TEST: LIST STREAM KEYS
{ code: -8,
  message: 'Invalid parameter value type, should be boolean' }
Unhandled rejection (<{"code":-8,"message":"Invalid paramete...>, no stack trace
)

Thanks.
asked Mar 23, 2017 by saravana

1 Answer

0 votes

I'm not sure what this test.js file is, but the problem is probably that an integer is being passed instead of a boolean value for a parameter for liststreamkeys.

answered Mar 23, 2017 by MultiChain
Thanks, I will write to Greg Piccolo, the multichain-node API owner.
It has nothing to do with test.js file since i am using curl and i get same response
Error 500
{"result":null,"error":{"code":-8,"message":"Invalid value for 'verbose' parameter, should be boolean"},"id":"curltext"}

Problem is when you POST a data on the server side when it needs to read
example:
"params":[{"verbose":true}]
it treats the true as string and not as boolean

Can somebody post a solution for this ???
Parameters are passed by position in an array, not by name in an object, so the curl request should have a parameter field looking something like:
"params":["stream1", "*", true]
Does that mean i should know as consumer of API the position of each key how it is read in order to set something
Everything is documented on the API page (http://www.multichain.com/developers/json-rpc-api/ ), and if you use multichain-cli you see the full JSON-RPC request sent, such as:

{"method":"liststreamkeys","params":["stream1","*",true],"id":1,"chain_name":"chain1"}
Thanks. I will take a look
I got it working . Thanks for the help .
...