Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QR code to start WebMiner on Android devices #1690

Open
PSLLSP opened this issue Nov 10, 2023 · 0 comments
Open

QR code to start WebMiner on Android devices #1690

PSLLSP opened this issue Nov 10, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@PSLLSP
Copy link

PSLLSP commented Nov 10, 2023

Getting Started page for WebMiner page could show QR code with URL to start WebMiner with scanning QR code...


URL to launch WebMiner can contain RIG id, I think it is not documented. RIGID can be included in QR code too. Parameters are optional and URL with all parameters is
https://server.duinocoin.com/webminer.html?username=FIXME&keyinput=FIXME&rigid=FIXME&threads=FIXME

It is interesting that WebMiner mines even when USERNAME is invalid, like FIXME...

Other interesting observation is that when WebMiner is started without RIGID, it cannot be added later, Wallet reports "null". I think there should be button "Restart mining" to update WebMiner with values in the form...

One more observation. When RIGID is like "WMINER@TEST", it is displayed in wallet and explorer as "WMINER TEST", like "@" was removed. I assumed that it is because character "@" has to be encoded in URL but I think it is not the case, the field RIGNAME in WebMiner has value "WMINER@TEST"... So, I am not sure why and where "@" was removed from the RIGID...

I think you should include QR generator to your Gettings started page. There are many online QR code generators but it is not good idea to use those to generate QR code with sensitive information, like username or mining key...


Simple script for Linux to generate QR code for WebMining in offline mode:

$ cat DUCO-webminer-QR-gen.sh 
#!/bin/sh

# install qrencode: 'sudo apt-get install -y qrencode'

[ -z "$DUINONAME" ] && DUINONAME="" # define your USERNAME for DuinoCoin; when not defined, other paremeters are ignored
[ -z "$DUINOKEY" ] && DUINOKEY="" # define your Mining Key for DuinoCoin, optional
[ -z "$DUINORIG" ] && DUINORIG="$(hostname)" # define your RIGNAME for DuinoCoin, you can change default hostname
[ -z "$DUINOTHREADS" ] && DUINOTHREADS="1"  # Default is 1 thread, you can change it...

[ -z "$QRFILENAME" ] && QRFILENAME="DUCO-WebMiner-QR.png"

URL="https://server.duinocoin.com/webminer.html"
if [ -n "$DUINONAME" ]; then
   # when DUINONAME is empty, other parameters are ignored by WebMiner...
   URL="${URL}?username=${DUINONAME}"
   [ -n "$DUINOKEY" ] && URL="${URL}&keyinput=${DUINOKEY}"
   [ -n "$DUINORIG" ] && URL="${URL}&rigid=${DUINORIG}"
   [ -n "$DUINOTHREADS" ] && URL="${URL}&threads=${DUINOTHREADS}"
fi

echo "URL: $URL"

QRLEVEL="M"  # QR correction level, value could be L, M, Q or H
QRSIZE=6

if ! type qrencode >/dev/null; then
   echo "ERROR: Install qrencode with command 'sudo apt-get install -y qrencode'"
   exit 1
fi

qrencode -o "$QRFILENAME" -l "$QRLEVEL" -s "$QRSIZE" "$URL"
echo "QR code was generated to file $QRFILENAME"

User can modify script and enter his credentials or these could be passed in shell variables, like this:

$ DUINONAME="FIXME" DUINORIG="WebMiner" sh DUCO-webminer-QR-gen.sh 
URL: https://server.duinocoin.com/webminer.html?username=FIXME&rigid=WebMiner&threads=1
QR code was generated to file DUCO-WebMiner-QR.png

I have found that when "DUINONAME" is not defined, other parameters are ignored by WebMiner (and has to be enetered manually), so script was designed in such way...

$ DUINORIG="WebMiner" sh DUCO-webminer-QR-gen.sh 
URL: https://server.duinocoin.com/webminer.html
QR code was generated to file DUCO-WebMiner-QR.png
@revoxhere revoxhere added the enhancement New feature or request label Nov 29, 2023
@revoxhere revoxhere self-assigned this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants