summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralgo-devops-service <ci-bot@algorand.com>2024-02-14 01:00:26 +0000
committeralgo-devops-service <ci-bot@algorand.com>2024-02-14 01:00:26 +0000
commit4766c5db4d9ba5c79c8e3098a795d928c3b3eb7f (patch)
treef69fe9b7bfcf352b5acf160efbf57a88eaabd516
parent975d694709a8c0d2b26da9a9eb3244a4c428edff (diff)
parentd8c825d96b90b4f1c84a5b3771987ab53bfc8568 (diff)
FI from master
-rw-r--r--cmd/catchpointdump/net.go2
-rw-r--r--network/wsNetwork.go6
-rw-r--r--network/wsNetwork_test.go2
-rw-r--r--package-deploy.yaml1
-rwxr-xr-xscripts/release/mule/common/ensure_centos8_image.sh17
-rwxr-xr-xscripts/release/mule/deploy/deb/deploy.sh25
-rwxr-xr-xscripts/release/mule/deploy/docker/docker.sh6
-rwxr-xr-xscripts/release/mule/deploy/releases_page/generate_releases_page.sh9
-rwxr-xr-xscripts/release/mule/deploy/rpm/deploy.sh42
-rwxr-xr-xscripts/release/mule/sign/sign.sh24
-rw-r--r--test/muleCI/mule.yaml35
-rw-r--r--tools/network/bootstrap.go14
-rw-r--r--tools/network/bootstrap_test.go5
-rw-r--r--tools/network/telemetryURIUpdateService.go3
14 files changed, 81 insertions, 110 deletions
diff --git a/cmd/catchpointdump/net.go b/cmd/catchpointdump/net.go
index 2de40c3c2..41e1fd1dd 100644
--- a/cmd/catchpointdump/net.go
+++ b/cmd/catchpointdump/net.go
@@ -78,7 +78,7 @@ var netCmd = &cobra.Command{
if relayAddress != "" {
addrs = []string{relayAddress}
} else {
- addrs, err = tools.ReadFromSRV("algobootstrap", "tcp", networkName, "", false)
+ addrs, err = tools.ReadFromSRV(context.Background(), "algobootstrap", "tcp", networkName, "", false)
if err != nil || len(addrs) == 0 {
reportErrorf("Unable to bootstrap records for '%s' : %v", networkName, err)
}
diff --git a/network/wsNetwork.go b/network/wsNetwork.go
index 5bfabbaf2..92a02976b 100644
--- a/network/wsNetwork.go
+++ b/network/wsNetwork.go
@@ -289,7 +289,7 @@ type WebsocketNetwork struct {
protocolVersion string
// resolveSRVRecords is a function that resolves SRV records for a given service, protocol and name
- resolveSRVRecords func(service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (addrs []string, err error)
+ resolveSRVRecords func(ctx context.Context, service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (addrs []string, err error)
}
const (
@@ -1887,7 +1887,7 @@ func (wn *WebsocketNetwork) mergePrimarySecondaryRelayAddressSlices(network prot
func (wn *WebsocketNetwork) getDNSAddrs(dnsBootstrap string) (relaysAddresses []string, archiverAddresses []string) {
var err error
- relaysAddresses, err = wn.resolveSRVRecords("algobootstrap", "tcp", dnsBootstrap, wn.config.FallbackDNSResolverAddress, wn.config.DNSSecuritySRVEnforced())
+ relaysAddresses, err = wn.resolveSRVRecords(wn.ctx, "algobootstrap", "tcp", dnsBootstrap, wn.config.FallbackDNSResolverAddress, wn.config.DNSSecuritySRVEnforced())
if err != nil {
// only log this warning on testnet or devnet
if wn.NetworkID == config.Devnet || wn.NetworkID == config.Testnet {
@@ -1896,7 +1896,7 @@ func (wn *WebsocketNetwork) getDNSAddrs(dnsBootstrap string) (relaysAddresses []
relaysAddresses = nil
}
- archiverAddresses, err = wn.resolveSRVRecords("archive", "tcp", dnsBootstrap, wn.config.FallbackDNSResolverAddress, wn.config.DNSSecuritySRVEnforced())
+ archiverAddresses, err = wn.resolveSRVRecords(wn.ctx, "archive", "tcp", dnsBootstrap, wn.config.FallbackDNSResolverAddress, wn.config.DNSSecuritySRVEnforced())
if err != nil {
// only log this warning on testnet or devnet
if wn.NetworkID == config.Devnet || wn.NetworkID == config.Testnet {
diff --git a/network/wsNetwork_test.go b/network/wsNetwork_test.go
index e35cc7d17..ef5769bcf 100644
--- a/network/wsNetwork_test.go
+++ b/network/wsNetwork_test.go
@@ -4156,7 +4156,7 @@ func TestRefreshRelayArchivePhonebookAddresses(t *testing.T) {
}
// Mock the SRV record lookup
- netA.resolveSRVRecords = func(service string, protocol string, name string, fallbackDNSResolverAddress string,
+ netA.resolveSRVRecords = func(ctx context.Context, service string, protocol string, name string, fallbackDNSResolverAddress string,
secure bool) (addrs []string, err error) {
if service == "algobootstrap" && protocol == "tcp" && name == primarySRVBootstrap {
return primaryRelayResolvedRecords, nil
diff --git a/package-deploy.yaml b/package-deploy.yaml
index 8daf262ac..9b67a2fe6 100644
--- a/package-deploy.yaml
+++ b/package-deploy.yaml
@@ -56,7 +56,6 @@ agents:
- NETWORK=$NETWORK
- NO_DEPLOY=$NO_DEPLOY
- PACKAGES_DIR=$PACKAGES_DIR
- - S3_SOURCE=$S3_SOURCE
- STAGING=$STAGING
- VERSION=$VERSION
volumes:
diff --git a/scripts/release/mule/common/ensure_centos8_image.sh b/scripts/release/mule/common/ensure_centos8_image.sh
new file mode 100755
index 000000000..1ebd3475f
--- /dev/null
+++ b/scripts/release/mule/common/ensure_centos8_image.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+set -exo pipefail
+
+# Ensure the centos8 docker image is built and available
+
+DOCKER_IMAGE="algorand/go-algorand-ci-linux-centos8:amd64-$(sha1sum scripts/configure_dev-deps.sh | cut -f1 -d' ')"
+MATCH=${DOCKER_IMAGE/:*/}
+
+echo "Checking for RPM image"
+if docker images $DOCKER_IMAGE | grep -qs $MATCH > /dev/null 2>&1; then
+ echo "Image exists"
+else
+ echo "RPM image doesn't exist, building"
+ docker build --platform=linux/amd64 --build-arg ARCH=amd64 \
+ --build-arg GOLANG_VERSION=$(./scripts/get_golang_version.sh) -t $DOCKER_IMAGE -f docker/build/cicd.centos8.Dockerfile .
+fi
diff --git a/scripts/release/mule/deploy/deb/deploy.sh b/scripts/release/mule/deploy/deb/deploy.sh
index c9c4b4b6c..2584b8412 100755
--- a/scripts/release/mule/deploy/deb/deploy.sh
+++ b/scripts/release/mule/deploy/deb/deploy.sh
@@ -2,28 +2,13 @@
set -ex
-if [ -z "$NETWORK" ]
-then
- echo "[$0] Network is a required parameter."
- exit 1
-fi
-
-if [ -z "$STAGING" ]
-then
- echo "[$0] Staging is a required parameter."
- exit 1
-fi
-
-CHANNEL=$("./scripts/release/mule/common/get_channel.sh" "$NETWORK")
+CHANNEL=${CHANNEL:-$("./scripts/release/mule/common/get_channel.sh" "$NETWORK")}
VERSION=${VERSION:-$(./scripts/compute_build_number.sh -f)}
+PACKAGES_DIR=${PACKAGES_DIR:-~/packages}
+SNAPSHOT=${SNAPSHOT:-"${CHANNEL}-${VERSION}"}
-if [ -z "$SNAPSHOT" ]
-then
- SNAPSHOT="$CHANNEL-$VERSION"
-fi
-
-PACKAGES_DIR=/root/packages
-mkdir -p /root/packages
+mkdir -p $PACKAGES_DIR
+rm -f $PACKAGES_DIR/*.deb
aptly mirror update stable
aptly mirror update beta
diff --git a/scripts/release/mule/deploy/docker/docker.sh b/scripts/release/mule/deploy/docker/docker.sh
index ee0c55fe0..093922fd3 100755
--- a/scripts/release/mule/deploy/docker/docker.sh
+++ b/scripts/release/mule/deploy/docker/docker.sh
@@ -13,9 +13,9 @@ if [ -z "$NETWORK" ] || [ -z "$VERSION" ]; then
exit 1
fi
-if [[ ! "$NETWORK" =~ ^mainnet$|^testnet$|^betanet$|^alphanet$ ]]
+if [[ ! "$NETWORK" =~ ^mainnet$|^testnet$|^betanet$ ]]
then
- echo "[$0] Network values must be either \`mainnet\`, \`testnet\`, \`betanet\`, or \`alphanet\`."
+ echo "[$0] Network values must be either \`mainnet\`, \`testnet\`, or \`betanet\`."
exit 1
fi
@@ -28,7 +28,7 @@ then
# Build and push testnet.
./build_releases.sh --tagname "$VERSION" --network testnet --cached
-elif [ "$NETWORK" = betanet ] || [ "$NETWORK" = alphanet ]
+elif [ "$NETWORK" = betanet ]
then
./build_releases.sh --tagname "$VERSION" --network "$NETWORK"
fi
diff --git a/scripts/release/mule/deploy/releases_page/generate_releases_page.sh b/scripts/release/mule/deploy/releases_page/generate_releases_page.sh
index 5b6a488ce..75df10d52 100755
--- a/scripts/release/mule/deploy/releases_page/generate_releases_page.sh
+++ b/scripts/release/mule/deploy/releases_page/generate_releases_page.sh
@@ -8,13 +8,8 @@
set -ex
-if [ -z "$NETWORK" ] || [ -z "$VERSION" ]
-then
- echo "[$0] Network and version are required parameters."
- exit 1
-fi
-
-CHANNEL=$(./scripts/release/mule/common/get_channel.sh "$NETWORK")
+CHANNEL=${CHANNEL:-$(./scripts/release/mule/common/get_channel.sh "$NETWORK")}
+VERSION=${VERSION:-$(./scripts/compute_build_number.sh -f)}
cd scripts/release/mule/deploy/releases_page
diff --git a/scripts/release/mule/deploy/rpm/deploy.sh b/scripts/release/mule/deploy/rpm/deploy.sh
index f660f1d01..b96cccd6c 100755
--- a/scripts/release/mule/deploy/rpm/deploy.sh
+++ b/scripts/release/mule/deploy/rpm/deploy.sh
@@ -7,28 +7,25 @@ echo
date "+build_release begin DEPLOY rpm stage %Y%m%d_%H%M%S"
echo
-if [ -z "$NETWORK" ]; then
- echo "[$0] NETWORK is missing."
- exit 1
-fi
-
-CHANNEL=$(./scripts/release/mule/common/get_channel.sh "$NETWORK")
+CHANNEL=${CHANNEL:-$(./scripts/release/mule/common/get_channel.sh "$NETWORK")}
VERSION=${VERSION:-$(./scripts/compute_build_number.sh -f)}
NO_DEPLOY=${NO_DEPLOY:-false}
-OS_TYPE=$(./scripts/release/mule/common/ostype.sh)
-PACKAGES_DIR=${PACKAGES_DIR:-"./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE"}
-STAGING=${STAGING:-"algorand-staging/releases"}
+PACKAGES_DIR=${PACKAGES_DIR:-"tmp"}
if [ -n "$S3_SOURCE" ]
then
PREFIX="$S3_SOURCE/$CHANNEL/$VERSION"
if [ "$CHANNEL" == "beta" ]
then
- aws s3 cp "s3://$PREFIX/algorand-beta-$VERSION-1.x86_64.rpm" /root
- aws s3 cp "s3://$PREFIX/algorand-devtools-beta-$VERSION-1.x86_64.rpm" /root
+ aws s3 cp "s3://$PREFIX/algorand-beta-$VERSION-1.x86_64.rpm" $PACKAGES_DIR
+ aws s3 cp "s3://$PREFIX/algorand-devtools-beta-$VERSION-1.x86_64.rpm" $PACKAGES_DIR
+ aws s3 cp "s3://$PREFIX/algorand-beta-$VERSION-1.aarch64.rpm" $PACKAGES_DIR
+ aws s3 cp "s3://$PREFIX/algorand-devtools-beta-$VERSION-1.aarch64.rpm" $PACKAGES_DIR
else
- aws s3 cp "s3://$PREFIX/algorand-$VERSION-1.x86_64.rpm" /root
- aws s3 cp "s3://$PREFIX/algorand-devtools-$VERSION-1.x86_64.rpm" /root
+ aws s3 cp "s3://$PREFIX/algorand-$VERSION-1.x86_64.rpm" $PACKAGES_DIR
+ aws s3 cp "s3://$PREFIX/algorand-devtools-$VERSION-1.x86_64.rpm" $PACKAGES_DIR
+ aws s3 cp "s3://$PREFIX/algorand-$VERSION-1.aarch64.rpm" $PACKAGES_DIR
+ aws s3 cp "s3://$PREFIX/algorand-devtools-$VERSION-1.aarch64.rpm" $PACKAGES_DIR
fi
else
cp "$PACKAGES_DIR"/*"$VERSION"*.rpm /root
@@ -56,11 +53,7 @@ cat << EOF > .rpmmacros
EOF
mkdir rpmrepo
-for rpm in $(ls *"$VERSION"*.rpm)
-do
- rpmsign --addsign "$rpm"
- cp -p "$rpm" rpmrepo
-done
+mv -f *"$VERSION"*.rpm rpmrepo
createrepo --database rpmrepo
rm -f rpmrepo/repodata/repomd.xml.asc
@@ -72,8 +65,19 @@ then
cp -r /root/rpmrepo .
else
aws s3 sync rpmrepo "s3://algorand-releases/rpm/$CHANNEL/"
+
# sync signatures to releases so that the .sig files load from there
- aws s3 sync s3://$STAGING/releases/$CHANNEL/ s3://algorand-releases/rpm/sigs/$CHANNEL/ --exclude='*' --include='*.rpm.sig'
+ if [ -n "$S3_SOURCE" ]; then
+ # if S3_SOURCE exists, we copied files from s3
+ echo "Copy signatures from s3 staging to s3 releases"
+ aws s3 sync s3://algorand-staging/releases/$CHANNEL/ s3://algorand-releases/rpm/sigs/$CHANNEL/ --exclude='*' --include='*.rpm.sig'
+
+ else
+ # We are working with files locally
+ popd
+ echo "Copy local signatures to s3 releases"
+ aws s3 sync "$PACKAGES_DIR" "s3://algorand-releases/rpm/sigs/$CHANNEL/" --exclude='*' --include='*.rpm.sig'
+ fi
fi
echo
diff --git a/scripts/release/mule/sign/sign.sh b/scripts/release/mule/sign/sign.sh
index e08e2d52d..89baedb9c 100755
--- a/scripts/release/mule/sign/sign.sh
+++ b/scripts/release/mule/sign/sign.sh
@@ -10,18 +10,13 @@ echo
date "+build_release begin SIGN stage %Y%m%d_%H%M%S"
echo
-if [ -z "$NETWORK" ]; then
- echo "[$0] NETWORK is missing."
- exit 1
-fi
-
-CHANNEL=$(./scripts/release/mule/common/get_channel.sh "$NETWORK")
+CHANNEL=${CHANNEL:-$(./scripts/release/mule/common/get_channel.sh "$NETWORK")}
VERSION=${VERSION:-$(./scripts/compute_build_number.sh -f)}
PKG_DIR="./tmp/node_pkgs"
SIGNING_KEY_ADDR=dev@algorand.com
OS_TYPE=$(./scripts/release/mule/common/ostype.sh)
-ARCHS=(amd64 arm arm64)
-ARCH_BITS=(x86_64 armv7l aarch64)
+ARCHS=(amd64 arm64)
+ARCH_BITS=(x86_64 aarch64)
# Note that we don't want to use $GNUPGHOME here because that is a documented env var for the gnupg
# project and if it's set in the environment mule will automatically pick it up, which could have
# unintended consequences and be hard to debug.
@@ -40,6 +35,14 @@ then
find "$GPG_DIR" -type f -exec chmod 600 {} \;
fi
+pushd /root
+cat << EOF > .rpmmacros
+%_gpg_name Algorand RPM <rpm@algorand.com>
+%__gpg /usr/bin/gpg2
+%__gpg_check_password_cmd true
+EOF
+popd
+
# Note that when downloading from the cloud that we'll get all packages for all architectures.
if [ -n "$S3_SOURCE" ]
then
@@ -87,13 +90,14 @@ for os in "${OS_TYPES[@]}"; do
for file in *.rpm
do
+ rpmsign --addsign "$file"
gpg -u rpm@algorand.com --detach-sign "$file"
done
HASHFILE="hashes_${CHANNEL}_${os}_${arch}_${VERSION}"
md5sum *.tar.gz *.deb *.rpm >> "$HASHFILE"
- shasum -a 256 *.tar.gz *.deb *.rpm >> "$HASHFILE"
- shasum -a 512 *.tar.gz *.deb *.rpm >> "$HASHFILE"
+ sha256sum *.tar.gz *.deb *.rpm >> "$HASHFILE"
+ sha512sum *.tar.gz *.deb *.rpm >> "$HASHFILE"
gpg -u "$SIGNING_KEY_ADDR" --detach-sign "$HASHFILE"
gpg -u "$SIGNING_KEY_ADDR" --clearsign "$HASHFILE"
diff --git a/test/muleCI/mule.yaml b/test/muleCI/mule.yaml
index cb75187db..afa73ae2c 100644
--- a/test/muleCI/mule.yaml
+++ b/test/muleCI/mule.yaml
@@ -61,22 +61,6 @@ agents:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
- ARCH=arm64v8
- GOARCH=arm64
- - name: cicd.ubuntu.arm
- dockerFilePath: docker/build/cicd.ubuntu.Dockerfile
- image: algorand/go-algorand-ci-linux
- version: scripts/configure_dev-deps.sh
- arch: arm32v7
- env:
- - TRAVIS_BRANCH=${GIT_BRANCH}
- - NETWORK=$NETWORK
- - VERSION=$VERSION
- - BUILD_NUMBER=$BUILD_NUMBER
- - GOHOSTARCH=arm
- - FULLVERSION=${FULLVERSION}
- buildArgs:
- - GOLANG_VERSION=`./scripts/get_golang_version.sh`
- - ARCH=arm32v7
- - GOARCH=armv6l
- name: docker-ubuntu
dockerFilePath: docker/build/docker.ubuntu.Dockerfile
image: algorand/go-algorand-docker-linux-ubuntu
@@ -122,10 +106,6 @@ tasks:
name: build.arm64
agent: cicd.ubuntu.arm64
target: ci-build
- - task: docker.Make
- name: build.arm
- agent: cicd.ubuntu.arm
- target: ci-build
- task: docker.Make
name: archive
@@ -168,12 +148,6 @@ tasks:
globSpecs:
- tmp/node_pkgs/**/*
- task: stash.Stash
- name: linux-arm
- bucketName: go-algorand-ci-cache
- stashId: ${JENKINS_JOB_CACHE_ID}/linux-arm
- globSpecs:
- - tmp/node_pkgs/**/*
- - task: stash.Stash
name: packages
bucketName: go-algorand-ci-cache
stashId: ${JENKINS_JOB_CACHE_ID}/packages
@@ -194,10 +168,6 @@ tasks:
bucketName: go-algorand-ci-cache
stashId: ${JENKINS_JOB_CACHE_ID}/darwin-amd64
- task: stash.Unstash
- name: linux-arm
- bucketName: go-algorand-ci-cache
- stashId: ${JENKINS_JOB_CACHE_ID}/linux-arm
- - task: stash.Unstash
name: darwin-arm64
bucketName: go-algorand-ci-cache
stashId: ${JENKINS_JOB_CACHE_ID}/darwin-arm64
@@ -233,15 +203,10 @@ jobs:
tasks:
- docker.Make.build.arm64
- stash.Stash.linux-arm64
- build-linux-arm32:
- tasks:
- - docker.Make.build.arm
- - stash.Stash.linux-arm
package-all:
tasks:
- stash.Unstash.linux-amd64
- stash.Unstash.linux-arm64
- - stash.Unstash.linux-arm
- stash.Unstash.darwin-arm64
- stash.Unstash.darwin-amd64
- docker.Make.deb.amd64
diff --git a/tools/network/bootstrap.go b/tools/network/bootstrap.go
index f04c67528..d30ae4bda 100644
--- a/tools/network/bootstrap.go
+++ b/tools/network/bootstrap.go
@@ -24,7 +24,7 @@ import (
"github.com/algorand/go-algorand/logging"
)
-func readFromSRV(service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (records []*net.SRV, err error) {
+func readFromSRV(ctx context.Context, service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (records []*net.SRV, err error) {
log := logging.Base()
if name == "" {
log.Debug("no dns lookup due to empty name")
@@ -38,14 +38,14 @@ func readFromSRV(service string, protocol string, name string, fallbackDNSResolv
controller := NewResolveController(secure, fallbackDNSResolverAddress, log)
systemResolver := controller.SystemResolver()
- _, records, sysLookupErr := systemResolver.LookupSRV(context.Background(), service, protocol, name)
+ _, records, sysLookupErr := systemResolver.LookupSRV(ctx, service, protocol, name)
if sysLookupErr != nil {
log.Infof("ReadFromBootstrap: DNS LookupSRV failed when using system resolver: %v", sysLookupErr)
var fallbackLookupErr error
if fallbackDNSResolverAddress != "" {
fallbackResolver := controller.FallbackResolver()
- _, records, fallbackLookupErr = fallbackResolver.LookupSRV(context.Background(), service, protocol, name)
+ _, records, fallbackLookupErr = fallbackResolver.LookupSRV(ctx, service, protocol, name)
}
if fallbackLookupErr != nil {
log.Infof("ReadFromBootstrap: DNS LookupSRV failed when using fallback '%s' resolver: %v", fallbackDNSResolverAddress, fallbackLookupErr)
@@ -54,7 +54,7 @@ func readFromSRV(service string, protocol string, name string, fallbackDNSResolv
if fallbackLookupErr != nil || fallbackDNSResolverAddress == "" {
fallbackResolver := controller.DefaultResolver()
var defaultLookupErr error
- _, records, defaultLookupErr = fallbackResolver.LookupSRV(context.Background(), service, protocol, name)
+ _, records, defaultLookupErr = fallbackResolver.LookupSRV(ctx, service, protocol, name)
if defaultLookupErr != nil {
err = fmt.Errorf("ReadFromBootstrap: DNS LookupSRV failed when using system resolver(%v), fallback resolver(%v), as well as using default resolver due to %v", sysLookupErr, fallbackLookupErr, defaultLookupErr)
return
@@ -65,8 +65,8 @@ func readFromSRV(service string, protocol string, name string, fallbackDNSResolv
}
// ReadFromSRV is a helper to collect SRV addresses for a given name
-func ReadFromSRV(service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (addrs []string, err error) {
- records, err := readFromSRV(service, protocol, name, fallbackDNSResolverAddress, secure)
+func ReadFromSRV(ctx context.Context, service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (addrs []string, err error) {
+ records, err := readFromSRV(ctx, service, protocol, name, fallbackDNSResolverAddress, secure)
if err != nil {
return addrs, err
}
@@ -88,7 +88,7 @@ func ReadFromSRV(service string, protocol string, name string, fallbackDNSResolv
// ReadFromSRVPriority is a helper to collect SRV addresses with priorities for a given name
func ReadFromSRVPriority(service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (prioAddrs map[uint16][]string, err error) {
- records, err := readFromSRV(service, protocol, name, fallbackDNSResolverAddress, secure)
+ records, err := readFromSRV(context.Background(), service, protocol, name, fallbackDNSResolverAddress, secure)
if err != nil {
return prioAddrs, err
}
diff --git a/tools/network/bootstrap_test.go b/tools/network/bootstrap_test.go
index 155615c70..a24bea422 100644
--- a/tools/network/bootstrap_test.go
+++ b/tools/network/bootstrap_test.go
@@ -17,6 +17,7 @@
package network
import (
+ "context"
"testing"
"github.com/algorand/go-algorand/test/partitiontest"
@@ -55,10 +56,10 @@ func TestReadFromSRV(t *testing.T) {
fallback := ""
secure := true
- addrs, err := ReadFromSRV("", protocol, name, fallback, secure)
+ addrs, err := ReadFromSRV(context.Background(), "", protocol, name, fallback, secure)
require.Error(t, err)
- addrs, err = ReadFromSRV(service, protocol, name, fallback, secure)
+ addrs, err = ReadFromSRV(context.Background(), service, protocol, name, fallback, secure)
require.NoError(t, err)
require.GreaterOrEqual(t, len(addrs), 1)
addr := addrs[0]
diff --git a/tools/network/telemetryURIUpdateService.go b/tools/network/telemetryURIUpdateService.go
index 66dd87dd0..2b4e61426 100644
--- a/tools/network/telemetryURIUpdateService.go
+++ b/tools/network/telemetryURIUpdateService.go
@@ -17,6 +17,7 @@
package network
import (
+ "context"
"net/url"
"strings"
"time"
@@ -132,5 +133,5 @@ func (t *telemetryURIUpdater) lookupTelemetryURL() (url *url.URL) {
}
func (t *telemetryURIUpdater) readFromSRV(protocol string, bootstrapID string) (addrs []string, err error) {
- return ReadFromSRV("telemetry", protocol, bootstrapID, t.cfg.FallbackDNSResolverAddress, t.cfg.DNSSecuritySRVEnforced())
+ return ReadFromSRV(context.Background(), "telemetry", protocol, bootstrapID, t.cfg.FallbackDNSResolverAddress, t.cfg.DNSSecuritySRVEnforced())
}