The post Syscoin 3 Alias Creation appeared first on Justin Silver.
]]>Before we start – please read this post fully! It will only take a few minutes, and you will feel much more comfortable creating your alias. Don’t worry about all the text, I included a lot of detail but these are the only commands you actually need to run – it’s mostly cutting and pasting.
aliasnew YOUR_ALIAS "" 3 EXPIRATION YOUR_ALIAS_ADDRESS "" "" "" syscointxfund ALIAS_HEX '{"addresses": ["YOUR_FUNDING_ADDRESS"]}' signrawtransaction RAW_HEX syscoinsendrawtransaction SIGNED_HEX
To use any Syscoin Alias service you will first need to enable the address index in the Syscoin Core by adding addressindex=1
to your syscoin.conf
file, then restarting Syscoin Core Qt and reindexing (it will prompt you when you restart). If you are using syscoind
directly you will need to run syscoin-cli stop
followed by syscoind -reindex
to trigger the reindexing process.
The process to create a Syscoin Alias is just 4 commands. You will need to run them once to reserve your alias, then a second time after waiting for a block confirmation to finalize your alias registration. You will need a small amount of SYS available, and either an existing address (funded or unfunded) or a new address to assign to the alias.
When selecting an expiration timestamp you will need to use Unix Epoch Time. Determine your expiration time by using a site such as https://www.epochconverter.com/ and make sure to only select 1 or 2 years for your expiration – aliases become exponentially more expensive and be quite pricey to reserve for a very long time.
If you’re wallet is encrypted (and it should be!) then you will need to unlock you wallet with `walletpassphrase ‘YOUR_PASSSPHRASE’ 1800` to unlock it for 30 minutes (1800 seconds).
It is recommended to create a new address to use to fund your alias creation transaction – you can do this by sending 1 SYS to a new address in your wallet and noting the address for later use when funding your alias creation transaction.
First, get familiar with the aliasnew command. You can read the help below or run syscoin-cli help aliasnew
to see it on your system.
aliasnew [aliasname] [public value] [accept_transfers_flags=3] [expire_timestamp] [address] [encryption_privatekey] [encryption_publickey] [witness] <aliasname> alias name. <public value> alias public profile data, 256 characters max. <accept_transfers_flags> 0 for none, 1 for accepting certificate transfers, 2 for accepting asset transfers and 3 for all. Default is 3. <expire_timestamp> Time in seconds. Future time when to expire alias. It is exponentially more expensive per year, calculation is FEERATE*(2.88^years). FEERATE is the dynamic satoshi per byte fee set in the rate peg alias used for this alias. Defaults to 1 hour. <address> Address for this alias. <encryption_privatekey> Encrypted private key used for encryption/decryption of private data related to this alias. Should be encrypted to publickey. <encryption_publickey> Public key used for encryption/decryption of private data related to this alias. <witness> Witness alias name that will sign for web-of-trust notarization of this transaction.
If you are running these commands from the command line and not the Syscoin Core Qt Console, just add “syscoin-cli” before each command, otherwise follow them filling in your details where there are capital letters.
In these examples YOUR_ALIAS
is the alias name you want to register, in lower case (ironically). Replace YOUR_ALIAS_ADDRESS
with the address you want to associate with your alias (possibly your masternode staking address?). For the EXPIRATION
use https://www.epochconverter.com/ to generate the expiration in Unix Epoch time – no more than a year or two is strongly recommend due to exponentially increasing fees.
aliasnew YOUR_ALIAS "" 3 EXPIRATION YOUR_ALIAS_ADDRESS "" "" ""
[ "00740000010ae45894ba90b24c5120db9354d44fc93f17b86dcc269eddd8111f2454c629f20200000000feffffff02f1020000000000005e515140313463626631663365313533636633656166643736346530396262303532373239336134343935353934333936363536323665353436656533633531316364646d7576a91464c63b4b3398452a32a8d9f47b42ee63d2a59cac88ac85c2e59a000000001976a914c1da47e228637af983e1c75172506eabd77962c188acf4040000", "TKA43ch9qBVh7H8LmfSNFN5GqPsXfLyNqJ" ]
Copy the hex string result from the aliasnew
command (the top part), which we will call ALIAS_HEX
below to keep it readable. Replace YOUR_FUNDING_ADDRESS
with the address you want to fund the transaction with – note that the change from this transaction will be sent to a new address, so it’s best to fund with a different address than you want to have your SYS associated with.
ALIAS_HEX
=output from aliasnew, “0074000….” in the example aboveYOUR_FUNDING_ADDRESS
=address to fund txsyscointxfund ALIAS_HEX '{"addresses": ["YOUR_FUNDING_ADDRESS"]}'
[ "007400000179347c7191687ee50469bb8cb8a50a978db51651f482e114d24a6ba926a027ed010000001976a914572b8c4219a138984742c46b231f63afaad6688c88acffffffff02b80b0000000000005e515140373137383831646139346264353934343335383837363766373739343538386134373966313064613163373862313235373333623664373165386262623666326d7576a9149ec5c7b6544d752575ed7672d7984b5aceb14cd588ac534c0609000000001976a9147dc19cec3f574a85d94f2b05186bf3fec39f170588ac00000000" ]
The result of this command is the raw transaction hex, which we will call RAW_HEX
from now on, again for brevity. Next you need to sign this raw transaction with your private key before it can be submitted.
RAW_HEX
=output from syscointxfundsignrawtransaction RAW_HEX
{ "hex": "00740000010ae45894ba90b24c5120db9354d44fc93f17b86dcc269eddd8111f2454c629f2020000006a47304402200be0e27776d44cb9ce69dc683c5d1fc41aceca4131392957181f25d40eae186b02201ac64cdbd219f6e587f347d87f5f72f36a22a85050a8c4d79e0d9e3adb29eff9012103d0f289fbb510b953fa5cecc20cf70f95a249c6e30cc8fec292b45a0637120a19feffffff02f1020000000000005e515140313463626631663365313533636633656166643736346530396262303532373239336134343935353934333936363536323665353436656533633531316364646d7576a91464c63b4b3398452a32a8d9f47b42ee63d2a59cac88ac85c2e59a000000001976a914c1da47e228637af983e1c75172506eabd77962c188acf4040000", "complete": true }
This gives us a signed transaction hex that we can submit to the network which we will call SIGNED_HEX
. Now, submit it to the network to reserve your alias.
SIGNED_HEX
=output from signrawtransactionsyscoinsendrawtransaction SIGNED_HEX
{ "txid": "d4a5ecdd111978082862f2b2ebc199f29158dd5f397df3117dd68e791ed9f446" }
The result of this is the transaction id that was submitted to the network. Now we need to wait for a couple of blocks before we can confirm the alias reservation to complete the registration. Check the current block height so you know where to start.
> getinfo
{ "version": "3.0.4.1", "dashversion": "0.12.3", "protocolversion": 70221, "walletversion": 3000000, "balance": 26.42070085, "privatesend_balance": 0.00000000, "blocks": 36817, "timeoffset": 0, "connections": 8, "proxy": "", "difficulty": 137061451496.0324, "testnet": false, "keypoololdest": 1525736009, "keypoolsize": 1999, "unlocked_until": 0, "paytxfee": 0.00000000, "relayfee": 0.00010000, "errors": "" }
In the results you can see "blocks": 36817,
though it will be higher when you run these commands :). Wait for a minute or two, then run it again to check the height. After a couple of blocks you are ready to continue. Enter the same four commands again entering exactly the same information for aliasnew
but updating each with the response of the commands the second time you run them.
aliasnew YOUR_ALIAS "" 3 EXPIRATION YOUR_ALIAS_ADDRESS "" "" "" syscointxfund ALIAS_HEX '{"addresses": ["YOUR_FUNDING_ADDRESS"]}' signrawtransaction RAW_HEX syscoinsendrawtransaction SIGNED_HEX
Now you’re done! You can check the status of your alias with the following commands. Fund your alias by sending to either your alias name or the underlying address.
aliasinfo YOUR_ALIAS aliasbalance YOUR_ALIAS
The post Syscoin 3 Alias Creation appeared first on Justin Silver.
]]>The post Syscoin 3.0 Masternode Configuration appeared first on Justin Silver.
]]>This is a setup guide for creating a Syscoin 3.0 Masternode. You will need a Virtual Private Server (VPS) from hosting providers such as Amazon EC2, DigitalOcean Droplets, Google Compute Engine, Microsoft Azure, Choopa, OVH, or Vultr that meets the following specifications:
Guide: Masternode VPS Setup
If you need help setting up your VPS see this guide by Syscoin community member JohnP, but be sure to return here before running any commands on your server!
It’s a good idea to read through any script you find on the Internet before running it on a server with root privileges, including this one. Note that to make it easier for beginners this script automatically installs additional firewall and DDOS protection that may interfere with other services if this is not a “fresh” Ubuntu 16.04 LTS VPS.
SCRIPT: https://gist.github.com/doublesharp/bacf7f9ac1ff15dccc1acffe49f989e9#file-masternode-sh
All steps in Syscoin Core Qt should be performed on your local computer, only the automated script should be run on your server. Do not transfer funds to the wallet on your masternode.
You will need to allocate a static IP to your Syscoin masternode. If your hosting provider implements a firewall (such as Security Groups for Amazon EC2) you will need to allow access to your masternode on TCP port 8369 from everywhere (inbound 0.0.0.0/0
). Since we will be using SSH (Putty) to access to server you will need to allow TCP port 22 from everywhere as well.
If you are upgrading your wallet from Syscoin 2.x to Syscoin 3.x you MUST run dumpwallet "/full/path/to/dump.txt"
and then importwallet "/full/path/to/dump.txt"
. You will likely want to delete “/full/path/to/dump.txt” after this process as it contains unprotected private keys.
If you are unable to open your wallet.dat with Syscoin-Qt 3.x with an error that your wallet is corrupted you will need to open the wallet using Syscoin-Qt 2.1.6 and call dumpwallet
then open Syscoin-Qt 3.x to run importwallet
.
WARNING: Your wallet dump file contains unprotected private keys. Please delete it after completing this step!
Windows users will need to take an additional step to open Syscoin-Qt 2.x correctly. Locate the shortcut for Syscoin-Qt 2.x and right click it to select “Properties”, then in the “Target” field add a space and then -datadir=%HOMEPATH%\AppData\Roaming\Syscoin
to the end of the value and click “Ok”. This will tell it to open using the legacy “Syscoin” directory instead of the new “SyscoinCore” directory.
PRO TIP: Backing up and encrypting your wallet is out of scope for this guide but if they are new concepts to you please look into how to do them!
To stake your masternode you will need to provide exactly 100,000SYS in your masternode address. Use Syscoin Core Qt for your system to process this transaction.
To get started open Syscoin Core Qt on your computer and from the menu select “Settings > Options” on Windows or “Syscoin Core > Preferences..” on a Mac. Select the “Wallet” tab and click the checkbox to “Enable coin control features” and “Show Masternodes Tab”. Click the “Ok” button to save your settings, close Syscoin Core Qt then re-open it to view the new options, then wait for the blockchain to fully sync with the network.
Once your local Syscoin Core Qt has fully synced select “Tools > Debug” and enter masternode genkey
to generate your masternode private key. Copy this value as you will need it later, it will look similar to the following:
7ra1rhngvNkhkiFE8STrmvH3LvYTCzLyRFHFsZvrJUBV6ZmWnc
Next type getnewaddress
to generate an address to use for collateral. Copy down this address as well as you will need to send your collateral to it in the next step. Note that using an alias is out of scope here, but if you create an alias you may use its address as well.
If you are configuring multiple masternodes you will need to create a unique masternode private key and unique collateral address for each masternode using the steps above. Once the address is created for each masternode send a collateral transaction of exactly 100,000SYS to the address for each masternode using the next steps.
WARNING: If you use the same address for multiple masternodes your reward payouts cannot be completed.
Use Coin Control to ensure that you send your collateral from the correct address. Go to “Send” and then “Inputs” to select the input that you would like to send from. In the example below using tSYS, the “Main” input will be selected. Click “Ok” to return to the “Send” screen.
Next enter your masternode collateral address from the previous step into the “Pay To” field. Enter “100,000” exactly into the “Amount” field and do NOT subtract fees from the amount as it will reduce your collateral total.
Press “Send” to send your Syscoin to your masternode collateral address. You will need to wait 1 block – approximately 1 minute – for the transaction to confirm.
Next you will need to get the transaction id for the collateral by selecting the “Transactions” tab to see the 100,000SYS sent to yourself. Right click this transaction to view the id, and copy it down as well for later use.
In Syscoin Core Qt again open the “Tools > Debug” menu and enter masternode outputs
. You will get a long string that is a hash of the transaction id from the previous step followed by a “0” or “1” to indicate the output index. The result should resemble the following:
{ “06e38868bb8f9958e34d5155437d009b72dff33fc87fd42e51c0f74fdb” : “0”, }
From the Syscoin-Qt menu select “Tools > Open Masternode Configuration File”. You will need to enter your masternode information using a text editor in the following format and use the public IP address of your server not your local computer. Make sure that the line does not start with a # as this will comment out the line! If you don’t see your masternode listed in the “Masternode” tab please double check this configuration.
# Masternode config file # Format: alias IP:port masternodeprivkey collateral_output_txid collateral_output_index mn1 123.123.123.123:8369 7ra1rhngvNkhkiFE8STrmvH3LvYTCzLyRFHFsZvrJUBV6ZmWnc 06e38868bb8f9958e34d5155437d009b72dff33fc87fd42e51c0f74fdb 0
Save this file and close Syscoin-Qt.
Finally we are ready to work on your server. Connect to your VPS via SSH (Putty) and enter the following command to start the automated install:
bash <(curl -sL doublesharp.com/sysmasternode)
Default values are found in brackets and pressing enter will selected the [default]
value. For entries with a [Y/n]
the capital letter is the default. Enter [Y]
to choose “yes” or [N]
to choose “no”. Likely the only value you will need to enter is your masternode private key.
Syscoin Core Github Branch [master]: Masternode Private Key []: 7ra1rhngvNkhkiFE8STrmvH3LvYTCzLyRFHFsZvrJUBV6ZmWnc External IP Address [123.123.123.123]: Masternode Port [8369]: Press any key to continue or Ctrl+C to exit...
Once the build process and configuration have completed type source ~/.bashrc
to access the syscoind
and syscoin-cli
executables via the new syscoin user.
Back on your local computer restart Syscoin Core Qt and wait for it to sync up to the network. Choose the “Masternodes” tab, select your masternode, then click “Initialize alias”. Only click this button once and if your “Status” ever changes it’s recommended to confer with the #masternodes Slack channel before restarting your node – if you restart you will need to re-qualify for rewards and won’t receive any rewards during this time. Read on for more information.
Keep in mind that your masternode will not immediately be eligible for rewards. The eligibility period is determined by the formula [number of masternodes] * 2.6 * 60 seconds
.
Note, if you restart your masternode by pressing “Initialize” in Qt this counter will reset and you will not receive rewards until your masternode is eligible again.
Now that syscoind
is running under the syscoin
user you will need to access it differently. The cron job for sentinel ping is also installed under this user. The following commands may be useful to run on your server.
# view your syscoin.conf sudo cat /home/syscoin/.syscoincore/syscoin.conf # view your sentinel.conf sudo cat /home/syscoin/sentinel/sentinel.conf # view the syscoin user crontab which should contain: # */10 * * * * /usr/local/bin/sentinel-ping sudo crontab -u syscoin -l # run a sentinel ping to speed up Qt syncing? why not! sudo su -c "sentinel-ping" syscoin # view the sentinel-ping cron log, look for errors sudo less /home/syscoin/sentinel/sentinel-cron.log # view the syscoind debug log, look for errors sudo less /home/syscoin/.syscoincore/debug.log # start and stop the syscoind systemd service sudo service syscoind stop sudo service syscoind start sudo service syscoind restart # check that the syscoind process is running at the proper user ps aux | grep [s]yscoind # log out and back in or run the following to alias syscoind and syscoin-cli source ~/.bashrc # now the commands run as the syscoin user syscoin-cli getinfo syscoin-cli mnsync status syscoin-cli masternode status # it is aliased to this shorter function syscli getinfo syscli mnsync status syscli masternode status # if you really want to log in as the syscoin user sudo su - syscoin
This script installs the necessary dependencies to build the Syscoin Core from source. It creates a user named “syscoin” and uses a systemd service to start the syscoind
process as the “syscoin” user, and it set to start on boot after the necessary networking services have started.
Updates and reconfigurations can be performed by entering the command sysmasternode
or the initial auto install command bash <(curl -sL doublesharp.com/sysmasternode)
.
This automated install script was written by demesm and doublesharp. If it saved you time setting you your masternode please consider sending a tip. Thanks!
doublesharp @ alias doublesharp / address SjaXL2hXfpiuoPZrRFEPawUSHVjwkdu5az”
demesm @ address SkSsc5DDejrXq2HfRf9B9QDqHrNiuUvA9Y
The post Syscoin 3.0 Masternode Configuration appeared first on Justin Silver.
]]>