How to pass command parameters in multichaincli python lib?

+1 vote
I want to create a stream on multichain blockchain using the multichaincli python lib:
https://github.com/chainstack/multichaincli

I search for the way to command parameters.
For example for `create` API there are following params:
```
type=stream name
restrictions
(custom-fields)
```
so using CLI it would be something like
```
 multichain-cli chain create type=stream mystream {"restrict":"offchain,onchain,write,read"}
```

How to do the same with python?
asked Mar 27 by anna

1 Answer

0 votes
 
Best answer

First, when the docs say type=stream this means that you have to just pass "stream" for this parameter, which is specifying the type of entity to create. Also note the need for escaping JSON objects so they are treated as a single parameter. So in the command line it would be:

multichain-cli chain create stream mystream '{"restrict":"offchain,onchain,write,read"}'

In this Python library, I believe this would map to:

mychain.create('stream', 'mystream', {'restrict':'offchain,onchain,write,read'})

The Python dict is converted to a JSON object. Please let us know if this works for you.

answered Mar 28 by MultiChain
...