Răsfoiți Sursa

add SOL_ENDPOINT

lushdog@outlook.com 1 lună în urmă
părinte
comite
ef266203bf
4 a modificat fișierele cu 5 adăugiri și 5 ștergeri
  1. 2 2
      README.md
  2. 1 1
      env.example
  3. 1 1
      next.config.ts
  4. 1 1
      src/lib/solana-config.ts

+ 2 - 2
README.md

@@ -8,7 +8,7 @@ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-
 
 ```bash
 # Solana RPC 地址
-SOLANA_RPC_URL=https://lb.drpc.live/solana/
+SOL_ENDPOINT=https://lb.drpc.live/solana/
 ```
 
 2. 或者参考 `.env.example` 文件创建 `.env.local`
@@ -22,7 +22,7 @@ SOLANA_RPC_URL=https://lb.drpc.live/solana/
 docker build -t byreal-table .
 
 # 运行容器时传入环境变量
-docker run -e SOLANA_RPC_URL=https://lb.drpc.live/solana/ -p 3000:3000 byreal-table
+docker run -e SOL_ENDPOINT=https://lb.drpc.live/solana/ -p 3000:3000 byreal-table
 ```
 
 或者使用 `docker-compose.yml` 文件配置环境变量。

+ 1 - 1
env.example

@@ -1,5 +1,5 @@
 # Solana RPC 地址
 # 请复制此文件为 .env.local 并填入真实的 RPC 地址
 # 注意:.env.local 文件不会被提交到 Git
-SOLANA_RPC_URL=
+SOL_ENDPOINT=
 

+ 1 - 1
next.config.ts

@@ -1,6 +1,6 @@
 import type { NextConfig } from 'next'
 
-console.log('SOLANA_RPC_URL', process.env.SOLANA_RPC_URL)
+console.log('SOL_ENDPOINT', process.env.SOL_ENDPOINT)
 
 const nextConfig: NextConfig = {
 	output: 'standalone',

+ 1 - 1
src/lib/solana-config.ts

@@ -8,7 +8,7 @@ export function getSolanaRpcUrl(): string {
 
 	if (!rpcUrl) {
 		throw new Error(
-			'SOLANA_RPC_URL 环境变量未设置。请在 .env.local 文件中设置 SOLANA_RPC_URL,或在构建时通过环境变量传入。'
+			'SOL_ENDPOINT 环境变量未设置。请在 .env.local 文件中设置 SOL_ENDPOINT,或在构建时通过环境变量传入。'
 		)
 	}