Jump to content

Welcome to DenariusTalk!

Welcome to DenariusTalk, the official community forums of Denarius [D]
Please register if you'd like to take part in our community!

Forums

  1. News & Announcements

    1. Announcements

      Announcements and News Updates regarding Denarius and related services.

      129
      posts
  2. Denarius Discussions

    1. General Discussion

      General discussions related to Denarius go here.

      179
      posts
    2. Tutorials & Help

      Made an awesome guide for Denarius or need some help getting started? Ask here!

      476
      posts
    3. Marketing & PR

      Marketing and PR campaigns for Denarius.

      941
      posts
    4. Development

      Discuss all Denarius related development here. C++, QT, NodeJS, etc.

      239
      posts
    5. Mining & Staking

      Discuss Tribus PoW Mining or Staking in Denarius here.

      322
      posts
    6. Trading & Exchanges

      Discuss Denarius D <-> BTC etc. trading and exchanges here.

      84
      posts
    7. Marketplace

      Buy, Sell, & Trade your physical or digital items here with D

      35
      posts
    8. FPGA Forums   (199 visits to this link)

  3. Other Discussions

    1. The Lounge

      Discuss anything and everything within the rules of the forums here.

      114
      posts
    2. Cryptocurrencies

      Discuss all other cryptocurrencies here. No coin announcements.

      18
      posts
  • Current Denarius Version

    Stable Release:

    v3.3.9.3

  • Recent Posts

    • 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/
    • 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. 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. #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.
    • TTL might need to be changed NS 7200 A 1800
    • 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  
    • 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
  • Recent Status Updates

  • Twitter Feed @denariuscoin

×
×
  • Create New...