Releases: aleph-im/pyaleph
v0.4.3
This release fixes a minor issue related to message processing introduced with v0.4.0.
How to upgrade
From 0.4.x
Download the new Docker Compose file
mv docker-compose.yml docker-compose-old.yml
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/v0.4.3/deployment/samples/docker-compose/docker-compose.yml"
Restart the node
docker-compose -f docker-compose-old.yml down
docker-compose -f docker-compose.yml up -d
From older versions
Follow the guide here.
v0.4.2
This release fixes default configuration values to make the transition to v0.4.x simpler.
How to upgrade
0.4.0 introduces a new service for P2P communication. This implies a few modifications to the configuration of your node.
Node private key file
This release includes a change in the private key format. The P2P service requires the key to be in PKCS8 DER format. This change is automatically managed in a migration script that you must run with the upgrade command (see below).
P2P topics
This release introduces new configuration options for the P2P service. The default configuration should work out of the box, but if you customized your install we advise to set the following configuration options. Append these options to your config.yml
file:
aleph:
queue_topic: ALEPH-TEST
p2p:
daemon_host: p2p-service
http_port: 4024
port: 4025
control_port: 4030
listen_port: 4031
reconnect_delay: 60
peers:
- /dns/api1.aleph.im/tcp/4025/p2p/Qmaxufiqdyt5uVWcy1Xh2nh3Rs3382ArnSP2umjCiNG2Vs
- /dns/api2.aleph.im/tcp/4025/p2p/QmZkurbY2G2hWay59yiTgQNaQxHSNzKZFt2jbnwJhQcKgV
Note that you are free to configure bootstrap peers as you wish. The two default servers listed above will fit most use cases.
RabbitMQ config
The Core Channel Node communicates with the new P2P service through an instance of RabbitMQ for P2P pubsub topics. We strongly advise to change the default username and password in the config.yml
and docker-compose.yml
files:
config.yml
rabbitmq:
host: rabbitmq
port: 5672
username: <new-username>
password: <new-password>
docker-compose.yml
services:
rabbitmq:
environment:
RABBITMQ_DEFAULT_USER: <new-username>
RABBITMQ_DEFAULT_PASS: <new-password>
Upgrade your node
From any version >= 0.2.0
Download the new Docker Compose file
mv docker-compose.yml docker-compose-old.yml
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/v0.4.2/deployment/samples/docker-compose/docker-compose.yml"
Stop, upgrade and restart the node
docker-compose -f docker-compose-old.yml down --remove-orphans
# Adapt if your config.yml and/or keys/ directory are in different places
docker run \
--entrypoint /opt/pyaleph/migrations/config_updater.py \
-v $(pwd)/keys:/opt/pyaleph/keys \
-v $(pwd)/config.yml:/opt/pyaleph/config.yml \
alephim/pyaleph-node:v0.4.2 \
--key-dir /opt/pyaleph/keys \
--key-file /opt/pyaleph/keys/node-secret.key \
--config /opt/pyaleph/config.yml \
upgrade \
--filter-scripts 0003*
docker-compose -f docker-compose.yml up -d
Alternatively, if you are encountering issues running the upgrade, you can simply generate the new key file with the following OpenSSL command:
docker-compose -f docker-compose-old.yml down --remove-orphans
cd keys/
openssl pkcs8 -topk8 -inform PEM -outform DER -in node-secret.key -out node-secret.pkcs8.der -nocrypt
docker-compose -f docker-compose.yml up -d
From any version < 0.2.0: https://pyaleph.readthedocs.io/en/latest/guides/upgrade.html
v0.4.1
This release fixes a minor issue of v0.4.0 where an improperly formatted message could be retried indefinitely.
What's Changed
- Fix: do not retry pending messages failing validation by @odesenfans in #348
Full Changelog: v0.4.0...v0.4.1
How to upgrade
0.4.0 introduces a new service for P2P communication. This implies a few modifications to the configuration of your node.
Node private key file
This release includes a change in the private key format. The P2P service requires the key to be in PKCS8 DER format. This change is automatically managed in a migration script that you must run with the upgrade command (see below).
P2P topics
This release introduces new configuration options for the P2P service. We advise to set the following configuration options. Append these options to your config.yml
file:
aleph:
queue_topic: ALEPH-TEST
p2p:
daemon_host: p2p-service
http_port: 4024
port: 4025
control_port: 4030
listen_port: 4031
reconnect_delay: 60
peers:
- /dns/api1.aleph.im/tcp/4025/p2p/Qmaxufiqdyt5uVWcy1Xh2nh3Rs3382ArnSP2umjCiNG2Vs
- /dns/api2.aleph.im/tcp/4025/p2p/QmZkurbY2G2hWay59yiTgQNaQxHSNzKZFt2jbnwJhQcKgV
Note that you are free to configure bootstrap peers as you wish. The two default servers listed above will fit most use cases.
RabbitMQ config
The Core Channel Node communicates with the new P2P service through an instance of RabbitMQ for P2P pubsub topics. We strongly advise to change the default username and password in the config.yml
and docker-compose.yml
files:
config.yml
rabbitmq:
host: rabbitmq
port: 5672
username: <new-username>
password: <new-password>
docker-compose.yml
services:
rabbitmq:
environment:
RABBITMQ_DEFAULT_USER: <new-username>
RABBITMQ_DEFAULT_PASS: <new-password>
Upgrade your node
From any version >= 0.2.0
Download the new Docker Compose file
mv docker-compose.yml docker-compose-old.yml
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/v0.4.1/deployment/samples/docker-compose/docker-compose.yml"
Stop, upgrade and restart the node
docker-compose -f docker-compose-old.yml down --remove-orphans
docker-compose -f docker-compose.yml \
run \
--entrypoint /opt/pyaleph/migrations/config_updater.py \
pyaleph \
--key-dir /opt/pyaleph/keys \
--key-file /opt/pyaleph/keys/node-secret.key \
--config /opt/pyaleph/config.yml \
upgrade
docker-compose -f docker-compose.yml up -d
From any version < 0.2.0: https://pyaleph.readthedocs.io/en/latest/guides/upgrade.html
v0.4.0
This release introduces the use of the Aleph.im P2P service to replace the libp2p daemon.
This is expected to reduce the load of core channel nodes significantly and fixes several performance issues.
The release also fixes several bugs linked to the validation of messages.
What's Changed
- Feature: use the Aleph.im P2P service by @odesenfans in #328
- [Messages] Use Pydantic message models everywhere by @odesenfans in #301
- Internal: Persistent VM messages were rejected by @hoh in #323
- Fix: avoid retrying improperly formatted FORGET messages by @odesenfans in #325
- [API] Remove MongoDB object ID from responses by @odesenfans in #266
- Chore: update kubo to v0.15.0 by @odesenfans in #322
Full Changelog: v0.3.3...v0.4.0
How to upgrade
Node private key file
This release includes a change in the private key format. The P2P service requires the key to be in PKCS8 DER format. This change is automatically managed in a migration script that you must run with the upgrade command (see below).
P2P topics
This release introduces new configuration options for the P2P service. We advise to set the following configuration options. Append these options to your config.yml
file:
aleph:
queue_topic: ALEPH-QUEUE
rabbitmq:
host: rabbitmq
port: 5672
RabbitMQ config
The Core Channel Node communicates with the new P2P service through an instance of RabbitMQ for P2P pubsub topics. We strongly advise to change the default username and password in the Docker Compose file:
services:
rabbitmq:
environment:
RABBITMQ_DEFAULT_USER: <new-username>
RABBITMQ_DEFAULT_PASS: <new-password>
And in the config.yml file:
rabbitmq:
username: <new-username>
password: <new-password>
From any version >= 0.2.0
Download the new Docker Compose file
mv docker-compose.yml docker-compose-old.yml
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/v0.4.0/deployment/samples/docker-compose/docker-compose.yml"
Stop, upgrade and restart the node
docker-compose down
docker-compose \
run \
--entrypoint /opt/pyaleph/migrations/config_updater.py \
pyaleph \
--key-dir /opt/pyaleph/keys \
--key-file /opt/pyaleph/keys/node-secret.key \
--config /opt/pyaleph/config.yml \
upgrade
docker-compose up -d
From any version < 0.2.0: https://pyaleph.readthedocs.io/en/latest/guides/upgrade.html
v0.3.3
What's Changed
- Feature: Add support for Tezos by @odesenfans in #306
- Feature: Validate messages on API POST by @odesenfans in #305
- Fix: float dates by @hoh in #314
Full Changelog: v0.3.2...v0.3.3
How to upgrade:
From any version >= 0.2.0
Download the new Docker Compose file
mv docker-compose.yml docker-compose-old.yml
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/v0.3.3/deployment/samples/docker-compose/docker-compose.yml"
Stop, upgrade and restart the node
docker-compose [-f <docker-compose-file>] down
docker-compose [-f <docker-compose-file>] \
run \
--entrypoint /opt/pyaleph/migrations/config_updater.py \
pyaleph \
--key-dir /opt/pyaleph/keys \
--key-file /opt/pyaleph/keys/node-secret.key \
--config /opt/pyaleph/config.yml \
upgrade
docker-compose [-f <docker-compose-file>] up -d
From any version < 0.2.0: https://pyaleph.readthedocs.io/en/latest/guides/upgrade.html
v0.3.2
This release fixes a synchronisation delay issue. The pending message job blocked
while waiting for the last pending messages in the queue to be processed. This caused
a delay of several hours until the job could loop again on the pending messages collection
and start processing new pending messages. We removed the blocking synchronisation point
and now let the job pick up new pending messages while ignoring the ones that are already
being processed.
How to upgrade: https://pyaleph.readthedocs.io/en/latest/guides/upgrade.html
v0.3.1
This release fixes a synchronisation issue introduced in 0.3.0. Messages where the "item_type"
field was not specified could not be processed in real-time and had to wait for the on-chain
confirmation to be processed.
How to upgrade: https://pyaleph.readthedocs.io/en/latest/guides/upgrade.html
v0.3.0 - Harder, Better, Faster, Stronger
This release focuses on improvements related to performance, stability and code quality. We also introduce new features related to FORGET and PROGRAM messages.
How to upgrade: https://pyaleph.readthedocs.io/en/latest/guides/upgrade.html
New features
- Ability to forget aggregates by @odesenfans in #289
- Add an API that exposes programs that respond to Aleph messages by @hoh in #230
- Specify max log file size by @odesenfans in #248
- Use property value for max_log_file_size by @odesenfans in #257
- [API] Add chain query parameter for messages by @odesenfans in #282
- [API] Add content hash query parameter for messages by @odesenfans in #284
Improvements
- [Messages] Improve throughput of jobs by @odesenfans in #278
- [Messages] Pydantic schema for message validation by @odesenfans in #272
- [Messages] Support default item type by @odesenfans in #287
- [Messages] Ignore confirmations in capped collection by @odesenfans in #252
- [DB] Use unordered bulk inserts by @odesenfans in #279
- [Chains] Use pending message model in signature verification by @odesenfans in #273
- [Forget] Fetch less data by @odesenfans in #276
- [Forget] Multi-users test by @odesenfans in #249
- [Jobs] Simplify pending TXs job by @odesenfans in #236
- [IPFS] Upgrade to v0.12.2 by @odesenfans in #225
- [Fix] Ignore invalid messages in messages job by @odesenfans in #246
- [Types] New dataclass for tx context by @odesenfans in #235
- [Permissions] Process unauthorized messages gracefully by @odesenfans in #258
- [Tests] Make API endpoints testable by @odesenfans in #260
- [Tests] Fixture to generate the test API client by @odesenfans in #263
- [Tests] Messages API tests by @odesenfans in #261
- [Migrations] Support for async upgrade functions by @odesenfans in #253
- [Migrations] Filter to select migration scripts by @odesenfans in #255
Other
- [Exceptions] Move old exceptions from types to exceptions by @odesenfans in #226
- [Readme] Fix link to install guide by @odesenfans in #243
- [Fix] Typo in monitoring Docker Compose file by @odesenfans in #244
- [Fix] Use collection of DB op in bulk write by @odesenfans in #245
- [TXs] Increase IPFS pin timeout to 2 minutes by @odesenfans in #251
- [mypy] Bump to 0.950 by @odesenfans in #259
- [Storage] Remove filename parameter by @odesenfans in #262
- [Tests] Use valid fixtures in forget tests by @odesenfans in #275
- [Types] Use ItemType defined in aleph-message by @odesenfans in #271
- [Monitoring] Fix Grafana dashboard time ranges by @odesenfans in #291
- [Docs] Improve protocol documentation by @odesenfans in #286
Full Changelog: v0.2.1...v0.3.0
v0.2.1
TLDR;
This minor release focuses on code improvements, improved test coverage and bug fixes.
Breaking changes
- CCNs now required Python 3.8+ instead of Python 3.6.
Changelog
- Improved the code for the storage module and improved test coverage.
- Fixed a major synchronisation issue between CCNs. A shared variable was not updated correctly, making it impossible
for CCNs to fetch the content linked to random messages. - Fixed an issue where IPFS/P2P jobs in charge of listening to the "alive" topics would not restart
once an error occurred. - Fixed an issue resulting in a KeyError if an IPFS pin timed out.
v0.2.0 Codename "Asimov, a new foundation."
TLDR;
- Support for FORGET messages
- A new dedicated service handles P2P connections
- Node private keys need to be migrated for the new service to work
- Many API improvements and fixes
Breaking changes
- This release requires a new way to manage private keys. The private key must now be provided in a new serialized format. Use the configuration updater to migrate to the new format.
- The "protocol" P2P config is disabled until further notice as it was not working properly.
- MongoDB becomes the only supported internal storage engine. RocksDB is not supported anymore.
Main features
FORGET message
This is a new type of message. It is designed to order the explicit deletion of a message by a user.
When a FORGET message is received by a node, it will immediately:
- remove the ‘content’ and ‘item_content’ sections of the targeted messages
- add a field ‘forgotten_by’ that references to the processed FORGET message
The FORGET message will only be accepted if either:
- the sender of the FORGET matches the ‘sender’ field of the message
- the targeted message was created by a VM and the sender of the FORGET matches the ‘sender’ of the VM
If the forgotten message is of type STORE, the number of references to the data will be counted.
If the new count amounts to zero, the file will be deleted from the database or unpinned and cleared from IPFS.
P2P daemon
P2P communication is now managed with the official libp2p daemon.
This allows us to get rid of a dependency to the unmaintained py-libp2p library.
This in turn enables many improvements. We:
- Moved to newer versions of many dependencies
- Resolved many bugs related to P2P communication
- Simplified the overall architecture of PyAleph.
API improvements
- Calling
/api/v0/messages.json
with unsupported fields returns a proper error message instead of the obscure 500 Internal Server Error - Improved reliability of the Websocket API
- New parameters to
/api/v0/messages.json
:contentKeys
,startDate
,endDate
.
Other changes
- The
--gen-key
option is renamed to--gen-keys
. It now stores the public key along with the private key, and a serialized version of the private key for use by the P2P daemon. - The private key for the P2P host can no longer be provided through the config.yml file using the
p2p.key
field. The key must be provided as a serialized file in thekeys
directory. - Decommissioned the dockerized VMs as they were replaced by the micro-VMs.
- Introduced a new tool called the configuration updater to manage changes in the configuration
files and key files between versions. - Fixed minor issues in the index page of the web service.
- Optimized the processing of messages by prioritizing new messages over messages that are waiting for a retry.
- Add support for a IPFS content identifier (CID) format version 1.
- Improve the reliability of the Websocket API
- A new API
/api/v0/storage/count/<storage-hash>
exposes the number of times a IPFS/storage hash is pinned - A new metric exposes the number of files pinned that belong to a chain and cannot be unpinned
- Operators can now distinguish the different processes of the node
- Fixed issues where errors could not be reported on Sentry
- Fixed an issue where the logging level was different in subprocesses