From d6fcfd888a60cfbef001cca3774e18f9293f423f Mon Sep 17 00:00:00 2001 From: Mark Beamer Jr Date: Mon, 3 Feb 2020 01:25:54 -0500 Subject: [PATCH] Upgrade to latest lbrycrd support for internal-apis --- e2e/e2e.sh | 1 + go.mod | 4 +++- go.sum | 8 ++++++++ util/util.go | 9 +++++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/e2e/e2e.sh b/e2e/e2e.sh index e7fe7d3..e051e27 100755 --- a/e2e/e2e.sh +++ b/e2e/e2e.sh @@ -28,6 +28,7 @@ export BLOBS_DIRECTORY="$(pwd)/e2e/blobsfiles" export LBRYNET_DIR="$(pwd)/e2e/persist/.lbrynet/.local/share/lbry/lbrynet/" export LBRYNET_WALLETS_DIR="$(pwd)/e2e/persist/.lbrynet/.local/share/lbry/lbryum" export TMP_DIR="/var/tmp" +export CHAINNAME="lbrycrd_regtest" export UID cd ./e2e diff --git a/go.mod b/go.mod index 1144e92..0a82ff9 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/lbryio/ytsync +replace github.com/btcsuite/btcd => github.com/lbryio/lbrycrd.go v0.0.0-20200203050410-e1076f12bf19 + require ( cloud.google.com/go v0.46.3 // indirect github.com/ChannelMeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61 @@ -18,7 +20,7 @@ require ( github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/hashicorp/memberlist v0.1.5 // indirect github.com/hashicorp/serf v0.8.5 // indirect - github.com/lbryio/lbry.go/v2 v2.4.1-0.20191206194319-06764c3d007e + github.com/lbryio/lbry.go/v2 v2.4.7-0.20200203053542-c4772e61c565 github.com/lbryio/reflector.go v1.0.6-0.20190828131602-ce3d4403dbc6 github.com/miekg/dns v1.1.22 // indirect github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b diff --git a/go.sum b/go.sum index 28ced5a..c701b06 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,8 @@ github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9 github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803 h1:j3AgPKKZtZStM2nyhrDSLSYgT7YHrZKdSkq1OYeLjvM= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYDPGi1WCPjy1tGyMpmDK8IEapSsszn7HE= @@ -215,6 +217,12 @@ github.com/lbryio/lbry.go v1.1.2 h1:Dyxc+glT/rVWJwHfIf7vjlPYYbjzrQz5ARmJd5Hp69c= github.com/lbryio/lbry.go v1.1.2/go.mod h1:JtyI30bU51rm0LZ/po3mQuzf++14OWb6kR/6mMRAmKU= github.com/lbryio/lbry.go/v2 v2.4.1-0.20191206194319-06764c3d007e h1:wN6r46L8EjgC2JyOImagQXaQvyF8Bd2QPjfXqv7oDAg= github.com/lbryio/lbry.go/v2 v2.4.1-0.20191206194319-06764c3d007e/go.mod h1:gbs/+PVII96AqsRgf+hY/F7sJkb/ciiX2yy3j+NApd0= +github.com/lbryio/lbry.go/v2 v2.4.7-0.20200109014510-1835deb2c9ce h1:B+sByBrbui3r7SlmI+rwD47E+eBJ4gmc3kU+O+lUBSU= +github.com/lbryio/lbry.go/v2 v2.4.7-0.20200109014510-1835deb2c9ce/go.mod h1:if3y+rnBnsZN4aYsWF/kHGpCta8kmLFflqRnMkKlX08= +github.com/lbryio/lbry.go/v2 v2.4.7-0.20200203053542-c4772e61c565 h1:rMRLCQwZKaRTeL8CHPjer5RhgYqphBH7NQTd1VNYBog= +github.com/lbryio/lbry.go/v2 v2.4.7-0.20200203053542-c4772e61c565/go.mod h1:LgFKEpZzJE72DVgSXXfg+2IGOhrC9Lzj6eLma18iNz8= +github.com/lbryio/lbrycrd.go v0.0.0-20200203050410-e1076f12bf19 h1:/zWD8dVIl7bV1TdJWqPqy9tpqixzX2Qxgit48h3hQcY= +github.com/lbryio/lbrycrd.go v0.0.0-20200203050410-e1076f12bf19/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002/go.mod h1:dAzPCBj3CKKWBGYBZxK6tKBP5SCgY2tqd9SnQd/OyKo= github.com/lbryio/lbryschema.go v0.0.0-20190602173230-6d2f69a36f46 h1:LemfR+rMxhf7nnOrzy2HqS7Me7SZ5gEwOcNFzKC8ySQ= github.com/lbryio/lbryschema.go v0.0.0-20190602173230-6d2f69a36f46/go.mod h1:dAzPCBj3CKKWBGYBZxK6tKBP5SCgY2tqd9SnQd/OyKo= diff --git a/util/util.go b/util/util.go index 996b5c7..16f8fb4 100644 --- a/util/util.go +++ b/util/util.go @@ -94,15 +94,20 @@ func IsRegTest() bool { } func GetLbrycrdClient(lbrycrdString string) (*lbrycrd.Client, error) { + chainName := os.Getenv("CHAINNAME") + chainParams, ok := lbrycrd.ChainParamsMap[chainName] + if !ok { + chainParams = lbrycrd.MainNetParams + } var lbrycrdd *lbrycrd.Client var err error if lbrycrdString == "" { - lbrycrdd, err = lbrycrd.NewWithDefaultURL() + lbrycrdd, err = lbrycrd.NewWithDefaultURL(&chainParams) if err != nil { return nil, err } } else { - lbrycrdd, err = lbrycrd.New(lbrycrdString) + lbrycrdd, err = lbrycrd.New(lbrycrdString, &chainParams) if err != nil { return nil, err }