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:
parent
752498d6b3
commit
1813207772
@ -7,7 +7,7 @@ let ipfs: any = null
|
|||||||
let ipfsMessage = ''
|
let ipfsMessage = ''
|
||||||
let ipfsVersion = ''
|
let ipfsVersion = ''
|
||||||
|
|
||||||
interface IpfsConfig {
|
export interface IpfsConfig {
|
||||||
host: string
|
host: string
|
||||||
port: string
|
port: string
|
||||||
protocol: string
|
protocol: string
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@import '../../../../styles/variables';
|
@import '../../../styles/variables';
|
||||||
|
|
||||||
.ipfsForm {
|
.ipfsForm {
|
||||||
margin-top: $spacer / 2;
|
margin-top: $spacer / 2;
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { render, fireEvent } from '@testing-library/react'
|
import { render, fireEvent } from '@testing-library/react'
|
||||||
import Ipfs from '.'
|
import Ipfs from './Ipfs'
|
||||||
|
|
||||||
const addFile = jest.fn()
|
const addFile = jest.fn()
|
||||||
|
|
@ -1,14 +1,14 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import useIpfsApi from '../../../../hooks/use-ipfs-api'
|
import useIpfsApi, { IpfsConfig } from '../../../hooks/use-ipfs-api'
|
||||||
import Label from '../../../../components/atoms/Form/Label'
|
import Label from '../../../components/atoms/Form/Label'
|
||||||
import Spinner from '../../../../components/atoms/Spinner'
|
import Spinner from '../../../components/atoms/Spinner'
|
||||||
import Dropzone from '../../../../components/molecules/Dropzone'
|
import Dropzone from '../../../components/molecules/Dropzone'
|
||||||
import { formatBytes, pingUrl, readFileAsync } from '../../../../utils/utils'
|
import { formatBytes, pingUrl, readFileAsync } from '../../../utils/utils'
|
||||||
import { ipfsGatewayUri } from '../../../../config'
|
import { ipfsGatewayUri } from '../../../config'
|
||||||
import styles from './index.module.scss'
|
import styles from './Ipfs.module.scss'
|
||||||
|
|
||||||
const config = {
|
const config: IpfsConfig = {
|
||||||
host: 'ipfs.infura.io',
|
host: 'ipfs.infura.io',
|
||||||
port: '5001',
|
port: '5001',
|
||||||
protocol: 'https'
|
protocol: 'https'
|
||||||
@ -76,7 +76,7 @@ export default function Ipfs({ addFile }: { addFile(url: string): void }) {
|
|||||||
|
|
||||||
// Ping gateway url to make it globally available,
|
// Ping gateway url to make it globally available,
|
||||||
// but store native url in DDO.
|
// but store native url in DDO.
|
||||||
const urlGateway = `${ipfsGatewayUri}/ipfs/${cid}`
|
const urlGateway = `${ipfsGatewayUri}/ipfs/${cid}/${name}`
|
||||||
const url = `ipfs://${cid}/${name}`
|
const url = `ipfs://${cid}/${name}`
|
||||||
|
|
||||||
setMessage('Checking IPFS gateway URL')
|
setMessage('Checking IPFS gateway URL')
|
Loading…
Reference in New Issue
Block a user