abaxxidgo

package module
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

ID++ Protocol

Introduction

This repository contains ID++ a reference implementation of Decentralized Web Node (DWN) as per the specification. This specification is in a draft state and very much so a WIP. For the foreseeable future, a lot of the work on DWN will be split across this repo and the repo that houses the specification.

Proposals and issues for the specification itself should be submitted as pull requests.

Documentation

Usage

./bin/abaxx-id is a CLI tool that allows you to create and manage DIDs, DWNs, and VCs.

Integration Readme's

SQL Message Store

The SQL message store provides a persistent storage implementation for DWN messages. Here's how to use it:

Installation

First, ensure you have a supported SQL database (e.g., PostgreSQL) installed and running.

Basic Usage
import (
    "github.com/abaxx/abaxx-id-go/pkg/store"
)

// Configure the message store
config := store.MessageStoreSQLConfig{
    DriverName:     "postgres",
    DataSourceName: "postgres://user:password@localhost:5432/dbname?sslmode=disable",
}

// Create a new message store instance
messageStore, err := store.NewMessageStoreSQL(config)
if err != nil {
    log.Fatal(err)
}

// Initialize the database schema
err = messageStore.Open()
if err != nil {
    log.Fatal(err)
}
defer messageStore.Close()

// Store a message
message := map[string]interface{}{
    "content": "Hello, World!",
    "type": "text/plain",
}
indexes := store.KeyValues{
    "interface": "MessagesInterface",
    "method": "Create",
    "dateCreated": time.Now().String(),
}
err = messageStore.Put("tenant1", message, indexes, nil)

// Query messages
filters := []store.Filter{
    {
        Property: "interface",
        Operator: "=",
        Value: "MessagesInterface",
    },
}
sort := &store.MessageSort{
    Property: "dateCreated",
    Direction: "DESC",
}
pagination := &store.Pagination{
    Limit: 10,
}
messages, cursor, err := messageStore.Query("tenant1", filters, sort, pagination, nil)
Features
  • CRUD operations for DWN messages
  • Multi-tenant support
  • Flexible querying with filters
  • Sorting and pagination
  • Support for message indexing
  • CBOR encoding for efficient storage
Database Schema

The message store automatically creates the necessary database schema when Open() is called. The schema includes:

  • Message content storage
  • Index fields for efficient querying
  • Support for encoded data and metadata

For more details about the implementation, see messagestore-sql.go.

Documentation

Index

Constants

View Source
const Version = "0.1.6"

Version is the current version of the abaxx-id-go library

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
pkg
crypto
Package crypto provides the following functionality: * Key Generation: secp256k1, ed25519 * Signing: secp256k1, ed25519 * Verification: secp256k1, ed25519 * A KeyManager abstraction that can be leveraged to manage/use keys (create, sign etc) as desired per the given use case
Package crypto provides the following functionality: * Key Generation: secp256k1, ed25519 * Signing: secp256k1, ed25519 * Verification: secp256k1, ed25519 * A KeyManager abstraction that can be leveraged to manage/use keys (create, sign etc) as desired per the given use case
crypto/dsa/eddsa
Package eddsa implements the EdDSA signature schemes as per RFC 8032 https://tools.ietf.org/html/rfc8032.
Package eddsa implements the EdDSA signature schemes as per RFC 8032 https://tools.ietf.org/html/rfc8032.
dwn
jwk
Package jwk implements a subset of the JSON Web Key spec (https://tools.ietf.org/html/rfc7517)
Package jwk implements a subset of the JSON Web Key spec (https://tools.ietf.org/html/rfc7517)
jws
jwt
vc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL