Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pagu-project/Pagu into feat/target-…
Browse files Browse the repository at this point in the history
…command
  • Loading branch information
mj committed Jun 28, 2024
2 parents e933222 + da9a138 commit 325b304
Show file tree
Hide file tree
Showing 222 changed files with 11 additions and 37,332 deletions.
19 changes: 2 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.26
github.com/bwmarrin/discordgo v0.28.1
github.com/labstack/echo/v4 v4.12.0
github.com/pactus-project/pactus v1.2.0
github.com/pactus-project/pactus v1.3.0
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.64.0
Expand All @@ -25,37 +25,23 @@ require (
require (
github.com/NathanBaulch/protoc-gen-cobra v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/kilic/bls12-381 v0.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.35.1
github.com/libp2p/go-libp2p v0.35.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.12.4 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/zerolog v1.33.0
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
Expand All @@ -73,5 +59,4 @@ require (
google.golang.org/protobuf v1.34.2
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/yaml.v3 v3.0.1
lukechampine.com/blake3 v1.3.0 // indirect
)
7 changes: 2 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU=
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down Expand Up @@ -199,8 +197,8 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pactus-project/pactus v1.2.0 h1:2ac7xxGXKkH9lfJZF7i8h6wfWe5cS1wWRdbl+nHYX/4=
github.com/pactus-project/pactus v1.2.0/go.mod h1:ZOudkajUDT6Sheh/iRCv8fJB+DCSuPaBF4zu8tYA0qM=
github.com/pactus-project/pactus v1.3.0 h1:XsmME/q2KJOec5fXIz3oZFT7oIwHo8D5KJDc2+gd8e0=
github.com/pactus-project/pactus v1.3.0/go.mod h1:ZOudkajUDT6Sheh/iRCv8fJB+DCSuPaBF4zu8tYA0qM=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
github.com/pion/datachannel v1.5.6 h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg=
Expand Down Expand Up @@ -325,7 +323,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
Expand Down
8 changes: 1 addition & 7 deletions internal/engine/command/network/node_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/pagu-project/Pagu/internal/entity"

"github.com/libp2p/go-libp2p/core/peer"
"github.com/pactus-project/pactus/types/amount"
"github.com/pagu-project/Pagu/internal/engine/command"
utils2 "github.com/pagu-project/Pagu/pkg/utils"
Expand All @@ -19,16 +18,11 @@ func (n *Network) nodeInfoHandler(cmd command.Command, _ entity.AppID, _ string,
return cmd.ErrorResult(err)
}

peerID, err := peer.IDFromBytes(peerInfo.PeerId)
if err != nil {
return cmd.ErrorResult(err)
}

ip := utils2.ExtractIPFromMultiAddr(peerInfo.Address)
geoData := utils2.GetGeoIP(ip)

nodeInfo := &NodeInfo{
PeerID: peerID.String(),
PeerID: peerInfo.PeerId,
IPAddress: peerInfo.Address,
Agent: peerInfo.Agent,
Moniker: peerInfo.Moniker,
Expand Down
8 changes: 1 addition & 7 deletions internal/engine/command/phoenix/node_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/pagu-project/Pagu/internal/entity"

"github.com/libp2p/go-libp2p/core/peer"
"github.com/pactus-project/pactus/types/amount"
"github.com/pagu-project/Pagu/internal/engine/command"
"github.com/pagu-project/Pagu/internal/engine/command/network"
Expand All @@ -21,16 +20,11 @@ func (pt *Phoenix) nodeInfoHandler(cmd command.Command, _ entity.AppID, _ string
return cmd.ErrorResult(err)
}

peerID, err := peer.IDFromBytes(peerInfo.PeerId)
if err != nil {
return cmd.ErrorResult(err)
}

ip := utils2.ExtractIPFromMultiAddr(peerInfo.Address)
geoData := utils2.GetGeoIP(ip)

nodeInfo := &network.NodeInfo{
PeerID: peerID.String(),
PeerID: peerInfo.PeerId,
IPAddress: peerInfo.Address,
Agent: peerInfo.Agent,
Moniker: peerInfo.Moniker,
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (c *Client) GetPeerInfo(ctx context.Context, address string) (*pactus.PeerI
networkInfo, _ := c.GetNetworkInfo(ctx)
if networkInfo != nil {
for _, p := range networkInfo.ConnectedPeers {
for _, addr := range p.ConsensusAddress {
for _, addr := range p.ConsensusAddresses {
if addr != "" {
if addr == address {
return p, nil
Expand Down Expand Up @@ -99,7 +99,7 @@ func (c *Client) GetValidatorInfoByNumber(ctx context.Context, num int32) (*pact
func (c *Client) TransactionData(ctx context.Context, hash string) (*pactus.TransactionInfo, error) {
data, err := c.transactionClient.GetTransaction(ctx,
&pactus.GetTransactionRequest{
Id: []byte(hash),
Id: hash,
Verbosity: pactus.TransactionVerbosity_TRANSACTION_DATA,
})
if err != nil {
Expand Down Expand Up @@ -134,7 +134,7 @@ func (c *Client) GetNodeInfo(ctx context.Context) (*pactus.GetNodeInfoResponse,

func (c *Client) GetTransactionData(ctx context.Context, txID string) (*pactus.GetTransactionResponse, error) {
return c.transactionClient.GetTransaction(ctx, &pactus.GetTransactionRequest{
Id: []byte(txID),
Id: txID,
Verbosity: pactus.TransactionVerbosity_TRANSACTION_DATA,
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (cm *Mgr) updateValMap() {
}

for _, p := range networkInfo.ConnectedPeers {
for _, addr := range p.ConsensusAddress {
for _, addr := range p.ConsensusAddresses {
current := freshValMap[addr]
if current != nil {
if current.LastSent < p.LastSent {
Expand Down
17 changes: 0 additions & 17 deletions vendor/github.com/decred/dcrd/dcrec/secp256k1/v4/LICENSE

This file was deleted.

72 changes: 0 additions & 72 deletions vendor/github.com/decred/dcrd/dcrec/secp256k1/v4/README.md

This file was deleted.

This file was deleted.

Loading

0 comments on commit 325b304

Please sign in to comment.