Phala-Network / runtime-bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

开发模式的话是否有读取环境文件或者配置文件的方式

sidealice opened this issue · comments

commented

Describe the bug

我设置了环境变量为:
NODE_ENV=development # Node环境,testing或development
PHALA_MODULE=fetch # 启动的组件,fetch, trade, lifecycle
PHALA_LOGGER_LEVEL=debug
PHALA_DB_PREFIX=/var/data # 数据库位置
PHALA_MAIN_CHAIN_ENDPOINT= # 平行链Websocket节点地址,暂不需要
PHALA_CHAIN_ENDPOINT=wss://127.0.0.1/ws # Phala Websocket节点地址
PHALA_REDIS_ENDPOINT=redis://127.0.0.1:6379/ # redis地址
试过echo 变量有显示

按照文档说明如果进入开发的模式项目代码根目录:
npm install
pnpm db_init
显示:


TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at Object.join (path.js:1148:7)
    at getDb (file:///home/newasset/runtime-pool/runtime-bridge/src/io/db.js:51:25)
    at Array.map (<anonymous>)
    at main (file:///home/newasset/runtime-pool/runtime-bridge/src/scripts/db_init.js:5:13)
    at file:///home/newasset/runtime-pool/runtime-bridge/src/scripts/db_init.js:10:9
    at ModuleJob.run (internal/modules/esm/module_job.js:169:25)
    at async Loader.import (internal/modules/esm/loader.js:177:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

因为看到你今天的文档有说环境文件,我想每次有export很长也很麻烦。
如果执行export NODE_ENV='development' && export PHALA_LOGGER_LEVEL='debug' && export PHALA_MODULE='fetch' && export PHALA_DB_PREFIX='/var/data' && export PHALA_MAIN_CHAIN_ENDPOINT='wss://127.0.0.1/ws' && export PHALA_CHAIN_ENDPOINT= && export PHALA_REDIS_ENDPOINT='redis://127.0.0.1:6379/' && export PHALA_ENABLE_HTTP_KEEPALIVE='true' && export PHALA_PARALLEL_BLOCKS='50' && export PHALA_DEV_SKIP_RA='true' && pnpm db_init这样是可以没有错误的。

就不能有个配置文件吗?

To Reproduce
按照文档说明

Expected behavior
有返回其他信息

Screenshots
If applicable, add screenshots to help explain your problem.

Host (please complete the following information):

Linux distribution: ubuntu 20.04
Docker version: Docker version 20.10.7, build f0df350
Docker Compose version:docker-compose version 1.25.0, build unknown
Containers (please complete the following information):

poc4-prb image hash: 没有
phala-dev-node image hash: sha256:bd2804685a1e77dfcee585227d5f37db3702e154d5a6792f3e09a38e5d89f058
phala-dev-pruntime image hash: 没有

Hello @sidealice

Please use https://unix.stackexchange.com/ for your Unix & Linux questions.