Updating notary node in few lessons - ns408/komodo GitHub Wiki

Work is ongoing.

Lesson 1: Securing and updating server

Soon.

Lesson 2: Bitcoin

Assuming your server was just updated to latest OS software, re-checked for security and rebooted. Nothing from our set is running yet. It’s the same as before, so you had your very first steps in setting this up done and your are not a newbie. We're only updating here.

First of all, run bitcoin using just bitcoind & and validate bitcoin-cli getinfo.

You should have at least 0.01 BTC there for no worries. Ask @kolo or @pondsea if you have no funds anymore.

Recommendation: To avoid trouble, send 0.1 BTC to each of your nodes. It's not that much and you will get them back later. But this is good for notarizing for a very long time.

You shoud have correctly imported your privkey (bitcoin privkey, BTCwif, not BTCDwif or KMDwif), long time ago. Use bitcoin-cli validateaddress 1YourAddress with your node's BTC address. Should be ismine: true. If your balance on ratified node is exactly zero - this indicates you have not imported your privkey correctly. Upon ratify it gets 6 satoshi.

Recommendation: if you see weird problems, your address is correct, but balance is zero - stop it, remove wallet.dat file in .bitcoin folder. This will not trigger a full chain rescan - only wallet recreation. Than you can import privkey again. And yes, this can take hours to complete.

You should have your funds on primary node BTC address generated by iguana, not on a random change address. Make bitcoin-cli listunspent and manually review unspent inputs. They should all be on your node BTC address, otherwise iguana will not see those funds, regardless of balance shown in getinfo. Change address happens when you've sent something to other address using directly bitcoin-cli sendtoaddress - in that case change (remaining balance of used input) always goes to new generated address (it's still yours).

Possible solution: from bitcoin-cli listunspent get addresses, which are not your node primary address and make bitcoin-cli dumpprivkey 1ThatRandomNonNotaryAddress. This privkey than can be imported in blockchain.info wallet (or any other supporting spending addresses) and send them back to your main address.

Recommendation: Never ever use bitcoin-cli sendtoaddress.

Result: You can keep backup of only iguana passphrase and than recreate all software set using only it. It will give you back same set of privkeys. Only coins left on change addresses (which you have 0 now) will be lost.

You should have a lot of inputs (verify by bitcoin-cli listunspent) of exaclty size 0.0001 BTC. That's inputs of exact size needed for notarize. If there is no - iguana will make splitfund (when starting it, few lessons ahead) for that, but this will require 30-60 minutes - iguana will complain about no BTC funds until that transaction gets mined in bitcoin blockchain.

Solution and recommendation: patience.

It's good idea to update bitcoin itself (once in a year or so :slightly_smiling_face:) and revew your bitcoin configuration. For example, I highly recommend having

bind=127.0.0.1
rpcbind=127.0.0.1

inside bitcoin.conf or you will have few terabytes of your banwidth gone to helping other bitcoin nodes in wild world. Also you need to have txindex=1 in that conf or you will get random bugs. After first time adding this line you must do full bitcoin chain resync.

Did it? Ok, from now we can think your bitcoin is working as it should.

Lesson 3: Updating komodo instance

Next step will be verify that you have komodo (out main core chain) properly configured and updated. (No assetchains exist on this step regardless of komodo output).

First of all you go ~/komodo/src folder and check everything:

You should use exactly beta code branch. Do git fetch && git checkout beta until you will see Already on 'beta'. Than never switch to any other branches. All old branches (dPoW, master, dev) are obsolete for you and must be forgotten.

You should always have latest code - do git pull - this your daily updating step. If you see new files (+'s and -'s) it means it had new code and needs recompile. If you see only branches updates - ignore it.

Verify that you have not messed anything manually inside code tree. If it's so - it's solved by simply doing git reset --hard to remove any manual additions and get exactly latest commit. You will not loose anything.

Your beloved txt file named pubkey.txt should be in komodo/src folder and conain your pubkey (btcpubkey!) in form pubkey=yourpubkey. No quotes, no spaces, no remarks and no dead animals:

~/komodo/src$ cat pubkey.txt
pubkey=0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec

Second file (who's future is unclear) is userhome.txt in same directory. Nobody knows for sure if it is need or not anymore. Just have it. Inside you should put path to your homedir without leading slash, nothing more:

~/komodo/src$ cat userhome.txt
home/kolo

Now you can try to compile everything. Command is just make or make -j$(nproc). Last will try to use all availible CPU's (nproc) to speed up compile process. This should work without errors if you not ignored recommendation to use beta branch.

It's good idea to clean chain files before start if you have not done so in a 1-2 weeks or if you see strange errors after all other checks. You can monitor slack channel #notarynode day by day to see when it's really needed. But if you have missed that moment - nobody can tell you if you need resync right now or no. There is no exact moment in records. Current chain resync should take no more than 30 minutes, unless youre not on SSD. To resync - go to folder ~/.komodo and remove everything but files wallet.dat and komodo.conf.

Dont forget to verify komodo.conf file. There is no more need to keep addnode lines there. Only this lines:

rpcuser=yourrandomusername
rpcpassword=youverysecretpassword
txindex=1
bind=127.0.0.1
rpcbind=127.0.0.1

Last two lines allow you to keep komodo daemon hidden from outter world. It will be slower on network stuff, but more safe.

Now you can fasten your belt and finally start komodo.

Lesson 4: Starting komod instance

cd ~/komodo/src
./komodod -notary -gen -genproclimit=4 \
-pubkey=0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec \
-pax -rewind=110000

Lesson 5: Starting iguana

cd ~/KomodoPlatform/iguana
cat ./wp_7776     # <-- post this to slack
./m_notary

Lesson 6: Starting assetchains

Go to ~/komodo/src

cd ~/komodo/src

Edit clearassets and delete everything in it

vi clearassets (and delete everything in it)

And paste the following in it:

rm -rf ~/.komodo/USD
rm -rf ~/.komodo/EUR
rm -rf ~/.komodo/JPY
rm -rf ~/.komodo/GBP
rm -rf ~/.komodo/AUD
rm -rf ~/.komodo/CAD
rm -rf ~/.komodo/CHF
rm -rf ~/.komodo/NZD
rm -rf ~/.komodo/CNY
rm -rf ~/.komodo/RUB
rm -rf ~/.komodo/MXN
rm -rf ~/.komodo/BRL
rm -rf ~/.komodo/INR
rm -rf ~/.komodo/HKD
rm -rf ~/.komodo/TRY
rm -rf ~/.komodo/ZAR
rm -rf ~/.komodo/PLN
rm -rf ~/.komodo/NOK
rm -rf ~/.komodo/SEK
rm -rf ~/.komodo/DKK
rm -rf ~/.komodo/CZK
rm -rf ~/.komodo/HUF
rm -rf ~/.komodo/ILS
rm -rf ~/.komodo/KRW
rm -rf ~/.komodo/MYR
rm -rf ~/.komodo/PHP
rm -rf ~/.komodo/RON
rm -rf ~/.komodo/SGD
rm -rf ~/.komodo/THB
rm -rf ~/.komodo/BGN
rm -rf ~/.komodo/IDR
rm -rf ~/.komodo/HRK
rm -rf ~/.komodo/BET
rm -rf ~/.komodo/BOTS
rm -rf ~/.komodo/CRYPTO
rm -rf ~/.komodo/DEX
rm -rf ~/.komodo/HODL
rm -rf ~/.komodo/JUMBLR
rm -rf ~/.komodo/MGW
rm -rf ~/.komodo/PANGEA
rm -rf ~/.komodo/REVS
rm -rf ~/.komodo/SHARK
rm -rf ~/.komodo/SUPERNET

Save it and run clearassets

./clearassets

Run assetchains

./assetchains

Wait for it until it stops doing its thing. The import your BTCDwif key

./fiat-cli importprivkey U*************************** (your BTCDwif key)

After it is finished fund your assets with your BTCD address

./assetfunds R********************* (your BTCD address)

Lesson 7: Adding assets dPoW

cd ~/komodo/src
./dpowassets

Done.