-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9a4ebc
commit 5a3391e
Showing
7 changed files
with
241 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
var fs = require('fs') | ||
|
||
module.exports = { | ||
identityProviders: [ | ||
{ | ||
package: 'daf-ethr-did', | ||
network: 'rinkeby', | ||
rpcUrl: 'https://rinkeby.infura.io/v3/' + process.env.DAF_INFURA_ID, | ||
gas: 10001, | ||
ttl: 60 * 60 * 24 * 30 * 12 + 1, | ||
}, | ||
{ | ||
package: 'daf-ethr-did', | ||
network: 'ropsten', | ||
rpcUrl: 'https://ropsten.infura.io/v3/' + process.env.DAF_INFURA_ID, | ||
}, | ||
{ | ||
package: 'daf-ethr-did', | ||
network: 'mainnet', | ||
rpcUrl: 'https://mainnet.infura.io/v3/' + process.env.DAF_INFURA_ID, | ||
}, | ||
{ | ||
package: 'daf-ethr-did', | ||
network: 'private', | ||
rpcUrl: 'http://localhost:8545/', | ||
registry: '0x05cc574b19a3c11308f761b3d7263bd8608bc532' | ||
}, | ||
{ | ||
package: 'daf-elem-did', | ||
network: 'ropsten', | ||
apiUrl: 'https://element-did.com/api/v1/sidetree', | ||
}, | ||
], | ||
ethrDidNetworks: [ | ||
{ | ||
name: 'mainnet', | ||
rpcUrl: 'https://mainnet.infura.io/v3/' + process.env.DAF_INFURA_ID | ||
}, | ||
{ | ||
name: 'rinkeby', | ||
rpcUrl: 'https://rinkeby.infura.io/v3/' + process.env.DAF_INFURA_ID | ||
}, | ||
{ | ||
name: 'ropsten', | ||
rpcUrl: 'https://ropsten.infura.io/v3/' + process.env.DAF_INFURA_ID | ||
}, | ||
{ | ||
name: 'kovan', | ||
rpcUrl: 'https://kovan.infura.io/v3/' + process.env.DAF_INFURA_ID | ||
}, | ||
{ | ||
name: 'goerli', | ||
rpcUrl: 'https://goerli.infura.io/v3/' + process.env.DAF_INFURA_ID | ||
}, | ||
{ | ||
name: 'private', | ||
rpcUrl: 'http://localhost:8545/', | ||
registry: '0x05cc574b19a3c11308f761b3d7263bd8608bc532' | ||
} | ||
], | ||
// https://typeorm.io/#/connection-options | ||
database: { | ||
type: 'sqlite', | ||
synchronize: !fs.existsSync(process.env.DAF_DATA_STORE), | ||
database: process.env.DAF_DATA_STORE, | ||
logging: process.env.DAF_DEBUG_DB === 'true' ? true : false, | ||
migrationsRun: true, | ||
}, | ||
graphql: { | ||
apiKey: process.env.DAF_GRAPHQL_API_KEY, | ||
resolvers: { | ||
IdentityManager: true, | ||
TrustGraph: false, | ||
DIDComm: true, | ||
W3c: true, | ||
Sdr: true, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { ConnectionOptions } from 'typeorm' | ||
const fs = require('fs') | ||
|
||
export interface Configuration { | ||
identityProviders: { | ||
package: 'daf-ethr-did' | 'daf-elem-did' | ||
network: string | ||
rpcUrl?: string | ||
apiUrl?: string | ||
gas?: number | ||
ttl?: number | ||
registry?: string | ||
}[], | ||
ethrDidNetworks: { | ||
name: string | ||
rpcUrl: string | ||
registry?: string | ||
}[], | ||
database: ConnectionOptions, | ||
graphql: { | ||
apiKey?: string | ||
resolvers: { | ||
IdentityManager: boolean | ||
TrustGraph: boolean | ||
DIDComm: boolean | ||
W3c: boolean | ||
Sdr: boolean | ||
} | ||
} | ||
} | ||
|
||
const defaultPath = process.env.HOME + '/.daf/' | ||
const configFile = process.env.DAF_CONFIG || defaultPath + 'config.js' | ||
|
||
|
||
export const getConfiguration = (): Configuration => { | ||
if (!fs.existsSync(configFile)) { | ||
console.log('Config file does not exist. Creating: ' + configFile) | ||
const contents = fs.readFileSync(__dirname + '/../default/config.js') | ||
fs.writeFileSync(configFile, contents) | ||
} | ||
const configuration: Configuration = require(configFile) | ||
return configuration | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.