Skip to content

Commit

Permalink
chore(deps): use adder 0.24.2 (#284)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <[email protected]>
  • Loading branch information
wolf31o2 authored Oct 17, 2024
1 parent 404b650 commit 90a8dfb
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 80 deletions.
12 changes: 3 additions & 9 deletions cmd/bluefin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/blinklabs-io/bluefin/internal/config"
"github.com/blinklabs-io/bluefin/internal/indexer"
"github.com/blinklabs-io/bluefin/internal/logging"
"github.com/blinklabs-io/bluefin/internal/storage"
"github.com/blinklabs-io/bluefin/internal/version"
"github.com/blinklabs-io/bluefin/internal/wallet"
Expand Down Expand Up @@ -61,15 +62,8 @@ func main() {
}

// Configure logger
logLevel := slog.LevelInfo
if cmdlineFlags.debug {
logLevel = slog.LevelDebug
}
logger := slog.New(
slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
Level: logLevel,
}),
)
logging.Configure()
logger := logging.GetLogger()
slog.SetDefault(logger)

slog.Info(
Expand Down
17 changes: 11 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ toolchain go1.22.6

require (
github.com/Salvionied/apollo v1.0.13-0.20240908221422-e50b26fff03e
github.com/blinklabs-io/adder v0.23.4
github.com/blinklabs-io/adder v0.24.2
github.com/blinklabs-io/bursa v0.8.2
github.com/blinklabs-io/cardano-models v0.3.7
github.com/blinklabs-io/gouroboros v0.99.0
github.com/blinklabs-io/gouroboros v0.100.0
github.com/blinklabs-io/merkle-patricia-forestry v0.1.0
github.com/dgraph-io/badger/v4 v4.3.1
github.com/kelseyhightower/envconfig v1.4.0
Expand All @@ -34,7 +34,11 @@ require (
require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Salvionied/cbor/v2 v2.6.0 // indirect
github.com/SundaeSwap-finance/kugo v1.0.5 // indirect
github.com/SundaeSwap-finance/ogmigo/v6 v6.0.0-20240117201106-ce491d0b031e // indirect
github.com/aws/aws-sdk-go v1.48.7 // indirect
github.com/btcsuite/btcutil v1.0.2 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dgraph-io/ristretto v1.0.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
Expand All @@ -48,23 +52,24 @@ require (
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/flatbuffers v24.3.25+incompatible // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.10 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/maestro-org/go-sdk v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/utxorpc/go-codegen v0.10.0 // indirect
github.com/utxorpc/go-codegen v0.11.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
41 changes: 29 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ github.com/Salvionied/apollo v1.0.13-0.20240908221422-e50b26fff03e h1:Pvo1XJK30L
github.com/Salvionied/apollo v1.0.13-0.20240908221422-e50b26fff03e/go.mod h1:lOk22W7FRdqg107bHMo8K68P0WIoDejbd9TQpXRLI20=
github.com/Salvionied/cbor/v2 v2.6.0 h1:OEwlZLiodLdNeM9wFoSydLvj6/rHRaxu5G8VzwXSeuY=
github.com/Salvionied/cbor/v2 v2.6.0/go.mod h1:oFxaUo/mQ5sG1k459nzctGdYa80jy0ZqZ9pln9C/fGw=
github.com/SundaeSwap-finance/kugo v1.0.5 h1:GWUbHkAIIMh1SmGMCw5r0rpOvriRsEoLpp5ofufWRvs=
github.com/SundaeSwap-finance/kugo v1.0.5/go.mod h1:jkNGTmwLRdUPKVzkOOQjxqkpPTDw5gJ2hkJi3zUF9tA=
github.com/SundaeSwap-finance/ogmigo/v6 v6.0.0-20240117201106-ce491d0b031e h1:wYmyTXTnrYNMZqe3qFs9dJiUYy+yhZrNJFbN49tSjbY=
github.com/SundaeSwap-finance/ogmigo/v6 v6.0.0-20240117201106-ce491d0b031e/go.mod h1:CsDGcgbkKoz6S4h0RJ30go7oXG+KhGE2KLhBpRFnEqA=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/blinklabs-io/adder v0.23.4 h1:kBEacpX+SqiMSIItJf5BHg987phwqs9UtmePEq8zdIQ=
github.com/blinklabs-io/adder v0.23.4/go.mod h1:LfLui6ULQyv7pTloIq8bZl2577Lhd6XxDxRiUQSxRmU=
github.com/aws/aws-sdk-go v1.48.7 h1:gDcOhmkohlNk20j0uWpko5cLBbwSkB+xpkshQO45F7Y=
github.com/aws/aws-sdk-go v1.48.7/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/blinklabs-io/adder v0.24.2 h1:42+/o4qO/nI7ddOZYQQdJQ8lUYS2eJwJCXu/vDvMJzM=
github.com/blinklabs-io/adder v0.24.2/go.mod h1:eQfbVGMxbfPg5B1PhKNh21bTehXjjBLevppGwdkcxQg=
github.com/blinklabs-io/bursa v0.8.2 h1:f4ofPhTCW/Kev5lMrHRqf37s91NrUeVrpPvL4+JWqxE=
github.com/blinklabs-io/bursa v0.8.2/go.mod h1:gwpOJC25ASg+xL5lF8nHGMA0Aqv3vt41tGUDiruFjew=
github.com/blinklabs-io/cardano-models v0.3.7 h1:KkIFnimGf/5JLL8JPsH7hbfzUrC8qfHBYv3fx+AJSb4=
github.com/blinklabs-io/cardano-models v0.3.7/go.mod h1:gnL+MVNX7b4bxH7AjeV1xJBbwIqwvXhJDOWiVt5ji50=
github.com/blinklabs-io/gouroboros v0.99.0 h1:tGiti2mPjQM/rVOYi1ZrCSlKh8Qt3iQUkDdsOeWKuvw=
github.com/blinklabs-io/gouroboros v0.99.0/go.mod h1:gU9pBcL1h584sVqYF8H7JJcB2x0n1HdWcmWP11VYxPE=
github.com/blinklabs-io/gouroboros v0.100.0 h1:f1M0AA+Zi4YC4sbR0gJBOaMyKTClRTNY894r4Lm7TDk=
github.com/blinklabs-io/gouroboros v0.100.0/go.mod h1:otpDPTJTU/EVt3J4axaJAA1gF/0UtalSdVxVqXK8Zuk=
github.com/blinklabs-io/merkle-patricia-forestry v0.1.0 h1:tpnFc3uhxm1g14aOd2WsGUJc8wJS1WsVe6tCDZqjGsI=
github.com/blinklabs-io/merkle-patricia-forestry v0.1.0/go.mod h1:0RVrI9p0itJdOGr35s3c8uGjO6iUkQ5dlZFsu8IoFYk=
github.com/blinklabs-io/ouroboros-mock v0.3.4 h1:codPfiI5vLeD6YdhKL5VwYSzy2N3Dsgx6xjcLsqFaJQ=
Expand All @@ -29,6 +35,8 @@ github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVa
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
Expand Down Expand Up @@ -95,10 +103,16 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
Expand All @@ -122,6 +136,8 @@ github.com/maestro-org/go-sdk v1.2.0 h1:0YbC5bwRWklV25L1Z4p2pg2VQYasZGDaC9Epfxwd
github.com/maestro-org/go-sdk v1.2.0/go.mod h1:EYaRwFT8nkwFzZsN6xK256j+r7ASUUn9p44RlaqYjE8=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE=
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
Expand All @@ -145,10 +161,12 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/utxorpc/go-codegen v0.10.0 h1:EVRNc136CThXbbGeYV/oIy6NKfcZGLH2QSRmLTPE6TQ=
github.com/utxorpc/go-codegen v0.10.0/go.mod h1:+npvJc9wftIf8JMtWaRXxwjX0YlOCpNp1OlZVioNEO0=
github.com/utxorpc/go-codegen v0.11.0 h1:MxiC//jV/2xj8kadAuiW7wgtbE+4YhYrf4uxCh8NheA=
github.com/utxorpc/go-codegen v0.11.0/go.mod h1:NHXsykQWNetMMm2Kak+PfqmEY9Htgs6unJENPC4Kobs=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand All @@ -159,10 +177,6 @@ go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down Expand Up @@ -196,6 +210,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -239,14 +255,15 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
14 changes: 11 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
)

type Config struct {
Logging LoggingConfig `yaml:"logging"`
Storage StorageConfig `yaml:"storage"`
Indexer IndexerConfig `yaml:"indexer"`
Submit SubmitConfig `yaml:"submit"`
Expand All @@ -38,6 +39,10 @@ type Config struct {
NetworkMagic uint32
}

type LoggingConfig struct {
Debug bool `yaml:"debug" envconfig:"LOGGING_DEBUG"`
}

type IndexerConfig struct {
Address string `yaml:"address" envconfig:"INDEXER_TCP_ADDRESS"`
SocketPath string `yaml:"socketPath" envconfig:"INDEXER_SOCKET_PATH"`
Expand All @@ -62,9 +67,9 @@ type WalletConfig struct {
}

type MinerConfig struct {
WorkerCount int `yaml:"workers" envconfig:"WORKER_COUNT"`
WorkerCount int `yaml:"workers" envconfig:"WORKER_COUNT"`
HashRateInterval int `yaml:"hashRateInterval" envconfig:"HASH_RATE_INTERVAL"`
Message string `yaml:"message" envconfig:"MINER_MESSAGE"`
Message string `yaml:"message" envconfig:"MINER_MESSAGE"`
}

type MetricsConfig struct {
Expand Down Expand Up @@ -96,7 +101,10 @@ var globalConfig = &Config{
Miner: MinerConfig{
WorkerCount: max(1, runtime.NumCPU()/2),
HashRateInterval: 60,
Message: fmt.Sprintf("Bluefin %s by Blink Labs", version.GetVersionString()),
Message: fmt.Sprintf(
"Bluefin %s by Blink Labs",
version.GetVersionString(),
),
},
Network: "mainnet",
Profile: "tuna-v2",
Expand Down
53 changes: 10 additions & 43 deletions internal/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"time"

"github.com/blinklabs-io/bluefin/internal/config"
"github.com/blinklabs-io/bluefin/internal/logging"
"github.com/blinklabs-io/bluefin/internal/miner"
"github.com/blinklabs-io/bluefin/internal/storage"
"github.com/blinklabs-io/bluefin/internal/wallet"
Expand Down Expand Up @@ -87,7 +88,7 @@ func (i *Indexer) Start() error {
inputOpts := []input_chainsync.ChainSyncOptionFunc{
input_chainsync.WithBulkMode(true),
input_chainsync.WithAutoReconnect(true),
input_chainsync.WithLogger(NewAdderLogger()),
input_chainsync.WithLogger(logging.GetLogger()),
input_chainsync.WithStatusUpdateFunc(i.updateStatus),
input_chainsync.WithNetwork(cfg.Network),
}
Expand Down Expand Up @@ -148,7 +149,9 @@ func (i *Indexer) Start() error {
// Configure pipeline filters
// We only care about transaction events
filterEvent := filter_event.New(
filter_event.WithTypes([]string{"chainsync.transaction", "chainsync.rollback"}),
filter_event.WithTypes(
[]string{"chainsync.transaction", "chainsync.rollback"},
),
)
i.pipeline.AddFilter(filterEvent)
// Configure pipeline output
Expand Down Expand Up @@ -198,7 +201,11 @@ func (i *Indexer) handleEventRollback(evt event.Event) error {
return err
}
slog.Info(
fmt.Sprintf("rolled back to %d.%s", eventRollback.SlotNumber, eventRollback.BlockHash),
fmt.Sprintf(
"rolled back to %d.%s",
eventRollback.SlotNumber,
eventRollback.BlockHash,
),
)
// Purge older deleted UTxOs
if err := store.PurgeDeletedUtxos(eventRollback.SlotNumber - rollbackSlots); err != nil {
Expand Down Expand Up @@ -445,43 +452,3 @@ func (i *Indexer) updateStatus(status input_chainsync.ChainSyncStatus) {
func GetIndexer() *Indexer {
return globalIndexer
}

// TODO: remove the below once we switch adder to slog

// AdderLogger is a wrapper type to give our logger the expected interface
type AdderLogger struct{}

func NewAdderLogger() *AdderLogger {
return &AdderLogger{}
}

func (a *AdderLogger) Infof(msg string, args ...any) {
slog.Info(
fmt.Sprintf(msg, args...),
)
}

func (a *AdderLogger) Warnf(msg string, args ...any) {
slog.Warn(
fmt.Sprintf(msg, args...),
)
}

func (a *AdderLogger) Debugf(msg string, args ...any) {
slog.Debug(
fmt.Sprintf(msg, args...),
)
}

func (a *AdderLogger) Errorf(msg string, args ...any) {
slog.Error(
fmt.Sprintf(msg, args...),
)
}

func (a *AdderLogger) Fatalf(msg string, args ...any) {
slog.Error(
fmt.Sprintf(msg, args...),
)
os.Exit(1)
}
59 changes: 59 additions & 0 deletions internal/logging/logging.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2024 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package logging

import (
"log/slog"
"os"
"time"

"github.com/blinklabs-io/bluefin/internal/config"
)

var globalLogger *slog.Logger

func Configure() {
cfg := config.GetConfig()
var level slog.Level
if cfg.Logging.Debug {
level = slog.LevelDebug
} else {
level = slog.LevelInfo
}

handler := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
if a.Key == slog.TimeKey {
// Format the time attribute to use RFC3339 or your custom format
// Rename the time key to timestamp
return slog.String(
"timestamp",
a.Value.Time().Format(time.RFC3339),
)
}
return a
},
Level: level,
})
globalLogger = slog.New(handler).With("component", "main")

}

func GetLogger() *slog.Logger {
if globalLogger == nil {
Configure()
}
return globalLogger
}
3 changes: 2 additions & 1 deletion internal/miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ func (m *Miner) Start() {
if profileCfg.EpochTarget > 0 {
epochTarget = profileCfg.EpochTarget
}
if blockDataBlockNumber > 0 && blockDataBlockNumber%int64(epochNumber) == 0 {
if blockDataBlockNumber > 0 &&
blockDataBlockNumber%int64(epochNumber) == 0 {
adjustment := getDifficultyAdjustment(epochTime, int64(epochTarget))
epochTime = 0
newDifficulty := calculateDifficultyNumber(
Expand Down
Loading

0 comments on commit 90a8dfb

Please sign in to comment.