Jump to content

buzzkillb

Moderators
  • Content Count

    342
  • Joined

  • Last visited

  • Days Won

    63
  • Feedback

    N/A

Everything posted by buzzkillb

  1. How to compile daemon in Ubuntu 19.10 https://github.com/carsenk/denarius/issues/256
  2. Lets say you want to create a simple website and share that on IPFS, we will add a subdomain at the end to make the website easier to find. First create an index.html file with your site. Now go to the QT wallet, click the Jupiter tab, select your file and click Upload to IPFS. Once the file uploads you get the IPFS hash. Click view on Infura or Cloudflare. Lets add one more twist to make this easier to find. I am going to use namecheap as an example of how to create a subdomain to the IPFS hash. Add a TXT record to your new IPFS hash. I am using ipfschain as my subdomain and dnslink=/ipfs/QmPm4AUBGsTjiKN3UtxTtarw4CKAcPNSVjNU18Tjrm6N7R as the IPFS hash. Save this, wait a few minutes and now try https://cloudflare-ipfs.com/ipns/ipfschain.pos.watch
  3. Lets make sure to run that python file over and over and over on every new block. Go into denarius.conf and add this line. I have my files in a influx directory. blocknotify=/home/USERNAME/influx/block.sh Lets create block.sh in the influx directory and throw our sample.py in there #!/bin/bash python /home/USERNAME/influx/sample.py make block.sh executable chmod +x block.sh stop and restart daemon to pick this change up denariusd stop denariusd If it all went right your grafana page should start updating the block count.
  4. Login to your localhost grafana. http://192.168.1.337:3000/ on the left click the gear -> data sources add data source search for influxdb use settings like this save and test Go back to the grafana homepage and click + and add query Your query would look something like this. Remember to select your mydb database, my screenshot is using another name for the DB. Visualization General Click Save at the top right Should see something like this on your homepage.
  5. Create a new database ininfluxdb. Run influx to get into the command prompt. influx create database CREATE DATABASE mydb use database USE mydb from a second command line, lets make a sample.py sample.py from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException import time import sys import datetime import urllib import json from influxdb import InfluxDBClient # rpc_user and rpc_password are set in the denarius.conf file rpc_connection = AuthServiceProxy("http://%s:%[email protected]:32369"%("rpc_user", "rpc_password")) #test blocktest = rpc_connection.getblockcount() print(blocktest) # Configure InfluxDB connection variables host = "127.0.0.1" # My Ubuntu NUC port = 8086 # default port user = "admin" # the user/password created for the pi, with write access password = "admin" dbname = "mydb" # the database we created earlier interval = 60 # Sample period in seconds # Create the InfluxDB client object client = InfluxDBClient(host, port, user, password, dbname) # think of measurement as a SQL table, it's not...but... measurement = "measurement" # location will be used as a grouping tag later blockchain = "denarius" blockcount = rpc_connection.getblockcount() block = rpc_connection.getblockbynumber(blockcount) grafanatime = block['time'] * 1000000000 hash = block['hash'] size = block['size'] height = block['height'] version = block['version'] merkleroot = block['merkleroot'] mint = int(block['mint']) timed = block['time'] nonce = block['nonce'] bits = block['bits'] difficulty = float(block['difficulty']) blocktrust = block['blocktrust'] chaintrust = block['chaintrust'] chainwork = block['chainwork'] previousblockhash = block['previousblockhash'] #nextblockhash = block['nextblockhash'] flags = block['flags'] proofhash = block['proofhash'] entropybit = block['entropybit'] modifier = block['modifier'] modifierchecksum = block['modifierchecksum'] data = [ { "measurement": measurement, "tags": { "blockchain": blockchain, }, "time": grafanatime, "fields": { #"block" : i, "hash" : hash, "size" : size, "height" : height, "version" : version, "merkleroot" : merkleroot, "mint" : mint, "time" : timed, "nonce" : nonce, "bits" : bits, "difficulty" : difficulty, "blocktrust" : blocktrust, "chaintrust" : chaintrust, "chainwork" : chainwork, # "nextblockhash" : nextblockhash, "flags" : flags, "proofhash" : proofhash, "entropybit" : entropybit, "modifier" : modifier, "modifierchecksum" : modifierchecksum } } ] # Send the JSON data to InfluxDB print(difficulty) client.write_points(data) If you run python sample.py you should see data appear in your influxdb. Run below a few times to throw data in. python sample.py In the other command line running influx already, make sure you are using the correct database and lets see if the data is inside. use mydb SELECT * FROM /.*/ LIMIT 10 You should see output, now we need to connect influxdb to grafana.
  6. How to pull stats from a coin daemon and throw them into influxdb, and then use Grafana to create a pretty graph. Setup a VM, VPS, raspberry pi, whatever to play on this. Anything breaks its pretty easy to delete stuff. Using ubuntu/debian for the example. The idea is relatively simple. Ask the daemon for information, throw that into influxdb and then have Grafana pull from that database. Install denarius daemon Install python denarius rpc https://github.com/buzzkillb/python-denariusrpc Install grafana https://grafana.com/docs/grafana/latest/installation/debian/ Install influxdb https://docs.influxdata.com/influxdb/v1.7/introduction/installation/ One this is all done we need a test to see if python is working with the daemon. Switch in rpc_user and rpc_password that's inside of denarius.conf test.py from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException # rpc_user and rpc_password are set in the denarius.conf file rpc_connection = AuthServiceProxy("http://%s:%[email protected]:32369"%(rpc_user, rpc_password)) best_block_hash = rpc_connection.getbestblockhash() print(rpc_connection.getblock(best_block_hash)) # batch support : print timestamps of blocks 0 to 99 in 2 RPC round-trips: commands = [ [ "getblockhash", height] for height in range(100) ] block_hashes = rpc_connection.batch_(commands) blocks = rpc_connection.batch_([ [ "getblock", h ] for h in block_hashes ]) block_times = [ block["time"] for block in blocks ] print(block_times) test run python test.py Lets double check another test run to get current Denarius price from Coinvex. testcoinvex.py from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException import requests, urllib, json #southexchange #coinvex coinvex_url = requests.get('https://coinvex.org/api/v1/public/getlastmarketdata') coinvex_data = json.loads(coinvex_url.text) coinvex_price = coinvex_data['result']['coins'] for r in coinvex_price: if r["name"] == "Denarius": coinvex_last = float(r["price"]) print format(coinvex_last, '0.8f') test run python testcoinvex.py Works? The next post will show how to take this data and put into influxdb.
  7. For some reason AMD64 and ARM chaindata's are not compatible. So I split them up here. https://chaindata.pos.watch/
  8. Restarting the wallet should help get past where its getting stuck. Otherwise latest chaindata is located here https://chaindata.pos.watch/
  9. I am keeping up to date chaindata here, as of now it should updated about every 3 days.. https://chaindata.pos.watch/ ARM really doesn't like to sync with the AMD64 (typical Intel/AMD PC/Windows/MacOS) version so I have an ARM wallet daemon setup as well for this. For a Raspberry Pi4 or other ARM board/VPS you probably want the ARM pichaindata.
  10. Download Denarius Wallet Install IPFS (locally or vps) https://docs.ipfs.io/guides/guides/install/ Ubuntu (AMD64) Find latest here - https://dist.ipfs.io/#go-ipfs wget https://dist.ipfs.io/go-ipfs/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz tar xvfz go-ipfs_v0.4.22_linux-amd64.tar.gz cd go-ipfs sudo ./install.sh ipfs version #start ipfs node and take note of your IPFS node ID ipfs init #example output ``` initializing IPFS node at /home/travanx/.ipfs generating 2048-bit RSA keypair...done peer identity: QmNyud5DGEmkBGYcV4QA69JHiTuWLU6EkStpviddZTgiag to get started, enter: ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme ``` #try reading the readme ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme #start IPFS service ipfs daemon denarius.conf jupiterlocal=1 if you want to specify your IPFS server and its not local add jupiterip=yournodeIP:5001 To upload a file #example command to upload using daemon or QT from debug console, other use the Jupiter tab in the QT jupiterupload /home/USERNAME/Downloads/denarius-256.png Carsen uploaded the below image using localhost, then turned off his localhost IPFS server and because Denarius is amazing the file still shows up.
  11. Blocklist located here -> https://github.com/buzzkillb/hosts I am using this on pihole and will be updating the links anytime I get dm spam, mainly from Discord. Raw File -> https://raw.githubusercontent.com/buzzkillb/hosts/master/hosts How to add to pihole.
  12. Mine randomx on Manjaro. I assume same thing to run on Arch btw #compile xmrrig on Manjaro sudo pacman -S base-devel cmake libuv libmicrohttpd openssl hwloc libutil-linux git clone https://github.com/xmrig/xmrig.git cd xmrig mkdir build && cd $_ cmake .. make
  13. Grab the latest QT wallet with IPFS built in and have 0.1 D or at least something small to pay the PoD fee. IPFS is free and can skip the PoD portion of this if you just want to upload files. Lets pick a good file to Proof of Data against and then upload into IPFS. Current Release: https://github.com/carsenk/denarius/releases/tag/v3.3.9.6 QT Wallet: https://github.com/carsenk/denarius/releases/download/v3.3.9.6/Denarius-v3.3.9.6-Win64.zip Download a file, I am going to use the denarius logo from denarius.io and lets proof of data this and upload to IPFS as a great example of how powerful this is. Here's a link but just right click the image on the homepage and save to your hard drive. https://i2.wp.com/denarius.io/wp-content/uploads/2017/11/denarius-256.png?w=256&ssl=1 Go to the Jupiter Tab Select your file, in this case select the image file we just downloaded. Click Upload to IPFS (The Wallet will freeze while the upload is taking place) After the upload you will get an IPFS Hash along with being able to click the link to see the file in your web browser. Success, and currently there are file limits on uploading through the wallet. I was not able to upload the QT.zip yet. Lets Proof of Data this file for good measure, so the original hash is located on the Denarius blockchain. Go to Proof of Data tab in QT Wallet Select our image, then put a simple narration in and then click Create Timestamp This now gives us a D address where the hash matches the image. Now if we download the image we uploaded to IPFS we can verify the file against the blockchain by checking against PoD again. Here is our set in the blockchain address based on the image file or can Click Check Transaction to get to your PoD transaction. https://www.coinexplorer.net/D/address/DQQxYgD1KPzmoQGeL1JyXZk2JhZPfiaXsY
  14. for ipfs branch sudo apt install libcurl4-openssl-dev
  15. Added screenshot to first post in how the list showed unregistered as one daemon being tracked lost sync. Useful already.
  16. 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>
  17. 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.
  18. 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
  19. need to start these services sudo systemctl start pcscd.service sudo systemctl start pcscd.socket
  20. 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' ||
  21. how to change diff on a stratum /var/stratum/config/scrypt.conf [STRATUM] algo = scrypt difficulty = 150000 max_ttf = 40000
×
×
  • Create New...