该仓库依赖node v22以上版本,推荐使用最新LTS
This repository requires Node.js v22 or higher, with the latest LTS version recommended.
- 克隆此仓库
https://github.com/buckyos/SourceDAO
到本地 - 在仓库根目录下执行
npm i
- 编辑hardhat.config.ts文件,在
networks
字段下添加opmain网络的endpoint和投票的私钥。有多个私钥的情况,投票的私钥需要放在第一位networks: { opmain: { url: "your opmain endpoint url", accounts: [ "your private key, begin with 0x", ] } },
- 在根目录执行
npx hardhat run vote.ts --network opmain
- 等待连接网络,并检查输出的签名地址是否正确
- 输入要投票的提案id
- 检查提案的通用属性是否正确
- 输入支持/反对该提案,支持输入s,反对输入r
- 检查从后台返回的提案参数,输入y确定提交
- 等待提交上链,程序正常退出即可
- Clone this repository
https://github.com/buckyos/SourceDAO
to your local machine - Run
npm i
in the repository root directory - Edit the hardhat.config.ts file, add the opmain network endpoint and voting private key under the
networks
field. If you have multiple private keys, the voting private key should be placed firstnetworks: { opmain: { url: "your opmain endpoint url", accounts: [ "your private key, begin with 0x", ] } },
- Run
npx hardhat run vote.ts --network opmain
in the root directory - Wait for network connection and verify that the output signing address is correct
- Enter the proposal ID you want to vote on
- Check if the general properties of the proposal are correct
- Enter support/oppose for the proposal: enter 's' for support, 'r' for oppose
- Check the proposal parameters returned from the backend, enter 'y' to confirm submission
- Wait for on-chain submission, the program will exit normally when completed