create streamfilter - receive for field is allowed only for tx filters

+1 vote

Hi,

I am trying to create streamfilter on alpha6 with command:

create streamfilter streamfilter1 '{"for":"stream1"}' 'function filterstreamitem(){ var item=getfilterstreamitem(); if (item.keys.length < 2) return "2 keys required"; }'

and receive the following error:

error code: -8

error message: for field is allowed only for tx filters

May I know how do I create streamfilter with restrictions?

asked Nov 19, 2018 by jeremiahtws

1 Answer

0 votes
You cannot add these types of restrictions to a stream filter, and when you create a stream filter, it is not for a specific stream anyway. Instead, you activate the stream filter for a particular stream using the API. The process is covered in depth on the following page:

https://www.multichain.com/developers/smart-filters/
answered Nov 19, 2018 by MultiChain
...