LogoLogo
PAO DocsCommunity DocsInfrastructure DocsPeerplays.com
  • Developer Documentation
  • API Reference
    • Peerplays Core API
      • Popular API Calls
      • Account History
      • Asset API
      • Block API
      • Crypto API
      • Database API
      • Network Broadcast API
      • Network Nodes API
      • Orders API
    • Wallet API
      • Account Calls
      • Asset Calls
      • Blockchain Inspection
      • General Calls
      • Governance
      • Privacy Mode
      • Trading Calls
      • Transaction Builder
      • Wallet Calls
    • Bookie API
      • General Calls
      • Listeners
      • Tournaments
  • Peerplays API Libraries
    • Python Peerplays
      • Installation
      • Creating an Account
      • Creating a Peerplays Wallet
      • NFT API
      • Marketplace API
      • Role Based Permissions API
  • Development Guides
    • Creating User Issued Assets
    • Introduction to Permissions
    • NFT Minting
    • Calculating Costs
  • The Cookbook
    • NFTs for Staking Creator Tokens
  • Tools and Integrations
    • PeerID
      • 1.0.0
        • Infrastructure
          • Deployment on a Linux Serve
          • Deployment to AWS ECS
            • Building the Docker Images
            • Storing Secrets in Amazon Parameter Store to use in ECS
            • Creating the Task Definition
            • Creating the Cluster
            • Creating the Service
        • Development
          • How does PeerID work without storing the keys ?
          • Authentication with PeerID
          • Brain Storming
          • Software Requirements
      • Authentication with PeerID
      • Requirements Specification
    • Random Number Generator
      • RNG Technical Summary
      • RNG API
  • Supporting & Reference Docs
    • Peerplays Development FAQs
    • Sidechain Operator Node (SON) Development
      • Generic Sidechain Docs
        • Quick joining GLADIATOR
        • Changes to Peerplaysjs-lib
        • Requirements Specification
        • Low Level Designs
          • bitcoin-deposit-handling-lld
          • bitcoin-operations-draft
          • bitcoin-sidechain-handler-lld
          • bitcoin-sidechain-multisig-bitcoin-wallet-and-bitcoin-addresses-pw
          • bitcoin-withdrawal-handling-lld
          • btc-address-scripting-mechanism
          • comparison-between-scenarios-for-handling-deposits-and-withdrawals
          • exchange-rate-list
          • generic-sidechain-deposit-hld
          • generic-sidechain-high-level-design
          • generic-sidechain-listener-hld
          • generic-sidechain-withdrawal-hld
          • refund-btc-mechanism
          • son-configuration
          • son-consensus-communication-and-transaction-signing-on-chain-lld
          • son-de-register-proposals-lld
          • son-objects-and-operators
          • son-rewards-lld
          • son-voting-lld
          • son-wallet-list_sons-lld
          • creation of a multi-sig bitcoin address lld
          • claiming initial son vesting lld
          • changeover and SON maintenance scenarios lld
          • user-sidechain-addresses-mapping
          • wallet-commands-for-son
        • Functional Specs
          • SON Configuration
          • SON rewards
          • SON Voting and Consensus
          • SONs switchover scenarios
          • SON Status Operations & Monitoring
          • Proposals
          • SON Smart Contracts
      • Bitcoin Sidechain Docs
        • Functional Specs
          • btc-refunds
          • voting-and-consensus
          • son-switchover
          • son-rewards
          • son-proposals
          • son-configuration
          • heartbeat-monitoring
          • BTC Transaction Processing & Signing
          • Bitcoin Withdrawal Handling
          • Bitcoin Deposit Handling
          • SON Multisig Bitcoin Wallet
      • Hive Sidechain Docs
        • Functional Specs
          • HIVE Deposit Handling
          • HIVE Withdrawal Handling
    • Peerplays DEX Development
      • Peerplays NEX
        • Functional Specifications
          • NEX-FS01 Dashboard Page
            • NEX-FS12 ETH-SONs Deposit/Withdraw Functionality
          • NEX-FS02 Login and Account Creation
          • NEX-FS03 Menus and Nav
          • NEX-FS04 Notifications
          • NEX-FS05a Market Page (alpha)
          • NEX-FS05 Market Page
          • NEX-FS06 Profile Page
          • NEX-FS07 Wallet Functions
          • NEX-FS08 App Settings
          • NEX-FS09 Blockchain Page
          • NEX-FS10 GPOS Page
          • NEX-FS11 WhaleVault Integration
      • Requirements Specification
      • Functional Specs
        • Asset Info Page and Asset Lists
        • Dashboard
        • Exchange Page
        • Login and Account Creation
        • User Account Page
        • Voting Page
    • SPK Network
      • Functional Specs
        • Claimdrop Snapshot Functional Specification
        • Initial Claimdrop Functional Specification
    • NFT Development
      • NFT Store
        • NFT Store User Stories
        • NFT Store UI HLD
        • NFT Store Requirements Specification
        • Functional Specifications
          • APP-FS01 App Header
          • APP-FS02 App Body
          • APP-FS03 App Footer
          • APP-FS04 App Navigation
          • APP-FS05 Wallet Functions
          • APP-FS06 App Home Page
          • APP-FS07 Account Page
          • APP-FS08 Browse View
        • App Page List
        • Requirement Traceability Matrix
    • Operation IDs List
    • Sidechain Flow Diagram (HIVE coin)
    • Sidechain Flow Diagram (Bitcoin)
    • Sidechain Flow Diagram (Ethereum coin)
    • TradeHands Explorer
      • User Personas
      • User stories
      • APP-FS01 Detailed View
      • Draft: APP-FS02 Front Page
      • APP-FS03 Collection Details Page
    • Grafana
      • Grafana Installation
      • Install Grafana Behind reverse proxy
      • Loki Installation
      • Promtail agent Installation
      • Grafana Explorer
    • NEX Deployment & Configuration
      • NEX Deployment
      • NEX - Blockchain API configuration
      • Deploying NEX in a HA scenario
    • API Node
      • MarketCap API
    • TOTO Application
      • FS-Subscription Plan
      • FS-Achievements
  • Development Workflow Docs
    • Development Workflow
  • Other Documentation
    • Peerplays Home
    • Community Docs
    • Infrastructure Docs
    • Site Reliability Engineering
Powered by GitBook
On this page
  • Bitcoin-SON
  • How can I generate Bitcoin addresses?
  • How to get TEST BTC on the REGTEST network?
  • How can I generate / find the public key for a Bitcoin address?
  • If funds are deposited to a Bitcoin address, will there be logs?
  • What is the cli_command to generate a Bitcoin deposit address in the Peerplays blockchain?
  • If a Bitcoin deposit address is created for a Peerplays address (account) what are the logs in the Peerplays blockchain?
  • How to run a Peerplays blockchain node with RPC debugging turned on?
  • Gamified Proof of Stake (GPOS)
  • What are the blockchain logs when a successful GPOS Vesting is done?
  • Faucet
  • What are the logs in faucet when an account is successfully created?
  • Peerplays DEX
  • How do I setup a local DEX UI project?
  • Peerplays QA Environment
  • How do I transfer funds between accounts in a Peerplays QA Environment network?
  • ❓How to ensure QA environment is healthy ?

Was this helpful?

Export as PDF
  1. Supporting & Reference Docs

Peerplays Development FAQs

PreviousRNG APINextSidechain Operator Node (SON) Development

Last updated 3 years ago

Was this helpful?

Bitcoin-SON

How can I generate Bitcoin addresses?

Command:

./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getnewaddress

References:

From developer.bitcoin.org...

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

Start bitcoind in regtest mode to create a private block chain.

bitcoin-cli -regtest generatetoaddress 101 $(bitcoin-cli -regtest getnewaddress)
bitcoin-cli -regtest getbalance

Verify that we now have 50 bitcoins available to spend.

Reference:

Command:

./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getaddressinfo "address"

References:

Command Definition:

return type, namespace, & method
signed_transaction graphene::wallet::wallet_api::add_sidechain_address(
    string account,
    sidechain_type sidechain,
    string deposit_public_key,
    string withdraw_public_key,
    string withdraw_address,
    bool broadcast);

Command Structure:

add_sidechain_address <account> <sidechain> <deposit_public_key> <withdraw_public_key> <withdraw_address> true

Command Example:

add_sidechain_address myaccount123 bitcoin 03c8d1c33727788ca1f61e13bdeca0127047527a0880c816056b4015d6e2d36c1e 025cee805793fd94ca1933cc28ef9c065addd0e256195f1a541be0cd21867ac1c5 1EToWbQDvEwwie6jYsuM7WkZnh7rCn5Ecu true

Reference:

Gamified Proof of Stake (GPOS)

Faucet

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' 
-d '{
	"account": {
		"name": "<ACCOUNT_NAME>",
		"owner_key": "TEST5WaszCsqVN9hDkXZPMyiUib3dyrEA4yd5kSMgu28Wz47B3wUqa",
		"active_key": "TEST5TPTziKkLexhVKsQKtSpo4bAv5RnB8oXcG4sMHEwCcTf3r7dqE",
		"memo_key": "TEST5TPTziKkLexhVKsQKtSpo4bAv5RnB8oXcG4sMHEwCcTf3r7dqE"
	}
}'

IP_ADDRESS should be 127.0.0.1 or localhost when running it directly in a VM or on your local machine.

owner_key, active_key, memo_key should start with TEST on testnet, and it should be PPY on mainnet.

If the result of the above is successful, there should be output like this:

{
	"account": {
		"active_key": "TEST5TPTziKkLexhVKsQKtSpo4bAv5RnB8oXcG4sMHEwCcTf3r7dqE",
		"memo_key": "TEST5TPTziKkLexhVKsQKtSpo4bAv5RnB8oXcG4sMHEwCcTf3r7dqE",
		"name": "account-name4",
		"owner_key": "TEST5WaszCsqVN9hDkXZPMyiUib3dyrEA4yd5kSMgu28Wz47B3wUqa",
		"referrer": "nathan"
	}
}

And in case of any error, it will be following (i.e. duplicate account):

{"error":{"base":["Account exists"]}}

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.

37.252.95.183 - - [06/Oct/2021 17:55:29] "OPTIONS /api/v1/accounts HTTP/1.1" 200 -
37.252.95.183 - - [06/Oct/2021 17:55:30] "POST /api/v1/accounts HTTP/1.1" 200 -

Peerplays DEX

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:

FAUCET_URL='http://<IP_ADDRESS>:5000/api/v1/accounts'
BLOCKCHAIN_ENDPOINTS='ws://<IP_ADDRESS>:8090/api'

IP_ADDRESS should be 127.0.0.1 or localhost when running it directly on your local machine.

Peerplays QA Environment

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"):

unlock password

Get the private key for active key (public key):

get_private_key_from_password "<ACCOUNT_NAME>" active "<ACCOUNT_PASSWORD>"

ACCOUNT_PASSWORD is the password defined when creating account in DEX UI.

Import the private key returned from previous step:

import_key <ACCOUNT_NAME> <PRIVATE_KEY>
For example:
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

memo key should be empty string for it to work. With list_core_accounts command you can check all account’s balances.

❓How to ensure QA environment is healthy ?

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.

How to get TEST BTC on the REGTEST network?

Many developers consider regtest mode the preferred way to develop new applications. The following example will let you create a regtest environment after you first .

Generate 101 blocks using a special 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.

You can now use Bitcoin Core prefixed with bitcoin-cli -regtest.

Regtest wallets and block chain state (chainstate) are saved in the regtest subdirectory of the Bitcoin Core configuration directory. You can safely delete the regtest subdirectory and restart Bitcoin Core to start a new regtest. (See the for default configuration directory locations on various operating systems. Always back up mainnet wallets before performing dangerous operations such as deleting.)

How can I generate / find the public key for a Bitcoin address?

If funds are deposited to a Bitcoin address, will there be logs?

What is the cli_command to generate a Bitcoin deposit address in the Peerplays blockchain?

If a Bitcoin deposit address is created for a Peerplays address (account) what are the logs in the Peerplays blockchain?

How to run a Peerplays blockchain node with RPC debugging turned on?

What are the blockchain logs when a successful GPOS Vesting is done?

What are the logs in faucet when an account is successfully created?

How do I setup a local DEX UI project?

First, pull the DEX repository from .

How do I transfer funds between accounts in a Peerplays QA Environment network?

In the QA environment setup by instructions in , execute commands in Peerplays01 container with the following:

❓
❓
❓
❓
❓
❓
❓
❓
❓
❓
configure bitcoind
RPC
RPCs
Developer Examples Introduction
here
here
❓
getnewaddress — Bitcoin
Testing Applications — Bitcoin
Logo
getaddressinfo — Bitcoin
bitcoin-cli getaddressinfo – ChainQuery
Logo
bitcoin-cli getnewaddress – ChainQuery
Logo
Logo
CLI Commands for SONsPeerplays Infrastructure Docs
Logo
Logo