<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>MultiChain Developer Q&amp;A - Recent questions tagged sdk</title>
<link>https://www.multichain.com/qa/tag/sdk</link>
<description>Powered by Question2Answer</description>
<item>
<title>why it always return null when i use java multichain sdk to retrive stream items</title>
<link>https://www.multichain.com/qa/17709/always-return-null-when-java-multichain-retrive-stream-items</link>
<description>&lt;p style=&quot;text-align:start&quot;&gt;everything goes well if i use the command line or interactive mode , i create the stream , i grant the send permission , i subscribe to it , i publish item to stream , when i use the command line or&amp;nbsp;interactive mode the items returned successfully&amp;nbsp;....but when i use below&amp;nbsp; java command to retrive the items via postman&amp;nbsp;....only null values returns ..... for example . i published 2 items , it will return &quot;null,null&quot; ,&amp;nbsp; i publish 3 items , it returns &quot;null,null,null&quot; ,&amp;nbsp; &amp;nbsp;i tested this both on root stream and my own stream , the same output&lt;/p&gt;&lt;pre style=&quot;text-align:start&quot;&gt;    List&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;&amp;lt;&lt;/span&gt;StreamKeyItem&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;&amp;gt; &lt;/span&gt;items = &lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;new &lt;/span&gt;ArrayList&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;&amp;lt;&amp;gt;()&lt;/span&gt;&lt;strong&gt;;
&lt;/strong&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;try &lt;/span&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;{
&lt;/span&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;        &lt;/span&gt;items = &lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;(&lt;/span&gt;List&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;&amp;lt;&lt;/span&gt;StreamKeyItem&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;&amp;gt;) &lt;/span&gt;cm.invoke&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;(&lt;/span&gt;CommandElt.&lt;em&gt;LISTSTREAMITEMS&lt;/em&gt;&lt;strong&gt;, &lt;/strong&gt;streamidentifier&lt;strong&gt;, &lt;/strong&gt;&lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;true&lt;/span&gt;&lt;strong&gt;, &lt;/strong&gt;&lt;span style=&quot;color:rgb(77, 172, 240)&quot;&gt;10&lt;/span&gt;&lt;strong&gt;, &lt;/strong&gt;&lt;span style=&quot;color:rgb(77, 172, 240)&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;)&lt;/span&gt;&lt;strong&gt;;
&lt;/strong&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;} &lt;/span&gt;&lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;catch &lt;/span&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;(&lt;/span&gt;MultichainException e&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;) {
&lt;/span&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;        &lt;/span&gt;e.printStackTrace&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;()&lt;/span&gt;&lt;strong&gt;;
&lt;/strong&gt;&lt;strong&gt;        &lt;/strong&gt;&lt;span style=&quot;color:rgb(103, 103, 115)&quot;&gt;//should return meaningful message to the front-end
&lt;/span&gt;&lt;span style=&quot;color:rgb(103, 103, 115)&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;return &lt;/span&gt;GSonUtil.&lt;em&gt;getInstance&lt;/em&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;()&lt;/span&gt;.object2Json&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;new &lt;/span&gt;MultichainOperationResult&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;(&lt;/span&gt;e.getMessage&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;()&lt;/span&gt;&lt;strong&gt;, &lt;/strong&gt;&lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;))&lt;/span&gt;&lt;strong&gt;;
&lt;/strong&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;}
&lt;/span&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:rgb(224, 149, 123)&quot;&gt;return &lt;/span&gt;GSonUtil.&lt;em&gt;getInstance&lt;/em&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;()&lt;/span&gt;.object2Json&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;(&lt;/span&gt;items&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;)&lt;/span&gt;&lt;strong&gt;;
&lt;/strong&gt;&lt;span style=&quot;color:rgb(147, 166, 245)&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/17709/always-return-null-when-java-multichain-retrive-stream-items</guid>
<pubDate>Thu, 23 Jan 2020 06:12:13 +0000</pubDate>
</item>
<item>
<title>Protecting integrity of client-side data</title>
<link>https://www.multichain.com/qa/7024/protecting-integrity-of-client-side-data</link>
<description>&lt;p&gt;Scenario:&lt;/p&gt;&lt;p&gt;- I currently have a setup where an organization is running a node, and end-users communicate with this node via a REST API.&lt;/p&gt;&lt;p&gt;- I have used a node wrapper where I'm exposing a&amp;nbsp;REST API with url's to do things like publishing to a stream, querying a stream,etc, by connecting to that node.&lt;/p&gt;&lt;p&gt;- The &lt;strong&gt;problem &lt;/strong&gt;here is that a end-client needs to fully trust whoever is hosting this API layer, since they aren't:&amp;nbsp;a) Running their own node, b) directly communicating with the node itself; When the client makes a POST call, the API layer might change something before publishing it to the stream, and similarly display ficticious data while doing a GET to query the stream.&lt;/p&gt;&lt;p&gt;So right now, if the client doesn't trust the API layer, the only way it can trust its data integrity is by hosting its own node which connects to the main blockchain, after which it can query it.&lt;/p&gt;&lt;p&gt;Am I understanding this situation correctly, and if yes, is there any workaround to this?&lt;br&gt;Like an SDK (on the roadmap?) which would directly communicate with the node instead of doing REST calls to invoke JSON-RPC API?&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/7024/protecting-integrity-of-client-side-data</guid>
<pubDate>Tue, 10 Oct 2017 10:19:35 +0000</pubDate>
</item>
</channel>
</rss>