mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-16 04:43:07 +00:00
update accordingl to suggestion
This commit is contained in:
parent
4c6f87e62d
commit
2f6904edd1
@ -25,7 +25,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.23"
|
||||
go-version: "1.24"
|
||||
|
||||
- name: Install Go dependencies
|
||||
run: go mod download
|
||||
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
||||
[submodule "third_party/nwaku"]
|
||||
[submodule "vendor/nwaku"]
|
||||
path = vendor/nwaku
|
||||
url = https://github.com/logos-messaging/logos-messaging-nim.git
|
||||
|
||||
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
||||
module github.com/logos-messaging/logos-messaging-go-bindings
|
||||
|
||||
go 1.23.0
|
||||
go 1.24.0
|
||||
|
||||
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/status-im/go-ethereum v1.10.25-status.18
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ check-folders:
|
||||
fi
|
||||
|
||||
build:
|
||||
@echo "Building Waku Go Bindings (manual)..."
|
||||
@echo "Building Logos Messaging Go Bindings (manual)..."
|
||||
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o waku-bindings .
|
||||
|
||||
test: build
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
@ -10,27 +8,9 @@ import (
|
||||
)
|
||||
|
||||
func GetRSSKB() (uint64, error) {
|
||||
var m runtime.MemStats
|
||||
runtime.ReadMemStats(&m)
|
||||
|
||||
if runtime.GOOS == "linux" {
|
||||
data, err := os.ReadFile("/proc/self/status")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
var rss uint64
|
||||
for _, line := range []byte(string(data)) {
|
||||
if line == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if _, err := fmt.Sscanf(string(data), "VmRSS: %d kB", &rss); err == nil {
|
||||
return rss, nil
|
||||
}
|
||||
}
|
||||
|
||||
return m.Sys / 1024, nil
|
||||
var m runtime.MemStats
|
||||
runtime.ReadMemStats(&m)
|
||||
return m.Sys / 1024, nil
|
||||
}
|
||||
|
||||
func EncapsulatePeerID(p peer.ID, addrs ...multiaddr.Multiaddr) []multiaddr.Multiaddr {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user