@@ -7,34 +7,28 @@ import { createDeployment } from "./src/create_deployment.ts";
77import { querySystemStart } from "./src/utils.ts" ;
88import { KUPMIOS_ENV } from "./src/constants.ts" ;
99
10- ( async ( ) => {
10+ const deployerSk = Deno . env . get ( "DEPLOYER_SK" ) ;
11+ const kupoUrl = Deno . env . get ( "KUPO_URL" ) ;
12+ const ogmiosUrl = Deno . env . get ( "OGMIOS_URL" ) ;
1113
12- const deployerSk = Deno . env . get ( "DEPLOYER_SK" ) ;
13- const kupoUrl = Deno . env . get ( "KUPO_URL ") ;
14- const ogmiosUrl = Deno . env . get ( "OGMIOS_URL" ) ;
14+ if ( ! deployerSk || ! kupoUrl || ! ogmiosUrl ) {
15+ throw new Error ( "Unable to load environment variables ") ;
16+ }
1517
16- console . log ( deployerSk , kupoUrl , ogmiosUrl ) ;
18+ const provider = new Kupmios ( kupoUrl , ogmiosUrl ) ;
19+ const chainZeroTime = await querySystemStart ( ogmiosUrl ) ;
20+ SLOT_CONFIG_NETWORK . Preview . zeroTime = chainZeroTime ;
1721
18- if ( ! deployerSk || ! kupoUrl || ! ogmiosUrl ) {
19- throw new Error ( "Unable to load environment variables" ) ;
20- }
22+ const lucid = await Lucid (
23+ provider ,
24+ "Preview"
25+ ) ;
26+ lucid . selectWallet . fromPrivateKey ( deployerSk ) ;
2127
22- const provider = new Kupmios ( kupoUrl , ogmiosUrl ) ;
23- const chainZeroTime = await querySystemStart ( ogmiosUrl ) ;
24- SLOT_CONFIG_NETWORK . Preview . zeroTime = chainZeroTime ;
25- console . log ( { chainZeroTime } ) ;
26-
27- const lucid = await Lucid (
28- provider ,
29- "Preview"
30- ) ;
31- lucid . selectWallet . fromPrivateKey ( deployerSk ) ;
32-
33- console . log ( "=" . repeat ( 70 ) ) ;
34- try {
35- await createDeployment ( lucid , provider , KUPMIOS_ENV ) ;
36- } catch ( error ) {
37- console . error ( "ERR: " , error ) ;
38- throw error ;
39- }
40- } ) ( ) ;
28+ console . log ( "=" . repeat ( 70 ) ) ;
29+ try {
30+ await createDeployment ( lucid , KUPMIOS_ENV ) ;
31+ } catch ( error ) {
32+ console . error ( "ERR: " , error ) ;
33+ throw error ;
34+ }
0 commit comments