找回密码
 立即注册

新浪微博登陆

只需一步, 快速开始

查看: 1168|回复: 1

铸造---Mint

942

主题

1096

帖子

4668

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4668
nxt 发表于 2015-1-11 21:23:48 | 显示全部楼层 |阅读模式
https://bitbucket.org/JeanLucPic ... mint-worker-utility

Mint Worker Utility[size=14.3999996185303px]

lyaffe
created an issue 2014-12-13

[size=14.3999996185303px]Introduction
The NXT Monetary System supports the creation of new currency units using proof of work process we call "minting".
The process works as follows: When issuing a currency the issuer selects the "Mintable" property and sets the initial minting difficulty, final minting difficulty and hashing algorithm. The difficulty then increases linearly from the initial difficulty to the final difficulty as the number of units in circulation increases.
Minters retrieve a target value based on the current difficulty, using the getMinitingTarget transaction, then work offline to find an nonce number which produces a hash smaller than the target value. Once finding such hash, minters submit a currencyMint transaction, providing the nonce to one of the peers, as a result, once the next block is confirmed by the network the minter account receives the new currency units, .
Mint Worker
In order to help minters get started quickly, the protocol provides a simple utility named "Mint Worker" which provides a Java based, reference implementation for minting currency units. We hope that in the future 3rd party developers will adapt this utility for use with CPUs, GPUs and Asics to optimize the hashing performance.
The mint worker supports the following configuration parameters defined in the standard nxt.properties file:
Configuration
nxt.mint.serverAddress - the address of the NXT peer accepting the transactions. Defaults to "localhost".
nxt.mint.currencyCode - specifies the monetary system currency code of the currency to mint.
nxt.mint.secretPhrase - secret phrase of the account to which the new currency units are granted. This secret phrase is submitted to the peer with each mint transaction.
nxt.mint.unitsPerMint - specifies the number of units per mint for each mint transaction. This is the number of units credited to the minter account, however, minting difficulty increases linearly with the number of units, therefore small minters should define small number of units and large minters a larger number [default: 1 whole unit per mint] This field accepts decimal positions according to the currency decimals.
nxt.mint.threadPoolSize - number of threads used for hashing [default: 1 thread per CPU core]
nxt.mint.initialNonce - by default (or when setting the value to 0) the initial nonce is chosen randomly and increased by one on every hash calculation. Set this value when you like the hashing process to work deterministically, for example for testing purposes.
nxt.mint.isSubmitted - by default the mint worker does not actually submit the minting transaction. To submit the transactions automatically whenever a hash is solved set this value to true. Refer to the best practices section below.
Example
nxt.mint.serverAddress=10.0.0.1
nxt.mint.currencyCode=MINTZ
nxt.mint.secretPhrase=hashhashhash
nxt.mint.unitsPerMint=12.5
nxt.mint.threadPoolSize=2
nxt.mint.initialNonce=0
nxt.mint.isSubmitted=false
Runtime
To execute the mint worker follow these steps:
Install NXT
Configure the mint parameters as explained above
Start the NXT node and update the blockchain
Once the node is started launch the mint worker by running mint.sh on Unix or mint.bat on Windows
The mint worker connects to the NXT node specified by the nxt.mint.serverAddress setting, to retrieve the minting parameters and submit the solution nonce.
Constraints
Only a single currencyMint transaction per Block/Currency/Account is accepted by the blockchain. When submitting more that one such transaction in a single block, the rest of the transactions are delayed to the next block or until they expire. The mint worker submits transactions with an expiry deadline of 120 minutes.
Each accepted currencyMint transaction pays a fee of 1 NXT, therefore, make sure that the number of units minted in each currencyMint transaction worth much more than 1 NXT according to the current currency exchange rate.
Additional Best practices
Never set the isSubmitted flag to true unless you are absolutely sure what's you are doing. You may end up paying a lot of fees and spamming the blockchain.
Always start by minting 1 unit per mint and observe the log messages printed by the mint worker. Look at the hash rate and the number of seconds per transaction. Adjust the nxt.mint.unitsPerMint setting so that the mint worker solves no more than one hash per hour, but also consider that a single transaction cannot mint more than 1/10000 of the total unit supply.


Total number of coins in Nxt is exactly 0.
In the very beginning,BCNext created coins and anti-coins out of the void just like vacuum creates particles and anti-particles.
In the very end,all coins will come back to genesis account and annihilate with their opposites...

NxtChina.org | 微博 | 关于我们

341

主题

587

帖子

1529

积分

金牌会员

Rank: 6Rank: 6

积分
1529
18069787757 发表于 2018-4-23 16:26:13 | 显示全部楼层
CNS采用区块链技术,服务器和节点由商业联盟会员共同部署和维护,企业与企业、企业与用户、用户与用户之间的数字交易,都会通过共识算法“存”在CNS平台中所有节点上,单一企业对于自身节点数据的修改无法通过其它节点数据验证,从而保障了数字的真实性,确保数字真正属于用户。
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

快速回复 返回顶部 返回列表