@@ -39,10 +39,10 @@ const mamClient = require("./mamClient");
3939 log . info ( "Channel root: %s" , channelRoot )
4040 } else {
4141 //this is necessary to set iota in Mam lib
42- await mamClient . createMamFrom ( { iota : args . iota , mode : mode } )
42+ await mamClient . createMamFrom ( { iota : args . iota , mode : mode , sideKey : sideKey } )
4343 }
4444 if ( channelRoot ) {
45- readMessages ( channelRoot , mode , sideKey , args . iota )
45+ await readMessages ( channelRoot , mode , sideKey , args . iota )
4646 return ;
4747 } else {
4848 log . error ( "Seed or channel root must be given to get channel info" )
@@ -59,7 +59,7 @@ const mamClient = require("./mamClient");
5959 log . info ( "Message root: %s" , result . root )
6060 log . info ( "Message address: %s" , result . address )
6161 if ( args . readMessages ) {
62- readMessages ( client . channelRoot , client . mam . channel . mode , client . mam . channel . side_key , args . iota )
62+ await readMessages ( client . channelRoot , client . mam . channel . mode , client . mam . channel . side_key , args . iota )
6363 }
6464 return ;
6565 } else {
@@ -83,7 +83,7 @@ async function readMessages(channelRoot, mode, sideKey, iota) {
8383 if ( resp . messages . length == 0 ) {
8484 log . info ( "No messages published on the channel." )
8585 } else {
86- log . info ( "Messages:\n%O" , resp . messages . map ( iota . utils . fromTrytes ) )
86+ log . info ( "Messages:\n%O" , resp . messages . map ( m => iota . utils . fromTrytes ( m ) || m ) )
8787 }
8888 log . info ( "Next Root: %s" , resp . nextRoot )
8989}
0 commit comments