Author

Topic: NXT :: descendant of Bitcoin - Updated Information - page 1605. (Read 2761647 times)

full member
Activity: 238
Merit: 100
I forgot if it was ferment or nexern but one of them had a partial API in CLI form.  I did one that has every API so far except asset issue ones.

Warning, it uses insecure http since curl has issues with self-signed certs.  So be careful when using on anything other than l for localhost
Requires python and it's json.tool
Usage:  ncli APIcmd server option1 option2...

where server is IP/DNS or use l to query localhost
and options are APIcmd specific
API commands:
 sendMoney
 getTransactionBytes
 getTransaction
 broadcastTransaction
 decodeToken
 getPeers
 getPeer
 getAccountId
 getAccountBlockIds
 getAccountPublicKey
 getAccountTransactionIds
 getBalance
 getGuaranteedBalance
 assignAlias
 getAliasId
 getAliasIds
 getAliasURI
 listAccountAliases
 sendMessage
 getBlock
 getConstants
 getMyInfo
 getState
 getTime
 decodeHallmark
 markHost
use 'ncli APIcmd help' for more help on a particular API command

Code:
#!/bin/bash


# to update for additional API calls, enter the new command in the array API, but be sure to
# keep the case switch sections in the same order as in the API array
#

API=(sendMoney getTransactionBytes getTransaction broadcastTransaction decodeToken getPeers getPeer getAccountId getAccountBlockIds getAccountPublicKey getAccountTransactionIds getBalance getGuaranteedBalance assignAlias getAliasId getAliasIds getAliasURI listAccountAliases sendMessage getBlock getConstants getMyInfo getState getTime decodeHallmark markHost)

if [ "$2" = "l" ]; then
        HOST="127.0.0.1"
else
        HOST=$2
fi

case "$1" in

sendMoney)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&secretPhrase\=$3\&recipient\=$4\&amount\=$5\&fee=$6\&deadline\=$7 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server passphrase recipient amount fee deadline"
fi
        ;;

getTransactionBytes)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&transaction\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server transactionID"
fi
        ;;

getTransaction)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&transaction\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server transactionId"
fi
        ;;

broadcastTransaction)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&transactionBytes\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server bytecode"
        fi
;;

decodeToken)
if [ "$HOST" != "help" ]; then
       curl -s http://$HOST:7874/nxt\?requestType\=$1\&website\=$3\&token\=$4 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server site.domain.tld 160characterToken"
fi
        ;;

getPeers)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server"
fi
        ;;

getPeer)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&peer\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server peerIPorDNS"
fi
        ;;

getAccountId)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&secretPhrase\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server passphrase"
fi
        ;;

getAccountBlockIds)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&account\=$3\×tamp\=$4 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server account timestamp"
fi
        ;;

getAccountPublicKey)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&account\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server account"
fi
        ;;

getAccountTransactionIds)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&account\=$3\×tamp\=$4 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server account timestamp"
fi
        ;;

getBalance)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&account\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server account"
fi
        ;;

getGuaranteedBalance)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&account\=$3\&numberOfConfirmations\=$4 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server account numberOfConfirmationsRequired"
fi
        ;;

assignAlias)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&secretPhrase\=$3\&alias\=$4\&uri\=$5\&fee\=$6\&deadline\=$7 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server passphrase alias uri fee deadline"
fi
        ;;

getAliasId)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&alias\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server alias"
fi
        ;;

getAliasIds)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\×tamp\=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server timestamp"
fi
        ;;

getAliasURI)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&alias=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server alias"
fi
        ;;

listAccountAliases)
if [ "$HOST" != "help" ]; then
 curl -s http://$HOST:7874/nxt\?requestType\=$1\&account=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server account"
fi
        ;;

sendMessage)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&secretPhrase\=$3\&recipient\=$4\&fee=$5\&message\=$6\&deadline\=$7 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server passphrase recipient fee HEX deadline"
        echo "note the message is sent encrypted.  Encrypt yourself if required"
fi
        ;;

getBlock)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&block=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server blockID"
fi
        ;;

getConstants)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server"
fi
        ;;

getMyInfo)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server"
fi
        ;;

getState)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
       else
        echo "ncli $1 server"
fi
        ;;

getTime)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server"
fi
        ;;

decodeHallmark)
if [ "$HOST" != "help" ]; then
        curl -s http://$HOST:7874/nxt\?requestType\=$1\&hallmark=$3 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
else
        echo "ncli $1 server hallmarkString"
fi
        ;;

markHost)
if [ "$HOST" != "help" ]; then
 curl -s http://$HOST:7874/nxt\?requestType\=$1\&secretPhrase=$3\&host\=$4\&weight\=$5\&date\=$6 | python -m json.tool | sed -e 's/\([]"{}[,]\)//g'
       else
        echo "ncli $1 server passphrase IPaddressOrDNSname weight date"
        echo "where date format is YYYY-MM-DD"
fi
        ;;

*)      echo ""
        echo "Usage:  ncli APIcmd server option1 option2..."
        echo ""
        echo "where server is IP/DNS or use l to query localhost"
        echo "and options are APIcmd specific"
        echo "API commands:"

        for item in ${API[*]}
        do
                printf " %s\n" $item
        done
        echo "use 'ncli APIcmd help' for more help on a particular API command"
;;

esac
full member
Activity: 126
Merit: 100
Why vote makes no unfair social media.
You call a couple of people that the community is all about?

That decide for everyone

Why not conduct a fair vote social media?


Unfortunately creating a Facebook page and paying for fake 'Likes' doesn't really help the community at all.
full member
Activity: 210
Merit: 100
a fair vote social media?


That's on oxymoron.  On more than one level.
legendary
Activity: 2142
Merit: 1010
Newbie
The main goal of this little project was to find bugs in my clients (I think the only way I can win a prize in the AM contest with this is, if only two other people take part... ;-) )

I found three bugs with this project in my client and one of them was that I didn't correctly add public keys created through forging in my account list.

So, 60 of the 204 account I sent a message to, actually have a public key in the blockchain and got a false warning message.

I'll send out a second "go-to-sleep-again" message to these 60 later today.

Was the account '2449360251152267661' one of those?

As:
 - 'requestType=getAccountBlockIds&account=2449360251152267661×tamp=0' returns zero forged blocks
 - 'requestType=getAccountPublicKey&account=2449360251152267661' returns an empty hash

But:
 - 'requestType=getBlock&block=15154802272108425772' returns a block with 2449360251152267661 as generator
 - 'requestType=getBlock&block=2526093825202073401' returns a block with 2449360251152267661 as generator

Is that a bug in NRS?



requestType=getAccountBlockIds&account=2449360251152267661×tamp=0 returns non-empty list of forged blocks.
newbie
Activity: 42
Merit: 0
Why vote makes no unfair social media.
You call a couple of people that the community is all about?

That decide for everyone

Why not conduct a fair vote social media?
full member
Activity: 224
Merit: 100
what was the total messaging fee ....1 nxt per msg sent? or did you send in bulk?....just curious

1 nxt per msg, yes. No discounts for developers... ;-)

I am investing some of the donations I got for bug elimination actually.
full member
Activity: 266
Merit: 100
NXT is the future
A marketing Committee


1) I propose Salsacz, Pin, Utopianfuture, Opticarrier & Klee form the marketing committee


Consider uniqueorn for this list. He isn't here a lot but is at the other forum and has put in a lot of time.

Salsacz (campaigns, viral marketing, media, people, universities... "organizing" all what is in Media topic) - Bitcointalk, all other forums
NiftyNikel (people) - nextcoin
Uniqueorn (people) - nextcoin
Utopianfuture (articles, people, science world) - Bitcointalk
opticalcarrier (scienceworld?)

? Joefox (texts) - wiki, Bitcointalk
? Anon136 (science world)
? Klee (belongs to the dev commitee)

Pinarello (communication with Nxt users) - forums.nxtcrypto, Bitcointalk (declined, but still has "communication with Nxt users" topic)

yes...these additional three would be good.....Klee & Anon136 have solid reputations built on responsibly handling large amounts of funds.

Edit: Joefox...is also a smart marketer.

As of now I do not have a "function" so please remove bold.

thank you
Pin
full member
Activity: 224
Merit: 100
The main goal of this little project was to find bugs in my clients (I think the only way I can win a prize in the AM contest with this is, if only two other people take part... ;-) )

I found three bugs with this project in my client and one of them was that I didn't correctly add public keys created through forging in my account list.

So, 60 of the 204 account I sent a message to, actually have a public key in the blockchain and got a false warning message.

I'll send out a second "go-to-sleep-again" message to these 60 later today.

Was the account '2449360251152267661' one of those?

As:
 - 'requestType=getAccountBlockIds&account=2449360251152267661×tamp=0' returns zero forged blocks
 - 'requestType=getAccountPublicKey&account=2449360251152267661' returns an empty hash

But:
 - 'requestType=getBlock&block=15154802272108425772' returns a block with 2449360251152267661 as generator
 - 'requestType=getBlock&block=2526093825202073401' returns a block with 2449360251152267661 as generator

Is that a bug in NRS?



Yes, 2449360251152267661 is one the false positives.

For me

https://192.168.178.55:7875/nxt?requestType=getAccountPublicKey&account=2449360251152267661

returns

{"publicKey":"49ed84f9ed7b2a8a555ced4b07de61b5d666f2d0b6186414882136d72a911719"}
legendary
Activity: 2184
Merit: 1000

This is my entry for the AM contest: Project Wake-Up Call :-)

The idea is, that sooner or later account holders will use software (clients, BC Explorer, etc.) that will show the plain text messages received on their account.

Thus, I sent out plain text messages to all accounts with more than 50.000 NXT in it that have no public key (204 accounts in total).

The message says:

Quote
Your NXT account is not fully protected! Please visit http://goo.gl/7vvRJl to learn more.

The link in the message goes to http://nxtsolaris.wordpress.com/nxt-no-public-key-landing-page/ which gives a short explanation on how to secure an account by doing an outgoing transaction.

 Wink

The main goal of this little project was to find bugs in my clients (I think the only way I can win a prize in the AM contest with this is, if only two other people take part... ;-) )

I found three bugs with this project in my client and one of them was that I didn't correctly add public keys created through forging in my account list.

So, 60 of the 204 account I sent a message to, actually have a public key in the blockchain and got a false warning message.

I'll send out a second "go-to-sleep-again" message to these 60 later today.



what was the total messaging fee ....1 nxt per msg sent? or did you send in bulk?....just curious
newbie
Activity: 42
Merit: 0
Why vote makes no unfair social media.
You call a couple of people that the community is all about?

That decide for everyone

Why not conduct a fair vote social media?
sr. member
Activity: 378
Merit: 250
The main goal of this little project was to find bugs in my clients (I think the only way I can win a prize in the AM contest with this is, if only two other people take part... ;-) )

I found three bugs with this project in my client and one of them was that I didn't correctly add public keys created through forging in my account list.

So, 60 of the 204 account I sent a message to, actually have a public key in the blockchain and got a false warning message.

I'll send out a second "go-to-sleep-again" message to these 60 later today.

Was the account '2449360251152267661' one of those?

As:
 - 'requestType=getAccountBlockIds&account=2449360251152267661×tamp=0' returns zero forged blocks
 - 'requestType=getAccountPublicKey&account=2449360251152267661' returns an empty hash

But:
 - 'requestType=getBlock&block=15154802272108425772' returns a block with 2449360251152267661 as generator
 - 'requestType=getBlock&block=2526093825202073401' returns a block with 2449360251152267661 as generator

Is that a bug in NRS?

legendary
Activity: 1092
Merit: 1010
Quote from: gbeirn
Ahahah exactly. I sometimes want to contact BCNext and say "You know what...great idea....but take it back, we aren't ready for it"
The technology should be decentralized.  The method of its development should be centralized.

Can this be made into a banner? Smiley
hero member
Activity: 490
Merit: 504
There is a Bitcoin Meetup in London coming up next week on January 21:

http://www.meetup.com/London-bitcoin-meetup/events/159181392/

We need to get a few Nxters there to promote and educate people on Nxt.

So come on, that guy from the Moore's Traditional Museum, his friend from Tower Gardens or even our buddy from the Hoebridge Golf Centre, aren't you interested? Cheesy

Buump Cheesy
full member
Activity: 224
Merit: 100

This is my entry for the AM contest: Project Wake-Up Call :-)

The idea is, that sooner or later account holders will use software (clients, BC Explorer, etc.) that will show the plain text messages received on their account.

Thus, I sent out plain text messages to all accounts with more than 50.000 NXT in it that have no public key (204 accounts in total).

The message says:

Quote
Your NXT account is not fully protected! Please visit http://goo.gl/7vvRJl to learn more.

The link in the message goes to http://nxtsolaris.wordpress.com/nxt-no-public-key-landing-page/ which gives a short explanation on how to secure an account by doing an outgoing transaction.

 Wink

The main goal of this little project was to find bugs in my clients (I think the only way I can win a prize in the AM contest with this is, if only two other people take part... ;-) )

I found three bugs with this project in my client and one of them was that I didn't correctly add public keys created through forging in my account list.

So, 60 of the 204 account I sent a message to, actually have a public key in the blockchain and got a false warning message.

I'll send out a second "go-to-sleep-again" message to these 60 later today.

legendary
Activity: 1372
Merit: 1000
Quote from: gbeirn
Ahahah exactly. I sometimes want to contact BCNext and say "You know what...great idea....but take it back, we aren't ready for it"

I think you made the point perfectly.  We aren't ready to create a technological wonder under a new form of software development.  The technology should be decentralized.  The method of its development should be centralized.
full member
Activity: 171
Merit: 100
Quote from: smartwart
People become tired to be guided and restricted by authorities.
         If some one gives the people freedom and the connected responsibility, people say "yeeeh, we are free!!!".
         After a while, say get lost in there degrees of freedom and say "yeeeh, we need a leader".
         And the cycle starts again ;-)

In successful software development, there is always a leader.  We are not trying to set up a new society here.  We are trying to crank out a software project.  Then maybe the software will create a new society.


Absolutely, and If you look carefully, you will find the leaders.
I agree with the other sentences too.

At least its a mix of activity, patience and persistence which lead to success everything.
full member
Activity: 196
Merit: 100
What do Utopian Future, Klee, Anon, 2Kewl4School and other prolific posters do? Do they program stuff? Write articles?

I wasn't aware that i was "prolific" but i like the sound of it. Grin No but seriously I'm just an enthusiast. I think the forging algo is, for lack of a better word, revolutionary. All of my interest and involvement stems out of that and its not even particular to nxt. If another unique coin used a similar algo than i would be involved there also. But yea i just study it, write about it, answer questions about it, and act as a trusted counterpart where ever my reputation for honesty can be of use to someone.

Just as important to NXT and just as revolutionary as the transparent forging algorithm is the miniblockchain concept.  I've been researching this so I can write it up in the whitepaper and not sound too stupid:


http://www.bitfreak.info/files/pp2p-ccmbc-rev1.pdf

https://bitcointalksearch.org/topic/m.2029436

https://bitcointalksearch.org/topic/building-the-next-generation-of-crypto-currency-developers-required-215936

It's fascinating to follow the development and timeline of all this.  You can see NXT breaking out of its shell and getting born, just look at who's posting where and the title of that third link.  There's probably even a few hints in there for a good detective on just who BCNext might be, but some things in life are better left with an air of mystery about them...
legendary
Activity: 2142
Merit: 1010
Newbie
So much marketing.
Any dev cooperation?

What exactly do u need?
newbie
Activity: 42
Merit: 0
At the very least, why aren't there multiple topics on nxtcrypto about individual project discussion as opposed to everything discussed in a single thread here? This seems like a simple organizational fix that could be implemented immediately. That way we aren't all sitting around a round table having 10 conversations at a time.

Do it! Create the threads!

I've started two threads in the Stakeholder Collaboration forum of nxtcrypto for 1) marketing and 2) voting system discussion. These were two things that were hotly debated over the past couple days. Hopefully this will organize conversations a bit more and remove excess noise from this thread.

https://forums.nxtcrypto.org/viewforum.php?f=38

An experiment in coordination!
legendary
Activity: 2184
Merit: 1000
A marketing Committee


1) I propose Salsacz, Pin, Utopianfuture, Opticarrier & Klee form the marketing committee


Consider uniqueorn for this list. He isn't here a lot but is at the other forum and has put in a lot of time.

Salsacz (campaigns, viral marketing, media, people, universities... "organizing" all what is in Media topic) - Bitcointalk, all other forums
NiftyNikel (people) - nextcoin
Uniqueorn (people) - nextcoin
Utopianfuture (articles, people, science world) - Bitcointalk
opticalcarrier (scienceworld?)

? Joefox (texts) - wiki, Bitcointalk
? Anon136 (science world)
? Klee (belongs to the dev commitee)

Pinarello (communication with Nxt users) - forums.nxtcrypto, Bitcointalk (declined, but still has "communication with Nxt users" topic)

yes...these additional three would be good.....Klee & Anon136 have solid reputations built on responsibly handling large amounts of funds.

Edit: Joefox...is also a smart marketer.
Jump to: