Skip to content

Commit

Permalink
SQUASHME: inter-tool: pick among rpcAddrs
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Jul 13, 2023
1 parent c6f6ca8 commit 6045ee1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/inter-cli/src/inter-tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ const main = async () => {
return config;
};

const pick = xs => xs[Math.floor(Math.random() * xs.length)];

// cosmjs-based RPC client is only used for .Children()
const makeRpcClient = () =>
provideConfig().then(c => {
const [rpcAddr] = c.rpcAddrs;
tui.warn('TODO: pick among >1 rpcAddrs', { rpcAddr });
const rpcAddr = pick(c.rpcAddrs);
return makeHttpClient(rpcAddr, globalThis.fetch);
});

Expand Down

0 comments on commit 6045ee1

Please sign in to comment.