Skip to content

Commit

Permalink
fix(chain): update chain config from 1.5.4 (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
DLHTX authored Aug 14, 2023
1 parent c985c69 commit 32445ff
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/server/routers/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,13 @@ export const envRouter = t.router({
}

try {
// blockChains = await prisma.t_blockchain.findMany({
// select: {
// f_id: true,
// f_chain_id: true,
// f_chain_address: true
// }
// });
const ethClientRes = await axios.get(`${process.env.NEXT_PUBLIC_API_URL}/srv-applet-mgr/v0/configuration/eth_client`);
const clients: { [key: string]: string } = JSON.parse(ethClientRes.data.clients);
for (let key in clients) {
const f_chain_address = clients[key];
const f_chain_id = BigInt(key);
const f_id = BigInt(key);
blockChains.push({ f_id, f_chain_id, f_chain_address });
}
const ethClientRes = await axios.get(`${process.env.NEXT_PUBLIC_API_URL}/srv-applet-mgr/v0/configuration/chain_config`);
const chains: { chainID: number, name: string, endpoint: string }[] = JSON.parse(ethClientRes.data.chains);
chains.forEach(i => {
if (i.chainID) {
blockChains.push({ f_id: BigInt(i.chainID), f_chain_id: BigInt(i.chainID), f_chain_address: i.endpoint })
}
})
} catch (error) {
console.error(error);
}
Expand Down

0 comments on commit 32445ff

Please sign in to comment.