Skip to content

Commit

Permalink
Proposal getNetworkProperties (#54)
Browse files Browse the repository at this point in the history
* Added getNetworkProperties

* Changed Num to strings

* Updated examples

* Fixed amount default

* Update examples to match implementation

* Updated version

* Updated version
  • Loading branch information
dgarcia360 authored Mar 2, 2020
1 parent 964d5f8 commit 9a80afe
Show file tree
Hide file tree
Showing 24 changed files with 382 additions and 10 deletions.
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ All notable changes to this project will be documented in this file.

The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.8.6] - 02-Mar-2020

Targets catapult-rest 1.0.20.20

### Added

- ``/network/properties`` endpoint.

## [0.8.5] - 21-Feb-2020

Targets catapult-rest 1.0.20.19

- Renamed project to ``symbol-openapi``.
- Documented ``node/peers``.
- Validate ``type`` query params with ``TransactionTypeEnum``.
### Added

- ``node/peers`` endpoint.

### Changed

- ``type`` query params validation with ``TransactionTypeEnum``.
- Project was renamed to ``symbol-openapi``.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "symbol-openapi",
"version": "0.8.4",
"version": "0.8.6",
"description": "OpenAPI Specification of catapult-rest",
"main": "index.js",
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions spec/core/network/routes/getNetworkProperties.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tags:
- Network routes
summary: Get the network properties
description: |
Returns the content from a catapult-server network configuration file (resources/config-network.properties).
To enable this feature, the REST setting "network.propertiesFilePath" must define where the file is located.
This is adjustable via the configuration file (rest/resources/rest.json) per REST instance.
operationId: getNetworkProperties
responses:
"200":
description: success
content:
application/json:
schema:
$ref: "../schemas/NetworkConfigurationDTO.yml"
"409":
$ref : "../../../responses/InvalidArgument.yml"
87 changes: 87 additions & 0 deletions spec/core/network/schemas/ChainPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
type: object
description: Chain related configuration properties.
properties:
enableVerifiableState:
type: boolean
description: Set to true if block chain should calculate state hashes so that state is fully verifiable at each block.
example: true
enableVerifiableReceipts:
type: boolean
description: Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block.
example: true
currencyMosaicId:
type: string
description: Mosaic id used as primary chain currency.
example: 0x621E'C5B4'0385'6FC2
harvestingMosaicId:
type: string
description: Mosaic id used to provide harvesting ability.
example: 0x4291'ED23'000A'037A
blockGenerationTargetTime:
type: string # utils::TimeSpan
description: Targeted time between blocks.
example: 15s
blockTimeSmoothingFactor:
type: string # uint32
description: A higher value makes the network more biased.
example: "3000"
importanceGrouping:
type: string # uint64
description: Number of blocks that should be treated as a group for importance purposes.
example: "39"
importanceActivityPercentage:
type: string
description: Percentage of importance resulting from fee generation and beneficiary usage.
example: "5"
maxRollbackBlocks:
type: string # uint32
description: Maximum number of blocks that can be rolled back.
example: "40"
maxDifficultyBlocks:
type: string # uint32
description: Maximum number of blocks to use in a difficulty calculation.
example: "60"
defaultDynamicFeeMultiplier:
type: string # BlockFeeMultiplier
description: Default multiplier to use for dynamic fees.
example: 10'000
maxTransactionLifetime:
type: string #utils::TimeSpan
description: Maximum lifetime a transaction can have before it expires.
example: 24h
maxBlockFutureTime:
type: string # utils::TimeSpan
description: Maximum future time of a block that can be accepted.
example: 500ms
initialCurrencyAtomicUnits:
type: string # Amount
description: Initial currency atomic units available in the network.
example: 8'998'999'998'000'000
maxMosaicAtomicUnits:
type: string # Amount
description: Maximum atomic units (total-supply * 10 ^ divisibility) of a mosaic allowed in the network.
example: 9'000'000'000'000'000
totalChainImportance:
type: string # Importance
description: Total whole importance units available in the network.
example: 15'000'000
minHarvesterBalance:
type: string # Amount
description: Minimum number of harvesting mosaic atomic units needed for an account to be eligible for harvesting.
example: "500"
maxHarvesterBalance:
type: string # Amount
description: Maximum number of harvesting mosaic atomic units needed for an account to be eligible for harvesting.
example: 4'000'000
harvestBeneficiaryPercentage:
type: string
description: Percentage of the harvested fee that is collected by the beneficiary account.
example: "10"
blockPruneInterval:
type: string # uint32
description: Number of blocks between cache pruning.
example: "360"
maxTransactionsPerBlock:
type: string # uint32
description: Maximum number of transactions per block.
example: 200'000
12 changes: 12 additions & 0 deletions spec/core/network/schemas/NetworkConfigurationDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: object
required:
- network
- chain
- plugins
properties:
network:
$ref: "./NetworkPropertiesDTO.yml"
chain:
$ref: "./ChainPropertiesDTO.yml"
plugins:
$ref: "./PluginsPropertiesDTO.yml"
22 changes: 22 additions & 0 deletions spec/core/network/schemas/NetworkPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type: object
description: Network related configuration properties.
properties:
identifier:
type: string # NetworkIdentifier
description: Network identifier.
example: mijin-test
nodeEqualityStrategy:
$ref: "./NodeIdentityEqualityStrategy.yml"
example: host
publicKey:
$ref: "../../../schemas/PublicKey.yml"
description: Nemesis public key.
example: B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF
generationHash:
$ref: "../../../schemas/Hash256.yml"
description: Nemesis generation hash.
example: 57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6
epochAdjustment:
type: string # utils::TimeSpan
description: Nemesis epoch time adjustment.
example: 1573430400s
6 changes: 6 additions & 0 deletions spec/core/network/schemas/NodeIdentityEqualityStrategy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: string
description: |
Node equality strategy. Defines if the identifier for the node must be its public key or host.
enum:
- host
- public-key
25 changes: 25 additions & 0 deletions spec/core/network/schemas/PluginsPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
type: object
description: Plugin related configuration properties.
properties:
accountlink:
$ref: "../../../plugins/account_link/schemas/AccountLinkNetworkPropertiesDTO.yml"
aggregate:
$ref: "../../../plugins/aggregate/schemas/AggregateNetworkPropertiesDTO.yml"
lockhash:
$ref: "../../../plugins/lock_hash/schemas/HashLockNetworkPropertiesDTO.yml"
locksecret:
$ref: "../../../plugins/lock_secret/schemas/SecretLockNetworkPropertiesDTO.yml"
metadata:
$ref: "../../../plugins/metadata/schemas/MetadataNetworkPropertiesDTO.yml"
mosaic:
$ref: "../../../plugins/mosaic/schemas/MosaicNetworkPropertiesDTO.yml"
multisig:
$ref: "../../../plugins/multisig/schemas/MultisigNetworkPropertiesDTO.yml"
namespace:
$ref: "../../../plugins/namespace/schemas/NamespaceNetworkPropertiesDTO.yml"
restrictionaccount:
$ref: "../../../plugins/restriction_account/schemas/AccountRestrictionNetworkPropertiesDTO.yml"
restrictionmosaic:
$ref: "../../../plugins/restriction_mosaic/schemas/MosaicRestrictionNetworkPropertiesDTO.yml"
transfer:
$ref: "../../../plugins/transfer/schemas/TransferNetworkPropertiesDTO.yml"
4 changes: 2 additions & 2 deletions spec/info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 0.8.5
version: 0.8.6
title: Catapult REST Endpoints
description: OpenAPI Specification of catapult-rest 1.0.20.19
description: OpenAPI Specification of catapult-rest 1.0.20.20
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: object
properties:
dummy:
type: string
description: to trigger plugin load
22 changes: 22 additions & 0 deletions spec/plugins/aggregate/schemas/AggregateNetworkPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type: object
properties:
maxTransactionsPerAggregate:
type: string # uint32
description: Maximum number of transactions per aggregate.
example: 1'000
maxCosignaturesPerAggregate:
type: string
description: Maximum number of cosignatures per aggregate.
example: "15"
enableStrictCosignatureCheck:
type: boolean
description: Set to true if cosignatures must exactly match component signers. Set to false if cosignatures should be validated externally.
example: false
enableBondedAggregateSupport:
type: boolean
description: Set to true if bonded aggregates should be allowed. Set to false if bonded aggregates should be rejected.
example: true
maxBondedTransactionLifetime:
type: string # utils::TimeSpan
description: Maximum lifetime a bonded transaction can have before it expires.
example: 48h
10 changes: 10 additions & 0 deletions spec/plugins/lock_hash/schemas/HashLockNetworkPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
properties:
lockedFundsPerAggregate:
type: string # Amount
description: Amount that has to be locked per aggregate in partial cache.
example: 10'000'000
maxHashLockDuration:
type: string # utils::BlockSpan
description: Maximum number of blocks for which a hash lock can exist.
example: 2d
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: object
properties:
maxSecretLockDuration:
type: string # utils::BlockSpan
description: Maximum number of blocks for which a secret lock can exist.
example: 30d
minProofSize:
type: string
description: Minimum size of a proof in bytes.
example: "1"
maxProofSize:
type: string
description: Maximum size of a proof in bytes.
example: "1000"

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: object
properties:
maxValueSize:
type: string
description: Maximum metadata value size.
example: "1024"
22 changes: 22 additions & 0 deletions spec/plugins/mosaic/schemas/MosaicNetworkPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type: object
properties:
maxMosaicsPerAccount:
type: string
description: Maximum number of mosaics that an account can own.
example: 10'000
maxMosaicDuration:
type: string # utils::BlockSpan
description: Maximum mosaic duration.
example: 3650d
maxMosaicDivisibility:
type: string
description: Maximum mosaic divisibility.
example: "6"
mosaicRentalFeeSinkPublicKey:
$ref: "../../../schemas/PublicKey.yml"
description: Public key of the mosaic rental fee sink account.
example: 53E140B5947F104CABC2D6FE8BAEDBC30EF9A0609C717D9613DE593EC2A266D3
mosaicRentalFee:
type: string # Amount
description: Mosaic rental fee.
example: "500"
14 changes: 14 additions & 0 deletions spec/plugins/multisig/schemas/MultisigNetworkPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
properties:
maxMultisigDepth:
type: string
description: Maximum number of multisig levels.
example: "3"
maxCosignatoriesPerAccount:
type: string # uint32
description: Maximum number of cosignatories per account.
example: "10"
maxCosignedAccountsPerAccount:
type: string # uint32
description: Maximum number of accounts a single account can cosign.
example: "5"
42 changes: 42 additions & 0 deletions spec/plugins/namespace/schemas/NamespaceNetworkPropertiesDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
type: object
properties:
maxNameSize:
type: string
description: Maximum namespace name size.
example: "64"
maxChildNamespaces:
type: string
description: Maximum number of children for a root namespace.
example: "500"
maxNamespaceDepth:
type: string
description: Maximum namespace depth.
example: "3"
minNamespaceDuration:
type: string # utils::BlockSpan
description: Minimum namespace duration.
example: 1m
maxNamespaceDuration:
type: string # utils::BlockSpan
description: Maximum namespace duration.
example: 365d
namespaceGracePeriodDuration:
type: string # utils::BlockSpan
description: Grace period during which time only the previous owner can renew an expired namespace.
example: 2m
reservedRootNamespaceNames:
type: string
description: Reserved root namespaces that cannot be claimed.
example: xem, nem, user, account, org, com, biz, net, edu, mil, gov, info
namespaceRentalFeeSinkPublicKey:
$ref: "../../../schemas/PublicKey.yml"
description: Public key of the namespace rental fee sink account.
example: 3E82E1C1E4A75ADAA3CBA8C101C3CD31D9817A2EB966EB3B511FB2ED45B8E262
rootNamespaceRentalFeePerBlock:
type: string # Amount
description: Root namespace rental fee per block.
example: "1"
childNamespaceRentalFee:
type: string # Amount
description: Child namespace rental fee.
example: "100"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: object
properties:
maxAccountRestrictionValues:
type: string
description: Maximum number of account restriction values.
example: "512"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: object
properties:
maxMosaicRestrictionValues:
type: string
description: Maximum number of mosaic restriction values.
example: "20"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: object
properties:
maxMessageSize:
type: string
description: Maximum transaction message size.
example: "1024"
Loading

0 comments on commit 9a80afe

Please # to comment.