From fd8bdf8765b4a5891df36a34179998ace15715f0 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sun, 5 Sep 2021 16:55:37 -0300 Subject: [PATCH] Use default overridable gateway for ipfs/sourcify --- src/url.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/url.ts b/src/url.ts index 1b4da9c..d9f8459 100644 --- a/src/url.ts +++ b/src/url.ts @@ -14,15 +14,20 @@ export const blockURL = (blockNum: BlockTag) => `/block/${blockNum}`; export const blockTxsURL = (blockNum: BlockTag) => `/block/${blockNum}/txs`; +// const ipfsGatewayPrefix = "http://localhost:7000/sourcify"; +const sourcifyRootHash = + "k51qzi5uqu5dll0ocge71eudqnrgnogmbr37gsgl12uubsinphjoknl6bbi41p"; +const ipfsGatewayPrefix = `https://ipfs.io/ipns/${sourcifyRootHash}`; + export const sourcifyMetadata = ( checksummedAddress: string, networkId: number ) => - `http://localhost:7000/sourcify/contracts/full_match/${networkId}/${checksummedAddress}/metadata.json`; + `${ipfsGatewayPrefix}/contracts/full_match/${networkId}/${checksummedAddress}/metadata.json`; export const sourcifySourceFile = ( checksummedAddress: string, networkId: number, filepath: string ) => - `http://localhost:7000/sourcify/contracts/full_match/${networkId}/${checksummedAddress}/sources/${filepath}`; + `${ipfsGatewayPrefix}/contracts/full_match/${networkId}/${checksummedAddress}/sources/${filepath}`;