mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-05-24 15:56:37 +00:00

* added OSC response listener with logging added Machine NFT issuance for each machine attestation process added CID and Planetmint Issuer extPublicKey to the issuance process removed type inconsistency * added machine NFT creation criteria * [toml] Parsing does not allow sub-structs * made OSC listener port configurable Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com> Signed-off-by: Julian Strobl <jmastr@mailbox.org> Co-authored-by: Julian Strobl <jmastr@mailbox.org>
30 lines
699 B
Go
30 lines
699 B
Go
package keeper
|
|
|
|
import (
|
|
config "planetmint-go/config"
|
|
"strconv"
|
|
|
|
"github.com/cometbft/cometbft/libs/log"
|
|
"github.com/hypebeast/go-osc/osc"
|
|
)
|
|
|
|
func (k Keeper) IssueResponseHandler(logger log.Logger) {
|
|
conf := config.GetConfig()
|
|
addr := "0.0.0.0:" + strconv.FormatInt(int64(conf.OSCServicePort), 10)
|
|
d := osc.NewStandardDispatcher()
|
|
err := d.AddMsgHandler("/rddl/resp", func(msg *osc.Message) {
|
|
logger.Info("Issue Response: " + msg.String())
|
|
})
|
|
if err != nil {
|
|
logger.Error("Unable to add handler to OSC service.")
|
|
}
|
|
server := &osc.Server{
|
|
Addr: addr,
|
|
Dispatcher: d,
|
|
}
|
|
err = server.ListenAndServe()
|
|
if err != nil {
|
|
logger.Error("Unable to start the OSC service.")
|
|
}
|
|
}
|