Post
Topic
Board Announcements (Altcoins)
Re: Nxt :: descendant of Bitcoin - Updated Information
by
nadrimajstor
on 01/01/2014, 04:26:26 UTC
Undecided Only 200 aliases... I feel I should have at least twice that. Some are registering hourly,,, some others are not adding though. Could it take more than 24 hours to update?

See someone locked in Sakura in all 30 plus ways it can be written  Grin Still got an alt of it in 1337

I hope you make a lot of money from it.
heh, probably not Smiley
Some aliases I'm very surprised I got. Other fairly obscure ones I'm surprised were already taken.

Waiting for the servers to come online as I have another 700 to input. I can see doing 10k atleast...

Kinda wish you could batch upload a list of Aliases.... instead of this tedious 1 by 1 shit
Happy New Year
Code:
#!/usr/bin/env bash

#title :nxt_alias_batch_register.sh
#description :This script creates nxt aliases from a list in the given file
#author :nadrimajstor
#date :2014-01-01
#version :0.1
#licence :This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .

function are_arguments_correct(){
  if [[ "$#" -ne 4 || "$1" == "-h" || "$1" == "--help" ]]; then
    echo ""
    echo "Usage:"
    echo "  $0 ACCOUNT PASSPHRASE FILE URI"
    echo ""
    echo "Example:"
    echo "  $0 23948723498 mY1337PassPhrase alias.txt 'http://www.example.com'"
    exit 0
  fi
}

function is_curl_installed(){
  if ! hash curl &>/dev/null; then
    echo -e "\e[1;37mcurl\e[0m - \e[0;31mnot installed\e[0m"
    echo "try: sudo apt-get install curl"
    exit 1
  fi
}

function is_server_running(){
  if ! curl --silent -k "$URL/nxt?requestType=getState" &>/dev/null; then
    echo -e "\e[1;37m$URL\e[0m - \e[0;31mserver not found\e[0m"
    exit 1
  fi
}

function is_account_balance_positive(){
  local __balance=$(curl --silent -k "$URL/nxt?requestType=getBalance&account=$ACCOUNT" |\
                    grep 'balance' | tr --delete '{"}' | tr ':,' ' ' | cut -d ' ' -f2
                   )
  if ! [[ "$__balance" -gt 0 ]]; then
    echo -e "\e[1;37m$ACCOUNT\e[0m - \e[0;31mnot enough funds\e[0m"
    exit 1
  fi
}

function does_file_exist(){
  if ! [ -r "$FILE" ]; then
    echo -e "\e[1;37m$FILE\e[0m - \e[0;31mcan not read file\e[0m"
    exit 1
  fi
}

function create_alias(){
  local ALIAS=$1
  local __result=$(curl --silent -k "$URL/nxt?requestType=assignAlias&secretPhrase=$SECRET&alias=$ALIAS&uri=$URI&fee=$FEE&deadline=$DEADLINE")
  echo -e "\e[1;37m$ALIAS\e[0m - $__result"
}

are_arguments_correct $*
is_curl_installed

URL="https://localhost:7875"
is_server_running

ACCOUNT=$1
is_account_balance_positive

FILE=$3
does_file_exist

SECRET=$2
URI=$4
FEE=1
DEADLINE=1440

for line in $(cat "$FILE"); do
  create_alias $line
done
nxt_alias_batch_register.sh