This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
60 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
# NEAR Explorer Backend | ||
|
||
## Naming Conventions | ||
|
||
- Use kebab-case to name general modules (put them into `src/` structure) | ||
- Use camelCase to name variables, constants, functions, and methods | ||
- Use PascalCase to name classes | ||
- Use a single underscore in front of a method name to indicate private (non-public) methods | ||
|
||
## Run Backend | ||
## Run in development | ||
|
||
The simplest way to get started is to use [Indexer for Explorer](https://github.com/near/near-indexer-for-explorer) data. | ||
Conveniently, there are all the basic settings done in `package.json` and `mainnet.env` / `testnet.env` / `shardnet.env` / `guildnet.env`, so you can just run: | ||
|
||
``` | ||
$ npm run dev:mainnet | ||
$ npm run -w backend dev:mainnet | ||
or | ||
$ npm run -w backend dev:testnet | ||
or | ||
$ npm run -w backend dev:shardnet | ||
or | ||
$ npm run -w backend dev:guildnet | ||
``` | ||
|
||
NOTE: There are also configurations for `testnet`, `shardnet`, and `guildnet`, just change command suffix. | ||
|
||
NOTE: To override `mainnet.env` values during local development, create file `mainnet.env.local` and export all the necessary environment variables there | ||
|
||
## Run Backend for Production | ||
## Build & run in production | ||
|
||
If you want to build a release bundle and run it: | ||
|
||
``` | ||
$ npm run build | ||
$ npm run start | ||
$ npm run -w backend build | ||
$ npm run -w backend start:mainnet | ||
or | ||
$ npm run -w backend start:testnet | ||
or | ||
$ npm run -w backend start:shardnet | ||
or | ||
$ npm run -w backend start:guildnet | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters