|  | @ -10,13 +10,19 @@ import downloadContractArtifacts from './utils/drizzleUtils'; | 
			
		
	
		
		
			
				
					|  |  | import getIpfsOptions from './options/ipfsOptions'; |  |  | import getIpfsOptions from './options/ipfsOptions'; | 
			
		
	
		
		
			
				
					|  |  | import { logger } from './utils/logger'; |  |  | import { logger } from './utils/logger'; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  | process.on('unhandledRejection', (error) => { |  |  | let ipfsSingleton; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | process.on('unhandledRejection', async (error) => { | 
			
		
	
		
		
			
				
					|  |  |   // This happens when attempting to initialize without any available Swarm addresses (e.g. Rendezvous)
 |  |  |   // This happens when attempting to initialize without any available Swarm addresses (e.g. Rendezvous)
 | 
			
		
	
		
		
			
				
					|  |  |   if (error.code === 'ERR_NO_VALID_ADDRESSES') { |  |  |   if (error.code === 'ERR_NO_VALID_ADDRESSES') { | 
			
		
	
		
		
			
				
					|  |  |     logger.error(`unhandledRejection: ${error.message}`); |  |  |     logger.error(`unhandledRejection: ${error.message}`); | 
			
		
	
		
		
			
				
					|  |  |     process.exit(1); |  |  |     process.exit(1); | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   if (ipfsSingleton) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       await ipfsSingleton.stop(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   // Don't swallow other errors
 |  |  |   // Don't swallow other errors
 | 
			
		
	
		
		
			
				
					|  |  |   logger.error(error); |  |  |   logger.error(error); | 
			
		
	
		
		
			
				
					|  |  |   throw error; |  |  |   throw error; | 
			
		
	
	
		
		
			
				
					|  | @ -71,6 +77,10 @@ const main = async () => { | 
			
		
	
		
		
			
				
					|  |  |   getDeployedContract(web3) |  |  |   getDeployedContract(web3) | 
			
		
	
		
		
			
				
					|  |  |     .then(({ contract, contractAddress }) => getIpfsOptions() |  |  |     .then(({ contract, contractAddress }) => getIpfsOptions() | 
			
		
	
		
		
			
				
					|  |  |       .then((ipfsOptions) => IPFS.create(ipfsOptions)) |  |  |       .then((ipfsOptions) => IPFS.create(ipfsOptions)) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         .then((ipfs) => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             ipfsSingleton = ipfs; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             return ipfs; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         }) | 
			
		
	
		
		
			
				
					|  |  |       .then((ipfs) => createOrbitInstance(ipfs, contractAddress)) |  |  |       .then((ipfs) => createOrbitInstance(ipfs, contractAddress)) | 
			
		
	
		
		
			
				
					|  |  |       .then((orbit) => openExistingUsersDatabases(contract, orbit) |  |  |       .then((orbit) => openExistingUsersDatabases(contract, orbit) | 
			
		
	
		
		
			
				
					|  |  |         .then(() => { |  |  |         .then(() => { | 
			
		
	
	
		
		
			
				
					|  | 
 |