Use default overridable gateway for ipfs/sourcify

This commit is contained in:
Willian Mitsuda 2021-09-05 16:55:37 -03:00
parent 9f7962b6d4
commit fd8bdf8765
1 changed files with 7 additions and 2 deletions

View File

@ -14,15 +14,20 @@ export const blockURL = (blockNum: BlockTag) => `/block/${blockNum}`;
export const blockTxsURL = (blockNum: BlockTag) => `/block/${blockNum}/txs`; 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 = ( export const sourcifyMetadata = (
checksummedAddress: string, checksummedAddress: string,
networkId: number networkId: number
) => ) =>
`http://localhost:7000/sourcify/contracts/full_match/${networkId}/${checksummedAddress}/metadata.json`; `${ipfsGatewayPrefix}/contracts/full_match/${networkId}/${checksummedAddress}/metadata.json`;
export const sourcifySourceFile = ( export const sourcifySourceFile = (
checksummedAddress: string, checksummedAddress: string,
networkId: number, networkId: number,
filepath: string filepath: string
) => ) =>
`http://localhost:7000/sourcify/contracts/full_match/${networkId}/${checksummedAddress}/sources/${filepath}`; `${ipfsGatewayPrefix}/contracts/full_match/${networkId}/${checksummedAddress}/sources/${filepath}`;