11.如何运行spark当地节点 (How to run spark on the local node)
Local node accounts private keys 本地节点账号私钥
Setting up a local Fuel network
Clone the Spark repository by running the command: 运行以下命令克隆 Spark 存储库:
Navigate to the cloned repository directory by running: 运行以下命令导航到克隆的存储库目录:
Switch to the
local-node
branch by running: 运行以下命令切换到“local-node”分支:
Start a local Fuel node by navigating to the
node
directory and running the command: 运行以下命令来导航到node
目录并启动本地 Fuel 节点:
This will start a local node running on your machine. 这将启动在您的计算机上运行的本地节点。
部署代币和限价订单合约 (Deploying Token and Limit Order Contracts)
Open new terminal 打开新终端
Navigate to the
contracts/token
directory and create an.env
file with the following content: 导航到contracts/token
目录并创建一个包含以下内容的.env
文件:
This sets the private key of the account used to deploy the contracts.
这会设置用于部署合约的帐户的私钥。
Build the contracts by running the command: 通过运行命令构建合约:
Deploy the Token contract by running the command: 通过运行命令部署代币合约:
Navigate to the
contracts/limit_orders
directory and build the Limit Order contract by running the command: 导航到contracts/limit_orders
目录并通过运行以下命令构建限价订单合约:
Deploy the Limit Order contract by running the command: 通过运行以下命令部署限价订单合约:
运行前端 (Running the Frontend)
Navigate to the
frontend
directory and install the required packages by running the command: 导航到frontend
目录并通过运行以下命令安装所需的包:
Start the frontend by running the command: 通过运行以下命令启动前端:
This will start the frontend in your default browser. 这将在您的默认浏览器中启动前端。
运行图表数据推送后端 (Running the Chart Data Feed Backend)
Open new terminal 打开新终端
Unfortunately, we do not yet have instructions on how to launch the backend data feed due to the trading view privacy policy. But you can contact us and we will help you launch a lightweight trading view chart. 不幸的是,由于交易视图隐私政策,我们还没有关于如何启动后端数据推送的说明。但是您可以联系我们,我们会帮您推出轻量级交易视图图表。
运行匹配者服务 (Running the Matcher Service)
15.Navigate to the services/matcher
directory and create an .env
file with the following content:
导航到services/matcher
目录并创建一个包含以下内容的.env
文件:
This sets the private key of the account used to deploy the contracts. 这会设置用于部署合约帐户的私钥。
Run the Matcher service by running the command: 通过运行以下命令运行 匹配者Matcher 服务:
This will start the Matcher service in your terminal. 这将在您的终端中启动 Matcher 服务。
That's it! You should now have a local Fuel network running with the Token and Limit Order contracts deployed, the frontend running in your browser, and the Matcher service running in your terminal.
就是这样!您现在应该有一个本地 Fuel 网络运行,其中部署了代币和限价订单合约,前端在您的浏览器中运行,Matcher 服务在您的终端中运行。
测试 (Testing)
To test the frontend, you can connect Alice's or Bob's wallet (which are given at the beginning of this tutorial), they will have ETH on their balance to pay fees
要测试前端,您可以连接 Alice 或 Bob 的钱包(在本教程开头给出),他们的余额中将有 ETH 来支付费用
Last updated