Skip to content

Latest commit

 

History

History
119 lines (94 loc) · 3.25 KB

README.md

File metadata and controls

119 lines (94 loc) · 3.25 KB

🚀 Hyperchain Portal Setup

Portal supports custom ZK Stack Hyperchain nodes.


⚙️ Configuration

There are a few different ways to configure the application:

📁 Configure using ZK Stack configuration files

If you're using ZK Stack, just link your zksync-era repo directory to configure Portal.
  1. If you haven't already setup your hyperchain yet, follow the instructions
  2. Make sure to install the dependencies:
    npm install
  3. 🔄 Pull your hyperchain config files by running:
    npm run hyperchain:configure
    This will regenerate /hyperchains/config.json file. You can edit this file manually if needed.
  4. 🚀 Now you can start or build the application. See Development or Production section below for more details.

🖊️ Configure automatically with form

Fill out a simple form to configure the application.
  1. Make sure to install the dependencies:
    npm install
  2. 🌟 Follow the instructions in the terminal:
    npm run hyperchain:create
    This will regenerate /hyperchains/config.json file. You can edit this file manually if needed.
  3. 🚀 Now you can start or build the application. See Development or Production section below for more details.

✏️ Configure manually

Manually configure the application by editing the config file.
  1. 🔗 Add your network information to /hyperchains/config.json config file. See example config file in /hyperchains/example.config.json
  2. 🚀 Now you can start or build the application. See Development or Production section below for more details.
Hyperchain config.json structure
Array<{
  network: {
    key: string;
    id: number; // L2 Network ID
    rpcUrl: string; // L2 RPC URL
    name: string;
    blockExplorerUrl?: string; // L2 Block Explorer URL
    hidden?: boolean; // Hidden in the network selector
    l1Network?: { // @wagmi `Chain` structure https://wagmi.sh/core/chains#build-your-own
      // minimal required fields shown
      id: number;
      name: string;
      network: string;
      nativeCurrency: { name: string; symbol: string; decimals: number };
      rpcUrls: {
        default: { http: [ string ] },
        public: { http: [ string ] }
      }
    };
  },
  tokens: Array<{ // Should at least contain the `ETH` token (see `/hyperchains/example.config.json` for example)
    address: string;
    l1Address?: string;
    name?: string;
    symbol: string;
    decimals: number;
    iconUrl?: string;
    price?: number;
  }>
}>

🛠 Development

Advanced configuration

Read more in the main README: Advanced configuration

🔧 Setup

Make sure to install the dependencies:

npm install

🌐 Development Server

Start the development server on http://localhost:3000

npm run dev:node:hyperchain

🏭 Production

Build the application for production:

npm run generate:node:hyperchain