deca_node/index.ts

25 lines
616 B
TypeScript
Raw Permalink Normal View History

2024-02-22 23:08:26 +00:00
import { getDECACCDBAddress } from './getDB.ts'
//import * as dotenv from 'dotenv';
//dotenv.config();
import { load } from "https://deno.land/std@0.217.0/dotenv/mod.ts";
async function main() {
const env = await load();
const providerUrl = env["PROVIDER_URL"];
if(providerUrl){
try {
const ccdbadd: string = await getDECACCDBAddress(providerUrl);
console.log('Greeting from contract:', ccdbadd);
} catch (error) {
console.error('Error:', error);
}
} else {
console.error("couldn't get provider from the .env")
}
}
main();