Author

Topic: ◈◈Bitcredit ◈◈ Migrating to UniQredit◈◈ - page 124. (Read 284545 times)

sr. member
Activity: 260
Merit: 250
member
Activity: 115
Merit: 10
Still wondering how to get multiple BN's working in Windows

Once you create more than 1 inside the QT then close and re-open it only the last one created displays not however many you create


Run the daemons (bitcreditd) separately under different users, or with different datadirs and confdirs set for each instance, and appropriate bitcredit.conf files for each user/instance, ie. your port/rpcport and banknodeprivkeys need to be different in each bitcredit.conf file.

Until I or someone else gets around to writing a BCR-specific guide, use one of the many DASH Masternode guides, same thing, just replace dashd with bitcreditd, and you need bitcredit-cli to issue commands to the daemon, eg. 'bitcredit-cli banknode start,' not 'bitcreditd banknode start.' BCR is a version of Bitcoin Core ahead of them currently.



I got it to work with the QT just one node

The deamon didn't seem to do anything

I'll fire up the others shortly so AU is back online

Edit: Multiple user accounts doesn't work - only 2 can run else windows detects and doesn't allow the 3rd or more

For what its worth I got 6-7 of them working on one windows box (I used the QT...which i realize was sub-optimal but did work).  I just made different directories and different configs changing ports for rpc and outward.  Then I just made a script to bring them all online assuming a reboot is needed so I dont manually need to start them.  Downside is I have 7 copies of the blockchain, which is fine for now but will be an issue if a few years.  In a few years I am not worried though because everything will have evolved by then.
legendary
Activity: 966
Merit: 1000
To got it working I had to install Qpython or Qpython3 and change '/storage/sdcard0/mybanknodes.txt' to '/storage/emulated/0/mybanknodes.txt'

I'm on Sammy Note4 Android 5.0.1 and what i read sdcard/emulated/0/ must be used in any android 4.2 => versions.

I'm still using my old Galaxy S2. Smiley

New version checks for stuff in current working directory, it should tell you where to put your mybanknodes.txt if it doesn't find it:

Code:
#!/usr/bin/python

import sys, os, urllib, time, datetime, urllib2, re

def felch():

#set up paths
cwd = os.getcwd()
logpath = os.path.join(cwd, "mybanknodes.log")
mybanknodespath = os.path.join(cwd, "mybanknodes.txt")

#check if mybanknodes.txt exists, if not abort
if not os.path.isfile("mybanknodes.txt"):
print 'No mybanknodes.txt file found!'
print 'Please create one here: ' + mybanknodespath
print 'Place one BCR address on each line.'
sys.exit()

#check if mybanknodes.log exists, if not create it and stick a timestamp in it
if not os.path.isfile("mybanknodes.log"):
nowtime = datetime.datetime.now()
with open(logpath, "w") as myfile:
    myfile.write(str(nowtime) + "\n")

#build list of previous balances
prevbalancelist = []
floatlistold = []
with open(logpath, mode="r") as f:
#skip 1st line, instead store it as timestamp so we can compute the temporal delta - sounds fancy, eh?
timestampold = f.readline().rstrip('\n')
try:
thentime = datetime.datetime.strptime(timestampold, "%Y-%m-%d %H:%M:%S.%f")
#print 'Timestamp in mybanknodes.log: ' + str(thentime)
except:
print "Couldn't parse timestamp in mybanknodes.log!"
#carry on
a = [line.strip() for line in f]
for line in a:
#strip off 1st 17 chars, should leave us with just the numbers
prevbalancelist.append(line[17:])

#convert prevbalancelist to floats
floatlistold = [float(i) for i in prevbalancelist]

#get time for mybanknodes.log timestamp
nowtime = datetime.datetime.now()
print nowtime

#write timestamp to mybanknodes.log in writemode, incidentally erases previous file contents, making life simpler and preventing logfileaphantitis
with open(logpath, "w") as myfile:
    myfile.write(str(nowtime) + "\n")
   
#open mybanknknodes file
print 'Felching Banknode balances...'
print 'Querying ' + mybanknodespath

#loop through lines in file and query chainz for each address
with open(mybanknodespath, mode="r") as f:
a = [line.strip() for line in f]
itemindex = 0
delta = "0"
floatdelta = 0
deltatotal = 0
total = 0
print 'Address:\tBalance:\tChange:'
for line in a:
address = line[0:34]
######################################################### need to fool cloudflare!
      site = ("http://chainz.cryptoid.info/bcr/api.dws?q=getbalance&a=" + address)
      hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
       'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
       'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
       'Accept-Encoding': 'none',
       'Accept-Language': 'en-US,en;q=0.8',
       'Connection': 'keep-alive'}
      ######################################################### cloudflare hoodwinked!
req = urllib2.Request(site, headers=hdr)
      try:
page = urllib2.urlopen(req)
      except urllib2.HTTPError, e:
print e.fp.read()
data = page.read()

#compare data (balance we just felched) with previous balance stored in floatlistold
floatdata = float(data)
try:
    old = floatlistold[itemindex]
    floatdelta = floatdata - old
    delta = str(floatdelta)
    #print ("prevbal: " + str(old) + " - currentbal: " + str(floatdata) + " - delta: " + delta)
except IndexError:
print "Note: empty logfile as 1st run, can't compare past results."

#truncate address string to save space and print result of our little exercise
print(address[:3] + ' ... ' + address[-3:] + '\t' + data + "\t(+ " + delta + ")")

#append result for each line to mybanknodes.log
with open(logpath, "a") as myfile:
    myfile.write(address[:3] + ' ... ' + address[-3:] + '\t Bal: ' + data + "\n")

#update running total
b = float(re.sub("[^0-9.]", " ", (data)))
total = total + b

#sync list item with file line
itemindex = itemindex + 1
deltatotal = deltatotal + floatdelta

#compute temporal delta!
try:
thentime = datetime.datetime.strptime(timestampold, "%Y-%m-%d %H:%M:%S.%f")
except:
print "Couldn't parse timestamp in mybanknodes.log!"

try:
delta = nowtime - thentime
#print 'Your Banknodes have earned ' + str(deltatotal) + ' BCR in ' + str(delta)
print 'Your have earned ' + str(deltatotal) + ' BCR since'
print 'last check @ ' + timestampold
print '(' + str(delta) + ' ago.)'
except:
print "Couldn't compute temporal delta!"

#print total
print "Total: " + str(total) + " BCR"

#exit
sys.exit()

#shindig!
felch()
legendary
Activity: 966
Merit: 1000
Upgraded BCR address checker script a little:



Now stores the results of your last check and gives you any delta. Will post script later when I'm finished sunbathing. Smiley

Still uses the chainz API though, which lags the blockchain by hours, I could grab realtime balances with a bit of html parsing but doing that's a lot slower. Will continue noodling when I can. Not sure the microsecond precision is needed...

sr. member
Activity: 260
Merit: 250

Any ideas for simple BNs monitoring ?

nagios.. shell script.. a bit of python... and I would say, that's it. =)

Code:
#!/usr/bin/python

import sys, os, urllib, time, urllib2, re

def felch():
print 'Felching Banknode balances...'

now = time.strftime("%c")
print now

total = 0

m = 'mybanknodes.txt'
with open(m, mode="r") as f:
a = [line.strip() for line in f]
for line in a:
address = line[0:34]
######################################################### need to fool cloudflare!
      site = ("http://chainz.cryptoid.info/bcr/api.dws?q=getbalance&a=" + address)
      hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
      'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
      'Accept-Encoding': 'none',
      'Accept-Language': 'en-US,en;q=0.8',
      'Connection': 'keep-alive'}
      ######################################################### cloudflare hoodwinked!
req = urllib2.Request(site, headers=hdr)
      try:
page = urllib2.urlopen(req)
      except urllib2.HTTPError, e:
print e.fp.read()
data = page.read()

print(address + '\t Balance: ' + data)

b = float(re.sub("[^0-9.]", " ", (data)))
total = total + b

print "Total: " + str(total) + " BCR"

sys.exit()

felch()

Save as mybanknodes.py in same directory as your mybanknodes.txt and run with 'python mybanknodes.py'

Anyone with rudimentary java experience should be able to knock up an android version in minutes.

edit: actually this works fine on android if you have python installed, but you have to specify the full path to mybanknodes.txt, eg. change m = 'mybanknodes.txt' to m = '/storage/sdcard0/mybanknodes.txt' if you've stuck it in the root dir of your onboard memory.




Dog almighty I'd forgotten how easy everything is in python.  Cheesy

I might jazz it up a bit to give you the delta since you last checked.


I was thinking rather about any already available app that can be used to track any other coins wallet too, but this script is great and working good enough for me , thanks a lot  Smiley

To got it working I had to install Qpython or Qpython3 and change '/storage/sdcard0/mybanknodes.txt' to '/storage/emulated/0/mybanknodes.txt'

I'm on Sammy Note4 Android 5.0.1 and what i read sdcard/emulated/0/ must be used in any android 4.2 => versions.

legendary
Activity: 966
Merit: 1000
I got it to work with the QT just one node

The deamon didn't seem to do anything

I'll fire up the others shortly so AU is back online

Edit: Multiple user accounts doesn't work - only 2 can run else windows detects and doesn't allow the 3rd or more

Really, the simplest solution to to rent a *buntu 14.04 / 14.10 VPS for a few dollars a month. You can easily fit 5 BNs on a 1GB server, 10 on a 2GB RAM server... etc. Cutting and pasting a few commands into a terminal window is surely easier than buggering about with Windows...
hero member
Activity: 1344
Merit: 502
Still wondering how to get multiple BN's working in Windows

Once you create more than 1 inside the QT then close and re-open it only the last one created displays not however many you create


Run the daemons (bitcreditd) separately under different users, or with different datadirs and confdirs set for each instance, and appropriate bitcredit.conf files for each user/instance, ie. your port/rpcport and banknodeprivkeys need to be different in each bitcredit.conf file.

Until I or someone else gets around to writing a BCR-specific guide, use one of the many DASH Masternode guides, same thing, just replace dashd with bitcreditd, and you need bitcredit-cli to issue commands to the daemon, eg. 'bitcredit-cli banknode start,' not 'bitcreditd banknode start.' BCR is a version of Bitcoin Core ahead of them currently.



I got it to work with the QT just one node

The deamon didn't seem to do anything

I'll fire up the others shortly so AU is back online

Edit: Multiple user accounts doesn't work - only 2 can run else windows detects and doesn't allow the 3rd or more
sr. member
Activity: 313
Merit: 250
HGPUPC addicted!

Any ideas for simple BNs monitoring ?

nagios.. shell script.. a bit of python... and I would say, that's it. =)

Code:
#!/usr/bin/python

import sys, os, urllib, time, urllib2, re

def felch():
print 'Felching Banknode balances...'

now = time.strftime("%c")
print now

total = 0

m = 'mybanknodes.txt'
with open(m, mode="r") as f:
a = [line.strip() for line in f]
for line in a:
address = line[0:34]
######################################################### need to fool cloudflare!
      site = ("http://chainz.cryptoid.info/bcr/api.dws?q=getbalance&a=" + address)
      hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
      'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
      'Accept-Encoding': 'none',
      'Accept-Language': 'en-US,en;q=0.8',
      'Connection': 'keep-alive'}
      ######################################################### cloudflare hoodwinked!
req = urllib2.Request(site, headers=hdr)
      try:
page = urllib2.urlopen(req)
      except urllib2.HTTPError, e:
print e.fp.read()
data = page.read()

print(address + '\t Balance: ' + data)

b = float(re.sub("[^0-9.]", " ", (data)))
total = total + b

print "Total: " + str(total) + " BCR"

sys.exit()

felch()

Save as mybanknodes.py in same directory as your mybanknodes.txt and run with 'python mybanknodes.py'

Anyone with rudimentary java experience should be able to knock up an android version in minutes.

edit: actually this works fine on android if you have python installed, but you have to specify the full path to mybanknodes.txt, eg. change m = 'mybanknodes.txt' to m = '/storage/sdcard0/mybanknodes.txt' if you've stuck it in the root dir of your onboard memory.




Dog almighty I'd forgotten how easy everything is in python.  Cheesy


sh...tt.. just make it happen! Great job!... I would make windows better just with python.... but... i don't wana be as much as successfully as them in multi-platform... so.. I am giving up it all on you! =) LOL RA!
legendary
Activity: 966
Merit: 1000

Any ideas for simple BNs monitoring ?

nagios.. shell script.. a bit of python... and I would say, that's it. =)

Code:
#!/usr/bin/python

import sys, os, urllib, time, urllib2, re

def felch():
print 'Felching Banknode balances...'

now = time.strftime("%c")
print now

total = 0

m = 'mybanknodes.txt'
with open(m, mode="r") as f:
a = [line.strip() for line in f]
for line in a:
address = line[0:34]
######################################################### need to fool cloudflare!
      site = ("http://chainz.cryptoid.info/bcr/api.dws?q=getbalance&a=" + address)
      hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
      'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
      'Accept-Encoding': 'none',
      'Accept-Language': 'en-US,en;q=0.8',
      'Connection': 'keep-alive'}
      ######################################################### cloudflare hoodwinked!
req = urllib2.Request(site, headers=hdr)
      try:
page = urllib2.urlopen(req)
      except urllib2.HTTPError, e:
print e.fp.read()
data = page.read()

print(address + '\t Balance: ' + data)

b = float(re.sub("[^0-9.]", " ", (data)))
total = total + b

print "Total: " + str(total) + " BCR"

sys.exit()

felch()

Save as mybanknodes.py in same directory as your mybanknodes.txt and run with 'python mybanknodes.py'

Anyone with rudimentary java experience should be able to knock up an android version in minutes.

edit: actually this works fine on android if you have python installed, but you have to specify the full path to mybanknodes.txt, eg. change m = 'mybanknodes.txt' to m = '/storage/sdcard0/mybanknodes.txt' if you've stuck it in the root dir of your onboard memory.




Dog almighty I'd forgotten how easy everything is in python.  Cheesy

I might jazz it up a bit to give you the delta since you last checked.
sr. member
Activity: 260
Merit: 250
@thelonecrouton

1. I have tried to apply your stylesheets without success (qss in the same location as wallet.dat), every time I try to select a theme, browsing files force closes all wallet. All the same with clean new wallet.

2. So far mybanknodes.txt didn't worked for me too (same location as wallet.dat)

addresses are in a few rows like this :

xGCvyHbhjbJNkjnKNMkmKMKmkMKmk
hbhBUHJjikjiuhYGytgYGujikMIKmiMIiJM



Anyone know some good and tested android app that can track few BCR wallet addresses, monitoring banknodes is now another pain in the ass, tracking this in desktop browser tabs is also not easy, it has to be an easier way.


mybanknodes.txt didn't work here to.


Are you using Windows? If you're using the last Windows build then I'm not sure the mybanknodes thing was included yet.

If you're on linux and compiling from the master branch then it should work, has done for me on all the boxes I've tried it on.

When it's in the Windows build, make sure Windows isn't adding some additional file extension to it.
 

I'm using Windows version, seems to be the latest alpha - alpha something, extensions are OK, so maybe next time...
Any ideas for simple BNs monitoring ?

nagios.. shell scripgt.. a bit of python... and I would say, that's it. =)

OK, then I'm waiting to see your results Wink
sr. member
Activity: 313
Merit: 250
HGPUPC addicted!
@thelonecrouton

1. I have tried to apply your stylesheets without success (qss in the same location as wallet.dat), every time I try to select a theme, browsing files force closes all wallet. All the same with clean new wallet.

2. So far mybanknodes.txt didn't worked for me too (same location as wallet.dat)

addresses are in a few rows like this :

xGCvyHbhjbJNkjnKNMkmKMKmkMKmk
hbhBUHJjikjiuhYGytgYGujikMIKmiMIiJM



Anyone know some good and tested android app that can track few BCR wallet addresses, monitoring banknodes is now another pain in the ass, tracking this in desktop browser tabs is also not easy, it has to be an easier way.


mybanknodes.txt didn't work here to.


Are you using Windows? If you're using the last Windows build then I'm not sure the mybanknodes thing was included yet.

If you're on linux and compiling from the master branch then it should work, has done for me on all the boxes I've tried it on.

When it's in the Windows build, make sure Windows isn't adding some additional file extension to it.
 

I'm using Windows version, seems to be the latest alpha - alpha something, extensions are OK, so maybe next time...
Any ideas for simple BNs monitoring ?

nagios.. shell script.. a bit of python... and I would say, that's it. =)
sr. member
Activity: 260
Merit: 250
@thelonecrouton

1. I have tried to apply your stylesheets without success (qss in the same location as wallet.dat), every time I try to select a theme, browsing files force closes all wallet. All the same with clean new wallet.

2. So far mybanknodes.txt didn't worked for me too (same location as wallet.dat)

addresses are in a few rows like this :

xGCvyHbhjbJNkjnKNMkmKMKmkMKmk
hbhBUHJjikjiuhYGytgYGujikMIKmiMIiJM



Anyone know some good and tested android app that can track few BCR wallet addresses, monitoring banknodes is now another pain in the ass, tracking this in desktop browser tabs is also not easy, it has to be an easier way.


mybanknodes.txt didn't work here to.


Are you using Windows? If you're using the last Windows build then I'm not sure the mybanknodes thing was included yet.

If you're on linux and compiling from the master branch then it should work, has done for me on all the boxes I've tried it on.

When it's in the Windows build, make sure Windows isn't adding some additional file extension to it.
 

I'm using Windows version, seems to be the latest alpha - alpha something, extensions are OK, so maybe next time...
Any ideas for simple BNs monitoring ?
sr. member
Activity: 313
Merit: 250
HGPUPC addicted!
Still wondering how to get multiple BN's working in Windows

Once you create more than 1 inside the QT then close and re-open it only the last one created displays not however many you create


Don't use the QT for Bank nodes.. use the daemon version. Much less memory hungry.. much faster. 50 MB each.. maybe less... (43 MB for me)
legendary
Activity: 966
Merit: 1000
@bitcreditscc - should we just get rid of the 2nd tab in the banknodes page? It's useless for anything other than a single BN and just confuses people. Or I could at least make it clearer in there that this is for one BN only and trying to set up multiple BNs this way isn't going to work.

Eventually I'd like to either replace it with something better or improve it but I haven't had the time yet and me doing anything low-level might be dangerous.  Cheesy
legendary
Activity: 966
Merit: 1000
Still wondering how to get multiple BN's working in Windows

Once you create more than 1 inside the QT then close and re-open it only the last one created displays not however many you create


Run the daemons (bitcreditd) separately under different users, or with different datadirs and confdirs set for each instance, and appropriate bitcredit.conf files for each user/instance, ie. your port/rpcport and banknodeprivkeys need to be different in each bitcredit.conf file.

Until I or someone else gets around to writing a BCR-specific guide, use one of the many DASH Masternode guides, same thing, just replace dashd with bitcreditd, and you need bitcredit-cli to issue commands to the daemon, eg. 'bitcredit-cli banknode start,' not 'bitcreditd banknode start.' BCR is a version of Bitcoin Core ahead of them currently.

legendary
Activity: 966
Merit: 1000
@thelonecrouton

1. I have tried to apply your stylesheets without success (qss in the same location as wallet.dat), every time I try to select a theme, browsing files force closes all wallet. All the same with clean new wallet.

2. So far mybanknodes.txt didn't worked for me too (same location as wallet.dat)

addresses are in a few rows like this :

xGCvyHbhjbJNkjnKNMkmKMKmkMKmk
hbhBUHJjikjiuhYGytgYGujikMIKmiMIiJM



Anyone know some good and tested android app that can track few BCR wallet addresses, monitoring banknodes is now another pain in the ass, tracking this in desktop browser tabs is also not easy, it has to be an easier way.


mybanknodes.txt didn't work here to.


Are you using Windows? If you're using the last Windows build then I'm not sure the mybanknodes thing was included yet.

If you're on linux and compiling from the master branch then it should work, has done for me on all the boxes I've tried it on.

When it's in the Windows build, make sure Windows isn't adding some additional file extension to it.
full member
Activity: 431
Merit: 105
Yes me too wondering how to create them multiple ones.. in one qt and then turn the thingy off or on.

Themes, not defaulted yet on wich one to set as default? please give that one.
And or all those frequent crash if wanting to start try till it starts act up all over the pc's can it stop please.

Price still not around at where it really should be.. when next chain or possibility of new things in new Qt.
Including coloured coins, or some other crave? Or new roadmap adjusted frontpage with last wallet version dl link, current version number.

How many times a block or a day should the bn/ get a payment on being bn,, see less each time.
or already at a few only a day. could get mining more. one gpu. then again the pool still does not show up on my hash.
bcr's pool or the other ones. get 1 then few hrs later maybe another one or not. or 5 total a day. ?

mybanknodes.txt didn't work here to.
hero member
Activity: 1344
Merit: 502
Still wondering how to get multiple BN's working in Windows

Once you create more than 1 inside the QT then close and re-open it only the last one created displays not however many you create
sr. member
Activity: 260
Merit: 250
@thelonecrouton

1. I have tried to apply your stylesheets without success (qss in the same location as wallet.dat), every time I try to select a theme, browsing files force closes all wallet. All the same with clean new wallet.

2. So far mybanknodes.txt didn't worked for me too (same location as wallet.dat)

addresses are in a few rows like this :

xGCvyHbhjbJNkjnKNMkmKMKmkMKmk
hbhBUHJjikjiuhYGytgYGujikMIKmiMIiJM



Anyone know some good and tested android app that can track few BCR wallet addresses, monitoring banknodes is now another pain in the ass, tracking this in desktop browser tabs is also not easy, it has to be an easier way.
newbie
Activity: 39
Merit: 0
Hey Dev,
  sent you a message on google...
Jump to: