@@ -47,6 +47,11 @@ type PingResult struct {
4747 Time int
4848}
4949
50+ type ConfigResult struct {
51+ Key string
52+ Value bool
53+ }
54+
5055type P2PStreamsList struct {
5156 Streams []* struct {
5257 HandlerID string
@@ -91,7 +96,6 @@ func ListListeners(c *gin.Context) {
9196 var response * P2PListenerList
9297 s := shell .NewLocalShell ()
9398 reqBuilder := s .Request ("p2p/ls" )
94- // reqBuilder.Arguments("arg1", "arg2")
9599 err := reqBuilder .Exec (context .Background (), & response )
96100 if err != nil {
97101 log .Fatal (err )
@@ -103,14 +107,25 @@ func ListStreams(c *gin.Context) {
103107 var response * P2PStreamsList
104108 s := shell .NewLocalShell ()
105109 reqBuilder := s .Request ("p2p/stream/ls" )
106- // reqBuilder.Arguments("arg1", "arg2")
107110 err := reqBuilder .Exec (context .Background (), & response )
108111 if err != nil {
109112 log .Fatal (err )
110113 }
111114 c .IndentedJSON (http .StatusOK , response .Streams )
112115}
113116
117+ func EnableLibp2pStreaming () {
118+ var response * ConfigResult
119+ s := shell .NewLocalShell ()
120+ reqBuilder := s .Request ("config" )
121+ reqBuilder .Arguments ("Experimental.Libp2pStreamMounting" , "true" )
122+ reqBuilder .Option ("bool" , true )
123+ err := reqBuilder .Exec (context .Background (), & response )
124+ if err != nil {
125+ log .Fatal (err )
126+ }
127+ }
128+
114129// Send echo request packets to IPFS hosts.
115130func Ping (c * gin.Context ) {
116131 var response * PingResult
0 commit comments