-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: python safenode module #2425
Conversation
Adds Python bindings using PyO3 to allow direct programmatic control of safenode instances. This enables Python applications to create and manage Safe Network nodes without using the CLI or RPC interface. Key changes: - Add PyO3 integration and module structure - Implement SafeNode Python class with core node functionality - Add proper error handling and type conversions - Include example code and documentation - Add maturin build configuration
Adds comprehensive storage operations to the Python bindings, allowing direct manipulation of node storage from Python applications. Key changes: - Add store_record() method for storing chunks with proper type handling - Add get_record() method for retrieving stored data - Add delete_record() method for removing stored data - Add get_stored_records_size() for storage statistics - Fix RecordKey and NetworkAddress type conversions - Update example.py with storage operation demonstrations - Update README with storage operation documentation The storage operations now properly handle: - Hex key conversions - Record type validation - Proper Kad record creation - Network address and record key conversions - Error handling and type safety Example usage: ```python node.store_record("1234abcd", b"Hello Network!", "chunk") data = node.get_record("1234abcd") size = node.get_stored_records_size() ```
This reverts commit 66b575d.
…gs"" This reverts commit 359029d.
Merge branch 'temp' into python
Also added flags to prevent publish of python workflows for now.
|
||
on: | ||
push: | ||
tags: | ||
- 'XXX*' | ||
- '*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would trigger the workflow when any tag is pushed. I don't think we want this.
For now, I would just remove the whole trigger from the workflow. We can come back to this when we incorporate the bindings into the release process.
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
- '*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would trigger the workflow when any tag is pushed. I don't think we want this.
For now, I would just remove the whole trigger from the workflow. We can come back to this when we incorporate the bindings into the release process.
Description
Please provide a brief description of the changes made in this pull request. Highlight the purpose of the changes and the problem they address.
Related Issue
Fixes #<issue_number> (if applicable).
Type of Change
Please mark the types of changes made in this pull request.
Checklist
Please ensure all of the following tasks have been completed: