Jump to content

buzzkillb

Moderators
  • Content Count

    324
  • Joined

  • Last visited

  • Days Won

    59
  • Feedback

    N/A

Everything posted by buzzkillb

  1. Added screenshot to first post in how the list showed unregistered as one daemon being tracked lost sync. Useful already.
  2. What the index.html looks like to add the row header to the above. index.html <html> <head> <title>FortunaStake List</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css"> <script type="text/javascript" src="block.js?version=0.1337"></script> <script type="text/javascript" src="fortunastake.js?version=0.1337"></script> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="style.css?version=0.1337"> </head> <body> <div class="row"> <div class="col">FortunaStake List</div> </div> <div class="row"> <div class="col">Block #<div id="block"; style="display:inline-block"; class="animated rubberBand"></div></div> </div> <div class="row"> <div class="col">FS #</div> <div class="col">IP Address</div> <div class="col">Address</div> <div class="col">Status</div> <div class="col">Earnings</div> </div> <div id="fsnumber"></div> </body> </html>
  3. This is a lot easier than it looks, and a super easy way to watch the status of your Fortunastakes (masternodes) from anything, including a raspberry pi. If you have multiple fortunastakes, somehow you want to get each json of your fortunastake status onto a single nginx server. Depends a lot on how to go about this. I am using blocknotify on the daemon to create 1.json and 2.json files, also grab the current block from blocknotify send that to block.txt, sending these files to /var/www/html and then making sure permissions are what I want. Install nginx on your ubuntu you will be using. sudo apt install nginx Verify that works by going to your ip address. I am doing everything on a local network, this is gonna vary, but if its working you should see the default nginx welcome screen. denarius.conf (change the full path to your server, maybe /home/username/status.sh) blocknotify=/root/status.sh status.sh (creates block.txt and iterates through 2 fortunastakes on same server at directories /root/D01 and /root/D02, i<3 is +1 of the number you are running if on same server) #!/bin/bash denariusd -datadir=/root/D01 getblockcount > /var/www/html/block.txt #stop and start 01-02 for ((i=1; i<3; i++)) do echo "$i" denariusd -datadir=/root/D0$i fortunastake status > /var/www/html/$i.json chmod -R 644 /var/www/html/* done Restart the daemon and on the first new block status.sh will run and send the files into /var/www/html. Double check the directory has some files after running for a bit. Basically you want to get each of your Fortunastakes json files into your /var/www/html, maybe even using scp from multiple vps's. Just make sure to label them 1.json 2.json 3.json and so forth for how we will iterate through these json files. example of using scp command way to do it, you want ssh-key login if using scp scp 2.json [email protected]:/var/www/html/2.json Create 4 files we will use to create the website, stick them in /var/www/html folder style.css body { background: #020000; font-family: 'Raleway', sans-serif; font-size:16px; } .row { display: flex; flex-wrap: wrap; } .col { flex: 1 0 18%; /* The important bit. This percentage decides your columns. The percent can be px. It just represents your minimum starting width. */ margin: 0.5px; background: #333333; height: 30px; color: white; display: flex; align-items: center; justify-content: center; } /* visited link */ a:visited { color: white; } /* unvisited link */ a:link { color: white; } fortunastake.js fetchData = () => { const urls = [ "1.json", "2.json" ]; const allRequests = urls.map(url => fetch(url).then(response => response.json()) ); return Promise.all(allRequests); }; fetchData().then(arrayOfResponses => { for (index = 0; index < arrayOfResponses.length; index++) { window.FS = '<div class="row">' + '<div class="col">FS' + [index+1] + '</div>' + '<div class="col">' + (arrayOfResponses[index].local.service) + '</div>' + '<div class="col">' + '<a href="https://www.coinexplorer.net/D/address/' + (arrayOfResponses[index].local.payment_address) + '">' + (arrayOfResponses[index].local.payment_address) + '</a></div>' + '<div class="col">' + (arrayOfResponses[index].local.network_status) + '</div>' + '<div class="col">' + parseFloat((arrayOfResponses[index].local.earnings) / 100000000).toFixed(8) + '</div>' + '</div>'; console.log(window.FS) $("#fsnumber").append(window.FS).hide().fadeIn("fast"); } } ); block.html fetch('block.txt', {mode: 'no-cors'}) .then(function(response) { return response.json(); }) .then(function(data) { if (data) console.log(data); $('#block').html(""); $("#block").append(data).hide().fadeIn("slow"); }) .catch(function(err) { console.log(err); }); var listen = setInterval(function() { fetch('block.txt', {mode: 'no-cors'}) .then(function(response) { return response.json(); }) .then(function(data) { if (data) console.log(data); $('#block').html(""); $("#block").append(data).hide().fadeIn("slow"); }) .catch(function(err) { console.log(err); }); }, 30000);//30 second index.html <html> <head> <title>FortunaStake List</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css"> <script type="text/javascript" src="block.js?version=0.1337"></script> <script type="text/javascript" src="fortunastake.js?version=0.1337"></script> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="style.css?version=0.1337"> </head> <body> <div class="row"> <div class="col">FortunaStake List</div> </div> <div class="row"> <div class="col">Block #<div id="block"; style="display:inline-block"; class="animated rubberBand"></div></div> </div> <div id="fsnumber"></div> </body> </html> Go back to your nginx IP and force refresh by using shift+ctrl+r and now you can start watching your Fortunastake Status from wherever. This uses a 5 column flex grid and has clickable link to coinexplorer per address and auto refreshes the block count every 30 seconds. This does not autorefresh the FS list though. FS # | IP Address | FS Address | Status | Round Earnings What it shows when one goes down from the list. This particular one lost sync on the daemon, and still shows active as I restarted the QT. Was about to get bumped off to inactive and REKT.
  4. Reduce bandwidth as much as possible running the QT wallet or daemon. 500megs is a good starting point for max upload daily (this is a suggestion and won't cap completely at this number), 8 connections is the minimum for peer2peer to work. And should use listen=1, but if trying to run this on low bandwidth capped ISP try below. denarius.conf maxconnections=8 maxuploadtarget=500 listen=0 or run with flags -maxconnections=8 -maxuploadtarget=500 -listen=0
  5. need to start these services sudo systemctl start pcscd.service sudo systemctl start pcscd.socket
  6. for payouts to work go to near line 57 and add your coin symbol in /var/web/yaamp/core/backend/payment.php // todo: enhance/detect payout_max from normal sendmany error if($coin->symbol == 'BOD' || $coin->symbol == 'TWIT' || $coin->symbol == 'D' ||
  7. how to change diff on a stratum /var/stratum/config/scrypt.conf [STRATUM] algo = scrypt difficulty = 150000 max_ttf = 40000
  8. to set separate fees per algo, near the bottom of the file serverconfig.php // Sample fixed pool fees $configFixedPoolFees = array( 'zr5' => 2.0, 'scrypt' => 0.5, 'sha256' => 5.0, );
  9. I am using a yubikey 5 for this and Manjaro KDE distro. Amazon has same day delivery https://amzn.to/338KYgF slightly different but basically the same as official arch install, except I took out assuming the -m and $MK PIV application's 24-byte management key part as it didn't work for me when generating the self signed certificate. https://wiki.archlinux.org/index.php/YubiKey#Using_a_YubiKey_with_SSH #install yubikey manager sudo pacman -S yubikey-manager yubikey-manager-qt #plug in yubikey and verify it can be seen ykman list #generate key ykman piv generate-key -a RSA2048 9a pubkey.pem #generate self signed certificate ykman piv generate-certificate -d 1826 -s "SSH Key" 9a pubkey.pem #install opensc package sudo pacman -S opensc #configure ssh to use opensc library nano ~/.ssh/config #enter single line below, save and exit PKCS11Provider /usr/lib/opensc-pkcs11.so #convert public-key to standard openssh format ssh-keygen -i -m PKCS8 -f pubkey.pem > pubkey.txt #cat pubkey.txt to see your public key. example can copy and paste the public key into scaleway credentials cat pubkey.txt #or another way to get the public key onto your server cat ~/pubkey.txt | ssh [email protected] 'cat >> .ssh/authorized_keys' now when you ssh into your server, plug in your yubikey and you will be asked for a pin at the login prompt example ssh [email protected] and you will now be prompted for the yubikey pin to access your server
  10. I am using the snap daemon now as its so much easier than compiling or using the script install snapd if its not already installed sudo apt update sudo apt install snapd sudo snap install denarius run the daemon once to get the autoconfigured denarius.conf denarius.daemon wait a minute or so and stop the daemon denarius.daemon stop go to the snap denarius chaindata folder cd ~/snap/denarius/common/.denarius remove the chaindata just created rm -rf database txleveldb smsgDB get latest chaindata from pos.watch wget https://pos.watch/chaindata.zip unzip chaindata.zip overwrite anything it says, nano denarius.conf and add your fortunastakeprivkey and leave everything else alone. nothing else needs to be touched after enakyz did some updates to how the fortunastake works. and start daemon denarius.daemon start from collateral wallet (QT) and done
  11. updating chaindata here https://pos.watch/chaindata.zip the website shows the blockcount and also has an md5 checksum to verify
  12. I have denarius snap already installed so I add denarius_1 as above and this is what snap list shows. snap list Name Version Rev Tracking Publisher Notes core 16-2.41 7713 stable canonical✓ core core18 20191001 1192 stable canonical✓ base denarius 3.3.9.4 77 stable carsenk - denarius_1 3.3.9.4 77 stable carsenk - to run the 2nd denarius daemon denarius_1 denarius_1.daemon denarius_1 is now in the ~/snap/denarius_1 folder ~/snap$ ls -l total 28 drwxr-xr-x 5 user user 4096 Oct 5 20:15 denarius drwxr-xr-x 4 user user 4096 Oct 6 10:18 denarius_1 hint: listen=0 and +1 to port and rpcport per additional daemon/QT EZ-MODE
  13. Multiple Instances can now be run. How to do Snap Denarius Parallel Installs # Enable parallel instances sudo snap set system experimental.parallel-instances=true # First instance - normal install (not required if already installed) sudo snap install denarius # Second or more instances sudo snap install denarius denarius_1 sudo snap install denarius denarius_2 sudo snap install denarius denarius_3
  14. First create an account at https://www.unnamed.exchange/ Remember to use a strong unique password and enable 2FA. After validating your email, go to the Addresses list and then click Create Deposit Address In this example we are depositing Bitcoin. Type BTC to find Bitcoin and push enter, then click next to get your Bitcoin Deposit Address. Deposit Bitcoin into the exchange by either copy and pasting the BTC address, or use the QT code on something like coinomi with a camera. After clicking continue you will be brought back to the address list again. Wait for your confirmations after sending Bitcoin in and start buying up Denarius! Bitcoin takes 10 minutes per confirmation, and currently the exchange requires 2 confirmations for a deposit of Bitcoin. Denarius takes 30 seconds per confirmation, and currently the exchange requires 20 confirmation for a deposit of Denarius.
  15. Official Denarius QT / daemon Snap is available at https://snapcraft.io/denarius To install sudo apt update sudo apt install snapd sudo snap install denarius To run QT denarius To run the daemon denarius.daemon chaindata stored in ~/snap/denarius/common/.denarius cd ~/snap/denarius/common/.denarius Sample daemon command denarius.daemon getinfo stop daemon denarius.daemon stop
  16. verifying this also builds amd64 version on snapcraft itself https://build.snapcraft.io/user/buzzkillb/d-snapcraft/688224
  17. How to build denarius cryptocurrency in snapcraft. I used Ubuntu 18.04 Bionic as the OS for this process, but the build is done in 16.04 Xenial. https://github.com/buzzkillb/d-snapcraft We are going to build in LXD, which I ended up using a combination of the below guides. https://forum.snapcraft.io/t/how-to-create-a-lxd-container-for-snap-development/4658 https://forum.snapcraft.io/t/build-on-lxd/4157 Install LXD from snap sudo snap install lxd initialize LXD (I used all the default settings) sudo lxd init Give permissions so we can run without root sudo usermod -a -G lxd ${USER} Bring the setting through newgrp lxd Building Manually in Xenial lxc launch ubuntu:16.04 mysnapcraft Bring your snapcraft.yaml in from your PC and bring into LDX lxc file push snap/snapcraft.yaml mysnapcraft/home/ubuntu/ Open up a shell and install snapcraft lxc exec mysnapcraft -- /bin/bash snap install snapcraft --classic Lets build our snapcraft.yaml cd /home/ubuntu snapcraft prime snapcraft You will get a file like this denarius_master_amd64.snap Bring the snap into your PC, open up another terminal and type below and stay on that terminal for the remaining. sudo lxc file pull mysnapcraft/home/ubuntu/denarius_master_amd64.snap denarius_master_amd64.snap Install the snap sudo snap install denarius_master_amd64.snap --dangerous Run denarius QT denarius Should be ready to mess around with this.
  18. Use those lines above in your denarius.conf file. fsconflock=1 forces the 5000 to not be touched to allow the fortunastake continue running. staking=1 tells the wallet to stake. Default is 1, but just as well put this. When you get a FS reward, it will go into your collateral wallet address. Say 5001 D after you get your first reward. That 1 D will now sit there for 8 hours and then be ready to stake. What I am seeing recently is it takes about 4-5 days to stake around 12 D, so try to leave the wallet open when you can as staking helps secure the blockchain. Ask whatever questions you still have.
  19. https://github.com/buzzkillb/duct-tape-dns-seeder
  20. useful references https://github.com/cloudflare/python-cloudflare https://github.com/cloudflare/python-cloudflare/blob/master/cli4/cli4.man https://github.com/cloudflare/python-cloudflare/blob/master/examples/example_delete_zone_entry.py https://shapeshed.com/jq-json/
  21. Spent some time with the DNS seeders and there is very little info so I was playing with cloudflare and wondered if I could automate the DNS seeds somehow. I assume this works on any coins that has a peer list with minor tweaks. The basic idea is getpeerinfo from the daemon into a json file and then send line by line of that into an A record on your seeder domain name. I am hopeful some others will see this and have a better idea how to automate this by making it easier to setup and run on generic coin. https://github.com/buzzkillb/duct-tape-dns-seeder Make a cloudflare account and point your domain denarius.pro at the cloudflare nameservers from your domain host control panel. Now we can edit records on cloudflare and the changes are almost immediate. Cloudflare API Key is here, top right Icon -> My Profile -> View Global API Key #Install Python Cloudflare sudo apt install python-pip git clone https://github.com/cloudflare/python-cloudflare cd python-cloudflare ./setup.py build sudo ./setup.py install #Create a config file for your cloudflare API, change email and token (API KEY) mkdir ~/.cloudflare nano ~/.cloudflare/cloudflare.cfg [CloudFlare] email = <[email protected]> token = <API KEY> certtoken = v1.0-... extras = #test this works. change the ipv4 and denarius.pro to your stuff. dnsseed.denarius.pro is what my example will show. cli4 --post name="dnsseed" type="A" content="73.218.220.108" /zones/:denarius.pro/dns_records now we want to store a couple text files somewhere. you choose this for now I will use /root/ #create seed.sh and edit denarius.pro to your domain name. still using dnsseed.denarius.pro for this example. #!/bin/sh grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' "${1:?}" | while read IP do echo "$IP" cli4 --post name="dnsseed" type="A" content="$IP" /zones/:denarius.pro/dns_records done make this file executable chmod +x seed.sh now how to grab and put the ipv4's into the domain A records. denariusd daemon send peerinfo into a json file. then jq parses the json for the addr array and then we remove some junk and put that into peers.txt. From there the bash file uses regex to make the ipv4's pretty. denariusd getpeerinfo > peer.json jq '.[] | .addr' -r peer.json | sed 's/[][]//g' > peers.txt ./seed.sh peers.txt This can be updated as much as the cloudflare API limits gives. But how to remove A records and try to keep this list fresh? Lets make a delete file from python cloudflare examples. https://github.com/cloudflare/python-cloudflare/blob/master/examples/example_delete_zone_entry.py #create delete.py and chmod+x this, and then put this inside. #!/usr/bin/env python """Cloudflare API code - example""" from __future__ import print_function import os import sys import re import json import requests sys.path.insert(0, os.path.abspath('..')) import CloudFlare def main(): """Cloudflare API code - example""" try: zone_name = sys.argv[1] dns_name = sys.argv[2] except IndexError: exit('usage: example_delete_zone_entry.py zone dns_record') cf = CloudFlare.CloudFlare() # grab the zone identifier try: params = {'name':zone_name} zones = cf.zones.get(params=params) except CloudFlare.exceptions.CloudFlareAPIError as e: exit('/zones %d %s - api call failed' % (e, e)) except Exception as e: exit('/zones.get - %s - api call failed' % (e)) if len(zones) == 0: exit('/zones.get - %s - zone not found' % (zone_name)) if len(zones) != 1: exit('/zones.get - %s - api call returned %d items' % (zone_name, len(zones))) zone = zones[0] zone_id = zone['id'] zone_name = zone['name'] print('ZONE:', zone_id, zone_name) try: params = {'name':dns_name + '.' + zone_name} dns_records = cf.zones.dns_records.get(zone_id, params=params) except CloudFlare.exceptions.CloudFlareAPIError as e: exit('/zones/dns_records %s - %d %s - api call failed' % (dns_name, e, e)) found = False for dns_record in dns_records: dns_record_id = dns_record['id'] dns_record_name = dns_record['name'] dns_record_type = dns_record['type'] dns_record_value = dns_record['content'] print('DNS RECORD:', dns_record_id, dns_record_name, dns_record_type, dns_record_value) try: dns_record = cf.zones.dns_records.delete(zone_id, dns_record_id) print('DELETED') except CloudFlare.exceptions.CloudFlareAPIError as e: exit('/zones.dns_records.delete %s - %d %s - api call failed' % (dns_name, e, e)) found = True if not found: print('RECORD NOT FOUND') exit(0) if __name__ == '__main__': main() to run the deleter, and it appears this only deletes 10-15 records at a time, so you might need to run this 5 times before sending a fresh list. This is only deleting records from dnsseed.denarius.pro. Nothing else on denarius.pro. Magical. ./delete.py denarius.pro dnsseed Right now I am trying to think how frequent to send new ip's and delete the list and start over. Once I get that down I will post a sample cronjob to use. Otherwise this should work with basically any bitcoin fork daemon, maybe minor tweaks. I also need a better regex to parse ipv6 so we can also make some on the fly AAAA records. Use the github as that shows the crontab for adding and deleting the A records
  22. TTL might need to be changed NS 7200 A 1800
  23. I am using Scaleway VPS which only allows Ubuntu 18.04 Bionic for the cheaper plans. systemd-resolve appears to take over port 53. lsof -i -P -n | grep LISTEN and we see port 53 what I did to remove this was sudo nano /etc/systemd/resolved.conf then edit resolved.conf to this DNS=8.8.8.8 DNSStubListener=no restart systemd-resolved sudo systemctl restart systemd-resolved save old symlink sudo mv /etc/resolv.conf /etc/resolv.conf.OLD create new symlink sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf lets check if port 53 is there anymore lsof -i -P -n | grep LISTEN its gone, now go run your seeder and wait for DNS records to propagate through the internet backbone
  24. I am using he.net free dns for the setup of nameservers. https://dns.he.net Get a domain like denarius.guide for our example. The dns seeder nameserver will be dnsseed.denarius.guide Go to your domain and point it to the given he.net servers so he.net is handling your records. Lets add the first part. This creates dnsseed.denarius.guide. 86400 IN NS seeder.denarius.guide. Now lets point seeder.denarius.guide to our vps ip. This creates seeder.denarius.guide. 86400 IN A 163.172.157.116 Also can create an AAAA record because IPv6 is the future right? This creates seeder.denarius.guide. 86400 IN AAAA 2001:bc8:47a0:1933::1 On the vps side we need our dns seeder. Clone a seeder repo, get dependencies, and compile. This could vary depending on OS and VPS. git clone https://github.com/buzzkillb/d-seeder sudo apt-get install build-essential libboost-all-dev libssl-dev make -j2 Run the seeder for a while, and wait for the DNS to propagate. I also sudo apt install tor just because ./dnsseed -h dnsseed.denarius.guide -n seeder.denarius.guide -m buzz.denarius.io -o 127.0.0.1:9050 How to check if this is working. https://www.whatsmydns.net/#NS/dnsseed.denarius.guide
  25. If you get this error RAN: /usr/bin/gpg --keyserver pgp.mit.edu --recv-keys 0064428F455451B3EBE78A7F063938BA42CFA724 STDOUT: Change the server in the setup file. nano setup GPG_KEY_SERVER = 'ha.pool.sks-keyservers.net '
×
×
  • Create New...