diff --git a/docker-compose-hc.yml b/docker-compose-hc.yml index d5d2c1b51..c3021ebd2 100644 --- a/docker-compose-hc.yml +++ b/docker-compose-hc.yml @@ -7,7 +7,7 @@ services: RUNNER_IMAGE: "hexpm/elixir:1.17.3-erlang-26.2.5.3-debian-bullseye-20240926-slim" USER: root MIX_ENV: dev - NODE_IMAGE: aeternity/aeternity:master + NODE_IMAGE: aeternity/aeternity:v7.3.0-rc1 PATH_PREFIX: "/v3" image: aeternity/ae_mdw_dev${IMAGE_NAME_SUFFIX:-}:latest ports: diff --git a/docs/swagger_v3/hyperchain.spec.yaml b/docs/swagger_v3/hyperchain.spec.yaml new file mode 100644 index 000000000..0abb65d56 --- /dev/null +++ b/docs/swagger_v3/hyperchain.spec.yaml @@ -0,0 +1,313 @@ +schemas: + Schedule: + description: Schedule information + type: object + properties: + height: + type: integer + example: 1 + leader: + type: string + example: "ak_1111111111111111111111111111111111111111111111111" + required: + - height + - leader + Validator: + description: Validator information + type: object + properties: + epoch: + type: integer + example: 1 + validator: + type: string + example: "ak_1111111111111111111111111111111111111111111111111" + total_stakes: + type: integer + example: 1000000000000000000 + delegates: + type: integer + example: 5 + rewards_earned: + type: integer + example: 1000000000000000000 + pinning_history: + type: object + additionalProperties: + type: integer + example: {"1": 1000000000000000000, "2": 2000000000000000000} + required: + - epoch + - validator + - total_stakes + - delegates + - rewards_earned + - pinning_history + Delegate: + description: Delegate information + type: object + properties: + epoch: + type: integer + example: 1 + delegate: + type: string + example: "ak_1111111111111111111111111111111111111111111111111" + stake: + type: integer + example: 1000000000000000000 + validator: + type: string + example: "ak_1111111111111111111111111111111111111111111111111" + required: + - epoch + - delegate + - stake + - validator + EpochInfo: + description: Epoch information + type: object + properties: + epoch: + type: integer + example: 1 + first: + type: integer + example: 1 + last: + type: integer + example: 10 + length: + type: integer + example: 10 + seed: + type: string + example: "kh_1111111111111111111111111111111111111111111111111" + last_pin_height: + type: integer + example: 10 + parent_block_hash: + type: string + example: "kh_1111111111111111111111111111111111111111111111111" + last_leader: + type: string + example: "ak_1111111111111111111111111111111111111111111111111" + epoch_start_time: + type: integer + example: 1629820800000 + validators: + type: array + items: + type: object + properties: + validator: + type: string + example: "ak_1111111111111111111111111111111111111111111111111" + stake: + type: integer + example: 1000000000000000000 + required: + - epoch + - first + - last + - length + - seed + - last_pin_height + - parent_block_hash + - last_leader + - epoch_start_time + - validators +paths: + /hyperchain/epochs: + get: + deprecated: false + description: Get Epoch information + operationId: GetEpochs + parameters: + - $ref: '#/components/parameters/DirectionParam' + responses: + '200': + description: Returns paginated list of information about Epochs + content: + application/json: + schema: + allOf: + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/EpochInfo' + - $ref: '#/components/schemas/PaginatedResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /hyperchain/epochs/top: + get: + deprecated: false + description: Get Top Epoch information + operationId: GetEpochTop + responses: + '200': + description: Returns information about the top epoch + content: + application/json: + schema: + $ref: '#/components/schemas/EpochInfo' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /hyperchain/validators: + get: + deprecated: false + description: Get Validators information + operationId: GetValidators + responses: + '200': + description: Returns validator information + content: + application/json: + schema: + allOf: + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Validator' + - $ref: '#/components/schemas/PaginatedResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /hyperchain/validators/{validator}: + get: + deprecated: false + description: Get Validator information + operationId: GetValidator + responses: + '200': + description: Returns validator information + content: + application/json: + schema: + $ref: '#/components/schemas/Validator' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /hyperchain/validators/{validator}/delegates: + get: + deprecated: false + description: Get Delegates information for validator + operationId: GetValidatorDelegates + responses: + '200': + description: Returns delegates information + content: + application/json: + schema: + allOf: + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Delegate' + - $ref: '#/components/schemas/PaginatedResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /hyperchain/validators/{validator}/delegates/top: + get: + deprecated: false + description: Get top Delegates information for validator + operationId: GetTopValidatorDelegates + responses: + '200': + description: Returns top validator delegates information + content: + application/json: + schema: + allOf: + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Delegate' + - $ref: '#/components/schemas/PaginatedResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /hyperchain/schedule: + get: + deprecated: false + description: Get Schedule information + operationId: GetSchedules + parameters: + - $ref: '#/components/parameters/DirectionParam' + responses: + '200': + description: Returns schedule information + content: + application/json: + schema: + allOf: + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Schedule' + - $ref: '#/components/schemas/PaginatedResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /hyperchain/schedule/height/{height}: + get: + deprecated: false + description: Get Schedule information + operationId: GetSchedule + responses: + '200': + description: Returns schedule information + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' diff --git a/scripts/do.sh b/scripts/do.sh index d8197914f..85cf4efb2 100755 --- a/scripts/do.sh +++ b/scripts/do.sh @@ -26,7 +26,7 @@ case $1 in "hc-shell") mix local.hex --force && mix local.rebar --force && mix deps.get - AETERNITY_CONFIG=./hyperchains/aeternity.yaml iex --sname $NAME -S mix phx.server + AETERNITY_CONFIG=./hyperchain/aeternity.yaml iex --sname $NAME -S mix phx.server ;;