@@ -17,13 +17,12 @@ import { defaultConfig, getSecret } from "@prosopo/cli";
1717import { LogLevel , ProsopoEnvError , getLogger } from "@prosopo/common" ;
1818import { getEnvFile } from "@prosopo/dotenv" ;
1919import { ProviderEnvironment } from "@prosopo/env" ;
20- import { DEV_PHRASE , generateMnemonic , getPair } from "@prosopo/keyring" ;
2120import {
22- CaptchaType ,
23- ClientSettingsSchema ,
24- type IProviderAccount ,
25- type ISite ,
26- } from "@prosopo/types" ;
21+ generateMnemonic ,
22+ getDefaultSiteKeys ,
23+ getPair ,
24+ } from "@prosopo/keyring" ;
25+ import type { IProviderAccount } from "@prosopo/types" ;
2726import { get } from "@prosopo/util" ;
2827import fse from "fs-extra" ;
2928import { updateDemoHTMLFiles , updateEnvFiles } from "../util/index.js" ;
@@ -59,41 +58,9 @@ function getDefaultProvider(): IProviderAccount {
5958 address : process . env . PROSOPO_PROVIDER_ADDRESS || "" ,
6059 secret : getSecret ( ) ,
6160 captchaDatasetId : "" ,
61+ pair : getPair ( getSecret ( ) ) ,
6262 } ;
6363}
64- //sr25519 dev site keys
65- export function getDefaultSiteKeys ( ) : ISite [ ] {
66- return [
67- {
68- secret : `${ DEV_PHRASE } //${ CaptchaType . image } ` ,
69- address : "5DWuxC3covEaAsPcMt1zcpibGLsHAqMcfAzi2fzuWtQupFgq" ,
70- settings : ClientSettingsSchema . parse ( {
71- captchaType : CaptchaType . image ,
72- } ) ,
73- } ,
74- {
75- secret : `${ DEV_PHRASE } //${ CaptchaType . pow } ` ,
76- address : "5GWr5T3bCvBZMG9H9CDM5ynYS1zo7vcwS24Dg4DismRmsD8P" ,
77- settings : ClientSettingsSchema . parse ( {
78- captchaType : CaptchaType . pow ,
79- } ) ,
80- } ,
81- {
82- secret : `${ DEV_PHRASE } //${ CaptchaType . frictionless } ` ,
83- address : "5Do7mgno9VQCDPn6abR1UgB9jUjaEmqVQb5paB5fHNabvRDE" ,
84- settings : ClientSettingsSchema . parse ( {
85- captchaType : CaptchaType . frictionless ,
86- } ) ,
87- } ,
88- {
89- secret : `${ DEV_PHRASE } //${ CaptchaType . invisible } ` ,
90- address : "5FNFBC97JQoJu7LBapycXbT66N9xzQH2tyFv1yNvBxqa8tQR" ,
91- settings : ClientSettingsSchema . parse ( {
92- captchaType : CaptchaType . invisible ,
93- } ) ,
94- } ,
95- ] ;
96- }
9764
9865async function copyEnvFile ( ) {
9966 try {
@@ -169,7 +136,7 @@ export async function setup(provider: boolean, sites: boolean) {
169136
170137 defaultProvider . pair = getPair ( providerSecret ) ;
171138 if ( provider ) {
172- await setupProvider ( env , defaultProvider ) ;
139+ await setupProvider ( env ) ;
173140
174141 if ( ! hasProviderAccount ) {
175142 await updateEnvFile ( {
0 commit comments