Add IPFS connection check

This commit is contained in:
bumi 2019-07-02 17:41:38 +02:00
parent 28eba3452c
commit 4fb03c5677
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,7 @@ console.log(`Using IPFS:`, ipfsConfig);
{ network: argv.network, rpcUrl: argv.rpcUrl },
{ apm: argv.apm, ipfsConfig: ipfsConfig, addresses: { Kernel: argv.daoAddress } }
).init();
await kredits.ipfs._ipfsAPI.id(); // check the connection to the IPFS client TODO: redesign IPFS wrapper API and not use an internal attribute
const ipfsPinner = new IpfsPinner(kredits);
ipfsPinner.pinAll().then(pins => {
@ -42,6 +43,7 @@ console.log(`Using IPFS:`, ipfsConfig);
});
console.log(`Subscribed to DAO: ${kredits.Kernel.contract.address}`);
} catch(e) {
console.log('Failed to start pinner');
console.log(e);
process.exit(1);
}