This is just question.
Some commands (“core/commands/add.go”, “core/commands/bitswap.go” and more.) are using go-ipfs-cmds package.
Those were replaced last year.
Will devs rewrite legacy commands (e,g, core/commands/bootstrap.go) using go-ipfs-cmds in the future ?
Thanks
@stebalien Thank you for reply
Yeah, I’d like to contribute new command code if possible. (But, I started to learn Golang this year )
Sorry, One more question.
New designed command was changed “Run”'s arguments by this PR.
From
import cmds "github.com/ipfs/go-ipfs/commands"
var AddCmd = &cmds.Command{
Run: func(req cmds.Request, res cmds.Response) {...}
}
To
import "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds"
var AddCmd = &cmds.Command{
Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) {...}
}
Third party apps (Like Openbazaar) can’t do cmds.Response.Output()
using new designed command.
Because,“cmds.Response” was removed from “Run”'s arguments. (Openbazaar is still using legacy go-ipfs.)
If third party developers wants to take the output, They will need to take output through STDOUT now.
Is my understanding wrong ? Or, can we take the ouput struct by other way ?
@stebalien Hi. I excited about IPFS’s ‘Core API’ https://blog.ipfs.io/34-go-ipfs-0.4.14#ipfs-core-api.
“Once finished, the Core API will be the primary way to interact with go-ipfs using go”.
I believe the Core API solve my questions.
Thanks.
Sorry, I missed your reply. To answer both of your questions, yes. The “commands” are for the HTTP API, not when building go-ipfs into your application.
1 Like