Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEIP-13 Feedback after discussion #51

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions AEIP-13.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,28 @@ This works because the first thing AEWeb does is fetch the latest reference tran

The node needs two modifications:

1. Add a new schema for AEWeb transaction
1. Add a new sub schema for AEWeb transaction
1. The controller which serves the AEWeb content should check the status and act accordingly

### New schema
## New sub schema
```json
{
"type": "object",
"description": "Reference tx of an unpublished website",
"properties": {
"aeip": {
"type": "array",
"items": { "type": "number" },
"description": "Supported AEIPs"
},
"aewebVersion": {
"type": "number",
"exclusiveMinimum": 0,
"description": "AEWeb's version"
},
"publicationStatus": {
"type": "string",
"enum": [
"UNPUBLISHED"
]
"enum": [ "UNPUBLISHED" ]
}
},
"required": [
Expand All @@ -47,6 +50,31 @@ The node needs two modifications:
}
```

This sub schema is used in a `oneOf` that also contains the two existing sub schemas:

```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {...},
"oneOf": [
{"$ref": "#/definitions/aewebRefTxPublished"},
{"$ref": "#/definitions/aewebRefTxUnpublished"},
{"$ref": "#/definitions/aewebDataTx"},
]
}
```

#### Example of a web_hosting transaction's content to unpublish a website

```json
{
"aeip": [8, 13],
"aewebVersion": 1,
"publicationStatus": "UNPUBLISHED"
}
```


### Controller logic

When fetching the reference transaction for a AEWeb website, the controller will check the new `publicationStatus` attribute from the JSON. From there, there is 3 possibilities:
Expand Down