Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## [2.0.0](https://github.com/aeternity/ae_mdw/compare/v1.100.0...v2.0.0) (2025-03-05)


### ⚠ BREAKING CHANGES

* make docker paths the same as in the node images ([#2086](https://github.com/aeternity/ae_mdw/issues/2086))

### Features

* add hyperchain/config endpoint to read aeternity.yaml settings ([#2106](https://github.com/aeternity/ae_mdw/issues/2106)) ([205fb1a](https://github.com/aeternity/ae_mdw/commit/205fb1a398fa2d4801b94e972e2c0e93f94c6bf3))
* make docker paths the same as in the node images ([#2086](https://github.com/aeternity/ae_mdw/issues/2086)) ([249791d](https://github.com/aeternity/ae_mdw/commit/249791d65798927ea9b42e15879b069ee176173a))


### Miscellaneous

* bump node to 7.3.0-rc5 ([#2110](https://github.com/aeternity/ae_mdw/issues/2110)) ([6c48030](https://github.com/aeternity/ae_mdw/commit/6c4803060da8a4b6e552545f7ecf7fab8bc95ca2))
* remove deprecated poorly performant /by_names endpoint ([#2103](https://github.com/aeternity/ae_mdw/issues/2103)) ([87a26fc](https://github.com/aeternity/ae_mdw/commit/87a26fc5e4086c875c2d32462cdb33e35c3d28c6))
* update docker OS versions to fix docker multiarch pipeline build ([#2108](https://github.com/aeternity/ae_mdw/issues/2108)) ([9bda7ab](https://github.com/aeternity/ae_mdw/commit/9bda7ab1cce791d11661e09d02cf3cf99db2843d))

## [1.100.0](https://github.com/aeternity/ae_mdw/compare/v1.99.0...v1.100.0) (2025-02-20)


Expand Down
71 changes: 54 additions & 17 deletions docs/hyperchains_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,22 @@ To properly configure your middleware for Aeternity Hyperchains, start by genera
Once you have the necessary configuration files, you can run the middleware using Docker:

```
docker run -it --rm \
-p 3013:3013 \
docker run -it --name ae_mdw_${NAME} \
-p 4000:4000 \
-e AETERNITY_CONFIG=/home/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/aeternity.yaml:/home/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_accounts.json:/home/aeternity/node/local/rel/aeternity/data/aecore/${NAME}_accounts.json \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_contracts.json:/home/aeternity/node/local/rel/aeternity/data/aecore/${NAME}_contracts.json \
-p 4001:4001 \
-p 3113:3113 \
-p 3013:3013 \
-p 3014:3014 \
-v ${PWD}/${NAME}/nodeConfig/aeternity.yaml:/home/aeternity/.aeternity/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_accounts.json:/home/aeternity/node/data/aecore/${NAME}_accounts.json \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_contracts.json:/home/aeternity/node/data/aecore/${NAME}_contracts.json \
aeternity/ae_mdw
```

- **Make sure you have enough account balance on the pinning chain for all of the accounts**
- The command assumes the configuration files are in the `${NAME}/nodeConfig` directory in your current working directory, where `${NAME}` is the name of your Hyperchain.
- This command uses the [middleware image](https://hub.docker.com/r/aeternity/ae_mdw), which differs from the [node image](https://hub.docker.com/r/aeternity/aeternity).
- You can pass the `-d` flag to run the container in detached mode.

---

Expand All @@ -62,22 +65,56 @@ To ensure data persistence across container restarts:


```
docker run -it --rm \
-p 3013:3013 \
docker run -it --name ae_mdw_${NAME} \
-p 4000:4000 \
-e AETERNITY_CONFIG=/home/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/aeternity.yaml:/home/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_accounts.json:/home/aeternity/node/local/rel/aeternity/data/mnesia/${NAME}_accounts.json \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_contracts.json:/home/aeternity/node/local/rel/aeternity/data/mnesia/${NAME}_contracts.json \
-v ${PWD}/data/mnesia:/home/aeternity/node/local/rel/aeternity/data/mnesia \
-v ${PWD}/data/mdw.db:/home/aeternity/node/local/rel/aeternity/data/mdw.db \
-p 4001:4001 \
-p 3113:3113 \
-p 3013:3013 \
-p 3014:3014 \
-v ${PWD}/${NAME}/nodeConfig/aeternity.yaml:/home/aeternity/.aeternity/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_accounts.json:/home/aeternity/node/data/mnesia/${NAME}_accounts.json \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_contracts.json:/home/aeternity/node/data/mnesia/${NAME}_contracts.json \
-v ${PWD}/data/mnesia:/home/aeternity/node/data/mnesia \
-v ${PWD}/data/mdw.db:/home/aeternity/node/data/mdw.db \
aeternity/ae_mdw
```

- `-v ${PWD}/data/mnesia:/home/aeternity/node/local/rel/aeternity/data/mnesia`: Persists the node database.
- `-v ${PWD}/data/mdw.db:/home/aeternity/node/local/rel/aeternity/data/mdw.db`: Persists the middleware database.
- `-v ${PWD}/data/mnesia:/home/aeternity/node/data/mnesia`: Persists the node database.
- `-v ${PWD}/data/mdw.db:/home/aeternity/node/data/mdw.db`: Persists the middleware database.

With this setup, the middleware will retain its state even after the container is stopped or restarted.

You can also pass the `-d` flag to run the container in detached mode.

## Step 4: Accessing the Middleware

Once the container is running, you can access the middleware at `http://localhost:4000` and the node at `http://localhost:3013`.

## Managing the Container

To check the logs, run the following command:

```
docker logs ae_mdw_${NAME}
```

To check the status of the container, run the following command:

```
docker ps -a
```

To stop the container, run the following command:

With this setup, the middleware will retain its state even after the container is stopped or restarted.
```
docker stop ae_mdw_${NAME}
```

To restart the container, run the following command:

```
docker start ae_mdw_${NAME}
```

---

Expand Down
44 changes: 38 additions & 6 deletions docs/middleware_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

AeMdw is a middleware that acts as a caching and reporting layer for the [æternity blockchain](https://github.com/aeternity/aeternity). It responds to queries more efficiently than the node and supports additional queries.
AeMdw is a middleware that acts as a caching and reporting layer for the [æternity blockchain](https://github.com/aeternity/aeternity). It responds to queries more efficiently than the node and supports additional queries.

The middleware runs an Aeternity Node alongside it in the same Docker container and BEAM VM instance. This node can be configured using the `aeternity.yaml` file or by passing environment variables, just like configuring the node directly.

Expand Down Expand Up @@ -73,19 +73,51 @@ If you want to use a database snapshot:
Start the container with the following command:

```
docker run -d \
docker run -it --name ae_mdw \
-p 4000:4000 \
-p 4001:4001 \
-p 3113:3113 \
-p 3013:3013 \
-p 3014:3014 \
-v ${PWD}/data/mnesia:/home/aeternity/node/local/rel/aeternity/data/mnesia \
-v ${PWD}/data/mdw.db:/home/aeternity/node/local/rel/aeternity/data/mdw.db \
-v ${PWD}/log:/home/aeternity/node/ae_mdw/log \
-e AETERNITY_CONFIG=/home/aeternity/aeternity.yaml \
-v ${PWD}/data/mnesia:/home/aeternity/node/data/mnesia \
-v ${PWD}/data/mdw.db:/home/aeternity/node/data/mdw.db \
-v ${PWD}/log:/home/aeternity/ae_mdw/log \
-v ${PWD}/docker/aeternity.yaml:/home/aeternity/.aeternity/aeternity/aeternity.yaml \
aeternity/ae_mdw:latest
```

This command starts the middleware in a docker container. The middleware will be available at `http://localhost:4000`. Note that you can pass the -d flag to run the container in detached mode.

### Step 4: Check the Status

To check if the middleware is running properly, visit the `/status` endpoint and ensure that `node_height` is higher than `0`.

### Step 5: Managing the Container

To check the logs, run the following command:

```
docker logs ae_mdw
```

To check the status of the container, run the following command:

```
docker ps -a
```

To stop the container, run the following command:

```
docker stop ae_mdw
```

To restart the container, run the following command:

```
docker start ae_mdw
```

## Customizing Configuration

Edit the configuration file `docker/aeternity.yaml` to specify network settings:
Expand Down
3 changes: 3 additions & 0 deletions docs/swagger_v3/aexn.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ schemas:
tx_type:
description: Transaction type, indicating a state of a balance for that block height
type: string
enum:
- ContractCreateTx
- ContractCallTx
required:
- amount
- block_hash
Expand Down
2 changes: 2 additions & 0 deletions docs/swagger_v3/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,5 @@ components:
required:
- next
- prev
TransactionType:
$ref: '#/components/schemas/Tx/allOf/0/properties/type'
12 changes: 12 additions & 0 deletions docs/swagger_v3/channels.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ schemas:
example: 141956
last_updated_tx_type:
type: string
enum:
- ChannelCloseSoloTx
- ChannelCloseMutualTx
- ChannelCreateTx
- ChannelDepositTx
- ChannelForceProgressTx
- ChannelSetDelegatesTx
- ChannelSettleTx
- ChannelSlashTx
- ChannelSnapshotSoloTx
- ChannelWithdrawTx
- ChannelOffChainTx
description: The transaction type of the last transaction that updated the channel
example: ChannelDepositTx
last_updated_time:
Expand Down
28 changes: 25 additions & 3 deletions docs/swagger_v3/contracts.spec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
schemas:
ContractInternalTx:
description: Contract internal transaction
type: object
oneOf:
- $ref: '#/components/schemas/ContractCreateTx'
- $ref: '#/components/schemas/NameClaimTx'
- $ref: '#/components/schemas/NamePreclaimTx'
- $ref: '#/components/schemas/NameUpdateTx'
- $ref: '#/components/schemas/NameTransferTx'
- $ref: '#/components/schemas/OracleExtendTx'
- $ref: '#/components/schemas/OracleQueryTx'
- $ref: '#/components/schemas/OracleRegisterTx'
- $ref: '#/components/schemas/OracleRespondTx'
- $ref: '#/components/schemas/SpendTx'
Contract:
description: Contract creation info
type: object
Expand All @@ -21,21 +35,28 @@ schemas:
source_tx_hash:
$ref: '#/components/schemas/TransactionHash'
source_tx_type:
type: string
description: Contract source transaction type
example: ContractCreateTx
type: string
enum:
- ContractCreateTx
- GaAttachTx
- PayingForTx
create_tx:
type: object
oneOf:
- $ref: '#/components/schemas/ContractCreateTx'
- $ref: '#/components/schemas/GAAttachTx'
example:
abi_version: 3
amount: 25123
call_data: "cb_+Q=="
code: "cb_+QrfRgOgbAwsRHU"
deposit: 0
fee: 13276000000000
gas: 200000
gas_price: 1000000000
nonce: 66
owner_id: ak_7wqP18AHzyoqymwGaqQp8G2UpzBCggYiq7CZdJiB71VUsLpR4
owner_id: ak_7wqP18AHzyoqymwGaqQp8G2UpzBCggYiq7CZdJiB71VUsLpR4
ttl: 0
vm_version: 5
ContractCall:
Expand Down Expand Up @@ -68,6 +89,7 @@ schemas:
example: 608269
internal_tx:
type: object
$ref: '#/components/schemas/ContractInternalTx'
example:
fee: 0
nonce: 0
Expand Down
Loading
Loading