Hi,

The reason is that inside your govpp directory, you point to the latest version 
of GoVPP master branch, which supports the latest version of the VPP stats 
segment.

On the other hand, in your gst directory, I suspect that you have added govpp 
as a dependency (in go.mod) with a command like `go get git.fd.io/govpp.git 
<http://git.fd.io/govpp.git>`, which uses the latest released version. I think 
that this release does not support the stats segment evolution.
To use the latest version of govpp as a dependency, you should use the command  
`go get git.fd.io/govpp.git@master <http://git.fd.io/govpp.git@master%60>` 
<http://git.fd.io/govpp.git@master%60>. In general, if you want to use a 
specific commit, you can add @<commit-id> at the end of the get command.

Hope that helps.

Best regards,
Arthur

> Le 25 mars 2021 à 17:13, Юрий Иванов <format_...@outlook.com> a écrit :
> 
> Hi, first of all sorry for such noob question.
> I'm need to write go based program utilizing govpp stats-api.
> There is official example in library which I've trunk to minimal usable which 
> only opens socket:
> ~/GoVpp/govpp$ cat examples/stats-client/stats_api.go 
> package main
>
> import (
>         "log"
>         "git.fd.io/govpp.git/adapter/statsclient 
> <http://git.fd.io/govpp.git/adapter/statsclient>"
>         "git.fd.io/govpp.git/core <http://git.fd.io/govpp.git/core>"
> )
>
> func main() {
>         var (
>                 client *statsclient.StatsClient
>                 c      *core.StatsConnection
>                 err    error
>         )
>
>         client = statsclient.NewStatsClient("/run/vpp/stats.sock") 
> //(*statsSocket)
>         c, err = core.ConnectStats(client)
>         if err != nil {
>                 log.Fatalln("Connecting failed:", err)
>         }
>         defer c.Disconnect()
> }
> 
> In case I build it from govpp package with the help of make examples it 
> works, but when I've created separete my own project execution fails with 
> error:
> $ sudo ./stats 
> 2021/03/25 15:43:01 Connecting failed: stat segment version is not supported: 
> 2 (minimal version: 1)
> 
> What the difference when building the same file from govpp library folder 
> from separate project?
> 
> You may look all my steps to reproduce problem here 
> https://pastebin.com/Lv89BrVk <https://pastebin.com/Lv89BrVk>
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19023): https://lists.fd.io/g/vpp-dev/message/19023
Mute This Topic: https://lists.fd.io/mt/81606546/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to