File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ $(BINARY): mod-tidy $(GO_FILES)
24
24
mod-tidy :
25
25
go mod tidy
26
26
27
+ clean :
28
+ rm -f $(BINARY )
29
+
30
+ format :
31
+ go fmt ./...
32
+
33
+ golines :
34
+ golines -w --ignore-generated --chain-split-dots --max-len=80 --reformat-tags .
35
+
36
+ test :
37
+ go test -v ./...
38
+
27
39
# Build docker image
28
40
image : build
29
41
docker build -t $(BINARY ) .
Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ import (
7
7
"io"
8
8
"net/http"
9
9
"net/http/httptrace"
10
+ "strings"
10
11
"time"
11
12
13
+ "github.com/blinklabs-io/cardano-models"
12
14
"github.com/blinklabs-io/gouroboros/ledger"
15
+ "github.com/fxamacker/cbor/v2"
13
16
ginzap "github.com/gin-contrib/zap"
14
17
"github.com/gin-gonic/gin"
15
18
@@ -79,7 +82,21 @@ func handleSubmitTx(c *gin.Context) {
79
82
c .String (400 , fmt .Sprintf ("failed to parse transaction CBOR: %s" , err ))
80
83
return
81
84
}
82
- logger .Debugf ("transaction ID %s" , tx .Hash ())
85
+ logger .Debugf ("transaction ID: %s" , tx .Hash ())
86
+ // Debug log metadata messages
87
+ if tx .Metadata () != nil {
88
+ mdCbor := tx .Metadata ().Cbor ()
89
+ var msgMetadata models.Cip20Metadata
90
+ err := cbor .Unmarshal (mdCbor , & msgMetadata )
91
+ if err == nil {
92
+ if msgMetadata .Num674 .Msg != nil {
93
+ logger .Debugf (
94
+ "metadata msg: %s" ,
95
+ strings .Join (msgMetadata .Num674 .Msg , "\n " ),
96
+ )
97
+ }
98
+ }
99
+ }
83
100
// Send request to each backend
84
101
for _ , backend := range cfg .Backends {
85
102
go func (backend string ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ module github.com/blinklabs-io/tx-submit-api-mirror
3
3
go 1.20
4
4
5
5
require (
6
+ github.com/blinklabs-io/cardano-models v0.0.0-20231017185043-3138e1eca17e
6
7
github.com/blinklabs-io/gouroboros v0.61.0
8
+ github.com/fxamacker/cbor/v2 v2.5.0
7
9
github.com/gin-contrib/zap v0.2.0
8
10
github.com/gin-gonic/gin v1.9.1
9
11
github.com/kelseyhightower/envconfig v1.4.0
@@ -15,7 +17,6 @@ require (
15
17
github.com/bytedance/sonic v1.10.0 // indirect
16
18
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
17
19
github.com/chenzhuoyu/iasm v0.9.0 // indirect
18
- github.com/fxamacker/cbor/v2 v2.5.0 // indirect
19
20
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
20
21
github.com/gin-contrib/sse v0.1.0 // indirect
21
22
github.com/go-playground/locales v0.14.1 // indirect
Original file line number Diff line number Diff line change
1
+ github.com/blinklabs-io/cardano-models v0.0.0-20231017185043-3138e1eca17e h1:Ci4jouvRLR7wjvsl2symiMsXChcqykjL0eqkr+VyWng =
2
+ github.com/blinklabs-io/cardano-models v0.0.0-20231017185043-3138e1eca17e /go.mod h1:WrWzWgqqsY9sFQ0qpZw1hO4A9OdG5peIFQ1SCM5JTJ0 =
1
3
github.com/blinklabs-io/gouroboros v0.61.0 h1:HSAo2thM/4JM6tVF4e/o9f20aVElSckJVX6LdkvuNyE =
2
4
github.com/blinklabs-io/gouroboros v0.61.0 /go.mod h1:D5YJka8EyVmiXNMbRvjH23H9lNMLA4+qSlNNC/j7R0k =
3
5
github.com/bytedance/sonic v1.5.0 /go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM =
You can’t perform that action at this time.
0 commit comments