1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

fix gateway url ping

This commit is contained in:
Matthias Kretschmann 2019-09-18 18:38:02 +02:00
parent 752498d6b3
commit 1813207772
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 12 additions and 12 deletions

View File

@ -7,7 +7,7 @@ let ipfs: any = null
let ipfsMessage = ''
let ipfsVersion = ''
interface IpfsConfig {
export interface IpfsConfig {
host: string
port: string
protocol: string

View File

@ -1,4 +1,4 @@
@import '../../../../styles/variables';
@import '../../../styles/variables';
.ipfsForm {
margin-top: $spacer / 2;

View File

@ -1,6 +1,6 @@
import React from 'react'
import { render, fireEvent } from '@testing-library/react'
import Ipfs from '.'
import Ipfs from './Ipfs'
const addFile = jest.fn()

View File

@ -1,14 +1,14 @@
/* eslint-disable no-console */
import React, { useState, useEffect } from 'react'
import useIpfsApi from '../../../../hooks/use-ipfs-api'
import Label from '../../../../components/atoms/Form/Label'
import Spinner from '../../../../components/atoms/Spinner'
import Dropzone from '../../../../components/molecules/Dropzone'
import { formatBytes, pingUrl, readFileAsync } from '../../../../utils/utils'
import { ipfsGatewayUri } from '../../../../config'
import styles from './index.module.scss'
import useIpfsApi, { IpfsConfig } from '../../../hooks/use-ipfs-api'
import Label from '../../../components/atoms/Form/Label'
import Spinner from '../../../components/atoms/Spinner'
import Dropzone from '../../../components/molecules/Dropzone'
import { formatBytes, pingUrl, readFileAsync } from '../../../utils/utils'
import { ipfsGatewayUri } from '../../../config'
import styles from './Ipfs.module.scss'
const config = {
const config: IpfsConfig = {
host: 'ipfs.infura.io',
port: '5001',
protocol: 'https'
@ -76,7 +76,7 @@ export default function Ipfs({ addFile }: { addFile(url: string): void }) {
// Ping gateway url to make it globally available,
// but store native url in DDO.
const urlGateway = `${ipfsGatewayUri}/ipfs/${cid}`
const urlGateway = `${ipfsGatewayUri}/ipfs/${cid}/${name}`
const url = `ipfs://${cid}/${name}`
setMessage('Checking IPFS gateway URL')