Skip to content

Instantly share code, notes, and snippets.

@justanwar
Last active July 9, 2020 19:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justanwar/e0695c1ea909a46aed8209466fae9bb9 to your computer and use it in GitHub Desktop.
Save justanwar/e0695c1ea909a46aed8209466fae9bb9 to your computer and use it in GitHub Desktop.
Quick and Dirty Deterministic Znode Guide

Quick and Dirty Deterministic Znode Guide

This guide is for those who own and host their own Znodes. If you are using a Znode hosting provider, ask your provider for help.

  1. In Receive tab, create a new address OR go to Debug Console and enter getnewaddress. Send 1000 XZC to this address and wait for a confirmation.

  2. In Debug Console, enter evoznode outputs to see a list of 1000 XZC transaction. Select the transaction ID (the long string, collateralHash) and the transaction index (the shorter number, collateralIndex) that you made earlier.

  3. Generate two new addresses. One is for proof of ownership (ownerAddress), one is the address the Znode will pay out to (payoutAddress). DON'T SEND COINS TO THE OWNERADDRESS. DON'T USE IT AS PAYOUT ADDRESS

    If you want labels, create them in the Receive tab. If you will have lots of Znodes, you want to label ALL the addresses properly. If you don't want any labels, just do getnewaddress in Debug Console (this can be a bad idea).

  4. In Debug Console, enter bls generate. Output will look like this:

    {
      "secret": "2e551176c4cd5a2e26f3a1c61f151487e013f7095ffbc0f62b5c2b251e7bd84c",
      "public": "89d395bc75e99527e80d3bbd408a5b41bbf37e7e1e26c5924da734008d1aa4a3f5e42a968bef541cb1c9a0899280d29b"
    }
    

    The public part (operatorPubkey) will be used later. The secret (operatorKey) will go into your Znode's zcoin.conf along with the other configs:

    znode=1
    externalip=192.168.1.1:8168
    znodeblsprivkey=2e551176c4cd5a2e26f3a1c61f151487e013f7095ffbc0f62b5c2b251e7bd84c
    

    You will also need to add znodeprivkey= and fill it with the output of znode genkey. A future update will remove this requirement.

  5. In Debug Console, use listaddressbalances 0.01 to get a list of addresses with coins in it. We will use this for the protx fee (feeSourceAddress). If you don't have any balances available to use, send some coin to an address in your wallet.

    DON'T ACCIDENTALLY BREAK UP YOUR ZNODE. MAKE SURE YOU ARE NOT TAKING IT FROM THE 1000 XZC!

  6. You are now ready for to enter the full protx command! The full command looks like this:

    protx register collateralHash collateralIndex ipAndPort ownerAddress operatorPubKey votingAddress operatorReward payoutAddress feeSourceAddress

    It looks complicated but it's simplified since we can put the information from steps 2 to 5 and do the following:

    ipAndPort: the IP and port of your Znode. Port is 8168. Format: 192.168.1.1:8168

    votingAddress: we can use ownerAddress, so put this as ""

    operatorReward: we are hosting our own Znode, so put this as 0

    After putting in all the information above, we get:

    protx register collateralHash collateralIndex 192.168.1.1:8168 ownerAddress 89d395bc75e99527e80d3bbd408a5b41bbf37e7e1e26c5924da734008d1aa4a3f5e42a968bef541cb1c9a0899280d29b "" 0 payoutAddress feeSourceAddress

    Before you are able to enter the command, you must first unlock your wallet:

    walletpassphrase YOURPASSWORD 60

    This command will unlock your wallet for 60 seconds and returns a (null) message when successfully executed.

  7. Enter this in the Debug Console. If everything is correct, you should get a transaction ID. Once the transaction is confirmed, your new Znode will appear in the Znodes tab!

    Repeat this for every Znode you want to setup.

    To check if the protx register command is received, go to explorer.zcoin.io and paste in the above transaction. You should see a Provider Register section, click on the plus sign to expand it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment