0

I am learning to develop a new cryptocurrency on my own, for the same i decided to develop a Proof-Of-Stake coin, I forked the Okcash for this purpose. And was able to change the coin according to my needs, Also was able to start the Proof-of-work phase mining. But after the mining stopped and i got the pre-mined coins, i am not able to figure it out that how i can start staking. Here is the details regarding the updated parameters:

nDistributionFund = 1; // 9998000 coins in this block
nLastFairLaunchBlock = 51; // 19.1 coins for each block here till 51 block
nLastPOWBlock = 1096; // 1 coin for each block here till 1096 block. so total pre-mine coin is 10 million. 
nFirstPosv2Block = 20000;
nStakeMinAge = 8 * 60 * 60; // 8 hours
nModifierInterval  = 10 * 60; // time to elapse before new modifier is computed, 60 seconds
nCoinbaseMaturity = 180;
nTargetTimespan = 16 * 60;  // 16 mins
nTargetSpacing = 69;

I was able to mine the initial PoW blocks successfully, but once it got to block 1096 and I tried staking some coins (I have two daemons on the different machine with considerably high number of coins in each) I never get any confirmations.

Details for the first daemon:

{
    "enabled" : true,
    "staking" : false,
    "errors" : "",
    "currentblocksize" : 181390,
    "currentblocktx" : 97,
    "pooledtx" : 97,
    "difficulty" : 0.00000000,
    "search-interval" : 1,
    "weight" : 0,
    "netstakeweight" : 0,
    "expectedtime" : 0
}


Details for the second daemon:

{
    "enabled" : true,
    "staking" : false,
    "errors" : "",
    "currentblocksize" : 181390,
    "currentblocktx" : 97,
    "pooledtx" : 97,
    "difficulty" : 0.00000000,
    "search-interval" : 0,
    "weight" : 5000000000000,
    "netstakeweight" : 0,
    "expectedtime" : 0
}

Also as you all can see in both the daemons the staking is "false". Though staking was "true" when the Proof-Of-work phase was on. It's weird to see staking "true" in the proof-of-work phase but not in the proof-of-stake phase itself, I don't know what is happening here.

Here is the getinfo file for both daemons:

First ->

{
    "mode" : "full",
    "protocolversion" : 60021,
    "walletversion" : 60000,
    "balance" : 9947915.97620000,
    "newmint" : 14.00000000,
    "stake" : 0.00000000,
    "reserve" : 0.00000000,
    "blocks" : 1096,
    "timeoffset" : 0,
    "moneysupply" : 10000000.00000000,
    "connections" : 1,
    "datareceived" : "18.47 KB",
    "datasent" : "216.03 KB",
    "proxy" : "",
    "difficulty" : {
        "proof-of-work" : 0.00000000,
        "proof-of-stake" : 0.00000000
    },
    "testnet" : true,
    "keypoololdest" : 1538982514,
    "keypoolsize" : 101,
    "paytxfee" : 0.00010000,
    "mininput" : 0.00000000,
    "errors" : ""
}

Second ->

{
    "mode" : "full",
    "protocolversion" : 60021,
    "walletversion" : 60000,
    "balance" : 50000.00000000,
    "newmint" : 0.00000000,
    "stake" : 0.00000000,
    "reserve" : 0.00000000,
    "blocks" : 1096,
    "timeoffset" : 0,
    "moneysupply" : 10000000.00000000,
    "connections" : 1,
    "datareceived" : "220.29 KB",
    "datasent" : "19.51 KB",
    "proxy" : "",
    "difficulty" : {
        "proof-of-work" : 0.00000000,
        "proof-of-stake" : 0.00000000
    },
    "testnet" : true,
    "keypoololdest" : 1538558297,
    "keypoolsize" : 101,
    "paytxfee" : 0.00010000,
    "mininput" : 0.00000000,
    "errors" : ""
}

Details for the config file:

testnet=1
staking=1
rpcallowip=*
rpcuser=user1
rpcpassword=pass1
server=1
listen=1

I am stuck here since many weeks now, and not able to figure it out that how to start the proof-of-stake phase, information regarding this on internet is vague at best.

Any explanation and help regarding these queries is appreciable and it will really helps me a lot.

put on hold as off-topic by Murch Aug 20 at 16:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about cryptocurrencies or projects that are not Bitcoin, and are not applicable to Bitcoin, are off-topic. For more information, see this meta-discussion." – Murch
If this question can be reworded to fit the rules in the help center, please edit the question.

0
After POW phase ends, POS phase starts automatically without any interference.

The reason for my problem was the function

int64_t CChainParams::GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees)
i had made some changes for the reward distribution, what i did was, i decided to distribute different percent of rewards according to the participation of user in the cryptocurrency. And for same i made two functions:

 GetProofOfStakeReward1(), and GetProofOfStakeReward2()

Somehow my way of defining two functions each with different reward distribution was wrong. Because after removing both the two functions and replacing it with the original function GetProofOfStakeReward() my problem got solved, And for my idea of different reward distribution i made the changes for that in the original GetProofOfStakeReward() function itself by using if else conditions.

Not the answer you're looking for? Browse other questions tagged or ask your own question.