Python-slp - Side Ledger Protocol With Python

Overview

Side Ledger Protocol

Run python-slp node

First install Mongo DB and run the mongodb service:

sudo systemctl start mongod.service

Install python-slp node via easy installation script:

bash <(curl -s https://raw.githubusercontent.com/Moustikitos/python-slp/master/slp-install.sh)

python-slp node will then run as a background service on your system. Status and logs are accessible from systemctl and journalctl commands.

python-slp can also be launched on server startup:

sudo systemctl enable mongod.service
sudo systemctl enable slp.service

Settings

  • webhook has to be enabled on Ark relay
  • set webhook peer in ark.json file

if python-slp is running on a standalone node

  • node ip where python-slp is installed has to be whitelisted by the Ark relay

Custom deployment

python-slp is configured for Ark blockchain on port 5200 and 5100. To deploy node and api with a specific Ark-fork, copy ark.json to name.json in package directory where name is the name of the targeted blockchain. Then edit created json file accordingly and deploy:

python -c "import app;app.deploy(host='127.0.0.1', port=5243, blockchain='name')"
python -c "import slp.api;slp.api.deploy(host='127.0.0.1', port=5124, blockchain='name')"

Where name is the basename of json configuration used to store specific blockchain parameters.

Webhook management

Webhook subsciption is done on python-slp launch. It can also be created/removed with:

python -c "import app;app.init('name');app.sync.chain.subscribe()"
python -c "import app;app.init('name');app.sync.chain.unsubscribe()"

API endpoint for slp database

An endpoint is available to get data from mongo database with the pattern:

/<table_name>/find[?field=value&..][&operator_field=op:value&..][&orderBy=field_i:direction_i,..][&page=number]

Where:

  • op is one of eq, neg, gt, gte, lt, lte
  • direction desc or reversed (default is asc)
table name fields operator fields
slp1 address, tokenId, blockStamp, owner, frozen balance
slp2 address, tokenId, blockStamp, owner, frozen
journal slp_type, emitter, receiver, legit, tp, sy, id, pa, mi qt
contracts tokenId, height, index, type, owner, paused, symbol minted, burned, exited, globalSupply
rejected tokenId, height, index, type, owner, paused, symbol minted, burned, exited, globalSupply
curl http://127.0.0.1:5100/slp2/find?tokenId=0c1b5ed5cff799a0dee2cadc6d02ac60
{
  "status": 200,
  "meta": {
    "page": 1,
    "totalPage": 1,
    "count": 2,
    "totalCount": 2
  },
  "data": [
    {
      "address": "ARypXg91KdTCFxUCtjktZMdDEne3AcA8A7",
      "tokenId": "0c1b5ed5cff799a0dee2cadc6d02ac60",
      "blockStamp": "17902732#1",
      "owner": false,
      "metadata": {
        "trait_background": "ice",
        "trait_base": "zombie",
        "trait_clothing": "astronaut",
        "trait_face": "angry",
        "trait_hat": "beanie"
      }
    },
    {
      "address": "AR2xF13MYMnTKGiqF5Z6oNp1nMue9Qpp84",
      "tokenId": "0c1b5ed5cff799a0dee2cadc6d02ac60",
      "blockStamp": "17902732#1",
      "owner": true,
      "metadata": {}
    }
  ]
}

Releases

current work

  • full SLP2 contract execution
  • SIGTEMR securely handled
  • run slp API separately
  • ubuntu install script
  • blockchain syncer
  • full SLP1 contract execution
  • mongo db api
  • TODO:
    • test suite
    • documentation
    • use websocket to sync slp database
    • slp database rebuild before sync process
    • p2p messaging
    • improve logging messages
You might also like...
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.

Best-of Python Developer Tools 🏆 A ranked list of awesome python developer tools and libraries. Updated weekly. This curated list contains 250 awesom

Run `black` on python code blocks in documentation files

blacken-docs Run black on python code blocks in documentation files. install pip install blacken-docs usage blacken-docs provides a single executable

Legacy python processor for AsciiDoc

AsciiDoc.py This branch is tracking the alpha, in-progress 10.x release. For the stable 9.x code, please go to the 9.x branch! AsciiDoc is a text docu

📖  Generate markdown API documentation from Google-style Python docstring. The lazy alternative to Sphinx.
📖 Generate markdown API documentation from Google-style Python docstring. The lazy alternative to Sphinx.

lazydocs Generate markdown API documentation for Google-style Python docstring. Getting Started • Features • Documentation • Support • Contribution •

A Python module for creating Excel XLSX files.
A Python module for creating Excel XLSX files.

XlsxWriter XlsxWriter is a Python module for writing files in the Excel 2007+ XLSX file format. XlsxWriter can be used to write text, numbers, formula

API spec validator and OpenAPI document generator for Python web frameworks.

API spec validator and OpenAPI document generator for Python web frameworks.

Materi workshop
Materi workshop "Light up your Python!" Himpunan Mahasiswa Sistem Informasi Fakultas Ilmu Komputer Universitas Singaperbangsa Karawang, 4 September 2021 (Online via Zoom).

Workshop Python UNSIKA 2021 Materi workshop "Light up your Python!" Himpunan Mahasiswa Sistem Informasi Fakultas Ilmu Komputer Universitas Singaperban

Exercism exercises in Python.

Exercism exercises in Python.

This is a repository for "100 days of code challenge" projects. You can reach all projects from beginner to professional which are written in Python.

100 Days of Code It's a challenge that aims to gain code practice and enhance programming knowledge. Day #1 Create a Band Name Generator It's actually

Owner
Solar
Solar
Python Eacc is a minimalist but flexible Lexer/Parser tool in Python.

Python Eacc is a parsing tool it implements a flexible lexer and a straightforward approach to analyze documents.

Iury de oliveira gomes figueiredo 60 Nov 16, 2022
Repository for learning Python (Python Tutorial)

Repository for learning Python (Python Tutorial) Languages and Tools ?? Overview ?? Repository for learning Python (Python Tutorial) Languages and Too

Swiftman 2 Aug 22, 2022
A python package to avoid writing and maintaining duplicated python docstrings.

docstring-inheritance is a python package to avoid writing and maintaining duplicated python docstrings.

Antoine Dechaume 15 Dec 7, 2022
advance python series: Data Classes, OOPs, python

Working With Pydantic - Built-in Data Process ========================== Normal way to process data (reading json file): the normal princiople, it's f

Phung Hưng Binh 1 Nov 8, 2021
A comprehensive and FREE Online Python Development tutorial going step-by-step into the world of Python.

FREE Reverse Engineering Self-Study Course HERE Fundamental Python The book and code repo for the FREE Fundamental Python book by Kevin Thomas. FREE B

Kevin Thomas 7 Mar 19, 2022
A simple USI Shogi Engine written in python using python-shogi.

Revengeshogi My attempt at creating a USI Shogi Engine in python using python-shogi. Current State of Engine Currently only generating random moves us

null 1 Jan 6, 2022
Python-samples - This project is to help someone need some practices when learning python language

Python-samples - This project is to help someone need some practices when learning python language

Gui Chen 0 Feb 14, 2022
Valentine-with-Python - A Python program generates an animation of a heart with cool texts of your loved one

Valentine with Python Valentines with Python is a mini fun project I have coded.

Niraj Tiwari 4 Dec 31, 2022
A curated list of awesome tools for Sphinx Python Documentation Generator

Awesome Sphinx (Python Documentation Generator) A curated list of awesome extra libraries, software and resources for Sphinx (Python Documentation Gen

Hyunjun Kim 831 Dec 27, 2022
API Documentation for Python Projects

API Documentation for Python Projects. Example pdoc -o ./html pdoc generates this website: pdoc.dev/docs. Installation pip install pdoc pdoc is compat

mitmproxy 1.4k Jan 7, 2023