Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to go get LND as a library #5624

Closed
burdiyan opened this issue Aug 12, 2021 · 3 comments
Closed

Unable to go get LND as a library #5624

burdiyan opened this issue Aug 12, 2021 · 3 comments

Comments

@burdiyan
Copy link

Background

I want to use LND as a library, embedded into another Go binary. With some recent updates of LND, go get fails with errors related to etcd.

Your environment

  • version of lnd: v0.13.1-beta
  • which operating system (uname -a on *Nix): Darwin MacBook-Pro-2.local 19.6.0 Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64 x86_64
  • version of btcd, bitcoind, or other backend: N/A.
  • any other relevant environment details: Go 1.16.3.

Steps to reproduce

  1. mkdir lnd-lib && cd lnd-lib.
  2. go mod init lib.
  3. go get github.com/lightningnetwork/lnd@v0.13.1-beta.

Expected behaviour

Library downloaded and ready to be imported.

Actual behaviour

go get: github.com/lightningnetwork/lnd@v0.12.1-beta-branch updating to
	github.com/lightningnetwork/lnd@v0.13.1-beta requires
	go.etcd.io/etcd@v3.4.14+incompatible: verifying go.mod: go.etcd.io/etcd@v3.4.14+incompatible/go.mod: reading https://sum.golang.org/lookup/go.etcd.io/etcd@v3.4.14+incompatible: 410 Gone
	server response: not found: go.etcd.io/etcd@v3.4.14+incompatible: invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required`
@burdiyan
Copy link
Author

Interestingly, if I clone LND repo into my own code, and then use replace directive in my go.mod to use this local version, everything works fine.

@guggero
Copy link
Collaborator

guggero commented Aug 12, 2021

This is a bug in the etcd library we pulled in for lnd v0.13.1. There was something weird with the go module in that version. This has been fixed on master (and therefore will be fixed in the upcoming v0.14.0-beta).

For now, you can fix the problem by adding the following replace into your project's go.mod file:

// Fix incompatibility of etcd go.mod package.
// See https://github.com/etcd-io/etcd/issues/11154
replace go.etcd.io/etcd => go.etcd.io/etcd v0.5.0-alpha.5.0.20201125193152-8a03d2e9614b

@guggero guggero closed this as completed Aug 12, 2021
@burdiyan
Copy link
Author

Thanks, this helps

edouardparis added a commit to edouardparis/lntop that referenced this issue Aug 24, 2021
replace to go.etcd.io/etcd v0.5.0-alpha.5.0.20201125193152-8a03d2e9614b
see lightningnetwork/lnd#5624
edouardparis added a commit to edouardparis/lntop that referenced this issue Aug 24, 2021
replace to go.etcd.io/etcd v0.5.0-alpha.5.0.20201125193152-8a03d2e9614b
see lightningnetwork/lnd#5624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants