Skip to content

Polygon gas stationの知識を習得するために作成したサンプルコード

Notifications You must be signed in to change notification settings

nabeo114/eth-gas-station-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Eth Gas Station Sample

Overview

eth-gas-station-sample is a sample project that demonstrates how to retrieve and display gas prices from the Polygon Amoy testnet Gas Station. The project fetches current gas prices on the Polygon Amoy testnet and provides an interface to visualize the different gas price tiers (fast, standard, safeLow).

For more details about the Polygon Gas Station, refer to the official documentation here.

Installation

To run this project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/nabeo114/eth-gas-station-sample.git
    cd eth-gas-station-sample
  2. Install the required dependencies:

    cd frontend
    npm install
  3. Configure the .env file:

    Create a .env file in the frontend directory with the following variables:

    INFURA_API_KEY=your_infura_api_key_here
    ACCOUNT_PRIVATE_KEY=your_private_key_here

    Note:

    • The ACCOUNT_PRIVATE_KEY is used for deploying contracts. Make sure this account has MATIC tokens from the Polygon Faucet.
    • The INFURA_API_KEY is required to connect to the Polygon Amoy testnet via Infura. You can obtain this by creating an account at Infura.

Usage

  1. Start the development server:

    npm start
  2. Open your browser and go to http://localhost:9000.

  3. The application will display the current gas prices on the Polygon Amoy testnet.

Features

  • Fetch Gas Prices: Retrieve live gas prices (fast, standard, safeLow) from the Polygon Amoy testnet Gas Station.
  • Select Gas Price for Contract Deployment: Users can choose a gas price (fast, standard, or safeLow) to deploy an ERC20 contract and mint tokens.
  • Real-time Updates: Gas prices are updated automatically at regular intervals.

About

Polygon gas stationの知識を習得するために作成したサンプルコード

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published