Nxt Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client: Nxt 1.11.14 - Latest Ardor Client: Ardor 2.0.14

Pages: [1]

Author Topic: Questions about the Nxt Blockchain Creation Kit  (Read 1089 times)

Omar

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 19
    • View Profile
  • Karma: +3/-0

Hello Nxt Community,

Not sure where this should go in the forums, there doesn't seem to be an applicable category.

We have questions about deploying the Nxt Blockchain Creation Kit. There are some details missing from the documentation.

The README.md refers to "changing the coin name and software name in nxt/Nxt.java" however applicable variables seem to be missing from the  /src/java/nxt/Nxt.java file.

The applicable variables seem to be in the /src/java/nxt/Constant.java file, however changing these variables doesn't seem to change what appears in the Wallet, which still shows "NxtClone" and "NxtCloneCoin".

We have installed the NRS in a server, and taken a JPLSnapshot, however we have not run the run.sh command with the JPLSnapshot's genesisAccounts.json file, just the default blank genesisAccounts.json file, as we don't want to launch a blockchain/network/currency called NxtCloneCoin.

Where would we adjust the NxtClone and NxtCloneCoin variables?

Right.Here

  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
    • View Profile
  • Karma: +21/-4

Hi :)

you can change this on the UI level in
...\html\www\js\nrs.constants.js
at line 125, change
NRS.constants.COIN_SYMBOL = response.coinSymbol;
to
NRS.constants.COIN_SYMBOL = "YourCoinName";
or
NRS.constants.COIN_SYMBOL = String("YourCoinName");

but at the base, if the changes on the java classes did not affect the UI ?!? may be there is some thing wrong somewhere...

thank you and good continuation  :D
NXT-LJV5-YSF4-MXXX-438D5

Omar

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 19
    • View Profile
  • Karma: +3/-0

Thanks for the response Right.Here

We did try the update you suggested: NRS.constants.COIN_SYMBOL = String("YourCoinName"); and then reinstall on the server, but still got the same NxtCoinClone result. We do see our own coin name on most of the pages, but most of that is from updating the language files. NxtCoinClone still shows in all the important place like at the top "Send NxtCloneCoin"

Interestingly the next line (126) in ...\html\www\js\nrs.constants.js is:
$(".coin-symbol").html(response.coinSymbol);
Are we supposted to have created a [coin-symbol].html file?

We did not alter the java classes. In fact they were the only files in the nxt-clone download we didn't try changing that contained "NxtClone" (grep -rl 'NxtClone' nxt-clone/*). Based on the README.md and the short comment about server side constants in the video posted on jelurida.com/blockchain-creation-kit it seemed like there should be a simpler solution than recompiling the class files.

The /src/java/nxt/Nxt.java lists a "nxt-installer.properties" file on line 61, which doesn't seem to be in the nxt-clone folder, or referenced anywhere we could find. Does anyone know if that's missing or no longer in use?

Also, does the nxt-clone system behave differently when installed with a viable genesisAccounts.json, instead of blank. Will it only read the Constants.java file if the genesisAccounts.json contains accounts? We don't want to drop a non-viable coin, so we don't want to test it with the real genesisAccounts.json file.

Thanks in advance for anyone that can answer any of these questions.

Right.Here

  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
    • View Profile
  • Karma: +21/-4

Hi  :D

in the same file change all this:
125# NRS.constants.COIN_SYMBOL = String("YourCoinName");

126# $(".coin-symbol").html(NRS.constants.COIN_SYMBOL);

127# NRS.constants.ACCOUNT_PREFIX = NRS.constants.COIN_SYMBOL;

add this line at 128#, will avoid you to change many thing after...

response.accountPrefix = NRS.constants.COIN_SYMBOL;

129# NRS.constants.PROJECT_NAME = "YourProjectName";

the $(".coin-symbol").html(NRS.constants.COIN_SYMBOL); is a JQuery that change all the html classes ".coin-symbol" to your coin name... you have just to add a span like this
Code: [Select]
<span class="coin-symbol"></span>
will print the coin name where is...


...

Also, does the nxt-clone system behave differently when installed with a viable genesisAccounts.json, instead of blank. Will it only read the Constants.java file if the genesisAccounts.json contains accounts? We don't want to drop a non-viable coin, so we don't want to test it with the real genesisAccounts.json file.


the genesis import/export dont have a direct relation with the constants.java...
you can setup the node to use the testnet and do what you want like if you was in production mode...

and remember! the blockchain kit is not supposed to be used in production! you have to secure your genesis block and lock it with other anti cheat code... before to publish your blockchain

add: clean your browser cache when you edit the JS or the HTML files to load the fresh ones...

good continuation  :D
« Last Edit: April 14, 2018, 09:45:04 am by Right.Here »
NXT-LJV5-YSF4-MXXX-438D5

Omar

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 19
    • View Profile
  • Karma: +3/-0

Thank you again Right.Here,

That last suggestion pointed us the right direction. We had to make some changes to your code, and edit a few other files, but now the NRS looks right. Thanks also for confirming that the genesis import/export is not in direct relation with the constants.java.

Regarding your statement "blockchain kit is not supposed to be used in production" that is not the impression the jelurida site gives. Any advice anyone wants to offer regrading this is welcome, along with any additional documentation. We have only read the jelurida docs.

If no one objects we will continue this thread with some more general Nxt-Clone questions.

First a chicken/egg question:
When you create a Nxt-Clone you start using another Account Prefix, for example EXP- instead of NXT- in the account number. When you create the blockchain you put the owner accounts into the JSON file, which gets added to the NXT Owners from the JPLSnapshot. So the owner accounts you put in must be NXT- accounts, not EXP- accounts, because there is no way to make EXP- accounts until after the blockchain is running. However there is no way to log into the Nxt-Clone using the NXT- account, so how do you transfer your ExampleCoin from your Nxt account to the Nxt-Clone account?

Second Question is about decimal points. NXT, like Bitcoin has 8 places under the decimal (1.00000000), maybe it is short-sighted, but we only want 3 (1.000). We don't believe our coin will go above ~$10 USD, and will more likely trade around $0.05 USD which is where we would like it to stay long term. So, who is going to sell anything for $0.0000000001 USD? If we change the decimals in nxt-clone, will it screw up the drop? We can leave it at 8, but it seems pointless.

Question Three, I believe I know the answer, but is there a way to pull a fiat exchange rate into Nxt-Clone for a MS currency? We need to run fiat-pegged crypto parallel to the NxtCloneCoin so merchants can collect taxable payments, otherwise we will run into legal issues. However the local fiat currency has no long term value (ongoing high inflation +17%), so allowing people and merchants to store their money in a stable crytpo, but still exchange in fiat-pegged crypto, has tremendous value. We have read about theoretical Fiat-pegged NXT currencies, which is just a "trust me, I'll buy it back" policy. We don't have concerns about the trust, the local fiat and government has no trust, and we can back what we will issue, but a live (or daily) exchange rate from a service like Alpha Vantage would be useful.

Thank you again to anyone that takes the time to answer.

Omar

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 19
    • View Profile
  • Karma: +3/-0

it looks like we have found an answer to the Chicken/Egg question: the NXT account and NXT-Clone account will essentially be the same account. The end user will login with the same account number just changing the NXT- to EXP- (for example), and then using the same passphrase.

I hope this is not correct, but it seems to be the case. It poses a potential security risk, as the same account number and passphrase would end up being used on several Nxt-clones. If one of the Nxt-Clones is compromised, then Nxt and all the other clones would be compromised.

Please someone tell me that we are misunderstand how the airdrop works!

Right.Here

  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
    • View Profile
  • Karma: +21/-4

Hi  :D

yes the account address is composed by 2 elements, the prefix (NXT-... ARDOR-...) and the the reed solomon address... more infos about here:
https://nxtwiki.org/wiki/RS_Address_Format

for this, the same passphrase will work in the same address with an other prefix...

it is a security risk the usage of the passphrases in the others twins projects ?
YES with red&bold  ;D

but there is a way to deal with this case based on the offline transaction so...
https://nxtwiki.org/wiki/Offline_Transaction_Signing

and the nxter.org guys made an easy to use tool for it here https://www.nxter.org/nxtbridge-offline

Quote
Second Question is about decimal points. NXT, like Bitcoin has 8 places under the decimal (1.00000000), maybe it is short-sighted, but we only want 3 (1.000). We don't believe our coin will go above ~$10 USD, and will more likely trade around $0.05 USD which is where we would like it to stay long term. So, who is going to sell anything for $0.0000000001 USD? If we change the decimals in nxt-clone, will it screw up the drop? We can leave it at 8, but it seems pointless.

you can play around what your end-user see , for example the amount that is displayed in the sidebar have only 2 decimals... there is some NRS.functions to format the NQT values as you want  ;) you have just to read the code...

Quote
Question Three, I believe I know the answer, but is there a way to pull a fiat exchange rate into Nxt-Clone for a MS currency? We need to run fiat-pegged crypto parallel to the NxtCloneCoin so merchants can collect taxable payments, otherwise we will run into legal issues. However the local fiat currency has no long term value (ongoing high inflation +17%), so allowing people and merchants to store their money in a stable crytpo, but still exchange in fiat-pegged crypto, has tremendous value. We have read about theoretical Fiat-pegged NXT currencies, which is just a "trust me, I'll buy it back" policy. We don't have concerns about the trust, the local fiat and government has no trust, and we can back what we will issue, but a live (or daily) exchange rate from a service like Alpha Vantage would be useful.

there is changelly and shapeshift integrated in the UI and you can use the changelly API to get the fiat values because they sell crypto for CC... there is already the apicall function that can be used... read here:
...\html\www\js\exchange\nrs.changelly.js

but in general, one of the rules when you code for NXT or NBCK is never use external resources even if they are like Google or microsoft APIs ... never is never!

if you want an advice, do not rush and take the time to devour the existing documentation even that of users here:
https://nxtwiki.org/
play with the API... you can use the test side in your wallet here for NXT:
http://localhost:7876/test

change the port number to work in your own NBCK

there is already all that is needed in the code itself in the form of NRS.functions() so it is useless to write code for something that already exists...

contact jelurida to see what they can do for you ... after, if you see that what they offer does not fit your project or too expensive ... you can try to develop stuff but it will be hard and you have to read and understand how it works in tons of java and javascript code pages ... it's people's money that will be in the game! you have to be absolutely sure of what you are doing ...

Thank you and good continuation
NXT-LJV5-YSF4-MXXX-438D5

Omar

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 19
    • View Profile
  • Karma: +3/-0

Wow Right.Here, thank you, that is a lot of info.

We have setup a small cluster of nodes that are running a Nxt-clone now. Our intent is not to clone the Nxt Platform, just to use a stripped-down clone for a alt-currency with a para-fiat option. A lot of small business owners I know want to transact in BTC, but the fees are too high, and the exchange rate is too unpredictable. I think by 2020 Crypto-currencies will be accepted at corner stores in many countries. From the research and testing my group has done Nxt seems the best suited to make that leap.

Lots of work to do...

Right.Here

  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
    • View Profile
  • Karma: +21/-4

Hi  :D
Wow Right.Here, thank you, that is a lot of info.

We have setup a small cluster of nodes that are running a Nxt-clone now. Our intent is not to clone the Nxt Platform, just to use a stripped-down clone for a alt-currency with a para-fiat option. A lot of small business owners I know want to transact in BTC, but the fees are too high, and the exchange rate is too unpredictable. I think by 2020 Crypto-currencies will be accepted at corner stores in many countries. From the research and testing my group has done Nxt seems the best suited to make that leap.

Lots of work to do...

you are welcome, ask if you need something and thank you for the Tip and your bug report  :D
NXT-LJV5-YSF4-MXXX-438D5

jonnytracker

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 29
    • View Profile
  • Karma: +1/-0

Wow Right.Here, thank you, that is a lot of info.

We have setup a small cluster of nodes that are running a Nxt-clone now. Our intent is not to clone the Nxt Platform, just to use a stripped-down clone for a alt-currency with a para-fiat option. A lot of small business owners I know want to transact in BTC, but the fees are too high, and the exchange rate is too unpredictable. I think by 2020 Crypto-currencies will be accepted at corner stores in many countries. From the research and testing my group has done Nxt seems the best suited to make that leap.

Lots of work to do...

so you want to strip down and use only the nxt transaction feature

Omar

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 19
    • View Profile
  • Karma: +3/-0

Wow Right.Here, thank you, that is a lot of info.

We have setup a small cluster of nodes that are running a Nxt-clone now. Our intent is not to clone the Nxt Platform, just to use a stripped-down clone for a alt-currency with a para-fiat option. A lot of small business owners I know want to transact in BTC, but the fees are too high, and the exchange rate is too unpredictable. I think by 2020 Crypto-currencies will be accepted at corner stores in many countries. From the research and testing my group has done Nxt seems the best suited to make that leap.

Lots of work to do...

so you want to strip down and use only the nxt transaction feature

Not exactly, we need the Monetary System, Asset Exchange, and Voting systems for our project to work.

I saw your thread and screenshots, looks good. Out of curiosity, did you have a problem getting the Account Number (NRS.accountRS) to show the correct prefix? Everything seems to be working right in our development hub, but the accounts always list NXT- once logged in.

Omar

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 19
    • View Profile
  • Karma: +3/-0

Solved!

Please disregard this thread. The problem was with the Java installed in the nodes we're using. Our auto-install script was installed in JRE instead of JDK and NBCK wasn't compiling.

If anyone else has this issue of the /src/java/nxt/Constants.java variables not showing in the wallet, check your Java, and then ./compile.sh

Thanks again to Right.Here for the assist!

Right.Here

  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
    • View Profile
  • Karma: +21/-4

Hi  :D

i suspected a compilation problem since the beginning but i told myself that your IDE will display it and refuse the compilation ...

i use IntelliJ community (free) which is a good IDE to work on the NBCK and that's what the Devs use at jelurida...
https://www.jetbrains.com/idea/download/#section=windows

if you want to use intellij with the the zip file version of NBCK, you have to manually configure the project settings to set the location of the source, libs, resources ... and the outputs (compiled classes)

you don't have to do it with the full version of NBCK...

thank you and good continuation  :D
NXT-LJV5-YSF4-MXXX-438D5
Pages: [1]