Skip to main content

Pure Python implementation of the RAFT concencous algorithm

Project description

pyraftlog is a RAFT consensus algorithm implementation that provides direct access to the consensus log.

Mock Server

There is a mock server that can be run by calling pyraftlog-mock:

-h, --help              show the help message
-t TYPE, --type TYPE    Type of the node {active,reluctant,passive}
-n NODE, --node NODE   (host:)?port of this node. e.g.: 7001 or localhost:7001
-b NEIGHBOURS, --neighbours NEIGHBOURS  Port(s) of neighbours.
-c COMMAND, --command COMMAND   Port for receiving commands
-l LOG_LEVEL, --log-level LOG_LEVEL Logging level
-f FILE, --file FILE    File to be used as storage (default ./<node_name>.pickle)

Create SSL certs (for mock)

The following set of commands (performed in pyraftlog/certs/) will create a set a CA and device certificate for running the mock cluster on localhost:

# Only do once: generate the root CA key:
> openssl genrsa -out ca.key 4096

# Generate the root CA certificate:
## Country Name (2 letter code) []:GB
## State or Province Name (full name) []:.
## Locality Name (eg, city) []:.
## Organization Name (eg, company) []:.
## Organizational Unit Name (eg, section) []:.
## Common Name (eg, fully qualified host name) []:PyRaftLog
## Email Address []:.
> openssl req -x509 -new -nodes -key ca.key -sha256 -days 1024 -out ca.pem

# Generate device certificates
# Only do once: generate device key:
> openssl genrsa -out localhost.key 4096

# Generate device certificate signing request:
## Country Name (2 letter code) []:GB
## State or Province Name (full name) []:.
## Locality Name (eg, city) []:.
## Organization Name (eg, company) []:.
## Organizational Unit Name (eg, section) []:.
## Common Name (eg, fully qualified host name) []:localhost
## Email Address []:.
> openssl req -new -key localhost.key -out localhost.csr

# Generate a signed device certificate:
> openssl x509 -req -in localhost.csr -CA ca.pem -CAkey ca.key -CAcreateserial -out localhost.crt -days 500 -sha256

Also See

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyraftlog-1.1.0.tar.gz (18.3 kB view details)

Uploaded Source

File details

Details for the file pyraftlog-1.1.0.tar.gz.

File metadata

  • Download URL: pyraftlog-1.1.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for pyraftlog-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f186e9604188e74c4f6aa6be94f9f3b60a40b652a962ddbfca1e348d256f8610
MD5 2646b16c7a5439a8da66c24fb7b56f67
BLAKE2b-256 a909bc0a5b4eb43dbdaa6b5e9be2cb016616b3fe899fa8c4f5cff0c18433f206

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page