Skip to content

Commit 74f23d2

Browse files
committed
Use ENV helpers
1 parent 40f815a commit 74f23d2

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

src/helloWorldRunner.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { type ChildProcess, spawn } from 'node:child_process'
22

33
import type { XyoViewer } from '@xyo-network/xl1-protocol-sdk'
44
import { XyoViewerMoniker } from '@xyo-network/xl1-protocol-sdk'
5-
import { config } from 'dotenv'
65

76
import { getLocator } from './getLocator.ts'
87
import { getMnemonic } from './getMnemonic.ts'
@@ -11,9 +10,6 @@ import { getSignerAccount } from './getSignerAccount.ts'
1110
import { helloWorld } from './helloWorld.js'
1211
import { waitForInitialBlocks } from './waitForInitialBlocks.js'
1312

14-
// Load environment variables from .env file
15-
config({ quiet: true })
16-
1713
// Parse the relevant ENV VARs or use defaults
1814
const mnemonic = getMnemonic()
1915
const rpcUrl = getRpcUrl()

src/index.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import { HDWallet } from '@xyo-network/wallet'
2-
import { config } from 'dotenv'
3-
1+
import { getMnemonic } from './getMnemonic.ts'
2+
import { getRpcUrl } from './getRpcUrl.ts'
43
import { helloWorld } from './helloWorld.js'
54

6-
// Load environment variables from .env file
7-
config({ quiet: true })
8-
95
// Parse the relevant ENV VARs or use defaults
10-
const mnemonic = process.env.XYO_WALLET_MNEMONIC ?? HDWallet.generateMnemonic()
11-
const rpcUrl = process.env.XYO_CHAIN_RPC_URL ?? 'http://localhost:8080/rpc'
6+
const mnemonic = getMnemonic()
7+
const rpcUrl = getRpcUrl()
128

139
await helloWorld(mnemonic, rpcUrl)

0 commit comments

Comments
 (0)