diff --git a/contrib/README.md b/contrib/README.md index 30a4e0db..cf15df14 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -1,4 +1,19 @@ - # Contrib -Resources and examples for running and interacting with the kava blockchain. +Resources and examples for running and interacting with the kava blockchain. `contrib` contains sample genesis files, example governance proposals, and rest-server request examples for different versions of kava. + +## testnet-4000 + +kava-testnet-4000 introduces the cdp and auction modules, allowing users to create CDPs and mint usdx as well as participate in auctions. + +Configuration and rest-server interaction files are available in the [testnet-4000](./testnet-4000/README.md) directory. + +## testnet-5000 + +kava-testnet-5000 introduces the bep3 modules, allowing users to transfer BNB between the bnbchain testnet and kava. + +Configuration and rest-server interaction files are available in the [testnet-5000](./testnet-5000/README.md) directory. + +## dev + +During development new features offer require modifications to the genesis file. The dev directory houses these genesis files. diff --git a/contrib/dev/genesis_examples/genesis_savings_rate.json b/contrib/dev/genesis_examples/genesis_savings_rate.json new file mode 100644 index 00000000..538d5b72 --- /dev/null +++ b/contrib/dev/genesis_examples/genesis_savings_rate.json @@ -0,0 +1,352 @@ +{ + "genesis_time": "2020-03-07T18:27:07.837213082Z", + "chain_id": "testing", + "consensus_params": { + "block": { + "max_bytes": "22020096", + "max_gas": "-1", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age": "100000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + } + }, + "app_hash": "", + "app_state": { + "cdp": { + "cdps": [], + "debt_denom": "debt", + "deposits": [], + "gov_denom": "ukava", + "previous_distribution_time": "1970-01-01T00:00:00Z", + "params": { + "circuit_breaker": false, + "collateral_params": [ + { + "auction_size": "5000000000", + "conversion_factor": "6", + "debt_limit": [ + { + "amount": "10000000", + "denom": "usdx" + } + ], + "denom": "xrp", + "liquidation_penalty": "0.05", + "liquidation_ratio": "2.0", + "market_id": "xrp:usd", + "prefix": 0, + "stability_fee": "1.000000001547126" + }, + { + "auction_size": "10000000", + "conversion_factor": "8", + "debt_limit": [ + { + "amount": "10000000", + "denom": "usdx" + } + ], + "denom": "btc", + "liquidation_penalty": "0.05", + "liquidation_ratio": "1.5", + "market_id": "btc:usd", + "prefix": 1, + "stability_fee": "1.0000000007829977" + } + ], + "debt_auction_threshold": "1000000000", + "debt_params": [ + { + "conversion_factor": "6", + "debt_floor": "10000000", + "debt_limit": [ + { + "amount": "2000000000000", + "denom": "usdx" + } + ], + "denom": "usdx", + "reference_asset": "usd", + "savings_rate": "0.95" + } + ], + "global_debt_limit": [ + { + "amount": "2000000000000", + "denom": "usdx" + } + ], + "savings_distribution_frequency": "120000000000", + "surplus_auction_threshold": "1000000000" + }, + "previous_block_time": "1970-01-01T00:00:00Z", + "starting_cdp_id": "1" + }, + "bank": { + "send_enabled": true + }, + "params": null, + "bep3": { + "params": { + "bnb_deputy_address": "kava1xy7hrjy9r0algz9w3gzm8u6mrpq97kwta747gj", + "min_block_lock": "80", + "max_block_lock": "600", + "supported_assets": [ + { + "denom": "ukava", + "coin_id": "459", + "limit": "1", + "active": false + } + ] + }, + "atomic_swaps": [], + "assets_supplies": [] + }, + "pricefeed": { + "params": { + "markets": [ + { + "active": true, + "base_asset": "xrp", + "market_id": "xrp:usd", + "oracles": [ + "kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw", + "kava1xq4cspcgl9thzmn6lkvd6dlx28wsr63zw4mlmf" + ], + "quote_asset": "usd" + }, + { + "active": true, + "base_asset": "btc", + "market_id": "btc:usd", + "oracles": [ + "kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw" + ], + "quote_asset": "usd" + } + ] + }, + "posted_prices": [ + { + "expiry": "2050-01-01T00:00:00Z", + "market_id": "btc:usd", + "oracle_address": "kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw", + "price": "8700.0" + }, + { + "expiry": "2050-01-01T00:00:00Z", + "market_id": "xrp:usd", + "oracle_address": "kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw", + "price": "0.25" + } + ] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": null, + "votes": null, + "proposals": null, + "deposit_params": { + "min_deposit": [ + { + "denom": "ukava", + "amount": "10000000" + } + ], + "max_deposit_period": "172800000000000" + }, + "voting_params": { + "voting_period": "172800000000000" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto": "0.334000000000000000" + } + }, + "staking": { + "params": { + "unbonding_time": "1814400000000000", + "max_validators": 100, + "max_entries": 7, + "bond_denom": "ukava" + }, + "last_total_power": "0", + "last_validator_powers": null, + "validators": null, + "delegations": null, + "unbonding_delegations": null, + "redelegations": null, + "exported": false + }, + "mint": { + "minter": { + "inflation": "0.130000000000000000", + "annual_provisions": "0.000000000000000000" + }, + "params": { + "mint_denom": "ukava", + "inflation_rate_change": "0.130000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "goal_bonded": "0.670000000000000000", + "blocks_per_year": "6311520" + } + }, + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [ + { + "type": "cosmos-sdk/Account", + "value": { + "address": "kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw", + "coins": [ + { + "denom": "ukava", + "amount": "1000000000000" + }, + { + "denom": "btc", + "amount": "10000000000" + }, + { + "denom": "xrp", + "amount": "1000000000000" + } + ], + "public_key": null, + "account_number": "0", + "sequence": "0" + } + }, + { + "type": "cosmos-sdk/Account", + "value": { + "address": "kava19dp7luf32mlqnw6mhpgk0g37ule7wm2g8gck8a", + "coins": [ + { + "denom": "ukava", + "amount": "1000000000000" + } + ], + "public_key": null, + "account_number": "0", + "sequence": "0" + } + } + ] + }, + "auction": { + "next_auction_id": "1", + "params": { + "max_auction_duration": "172800000000000", + "bid_duration": "3600000000000" + }, + "auctions": [] + }, + "validatorvesting": { + "previous_block_time": "1970-01-01T00:00:00Z" + }, + "supply": { + "supply": [] + }, + "crisis": { + "constant_fee": { + "denom": "ukava", + "amount": "1000" + } + }, + "distribution": { + "fee_pool": { + "community_pool": [] + }, + "community_tax": "0.020000000000000000", + "base_proposer_reward": "0.010000000000000000", + "bonus_proposer_reward": "0.040000000000000000", + "withdraw_addr_enabled": true, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "genutil": { + "gentxs": [ + { + "type": "cosmos-sdk/StdTx", + "value": { + "msg": [ + { + "type": "cosmos-sdk/MsgCreateValidator", + "value": { + "description": { + "moniker": "kava-tester", + "identity": "", + "website": "", + "security_contact": "", + "details": "" + }, + "commission": { + "rate": "0.100000000000000000", + "max_rate": "0.200000000000000000", + "max_change_rate": "0.010000000000000000" + }, + "min_self_delegation": "1", + "delegator_address": "kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw", + "validator_address": "kavavaloper15qdefkmwswysgg4qxgqpqr35k3m49pkx8yhpte", + "pubkey": "kavavalconspub1zcjduepq3qyhcxfpa0u2efeu3htuxjz0248khl2cqfcm8jz2n0dr2e2a6tuqqafg2g", + "value": { + "denom": "ukava", + "amount": "10000000000" + } + } + } + ], + "fee": { + "amount": [], + "gas": "200000" + }, + "signatures": [ + { + "pub_key": { + "type": "tendermint/PubKeySecp256k1", + "value": "Az740XKIPCJtnZLmJfktTfhsEStEJE3n2iRVyJ3wko43" + }, + "signature": "ZIzw2qsaJzsNuROW1JYYH1ZOA3jrc4ZCHvrCxirWNlEZqIvnyC42nBQLIPQ+d+PIcpldLVy0KAkb8NBXj9G0nQ==" + } + ], + "memo": "6fff8e9b327f0811e7a25c1419781167f82ec7b3@172.31.40.66:26656" + } + } + ] + }, + "slashing": { + "params": { + "max_evidence_age": "120000000000", + "signed_blocks_window": "100", + "min_signed_per_window": "0.500000000000000000", + "downtime_jail_duration": "600000000000", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000" + }, + "signing_infos": {}, + "missed_blocks": {} + } + } +} \ No newline at end of file diff --git a/contrib/testnet-4000/README.md b/contrib/testnet-4000/README.md index c579bb26..ce377e67 100644 --- a/contrib/testnet-4000/README.md +++ b/contrib/testnet-4000/README.md @@ -6,7 +6,7 @@ Resources and examples for running and interacting with kava-testnet-4000 ### Setup - Before making a request, query account information for the signing account. Note the 'accountnumber' and 'sequence' fields, we'll need them later in order to send our request: +Before making a request, query account information for the signing account. Note the 'accountnumber' and 'sequence' fields, we'll need them later in order to send our request: ```bash kvcli q auth account $(kvcli keys show accB -a) @@ -22,41 +22,41 @@ Now we'll create an unsigned request, sign it, and broadcast it to the Kava bloc ### Create CDP example request - Format the base request in create-cdp.json. You'll need to update the 'from', 'chain-id', 'account_number', 'sequence', and 'gas' as appropriate. Then, populate the CDP creation request's params 'owner', 'collateral', and 'principal'. An example formatted request can be found in `example-create-cdp.json`. +Format the base request in create-cdp.json. You'll need to update the 'from', 'chain-id', 'account_number', 'sequence', and 'gas' as appropriate. Then, populate the CDP creation request's params 'owner', 'collateral', and 'principal'. An example formatted request can be found in `example-create-cdp.json`. ```bash # Create an unsigned request - curl -H "Content-Type: application/json" -X PUT -d @./contrib/requests/create-cdp.json http://127.0.0.1:1317/cdp | jq > ./contrib/requests/create-cdp-unsigned.json + curl -H "Content-Type: application/json" -X PUT -d @./contrib/testnet-4000/rest_examples/cdp/create-cdp.json http://127.0.0.1:1317/cdp | jq > ./contrib/testnet-4000/rest_examples/cdp/create-cdp-unsigned.json # Sign the request - kvcli tx sign ./contrib/requests/create-cdp-unsigned.json --from accB --offline --chain-id testing --sequence 1 --account-number 2 | jq > ./contrib/requests/broadcast-create-cdp.json + kvcli tx sign ./contrib/testnet-4000/rest_examples/cdp/create-cdp-unsigned.json --from accB --offline --chain-id testing --sequence 1 --account-number 2 | jq > ./contrib/testnet-4000/rest_examples/cdp/broadcast-create-cdp.json # Broadcast the request - kvcli tx broadcast ./contrib/requests/broadcast-create-cdp.json + kvcli tx broadcast ./contrib/testnet-4000/rest_examples/cdp/broadcast-create-cdp.json ``` Congratulations, you've just created a CDP on Kava using the rest server! ### Post market price example request - Note that only market oracles can post prices, other senders will have their transactions rejected by Kava. +Note that only market oracles can post prices, other senders will have their transactions rejected by Kava. - Format the base request in post-price.json. You'll need to update the 'from', 'chain-id', 'account_number', 'sequence', and 'gas' as appropriate. Then, populate the post price request's params 'from', 'market_id', 'price', and 'expiry'. An example formatted request can be found in `example-post-price.json`. +Format the base request in post-price.json. You'll need to update the 'from', 'chain-id', 'account_number', 'sequence', and 'gas' as appropriate. Then, populate the post price request's params 'from', 'market_id', 'price', and 'expiry'. An example formatted request can be found in `example-post-price.json`. ```bash # Create an unsigned request - curl -H "Content-Type: application/json" -X PUT -d @./contrib/requests/post-price.json http://127.0.0.1:1317/pricefeed/postprice | jq > ./contrib/requests/post-price-unsigned.json + curl -H "Content-Type: application/json" -X PUT -d @./contrib/testnet-4000/rest_examples/pricefeed/post-price.json http://127.0.0.1:1317/pricefeed/postprice | jq > ./contrib/testnet-4000/rest_examples/pricefeed/post-price-unsigned.json # Sign the request - kvcli tx sign ./contrib/requests/post-price-unsigned.json --from validator --offline --chain-id testing --sequence 96 --account-number 0 | jq > ./contrib/requests/broadcast-post-price.json + kvcli tx sign ./contrib/testnet-4000/rest_examples/pricefeed/post-price-unsigned.json --from validator --offline --chain-id testing --sequence 96 --account-number 0 | jq > ./contrib/testnet-4000/rest_examples/pricefeed/broadcast-post-price.json # Broadcast the request - kvcli tx broadcast ./contrib/requests/broadcast-post-price.json + kvcli tx broadcast ./contrib/testnet-4000/rest_examples/pricefeed/broadcast-post-price.json ``` Congratulations, you've just posted a current market price on Kava using the rest server! ## Governance proposals -Example governance proposals are located in `/proposal_examples`. \ No newline at end of file +Example governance proposals are located in `/proposal_examples`. diff --git a/contrib/testnet-4000/requests/broadcast-create-cdp.json b/contrib/testnet-4000/rest_examples/cdp/broadcast-create-cdp.json similarity index 100% rename from contrib/testnet-4000/requests/broadcast-create-cdp.json rename to contrib/testnet-4000/rest_examples/cdp/broadcast-create-cdp.json diff --git a/contrib/testnet-4000/requests/broadcast-deposit-cdp.json b/contrib/testnet-4000/rest_examples/cdp/broadcast-deposit-cdp.json similarity index 100% rename from contrib/testnet-4000/requests/broadcast-deposit-cdp.json rename to contrib/testnet-4000/rest_examples/cdp/broadcast-deposit-cdp.json diff --git a/contrib/testnet-4000/requests/create-cdp-unsigned.json b/contrib/testnet-4000/rest_examples/cdp/create-cdp-unsigned.json similarity index 100% rename from contrib/testnet-4000/requests/create-cdp-unsigned.json rename to contrib/testnet-4000/rest_examples/cdp/create-cdp-unsigned.json diff --git a/contrib/testnet-4000/requests/create-cdp.json b/contrib/testnet-4000/rest_examples/cdp/create-cdp.json similarity index 100% rename from contrib/testnet-4000/requests/create-cdp.json rename to contrib/testnet-4000/rest_examples/cdp/create-cdp.json diff --git a/contrib/testnet-4000/requests/deposit-cdp.json b/contrib/testnet-4000/rest_examples/cdp/deposit-cdp.json similarity index 100% rename from contrib/testnet-4000/requests/deposit-cdp.json rename to contrib/testnet-4000/rest_examples/cdp/deposit-cdp.json diff --git a/contrib/testnet-4000/requests/example-create-cdp.json b/contrib/testnet-4000/rest_examples/cdp/example-create-cdp.json similarity index 100% rename from contrib/testnet-4000/requests/example-create-cdp.json rename to contrib/testnet-4000/rest_examples/cdp/example-create-cdp.json diff --git a/contrib/testnet-4000/requests/broadcast-post-price.json b/contrib/testnet-4000/rest_examples/pricefeed/broadcast-post-price.json similarity index 100% rename from contrib/testnet-4000/requests/broadcast-post-price.json rename to contrib/testnet-4000/rest_examples/pricefeed/broadcast-post-price.json diff --git a/contrib/testnet-4000/requests/example-post-price.json b/contrib/testnet-4000/rest_examples/pricefeed/example-post-price.json similarity index 100% rename from contrib/testnet-4000/requests/example-post-price.json rename to contrib/testnet-4000/rest_examples/pricefeed/example-post-price.json diff --git a/contrib/testnet-4000/requests/post-price-unsigned.json b/contrib/testnet-4000/rest_examples/pricefeed/post-price-unsigned.json similarity index 100% rename from contrib/testnet-4000/requests/post-price-unsigned.json rename to contrib/testnet-4000/rest_examples/pricefeed/post-price-unsigned.json diff --git a/contrib/testnet-4000/requests/post-price.json b/contrib/testnet-4000/rest_examples/pricefeed/post-price.json similarity index 100% rename from contrib/testnet-4000/requests/post-price.json rename to contrib/testnet-4000/rest_examples/pricefeed/post-price.json