Error with github.com/spacemonkeygo/monkit/v3

Hi there, I’m new to both Go and Storj. We recently had a developer leave the team that had far more knowledge in this area but we’re still commited to trying to use storj. I’m trying to get all the required libraries for storj and uplink. The previous developer had a Go server running that was accepting API requests and handling requests for writing and reading data to storj, I’m just trying to get it running again with the code he left behind.

The problem is that when I run:

go get github.com/storj/uplink

I get the error:

"code in directory /home/akaash/go/src/github.com/spacemonkeygo/monkit expects import “github.com/spacemonkeygo/monkit/v3

There are a bunch of files that reference this I don’t see any way to properly download the spacemonkey library, I’ve seen the error come up on some of my google searches but haven’t seen people describe their solutions much. Any help would be greatly appreciated.

Thanks,
Akaash

Hello Akaash,
glad you continuing to use uplink, but sorry youre encountering difficulty. We mentioned this to the engineers, and hopefully relay some useful info after they reply. Its already the weekend for most of them, as we are spread across timezones, so there may be some wait time; but the community team can give them a nudge when people are in the office.

Hello @AkaashMukherjee,
Welcome to the forum!

You can try to use a classic method, described on https://github.com/storj/storj/
i.e.

git clone https://github.com/storj/storj.git
cd storj
go install -v ./cmd/... 

What version of Go are you using? You can find out by running the command go version.

I suspect the problem has to do with trying to build without go module support, if that helps with the googling.

hmm… there are a bunch of missing packages when I don’t use go get

Updated my go version to 1.14.6 still the same error…

Hi Akaash,

let me try to jump on. Do you try to build a self-written app which is using our go uplink lib?

First I would expect that you do not need to pull the lib directly. In most cases, the go module support is used which will do this when you build your app.

We have an example code here on how to use our lib.

Is your code open source? Then I could try to figure out what ist wrong.

Hi @BlackDuck thanks for the reply. I also thought that there wouldn’t be a need to pull the library directly since it shoud be done through go as well. But that doesn’t seem to be working. Here’s the repo for the prototype that was started:

Also to be clear the developer that was workig on it before was using windows but it should be done with Linux.

Hi AkaashMukherjee,

Thanks for reaching out! It looks like this project has two issues:

  1. It needs to migrate to using Go modules. This way, the go tool will download everything it needs, our uplink library included. There’s pretty good information here as well as a set of example steps that work for your project: https://blog.golang.org/migrating-to-go-modules
  2. The next problem is updating the reference to the internal ./storj package as the fully qualified package instead: github.com/medical-blockchain/storj-go/storj

If you would like additional help, there’s many different ways to reach the greater Go community listed on their site: https://golang.org/help/

#matt

3 Likes

@AkaashMukherjee

I didn’t check your code in detail for other functional problems, but with the changed mentioned from brimstone your code is compiling on my machine.

I did

git clone https://github.com/medical-blockchain/storj-go.git
#changed line https://github.com/medical-blockchain/storj-go/blob/f10e1162b8dde73f2c35a5daa5f414aa565a244a/app.go#L14 from "./storj" to "github.com/medical-blockchain/storj-go/storj"
go mod init github.com/medical-blockchain/storj-go
go build app.go
1 Like

Thanks a lot @BlackDuck and @brimstone, as I’m very new to go I didn’t know about go modules, this is really good information. The server is running now. Thanks a lot for your help!

2 Likes