-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.ts
45 lines (39 loc) · 1.78 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import 'Extensions/Array'
import 'Extensions/Error'
import 'Extensions/Promise'
import Pino from 'pino'
import { catchStartupError } from 'Helpers/moduleStartStopCatch'
import { loadConfigurationWithDefaults } from 'LoadConfiguration'
import { EthereumRegistryWriter } from './EthereumRegistryWriter'
const configuration = loadConfigurationWithDefaults()
const logger: Pino.Logger = Pino({
level: configuration.loggingLevel,
prettyPrint: configuration.loggingPretty,
})
EthereumRegistryWriter({
loggingLevel: configuration.loggingLevel,
loggingPretty: configuration.loggingPretty,
apiPort: configuration.ethereumRegistryWriterApiPort,
mongodbUrl: configuration.mongodbUrl,
rabbitmqUrl: configuration.rabbitmqUrl,
ipfs: {
url: configuration.ipfsUrl,
},
exchanges: {
claimIpfsHash: configuration.exchangeClaimIpfsHash,
batchCreated: configuration.exchangeBatchWriterCreateNextBatchSuccess,
batchRead: configuration.exchangeBatchReaderReadNextDirectorySuccess,
poetAnchorDownloaded: configuration.exchangePoetAnchorDownloaded,
claimsDownloaded: configuration.exchangeClaimsDownloaded,
},
rpcUrl: configuration.ethereumRpcUrl,
chainId: configuration.ethereumChainId,
contractAddress: configuration.ethereumRegistryContractAddress,
privateKey: configuration.ethereumRegistryPrivateKey,
gasPrice: configuration.ethereumGasPrice,
uploadAnchorReceiptIntervalInSeconds: configuration.ethereumRegistryUploadAnchorReceiptIntervalInSeconds,
registerNextDirectoryIntervalInSeconds: configuration.ethereumRegistryRegisterNextDirectoryIntervalInSeconds,
maximumUnconfirmedTransactionAgeInSeconds: configuration.ethereumMaximumUnconfirmedTransactionAgeInSeconds,
})
.then(stop => process.on('SIGINT', stop))
.catch(catchStartupError('EthereumRegistryWriter', logger))