Peerplays Development FAQs
./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getnewaddress
For situations where interaction with random peers and blocks is unnecessary or unwanted, Bitcoin Core’s regression test mode (regtest mode) lets you instantly create a brand-new private block chain with the same basic rules as testnet—but one major difference: you choose when to create new blocks, so you have complete control over the environment.
bitcoind -regtest -daemon
bitcoindin regtest mode to create a private block chain.
bitcoin-cli -regtest generatetoaddress 101 $(bitcoin-cli -regtest getnewaddress)
Generate 101 blocks using a special RPC which is only available in regtest mode. This takes less than a second on a generic PC. Because this is a new block chain using Bitcoin’s default rules, the first blocks pay a block reward of 50 bitcoins. Unlike mainnet, in regtest mode only the first 150 blocks pay a reward of 50 bitcoins. However, a block must have 100 confirmations before that reward can be spent, so we generate 101 blocks to get access to the coinbase transaction from block #1.
bitcoin-cli -regtest getbalance
Verify that we now have 50 bitcoins available to spend.Regtest wallets and block chain state (chainstate) are saved in the
regtestsubdirectory of the Bitcoin Core configuration directory. You can safely delete the
regtestsubdirectory and restart Bitcoin Core to start a new regtest. (See the Developer Examples Introduction for default configuration directory locations on various operating systems. Always back up mainnet wallets before performing dangerous operations such as deleting.)
./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getaddressinfo "address"
return type, namespace, & method
add_sidechain_address <account> <sidechain> <deposit_public_key> <withdraw_public_key> <withdraw_address> true
add_sidechain_address myaccount123 bitcoin 03c8d1c33727788ca1f61e13bdeca0127047527a0880c816056b4015d6e2d36c1e 025cee805793fd94ca1933cc28ef9c065addd0e256195f1a541be0cd21867ac1c5 1EToWbQDvEwwie6jYsuM7WkZnh7rCn5Ecu true
One can use Curl command or POSTMAN in order to create a new account in the Faucet. With Curl you can do the following:
curl -X POST http://<IP_ADDRESS>:<PORT_NUMBER>/api/v1/accounts
-H 'content-type: application/json'
If the result of the above is successful, there should be output like this:
And in case of any error, it will be following (i.e. duplicate account):
You can also track the logs in Faucet container, with the following command:
docker logs --follow <Faucet-Container-ID>
For example: docker logs --follow 47c101add138
And look for logs when receiving Create Account requests, with 200 status code as a result.
220.127.116.11 - - [06/Oct/2021 17:55:29] "OPTIONS /api/v1/accounts HTTP/1.1" 200 -
18.104.22.168 - - [06/Oct/2021 17:55:30] "POST /api/v1/accounts HTTP/1.1" 200 -
This works with a Faucet and a local QA environment (create account & login).
After setting up the project, update the following variables in .env file:
docker exec -it peerplaysqaenvironment_peerplays01_1 /bin/bash
Then running into account’s wallet:
./cli_wallet list_account_balances <ACCOUNT_NAME>
For example: ./cli_wallet list_account_balances armin
Unlock the wallet with the default password (which is "password"):
Get the private key for active key (public key):
get_private_key_from_password "<ACCOUNT_NAME>" active "<ACCOUNT_PASSWORD>"
Import the private key returned from previous step:
import_key <ACCOUNT_NAME> <PRIVATE_KEY>
import_key armin 5JckQ6g57P9YyyumHCRj1cNbHTiMEUVA2HjVDJqXDDPYizEaAMu
Finally transfer with the following:
transfer <FROM_ACCOUNT_NAME> <TO_ACCOUNT_NAME> <AMOUNT> TEST "" true
For example: transfer armin nathan 10 TEST "" true
If you are getting "Generated block..." and "Scheduled SON..." messages, and SON last active timestamps are updated regularly, SON network is working as expected. To get last active timestamp, first use get_object 1.33.X (ids are 1.33.0, 1.33.1, ... 1.33.6), statistic object id will be there, and then use get_object statistic_object_id (I believe ids are 2.25.0, 2.25.1, ... 2.25.6). All timestamps should be in a last few minutes.