Neon水龙头:如何获取代币来测试你的 Neon dApp (The Neon Faucet:How to Get Tokens to Test your Neon dApp)

The Neon Faucet is a Neon service that distributes small amounts of test tokens to a user’s Neon EVM wallet address. This service exists in order to allow Neon users to experiment and play around with the Neon ecosystem for free, and therefore it only supports token distribution on devnet and testnet. On mainnet, however, a user is using ‘real’ tokens, and so cannot rely on the Neon Faucet to provide them.

Neon水龙头是一项 Neon 服务,即将少量测试代币分发到用户的 Neon EVM 钱包地址。该服务的存在是为了让 Neon 用户免费试用和试玩 Neon 生态系统,因此它仅支持在 devnet 和 testnet 上分发代币。而在主网上,用户使用的是“真实”代币,因此不能依赖Neon水龙头来提供。

如何使用Neon水龙头 (How to Use the Neon Faucet)

The following is a tutorial for using the Neon Faucet, based on the content found in the Neon Documentation. There are two ways to use the Neon Faucet — on the Neon Faucet website, and using the Neon Faucet API.

以下是使用Neon水龙头的教程,基于 Neon 文档中的内容。有两种使用Neon水龙头的方法——在 Neon 水龙头网站上,以及使用API。

通过网站请求测试 NEON 代币 (Requesting Test NEON Tokens via the Website)

第1步 Step 1

Set up MetaMask by following the Setting up MetaMask guide.

按照设置 MetaMask 指南设置 MetaMask。

第2步 Step 2

Go to the NeonFaucet webpage to request test tokens.

转到 Neon水龙头 网页 来请求测试代币。

第3步 Step 3

Connect your MetaMask wallet:

连接您的 MetaMask 钱包:

  • Click on the ‘CONNECT WALLET’ button to authorize the connection in the MetaMask pop-up.
    单击“连接钱包(CONNECT WALLET)”按钮,在 MetaMask 弹出窗口中授权。
  • In the MetaMask pop-up window, select one or more accounts and click Next.
    在 MetaMask 弹出窗口中,选择一个或多个帐户,然后单击下一步。
  • Сlick on the Connect button to confirm your selection.
    点击连接按钮以确认您的选择。
  • In the form that appears, select the token and enter the amount of tokens you would like to request, and then click on the ‘SEND TEST TOKENS’ button.
    在出现的表格中,选择代币并输入您想要请求的代币数量,然后单击“发送测试代币(SEND TEST TOKENS)”按钮。

通过 HTTP API 端点请求测试代币 (Requesting Test NEON Tokens via HTTP API Endpoints)

For this method, a client uses standard HTTP requests to send data to the server. Several endpoints are supported, as shown in the following table.
要使用这种方法,客户端需要用标准 HTTP 请求将数据发送到服务器。支持多个端点,如下表所示。

Some usage examples of the API method include the following:
API 方法的一些使用示例包括:

An example of a JSON payload: JSON 有效负载的示例

An example of a ping request with curl: 带有curl的 ping 请求示例

An example of a version request with curl: 带有 curl 的版本请求示例

An example of a NEON drop request with curl: 带有 curl 的 NEON 删除请求示例

配置 (Configuration)

The configuration file should be in the TOML format. A table containing all the configuration options with their descriptions is shown below.

配置文件应为 TOML 格式。下表显示了包含所有配置选项及其说明的表格。

A sample configuration file is as follows:

一个示例配置文件如下:

The configuration file is optional and, if present, can be incomplete (default values or environment variables will be used in such cases).

配置文件是可选的,如果存在,可以是不完整的(在这种情况下将采用默认值或环境变量)。

环境变量 (Environment Variables)

Environment variables, if present, take precedence and override the configuration file.
环境变量(如果存在),会优先并覆盖配置文件。

结论 (Conclusion)

The Neon Faucet is a service that allows users to easily obtain small amounts of test tokens for use in development and sandbox testing for the Neon EVM. It can be accessed via the NeonFaucet user interface or through its HTTP endpoints programmatically. This allows users and builders to experiment with Neon without having to worry about expending ‘real’ assets.

Neon水龙头是一项服务,允许用户轻松获得少量测试代币,用于 Neon EVM 的开发和沙盒测试。可以通过 Neon水龙头用户界面 或通过其 HTTP 端点用编程方式访问它。这使用户和建设者可以尝试使用 Neon,而不必担心消耗“真实”资产。

赞赏