Skip to content

Commit

Permalink
fix: typo in config file name
Browse files Browse the repository at this point in the history
  • Loading branch information
Romsters committed Oct 2, 2023
1 parent 5d1bf73 commit 5d27349
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ lerna-debug.log*
/allure-results/

# App hyperchain config
hyperchain.json
hyperchain.config.json
6 changes: 3 additions & 3 deletions packages/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ $ npm install
```

### Environment configs
Public environment configs are stored in `src/configs` folder and are named as `<appEnvironment>.config.ts` where `appEnvironment` is the name of the environment set in `VITE_APP_ENVIRONMENT` env variable.
Public environment configs are stored in `src/configs` folder and are named as `<appEnvironment>.config.json` where `appEnvironment` is the name of the environment set in `VITE_APP_ENVIRONMENT` env variable.
Currently there are 3 different environments for the project: `local`, `staging` and `production`, each with its corresponding configuration file.

### Adding a new network to the config
In order to change the configuration for the environment, you need to change its configuration file. By default, there are 4 networks configured for the `local` environment: `local`, `stage`, `testnet` and `mainnet`. Your local network might be different from what is configured in `local.config.ts` in such case you should edit the config and set correct values for your setup. You can also add new items to the `networks` array and they will automatically appear in the networks dropdown on UI.
In order to change the configuration for the environment, you need to change its configuration file. By default, there are 4 networks configured for the `local` environment: `local`, `stage`, `testnet` and `mainnet`. Your local network might be different from what is configured in `local.config.json` in such case you should edit the config and set correct values for your setup. You can also add new items to the `networks` array and they will automatically appear in the networks dropdown on UI.

Example of `local.config.ts` extended with the new network:
Example of `local.config.json` extended with the new network:

```
import stagingConfig from "./staging.config";
Expand Down
8 changes: 4 additions & 4 deletions scripts/setup-hyperchain-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const buildAppConfig = (zkSyncEnvs: { [key: string]: string }) => ({
}
});

const buildWorkerConfig = (zkSyncEnvs) => {
const buildWorkerConfig = (zkSyncEnvs: { [key: string]: string }) => {
const dbConfig = parseConnectionString(zkSyncEnvs.DATABASE_URL);
return {
BLOCKCHAIN_RPC_URL: zkSyncEnvs.API_WEB3_JSON_RPC_HTTP_URL || "",
Expand All @@ -32,7 +32,7 @@ const buildWorkerConfig = (zkSyncEnvs) => {
}
};

const buildApiConfig = (zkSyncEnvs) => {
const buildApiConfig = (zkSyncEnvs: { [key: string]: string }) => {
const dbConfig = parseConnectionString(zkSyncEnvs.DATABASE_URL);
return {
DATABASE_URL: `postgres://${dbConfig.user}:${dbConfig.password}@${dbConfig.host}/block-explorer`,
Expand Down Expand Up @@ -79,8 +79,8 @@ const buildEnvFileContent = (json: { [key: string]: string | number }) => Object
const workerConfig = buildWorkerConfig(envs);
const apiConfig = buildApiConfig(envs);

writeFileSync(path.join(__dirname, "../packages/app/src/configs/hyperchain.json"), JSON.stringify(appConfig, null, 2));
console.log("Updated app config at app/src/configs/hyperchain.json");
writeFileSync(path.join(__dirname, "../packages/app/src/configs/hyperchain.config.json"), JSON.stringify(appConfig, null, 2));
console.log("Updated app config at app/src/configs/hyperchain.config.json");
writeFileSync(path.join(__dirname, "../packages/worker/.env"), buildEnvFileContent(workerConfig));
console.log("Updated worker env file at worker/.env");
writeFileSync(path.join(__dirname, "../packages/api/.env"), buildEnvFileContent(apiConfig));
Expand Down

0 comments on commit 5d27349

Please sign in to comment.