-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from luguslabs/multi-srv
#268 add trustlines and centrifuge nodes support
- Loading branch information
Showing
8 changed files
with
948 additions
and
6 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,53 @@ | ||
const { | ||
validateSeed | ||
} = require('./substrate'); | ||
|
||
// Necessary fields for polkadot service | ||
const centrifugeFields = [ | ||
{ | ||
type: 'text', | ||
name: 'granKey', | ||
label: 'Gran Key', | ||
env: 'CENTRIFUGE_KEY_GRAN', | ||
}, | ||
{ | ||
type: 'text', | ||
name: 'babeKey', | ||
label: 'Babe Key', | ||
env: 'CENTRIFUGE_KEY_BABE', | ||
}, | ||
{ | ||
type: 'text', | ||
name: 'imonKey', | ||
label: 'Imon Key', | ||
env: 'CENTRIFUGE_KEY_IMON', | ||
}, | ||
{ | ||
type: 'text', | ||
name: 'audiKey', | ||
label: 'Audi Key', | ||
env: 'CENTRIFUGE_KEY_AUDI', | ||
}, | ||
]; | ||
|
||
// Validate CENTRIFUGE service configuration | ||
const validateCentrifugeConfig = async fieldData => { | ||
// Validate seeds | ||
if (!await validateSeed(fieldData.granKey)) { | ||
throw Error('granKey seed is not valid.'); | ||
} | ||
if (!await validateSeed(fieldData.babeKey)) { | ||
throw Error('babeKey seed is not valid.'); | ||
} | ||
if (!await validateSeed(fieldData.imonKey)) { | ||
throw Error('imonKey seed is not valid.'); | ||
} | ||
if (!await validateSeed(fieldData.audiKey)) { | ||
throw Error('audiKey seed is not valid.'); | ||
} | ||
}; | ||
|
||
module.exports = { | ||
centrifugeFields, | ||
validateCentrifugeConfig | ||
}; |
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.