mirror of https://gitlab.com/ecentrics/concordia
				
				
			
				 7 changed files with 54 additions and 33 deletions
			
			
		@ -1,6 +1,5 @@ | 
				
			|||
import path from 'path'; | 
				
			|||
import getBreezeConfiguration from 'concordia-shared/src/configuration/breezeConfiguration'; | 
				
			|||
 | 
				
			|||
export const swarmAddresses = getBreezeConfiguration().ipfs.config.Addresses.Swarm; | 
				
			|||
const ORBIT_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'orbitdb'); | 
				
			|||
 | 
				
			|||
export const ORBIT_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'orbitdb'); | 
				
			|||
export default ORBIT_DIRECTORY_DEFAULT; | 
				
			|||
 | 
				
			|||
@ -0,0 +1,11 @@ | 
				
			|||
import dns from 'dns'; | 
				
			|||
import util from 'util'; | 
				
			|||
import { rendezvousHost, rendezvousPort } from 'concordia-shared/src/environment/interpolated/rendezvous'; | 
				
			|||
 | 
				
			|||
const dnsLookup = util.promisify(dns.lookup); | 
				
			|||
 | 
				
			|||
export const getResolvedRendezvousUrl = async () => dnsLookup(rendezvousHost, { family: 4 }) | 
				
			|||
  .catch((error) => console.error(new Error(`DNS lookup of ${rendezvousHost} failed.\n${error}`))); | 
				
			|||
 | 
				
			|||
export const getSwarmAddresses = async () => getResolvedRendezvousUrl() | 
				
			|||
  .then((resolvedRendezvousUrl) => [`/ip4/${resolvedRendezvousUrl.address}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`]); | 
				
			|||
					Loading…
					
					
				
		Reference in new issue