Sorry for not attributing the authors here, I'm pulling out all the bits and pieces from everywhere. Thank you in advance. This is hot off the oven, it might have errors, please leave a pull request / issue.
- Buy node keys.
- Decide on whether you want to use Nodeops, or
- You want to run your own nodes at home, or
- With a server "in a cloud" (public cloud service / virtual private cloud).
- Get some Hychain $TOPIA.
- Delegate your node keys.
- Grab a cup of coffee, and profit.
- Oh no I got stuck somewhere.
- Check out the requirements, and prepare the machine properly first.
- Setting up the machine, and choosing an operating system.
- Hardening the machine. (TODO a guide on this)
- Setup the node according to the operating system of your node. Click here for Linux servers. Click here for ARM servers (like raspberry pi). Click here for windows servers. Click here for Mac servers.
- Login to your server. Recommend to learn SSH and login with SSH.
- Create a non root user. For example for the user
hychain-node-user
.
sudo adduser --system --group hychain-node-user
- Download the latest release
sudo wget https://github.com/HYCHAIN/guardian-node-software/releases/download/0.0.1/guardian-cli-linux-v0.0.1.zip -O /home/hychain-node-user/node.zip
- Download the software to unzip it. (Dear devs, please consider using tar instead)
sudo apt-get update
sudo apt-get install unzip
- Unzip the file and cleanup
sudo unzip -o /home/hychain-node-user/node.zip -d /home/hychain-node-user/
sudo rm /home/hychain-node-user/node.zip
- Create a new wallet
sudo /home/hychain-node-user/guardian-cli-linux guardian new-wallet
β Please save the public and private key somewhere safe!!! |
---|
-
Delegate your node keys, using this public address.
-
Test to see if it works, insert your private key into
<private key from the new-wallet command above>
.
sudo /home/hychain-node-user/guardian-cli-linux guardian run <private key from the new-wallet command above> --loop-interval-ms 3600000
You should see the following output or something similar if it works.
$Apr 02 21:08:52 hyserver bash[5649]: [21:08:52.042] INFO: Running guardian for owner (0x22134145124151511511455145144125) with 99999999999 delegated node keys
$Apr 02 21:08:53 hyserver bash[5649]: [21:08:53.502] INFO: Processing challenges for 99999999999 node keys
$Apr 02 21:10:19 hyserver bash[5649]: [21:10:19.172] INFO: Sleeping for 3600000ms before running guardian again
At that point you can press ctrl-c
to stop the command. If you didn't get this, you need to go through the steps and see where you missed out.
- Use systemctl to create a long standing service.
sudo nano /etc/systemd/system/hychain-node.service
π: Note: If you meet an error, maybe your linux doesn't have nano , you can install it with sudo apt-get install nano |
---|
Paste this inside. Remember to paste your real private key
into the <private key from the new-wallet command above>
.
[Unit]
Description=Hychain Node
Documentation=https://github.com/angyts/hychain-node-guides/blob/main/README.md#setup-for-linux-servers
[Service]
Type=simple
User=hychain-node-user
Group=hychain-node-user
WorkingDirectory=/home/hychain-node-user/
ExecStart=/bin/bash -c './guardian-cli-linux guardian run <private key from the new-wallet command above> --loop-interval-ms 3600000'
Restart=always
RestartSec=3
[Install]
WantedBy=default.target
RequiredBy=network.target
Then click ctrl-x
to save changes.
Start the service with
sudo systemctl daemon-reload
sudo systemctl start hychain-node.service
You can check on the status of the service with
sudo systemctl status hychain-node.service
or this command to view the logs.
sudo journalctl -fu hychain-node | ccze
If you want to stop it, use
sudo systemctl stop hychain-node.service
Now it will run even when your server restarts. But be careful of sharing your log files, because your private key might be there.
- Create a folder to keep the file. Maybe like in the documents.
- Download this file. https://github.com/HYCHAIN/guardian-node-software/releases/download/0.0.1/guardian-cli-windows-v0.0.1.zip
- Extract this file and move it inside the folder that you just created.
- Look for this file
guardian-cli-win.exe
. Right click on it, and clickproperties
. Look for this thing calledlocation
. It might look something likeC:\Users\Documents\hychainnode
. Copy thislocation
. - Open the command prompt with the hotkey
Windows-R
or pressstart
search forrun
to open this run window, then typecmd
inside.
- Go to the directory which contains your file, using
cd
then thelocation
from above.
cd <insert the location you got from above>
- Create a new wallet
guardian-cli-win guardian new-wallet
β Please save the public and private key somewhere safe!!! |
---|
-
Delegate your node keys, using this public address.
-
Run the node once to see if it works. Insert your
private key
into<private key from the new-wallet>
guardian-cli-win.exe guardian run <private key from the new-wallet> --loop-interval-ms 3600000
You should see the following output or something similar if it works.
$Apr 02 21:08:52 hyserver bash[5649]: [21:08:52.042] INFO: Running guardian for owner (0x22134145124151511511455145144125) with 99999999999 delegated node keys
$Apr 02 21:08:53 hyserver bash[5649]: [21:08:53.502] INFO: Processing challenges for 99999999999 node keys
$Apr 02 21:10:19 hyserver bash[5649]: [21:10:19.172] INFO: Sleeping for 3600000ms before running guardian again
At that point you can press ctrl-c
to stop the command. If you didn't get this, you need to go through the steps and see where you missed out.
- Use
Task Scheduler
to make a long running process. - Open Start
- Type
Task Scheduler
and open. - Right click
Task Scheduler Library
and clickNew Folder
, maybe name itHychain Node
. Select the new folder you created. - Click Action > Create Basic Task
- Put the following settings. Before pasting it, replace the
<your folder location above>
with yourlocation
above. Watch out for the slashes, and make sure that the whole thing is a valid file location. Also replace the<private key from the new-wallet>
with yourprivate key
. Then click finish.
Name | Hychain Node Launcher |
---|---|
Trigger | When I log on |
Action | Start a Program |
Program/Script | C:\Windows\System32\cmd.exe |
Add arguments | /c \guardian-cli-win.exe guardian run --loop-interval-ms 3600000 |
create a folder https://github.com/HYCHAIN/guardian-node-software/releases download macos zip and move it inside the folder you created unzip/extract the zip wile and click on the folder until you see guardian-cli-macos.exe right click and choose open terminal ./guardian-cli-macos guardian new-wallet (write public and secret keys somewhere) https://delegate.xyz/?r&chainId=2911&contract=0xE1060b30D9fF01Eef71248906Ce802801a670A48 fill in the public wallet you got in new-wallet command and connect metamask (you will need some topia on hychain and not on eth) and after that ./guardian-cli-macos guardian run --loop-interval-ms 3600000
If you are having issues with terminal just closing and you can't do anything follow this additional step go into your system settings and check under "Privacy & Security" if it says "App ... was blocked from use"? click allow anyway and try running command again
- Have some $MATIC on Polygon Mainnet (Chain ID:137). Go to any decentralised exchange. Let's use uniswap as an example. https://app.uniswap.org/. Don't google, learn to type it directly in the browser.
- Look for the NFT WORLD $WRLD token contract address.
0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9
Convince yourself and make sure it really is the correct token. - Key
0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9
into theSearch name or paste address
- Swap some $MATIC into $WRLD
- Go to the bridge. https://bridge.hytopia.com/bridge
- Then bridge your $WRLD into $TOPIA on Hychain. Wait about 15 to 30mins.
- While you are at it, add Hychain mainnet to your metamask by clicking the button below.
- Firstly you need some $TOPIA on the Hychain, see above.
- Go to delegate.xyx. https://delegate.xyz/?r&chainId=2911&contract=0xE1060b30D9fF01Eef71248906Ce802801a670A48
- Connect with the wallet that your bought your
node keys
on. - Confirm that you are on Hychain and the contract is
0xE1060b30D9fF01Eef71248906Ce802801a670A48
. - Key in your
public address
from above in the box and commit the transaction on chain. I think it uses about 0.4 $TOPIA.
This is for linux, check the node key numbers from here. Then type each key number followed by comma.
./guardian-cli-linux guardian reward-to-claim <all the key ID followed by comma>
Don't get too excited, divide that by 18 zeros.
Right now I think I lost more $TOPIA trying to claim, so perhaps don't do it yet? Until it accumulates more?
π€‘ 0.000142450142450141 $TOPIA reward claimed...
But if you want to do it, here it is, replace the <Insert your private key here>
with your private key
, the rewards will go to the wallet that is holding your node keys.
./guardian-cli-linux guardian claim-rewards <Insert your private key here> --owned-keys --approved-keys
Troubleshooting steps
Unable to estimate gas, maybe not enough $TOPIA on the node wallet:
Apr 03 00:09:25 hyserver bash[6543]: [00:09:25.411] ERROR: Error submitting assertions for challenge (623) Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"execution reverted","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0x5E57f4A43626DecC87B146436b14BCDc4243949C","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x03a3abfc6f00"},"to":"0x6c065572f1824171186aF6dF848313784d6E5b0E","data":"0x19d6c415000000000000000000000000000000000000000000000000000000000000026f6e739bb68b3471cbefa1c0b0ef9e657e48242717d25c47c2ae2f49987c43c2a0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000018c5000000000000000000000000000000000000000000000000000000000000274b00000000000000000000000000000000000000000000000000000000000000027366772bf0e81a034697b4b674169eed8c44a67f84dd5b10743318dabebe3b512339dd41d1f53f218732af59f8f944ffaaed92452795c48ca1200d8b0188a7d0","type":2,"accessList":null},"error":{"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":468,\"error\":{\"code\":-32000,\"message\":\"execution reverted\"}}\n","error":{"code":-32000},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\"[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x3a3abfc6f00\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0x5e57f4a43626decc87b146436b14bcdc4243949c\",\"to\":\"0x6c065572f1824171186af6df848313784d6e5b0e\",\"data\":\"0x19d6c415000000000000000000000000000000000000000000000000000000000000026f6e739bb68b3471cbefa1c0b0ef9e657e48242717d25c47c2ae2f49987c43c2a0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000018c5000000000000000000000000000000000000000000000000000000000000274b00000000000000000000000000000000000000000000000000000000000000027366772bf0e81a034697b4b674169eed8c44a67f84dd5b10743318dabebe3b512339dd41d1f53f218732af59f8f944ffaaed92452795c48ca1200d8b0188a7d0\"}],\"id\":468,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://hychain.calderachain.xyz/guardian-http"}}, tx={"data":"0x19d6c415000000000000000000000000000000000000000000000000000000000000026f6e739bb68b3471cbefa1c0b0ef9e657e48242717d25c47c2ae2f49987c43c2a0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000018c5000000000000000000000000000000000000000000000000000000000000274b00000000000000000000000000000000000000000000000000000000000000027366772bf0e81a034697b4b674169eed8c44a67f84dd5b10743318dabebe3b512339dd41d1f53f218732af59f8f944ffaaed92452795c48ca1200d8b0188a7d0","to"{},"nonce":1,"from":"0x5E57f4A43626DecC87B146436b14BCDc4243949C","type":2,"maxFeePerGas":{"type":"BigNumber","hex":"0x03a3abfc6f00"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.7.0)