Skip to content
repo to launch and manage KMDLabs notary nodes
Branch: master
Clone or download
Pull request Compare This branch is 299 commits ahead of blackjok3rtt:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
iguana/coins fixed! Dec 15, 2018
install KMDLabs URL update Jan 30, 2019
.gitignore change to use staked.json from komodod Nov 23, 2018
LICENSE Initial commit Sep 5, 2018
NNvote.py real NN lottery May 13, 2019
README.md fix bootstrap instructions May 21, 2019
TotalSupply.sh fixed Total Sep 26, 2018
asset-cli Add the start of diffrent branches code. STAKEDED is set to use Oct 6, 2018
assetchains fix komodod path Nov 12, 2018
assetchains.json remove dragon/hound and CFEKPAY May 17, 2019
assets-cli fix komodod path Nov 12, 2018
build_iguana remove liqudity provider add staked build flag Mar 15, 2019
checkmasks Add checkmasks script instead of masks. More readable and better info… Oct 1, 2018
config_example.ini Initial commit: Broken for sure! Sep 5, 2018
dpowassets.py Initial commit: Broken for sure! Sep 5, 2018
dwy_attack_mitigation.sh fix Feb 26, 2019
lib.py trim whitespace for lottery blockhash input May 20, 2019
listassetchainparams.py add burntxid to skipped params Jan 27, 2019
listassetchains.py Initial commit: Broken for sure! Sep 5, 2018
listbranches.py add daemon stop to start.sh so that we dont need to stop anything to Oct 6, 2018
listclis.sh Getting there Sep 5, 2018
listcoins.sh Getting there Sep 5, 2018
oraclefetch.sh add oraclefatch script Oct 12, 2018
oraclepush.sh add oraclepush script Oct 7, 2018
participants.json Update participants.json May 19, 2019
peer_ips.txt Update peer_ips.txt Apr 1, 2019
printkey.py Initial commit: Broken for sure! Sep 5, 2018
splitfunds.sh splitfunds for utxo < 1 Dec 24, 2018
start.sh try to fix exit command Mar 1, 2019
start_iguana.sh change start logic. Oct 2, 2018
stats cron fix Feb 14, 2019
stats.py clean up Feb 17, 2019
stop.sh fix komodod path Nov 12, 2018
update_komodo.sh fix update_komodo.sh with build.sh Mar 1, 2019
updatefirewall.sh firewall ports opening script Jan 4, 2019
utxosplitter.sh modified: utxosplitter.sh Jan 2, 2019
validateaddress.sh fix KMD didnt start error Feb 14, 2019
walletreset.sh 2 Dec 30, 2018

README.md

Staked Notary Control Scripts

Setting up your VPS

You need a new user, you cannot use root

For ubuntu 16.04 login as root and create a user: adduser

Add your user to sudo: gpasswd -a <user> sudo

Its reccomended to install an SSH key to this user. https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

Logout of root and login to your user to continue installing the notary repo.

Install instructions

cd ~
git clone https://github.com/KMDLabs/StakedNotary.git
cd StakedNotary

Install the relavent repos and dependancies

cd install
./installSuperNET.sh
./buildkomodo.sh
./installnanomsg.sh

You need to build our special repo of komodo thanks to @libbscott and nanomsg and SuperNET for iguana. Both these scripts cover all required deps on debian based distros.

Now you need to copy the config file and edit it with our pubkey/Raddress and WIF key for KMD. There needs to be a space after the = sign on each line.

e.g btcpubkey = 02.....

cd ~/StakedNotary
cp config_example.ini config.ini
nano config.ini

We also need to unblock the iguana port. To find this:

sudo ufw allow 9997
sudo ufw allow 22
sudo ufw enable

Bootstrap for KMD is here. But if possilbe please sync KMD from scratch, as we are now in production. https://bootstrap.0x03.services/komodo/KMD.html

After this we are ready to launch KMD and any chains that happen to be in assetchains.json and import our private keys to them all.

./start.sh

To keep an eye on komodods sync status run: tail -f ~/.komodo/debug.log This could take a while. 2-3H maybe longer. Also the progress of sync is printed to the terminal you started start.sh from.

There is one thing that notary nodes depend on more than anything else and that is the UTXO's. Once iguana has started we need to run @lukechilds excellent UTXO splitter.

./utxosplitter.sh

You also will want to put this UTXO splitter on a cron job every 15 minutes.

crontab -e

Enter this into the cron tab:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
*/15 * * * * /home/<your_username>/StakedNotary/utxosplitter.sh >> /home/<your_username>/utxo_split.log 2>&1

Using features of StakedNotary komodod.

Wallet filter

-stakednotary=1

This is needed on KMD, to activate our features amoung other things. Add the flags below in start.sh to customise the filter.

-mintxvalue=<amount in sats>

This defualts to 1 coin (to make it lower on KMD to fund smaller amounts, set it to a lower amount of sats.) eg. 0.2KMD would be 2000000

How it works:

-> Takes all the vouts in a transaction and counts which ones are to the notary nodes address (set with -pubkey=)

-> Adds the value of these together (total in sats)

-> Divides by the number of vouts,

-> If the amount is less than this number the transacion is ignored, not added to wallet. This filter does not work with -rescan
so you can add them to wallet by doing a rescan if you need to.

-> If this number is 0, the wallet accetpts NO transactions, once a notary is funded, likely this should be the setting you use. Only allowing to send from yourself, for iguana utxo split txs. You should not set this to 0, if you need to fund your node. Likely setting this value to a low value on KMD is good idea.

-whitelistaddress=RTVti13NP4eeeZaCCmQxc2bnPdHxCJFP9x

-> No matter what the setting of the above setting is set to, this address can send you coins. You can use this to have a trusted address either from another notary, or a wallet owned by yourself to fund your node any amount at any time.

Wallet cleaner

cleanwallettransactions RPC

-> Provide a txid to delete all tx in the wallet except the tx specified. The walletreset.sh script does this all for you.

-> Running without a txid specified will clean all transaction history in the wallet older than the last unspent utxo.

Adding New Coins

This is the coolest part, super happy about it. Simply add the coins params to assetchains.json (make sure you have the freq param it is required!) and submit a PR and merge it. Then have ALL operators:

./start.sh

There is no need to stop any deamons at this point, if they are already running, they will not start again.

Make sure some funds have been sent and everything should just work. :D

Using some of the Scripts

Additional dependancies required -

sudo apt-get install python3-dev python3 libgnutls28-dev libssl-dev python3-pip

pip3 install setuptools wheel base58 slick-bitcoinrpc requests python-bitcoinlib

To get a list of coins: ./listcoins.sh

To issue commands to a coin: asset-cli <COINS_NAME> <COMMAND>

To issue commands to all assetchains: assets-cli <COMMAND>

To kill everything: ./stop.sh

To HARD reset a coins wallet: ./walletreset.sh <coin>

Hard reset will send the entire balance to yourself, then remove all transactions that are not this transaction from the wallet after it has been confirmed. Might look at changing this to after it has been notarised?

To SOFT reset a KMDs wallet (works with ac by specifying -ac_name=): komodo-cli cleanwallettransactions

Soft reset is generally what you will use. This mode, simply removes all txs from that wallet database that are all spent. It means you lose transaction history, but also keeps the node able to build txs in a speedy manner, very important for notarisaions. :)

The install scripts come with the tools:

htop: To monitor system load

slurm: To monitor network load

tmux: To make panes, so you can run these tools and iguana console logs at he same time and detach/reattach when you login/out of the notary node. Google is your friend.

You can’t perform that action at this time.