Commit a50d9ab 1 parent d9d4709 commit a50d9ab Copy full SHA for a50d9ab
File tree 4 files changed +13
-5
lines changed
features/ipfs/ipfsSettings
4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 6
6
" cyberlink" ,
7
7
" cyberlinks" ,
8
8
" denoms" ,
9
+ " helia" ,
9
10
" investmint" ,
10
11
" Ipfs" ,
11
12
" Keplr" ,
Original file line number Diff line number Diff line change @@ -22,11 +22,12 @@ import ErrorIpfsSettings from './ErrorIpfsSettings';
22
22
import ComponentLoader from './ipfsComponents/ipfsLoader' ;
23
23
import Drive from '../Drive' ;
24
24
import { useBackend } from 'src/contexts/backend' ;
25
+ import { IPFSNodes } from 'src/services/ipfs/ipfs.d.ts' ;
25
26
26
- const dataOpts = [ 'external' , 'embedded' , 'helia' ] ;
27
+ const dataOpts = [ IPFSNodes . EXTERNAL , IPFSNodes . EMBEDDED , IPFSNodes . HELIA ] ;
27
28
28
29
function IpfsSettings ( ) {
29
- const [ valueSelect , setValueSelect ] = useState ( 'external' ) ;
30
+ const [ valueSelect , setValueSelect ] = useState ( IPFSNodes . HELIA ) ;
30
31
const [ valueInput , setValueInput ] = useState ( '' ) ;
31
32
const [ valueInputGateway , setValueInputGateway ] = useState ( '' ) ;
32
33
const { isIpfsInitialized, ipfsError : failed , loadIpfs } = useBackend ( ) ;
Original file line number Diff line number Diff line change 1
- import { IpfsOptsType } from './ipfs' ;
1
+ import { IPFSNodes , IpfsOptsType } from './ipfs.d ' ;
2
2
3
3
export const CYBER_NODE_SWARM_PEER_ID =
4
4
'QmUgmRxoLtGERot7Y6G7UyF6fwvnusQZfGR15PuE6pY3aB' ;
@@ -13,8 +13,8 @@ export const CYBER_GATEWAY_URL = 'https://gateway.ipfs.cybernode.ai';
13
13
export const FILE_SIZE_DOWNLOAD = 20 * 10 ** 6 ;
14
14
15
15
export const getIpfsOpts = ( ) => {
16
- let ipfsOpts = {
17
- ipfsNodeType : 'embedded' ,
16
+ let ipfsOpts : IpfsOptsType = {
17
+ ipfsNodeType : IPFSNodes . HELIA ,
18
18
urlOpts : '/ip4/127.0.0.1/tcp/5001' , // default url
19
19
userGateway : 'http://127.0.0.1:8080' ,
20
20
} ;
Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ import { LsResult } from 'ipfs-core-types/dist/src/pin';
3
3
4
4
export type CallBackFuncStatus = ( a : string ) => void ;
5
5
6
+ export enum IPFSNodes {
7
+ EXTERNAL = 'external' ,
8
+ EMBEDDED = 'embedded' ,
9
+ HELIA = 'helia' ,
10
+ }
11
+
6
12
type IpfsNodeType = 'embedded' | 'external' | 'helia' ;
7
13
8
14
export type IpfsFileStats = {
You can’t perform that action at this time.
0 commit comments