About Nxt

Did you ever want to participate in a financial field with your Software without taking big risks and have an easy and anonymous access to? Have you tried to access monetary systems and get transparent data from Asset Exchanges, Marketplaces, Data clouds? Nxt is a peer-to-peer Blockchain Sotware that allows a global financial service that you can use on your server or computer. No registration, no bureaucracy.

What does the NXT Blockchain bring to the table that is new?

In traditional banking systems you encounter ‘trusted’ banks which manage your money and holdings for you as a service. But when you want to access your money they do not make it easy for you. Especially as a developer, there is no chance you can retrieve the data of holdings or have access to the historical Wall Street data for free.

With the peer-to-peer blockchain system Nxt has started to build a whole ecosystem around secure and transparent data handling. You can start your own services, create currencies, create assets and trade them, a built-in marketplace, data cloud and much more!

Getting started

With the following lines of code I would like to demonstrate how to get a first access to Nxt data and then show you how to write on the blockchain and get some data ready for your homepage.

From there you could start building everything you can imagine around the Blockchain, Account Ledger and featured tools.

If you have not installed it yet, see here how to install and configure Nxt to start developing.

“Hello World”

In this example we are choosing the most basic setup which lets you display data from the Blockchain on your website.

We will use JQuery to simplify the API call but you can achieve the same results with other frameworks or a bit more code.

Let us create the first html file, we call it transaction.html and insert the following code into it.

<!DOCTYPE html>

<html>

<body>

<div id="result"></div> <script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>

<script>

$.getJSON('http://localhost:7876/nxt', {"requestType": "getTransaction", "transaction": "8520011591947303971"}, function(request)

{

$("#result").html(request.attachment.message);

});

</script>

</body> </html>

Nxt has a very helpful API documentation that is addressable on

http://localhost:7876/test

We are using the getTransaction call in this example, which you can also test on the API page.

When running the script above, you should see the following response in your Browser:

Hello World

Congratulations! You have received the first data from the blockchain

But what happened here?

First, we have used the API call “getTransaction” which allows us to have a detailed look at information of any transaction that is on the Blockchain. Have a look at your browser console to see the whole transaction information.

In the above code we have accessed the market output of the JSON response the Nxt API gave us. Here you can see the whole object returned from the API.