chore: update dóc

This commit is contained in:
ngoc 2026-02-02 16:19:07 +07:00
parent 8fc422b166
commit 562793312b
No known key found for this signature in database
GPG Key ID: 51FE6110113A5C32
3 changed files with 12 additions and 15 deletions

View File

@ -4,11 +4,11 @@
# DEPLOYMENT CONFIGURATION
# ================================
# Deployer's private key (used for contract deployment)
# Private key (used for deployment and oracle operations)
# IMPORTANT: This should be a funded account with enough ETH for gas
# NEVER commit your real private key!
# The key below is from Anvil's default accounts - DO NOT USE IN PRODUCTION
DEPLOYER_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
# ================================
# ORACLE CONFIGURATION
@ -21,12 +21,6 @@ DEPLOYER_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf
# Mainnet: https://mainnet.infura.io/v3/YOUR-INFURA-KEY
RPC_URL=http://localhost:8545
# Oracle operator's private key (required for oracle)
# This account submits arbitration decisions on-chain
# IMPORTANT: Ensure this account has sufficient ETH for gas!
# The key below is from Anvil's default accounts - DO NOT USE IN PRODUCTION
PRIVATE_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
# EAS (Ethereum Attestation Service) Contract Address (optional)
# If you used the deploy script, get this from deployments/<network>.json
# EAS_CONTRACT_ADDRESS=0x...

View File

@ -179,7 +179,6 @@ nla escrow:collect \
```bash
# 1. Get Sepolia ETH from faucet
# 2. Set your keys
export DEPLOYER_PRIVATE_KEY=0x...
export PRIVATE_KEY=0x...
export OPENAI_API_KEY=sk-...
@ -194,7 +193,6 @@ nla start-oracle sepolia
```bash
# ⚠️ PRODUCTION - Be careful!
export DEPLOYER_PRIVATE_KEY=0x...
export PRIVATE_KEY=0x...
export OPENAI_API_KEY=sk-...

View File

@ -13,6 +13,7 @@ import { mainnet, sepolia, baseSepolia, foundry } from "viem/chains";
import { writeFileSync, existsSync, mkdirSync } from "fs";
import { resolve } from "path";
import { fixtures, contracts } from "alkahest-ts";
import { getPrivateKey } from "../utils.js";
// Helper function to display usage
function displayHelp() {
@ -30,7 +31,7 @@ Options:
--help, -h Display this help message
Environment Variables (alternative to CLI options):
DEPLOYER_PRIVATE_KEY Deployer's private key
PRIVATE_KEY Deployer's private key
RPC_URL Custom RPC URL
Networks:
@ -47,7 +48,7 @@ Examples:
bun deploy.ts --network sepolia --private-key 0x... --rpc-url https://sepolia.infura.io/v3/YOUR-KEY
# Using environment variables
export DEPLOYER_PRIVATE_KEY=0x...
export PRIVATE_KEY=0x...
bun deploy.ts --network localhost
`);
}
@ -98,7 +99,7 @@ async function main() {
// Get configuration
const network = args.network;
const privateKey = args["private-key"] || process.env.DEPLOYER_PRIVATE_KEY;
const privateKey = args["private-key"] || getPrivateKey();
let rpcUrl = args["rpc-url"] || process.env.RPC_URL;
// Validate required parameters
@ -109,8 +110,12 @@ async function main() {
}
if (!privateKey) {
console.error("❌ Error: Private key is required. Use --private-key or set DEPLOYER_PRIVATE_KEY");
console.error("Run with --help for usage information.");
console.error("❌ Error: Private key is required.");
console.error("\n💡 You can either:");
console.error(" 1. Set it globally: nla wallet:set --private-key <your-key>");
console.error(" 2. Use for this command only: --private-key <your-key>");
console.error(" 3. Set PRIVATE_KEY environment variable");
console.error("\nRun with --help for usage information.");
process.exit(1);
}