frostfsid

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package frostfsid

FrostFSID contract is a contract deployed in FrostFS sidechain.

Contract notifications

FrostFSID contract does not produce notifications to process.

Contract storage scheme

|   Key                                                                        | Value                          |           Description                         |
|------------------------------------------------------------------------------|--------------------------------|-----------------------------------------------|
| `o` + [ owner address ]                                                      | []byte{1}                      | contract owners that can invoke write methods |
| `s` + [ subject address ]                                                    | Serialized Subject structure   | subject into                                  |
| `a` + [ pk address ] + [ subject address ]                                   | []byte{1}                      | link extra public keys for subject            |
| `n` + [ RIPEMD160 of namespace ]                                             | Serialized Namespace structure | namespace info                                |
| `N` + [ RIPEMD160 of namespace ] + [ subject address ]                       | []byte{1}                      | subject that belongs to the namespace         |
| `l` + [ RIPEMD160 of namespace ] + [ RIPEMD160 of subject name ]             | Subject public key             | subject name to public key index              |
| `g` + [ RIPEMD160 of namespace ] + [ 8 byte group id ]                       | Serialized Group structure     | group into                                    |
| `G` + [ RIPEMD160 of namespace ] + [ 8 byte group id ] + [ subject address ] | []byte{1}                      | subject that belongs to the group             |
| `c`                                                                          | Int                            | group id counter                              |
| `m` + [ RIPEMD160 of namespace ] + [ RIPEMD160 of subject name ]             | Serialized group id int        | group name to group id index                  |

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubjectKey added in v0.19.0

func AddSubjectKey(addr interop.Hash160, key interop.PublicKey)

func AddSubjectToGroup added in v0.19.0

func AddSubjectToGroup(addr interop.Hash160, groupID int)

func ClearAdmin added in v0.19.0

func ClearAdmin()

func CreateGroup added in v0.19.0

func CreateGroup(ns, group string) int

func CreateNamespace added in v0.19.0

func CreateNamespace(ns string)

func CreateSubject added in v0.19.0

func CreateSubject(ns string, key interop.PublicKey)

func DeleteGroup added in v0.19.0

func DeleteGroup(ns string, groupID int)

func DeleteGroupKV added in v0.19.0

func DeleteGroupKV(ns string, groupID int, key string)

func DeleteSubject added in v0.19.0

func DeleteSubject(addr interop.Hash160)

func DeleteSubjectKV added in v0.19.0

func DeleteSubjectKV(addr interop.Hash160, key string)

func GetAdmin added in v0.19.0

func GetAdmin() interop.Hash160

func GetGroupIDByName added in v0.19.0

func GetGroupIDByName(ns, name string) int

func GetSubjectKeyByName added in v0.19.0

func GetSubjectKeyByName(ns, name string) interop.PublicKey

func ListGroupSubjects added in v0.19.0

func ListGroupSubjects(ns string, groupID int) iterator.Iterator

func ListGroups added in v0.19.0

func ListGroups(ns string) iterator.Iterator

func ListNamespaceSubjects added in v0.19.0

func ListNamespaceSubjects(ns string) iterator.Iterator

func ListNamespaces added in v0.19.0

func ListNamespaces() iterator.Iterator

func ListSubjects added in v0.19.0

func ListSubjects() iterator.Iterator

func RemoveSubjectFromGroup added in v0.19.0

func RemoveSubjectFromGroup(addr interop.Hash160, groupID int)

func RemoveSubjectKey added in v0.19.0

func RemoveSubjectKey(addr interop.Hash160, key interop.PublicKey)

func SetAdmin added in v0.19.0

func SetAdmin(addr interop.Hash160)

func SetGroupKV added in v0.19.0

func SetGroupKV(ns string, groupID int, key, val string)

func SetGroupName added in v0.19.0

func SetGroupName(ns string, groupID int, name string)

func SetSubjectKV added in v0.19.0

func SetSubjectKV(addr interop.Hash160, key, val string)

func SetSubjectName added in v0.19.0

func SetSubjectName(addr interop.Hash160, name string)

func Update

func Update(script []byte, manifest []byte, data any)

Update method updates contract source code and manifest. It can be invoked only by committee.

func Version

func Version() int

Version returns the version of the contract.

Types

type Group added in v0.19.0

type Group struct {
	ID        int
	Name      string
	Namespace string
	KV        map[string]string
}

func GetGroup added in v0.19.0

func GetGroup(ns string, groupID int) Group

func GetGroupByName added in v0.19.0

func GetGroupByName(ns, name string) Group

type GroupExtended added in v0.19.0

type GroupExtended struct {
	ID            int
	Name          string
	Namespace     string
	KV            map[string]string
	SubjectsCount int
}

func GetGroupExtended added in v0.19.0

func GetGroupExtended(ns string, groupID int) GroupExtended

type Namespace added in v0.19.0

type Namespace struct {
	Name string
}

func GetNamespace added in v0.19.0

func GetNamespace(ns string) Namespace

type NamespaceExtended added in v0.19.0

type NamespaceExtended struct {
	Name          string
	GroupsCount   int
	SubjectsCount int
}

func GetNamespaceExtended added in v0.19.0

func GetNamespaceExtended(ns string) NamespaceExtended

type Subject added in v0.19.0

type Subject struct {
	PrimaryKey     interop.PublicKey
	AdditionalKeys []interop.PublicKey
	Namespace      string
	Name           string
	KV             map[string]string
}

func GetSubject added in v0.19.0

func GetSubject(addr interop.Hash160) Subject

func GetSubjectByKey added in v0.19.0

func GetSubjectByKey(key interop.PublicKey) Subject

func GetSubjectByName added in v0.19.0

func GetSubjectByName(ns, name string) Subject

type SubjectExtended added in v0.19.0

type SubjectExtended struct {
	PrimaryKey     interop.PublicKey
	AdditionalKeys []interop.PublicKey
	Namespace      string
	Name           string
	KV             map[string]string
	Groups         []Group
}

func GetSubjectExtended added in v0.19.0

func GetSubjectExtended(addr interop.Hash160) SubjectExtended

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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