planetmint-go/x/machine/keeper/issue_response.go
Jürgen Eckel 01ef2dbfd0
Improve communication to liquid issuance service (#58)
* 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>
2023-08-04 16:38:18 +02:00

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.")
}
}