Skip to content

Commit

Permalink
fix(arns): remove service default for TRUSTED_ARNS_GATEWAY_URL
Browse files Browse the repository at this point in the history
By defaulting this in the service, there is no way to disable gateway arns resolution. Instead we will leave the default in the docker-compose and set to undefined if not provided to disable always falling back to arweave.net
  • Loading branch information
dtfiedler committed Sep 14, 2024
1 parent 3e606a6 commit f1a4158
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,8 @@ export const ARNS_ON_DEMAND_CIRCUIT_BREAKER_RESET_TIMEOUT_MS =
);

// TODO: support multiple gateway urls
export const TRUSTED_ARNS_GATEWAY_URL = env.varOrDefault(
export const TRUSTED_ARNS_GATEWAY_URL = env.varOrUndefined(
'TRUSTED_ARNS_GATEWAY_URL',
'https://__NAME__.arweave.net',
);

//
Expand Down
5 changes: 4 additions & 1 deletion src/init/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export const createArNSResolver = ({
trustedGatewayUrl?: string;
networkProcess?: AoIORead;
}): NameResolver => {
log.info(`Using ${resolutionOrder} for arns name resolution`);
const resolverMap: Record<ArNSResolverType, NameResolver | undefined> = {
'on-demand': new OnDemandArNSResolver({
log,
Expand Down Expand Up @@ -103,6 +102,10 @@ export const createArNSResolver = ({
}
}

log.info(
`Using ${resolvers.map((r) => r.constructor.name).join(', ')} for arns name resolution`,
);

return new CompositeArNSResolver({
log,
resolvers,
Expand Down

0 comments on commit f1a4158

Please sign in to comment.