Giter VIP home page Giter VIP logo

meli's Introduction

p2panda

All the things a panda needs


This library provides all tools required to write a client, node or even your own protocol implementation for the p2panda network. It is shipped both as a Rust crate p2panda-rs with WebAssembly bindings and a NPM package p2panda-js with TypeScript definitions running in NodeJS or any modern web browser.

The core p2panda specification is fully functional but still under review so please be prepared for breaking API changes until we reach v1.0. Currently no p2panda implementation has recieved a security audit.

Features

  • Generate Ed25519 key pairs.
  • Create and encode Bamboo entries.
  • Publish schemas and validate data.
  • Create, update and delete data collaboratively.
  • Encrypt data with OpenMLS.
  • Materialise documents from data changes.
  • Prepare data for node servers.

Usage

import { KeyPair } from "p2panda-js";
const keyPair = new KeyPair();
console.log(keyPair.publicKey());
use p2panda_rs::identity::KeyPair;
let key_pair = KeyPair::new();
println!("{}", key_pair.public_key());

See the demo application and its source code. More examples can be found in the p2panda-rs and p2panda-js directories.

Installation

If you are using p2panda in web browsers or NodeJS applications run:

$ npm i p2panda-js

For Rust environments run:

$ cargo add p2panda-rs

Documentation

Visit the corresponding folders for development instructions and documentation:

Benchmarks

Performance benchmarks can be found in benches. You can run them using cargo-criterion:

$ cargo install cargo-criterion
$ cargo criterion
# An HTML report with plots is generated automatically
$ open target/criterion/reports/index.html

These benchmarks can be used to compare the performance across branches by running them first in a base branch and then in the comparison branch. The HTML-reports will include a comparison of the two results.

License

GNU Affero General Public License v3.0 AGPL-3.0-or-later

Supported by



This project has received funding from the European Union’s Horizon 2020 research and innovation programme within the framework of the NGI-POINTER Project funded under grant agreement No 871528 and NGI-ASSURE No 957073

meli's People

Contributors

achou11 avatar adzialocha avatar sandreae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

luandro

meli's Issues

Edit / Save behaviour and consistency

We currently have two different ways of allowing the user to Edit a field and Saving it:

  1. Click the "Edit" button in the header of the widget which then turns into a "Save" button, this can then be used to finalize the edit.
  2. Click the "Edit" button which then disappears, a "Save" and "Cancel" button is shown underneath the edit field (for example in the "Note" widget)

The first option is a little strange as a) You might want to cancel the action and not proceed b) Might be confusing that the same button changes it's meaning.

I can think of a third option as well which is:

  1. Have a global "Edit" button, for example in the top-bar of the screen which will toggle all widgets to go into edit mode, a global "Save" button and global "Cancel" button appear then as well

Tracking: Settings Screen

  • Basic Layout
  • Basic Screen Design
  • Switch language widget
  • Show basic system information (Android Version, CPU architecture etc., App Version)
  • #43

Nice to have

  • Show and burn private key
  • Show aquadoggo logs

Getting cargo errors when running `melos build`

Attempting to walk through the installation docs and when I run melos build, I get the following error from Cargo:

melos run build
  β””> bash scripts/build.sh
     β””> RUNNING

β—† Install Rust toolchain dependencies

    Updating crates.io index

     Ignored package `cargo-ndk v3.4.0` is already installed, use --force to override

    Updating crates.io index

  Installing cargo-expand v1.0.79

    Updating crates.io index

error: failed to compile `cargo-expand v1.0.79`, intermediate artifacts can be found at `/var/folders/3d/jpg9p2yn0t918hwkw50yrfxh0000gn/T/cargo-installjE8Dn7`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  package `clap_derive v4.5.0` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.73.0
  Try re-running cargo install with `--locked`

I had run this command once before and I thought it worked, although I think I was mistaken so I ran it again, encountering the error above.


Environment info:

OS: macOS 14.2.1 (Sonoma)
Cargo: 1.73.0 (9c4383fb5 2023-08-26)
Melos: 3.1.1

Unify action interactions for editing in sighting screen

Currently noticing 3 different approaches when it comes to performing an action related to editing:

  1. Controls only in card header: initiating edit mode is done by pressing the header. performing an edit action is done by pressing the header again. In this case there's no explicit "cancel" action.

    e.g. species_card.dart

    image image
  2. Controls only in bottom of card: initiating edit mode is done by pressing the header. the edit actions are presented as buttons in the bottom during edit mode.

    e.g. note_field.dart

    image image
  3. Controls in both header and bottom of card: initiating edit mode is done by pressing the header. the edit actions available in both the header and the button at the bottom during edit mode. There is no explicit cancel action.

    e.g. used_for_field.dart

    image image

(1) already existed when I started helping out. I introduced (2) based on what I saw in the mockups. @sandreae introduced (3) via #26 .

Think there should some some unification so the interaction experience is similar for all of these fields. I personally prefer (2) but I think it's more important to be consistent for now πŸ˜„ Wondering if there's been previous UX research/feedback to inform us.

Unhandled Exception when saving description widget with empty string

Steps to reproduce:

  1. Go to "Species Profile" screen
  2. Click "Edit" in Description Widget, don't enter anything in field
  3. Click "Edit" ("Save") button again

Error message:

E/flutter (12865): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
E/flutter (12865): #0      _TextFieldState._submit (package:app/ui/widgets/text_field.dart:51:34)
E/flutter (12865): #1      _TextFieldState._toggleEditMode.<anonymous closure> (package:app/ui/widgets/text_field.dart:65:9)
E/flutter (12865): #2      State.setState (package:flutter/src/widgets/framework.dart:1203:30)
E/flutter (12865): #3      _TextFieldState._toggleEditMode (package:app/ui/widgets/text_field.dart:62:5)
E/flutter (12865): #4      EditableCard._content.<anonymous closure> (package:app/ui/widgets/editable_card.dart:35:25)
E/flutter (12865): #5      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:344:24)
E/flutter (12865): #6      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:652:11)
E/flutter (12865): #7      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:309:5)
E/flutter (12865): #8      BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:279:7)
E/flutter (12865): #9      GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:167:27)
E/flutter (12865): #10     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:499:20)
E/flutter (12865): #11     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:475:22)
E/flutter (12865): #12     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:425:11)
E/flutter (12865): #13     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:420:7)
E/flutter (12865): #14     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:383:5)
E/flutter (12865): #15     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:330:7)
E/flutter (12865): #16     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:299:9)
E/flutter (12865): #17     _invoke1 (dart:ui/hooks.dart:328:13)
E/flutter (12865): #18     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442:7)
E/flutter (12865): #19     _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31)
E/flutter (12865): 

Fix potential race conditions in `BuildContext` detected by linter

We get the following linter errors when running melos analyze:

info - lib/ui/screens/create_sighting.dart:140:28 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check. - use_build_context_synchronously
info - lib/ui/screens/create_sighting.dart:146:28 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check. - use_build_context_synchronously
info - lib/ui/screens/settings.dart:60:28 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check. - use_build_context_synchronously
info - lib/ui/screens/settings.dart:64:15 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check. - use_build_context_synchronously
info - lib/ui/screens/settings.dart:71:28 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check. - use_build_context_synchronously

Refactor `PaginationList` and `InfiniteScrollList` into a single widget

We have two widgets doing essentially the same job except that one shows a "more" button which can be pressed to fetch the next page, and the other automatically fetches the next page on scroll end. PaginationList already has a builder for customising how the list items are displayed.

We could either decide we prefer one of the two behaviours (button press vs scroll end fetch) or make it so this is configurable behaviour.

"lazy" scrolling for nested scrollable widgets

Widgets which are in a scrollable view and are themselves scrollable cause UX issue where the inner widget intercepts a scroll action intended for the top level view. This occurs in widgets containing lists of items. The behaviour can be improved by only activating scroll on the inner widget "lazily", after the user requests more items in the displayed list by pressing a "show more" button.

Creating blob fails with "Read-only file system (os error 30)"

Maybe we need to actively ask for permission to use the file system?

D/MediaScannerConnection(26926): Scanned /data/user/0/com.p2panda.meli/cache/ae6a607b-faaa-4d2c-89cd-1844200874312169615943537887438.jpg to null
I/flutter (26926): [(datetime, OperationValue.string(field0: 2023-10-10 19:05:41.495875)), (latitude, OperationValue.float(field0: 0.0)), (longitude, OperationValue.float(field0: 0.0)), (images, OperationValue.relationList(field0: [002037c33a294cd2708dd1b61aaab3387668e3bdf06b44fcae84c1d5b57f87e97fbd])), (comment, OperationValue.string(field0: Some comment about this sighting)), (species, OperationValue.relationList(field0: [])), (local_names, OperationValue.relationList(field0: []))]
I/aquadoggo::materializ..(26926): Creating blob at path 002037c33a294cd2708dd1b61aaab3387668e3bdf06b44fcae84c1d5b57f87e97fbd
E/aquadoggo::materializ..(26926): Critical error in worker blob with task <QueueItem 290 w. <TaskInput -/002037c33a294cd2708dd1b61aaab3387668e3bdf06b44fcae84c1d5b57f87e97fbd>>: Could not create blob file @ 002037c33a294cd2708dd1b61aaab3387668e3bdf06b44fcae84c1d5b57f87e97fbd: Read-only file system (os error 30)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.