ledger

package
v0.30.75 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Overview

Package ledger is corresponding Go package for libindy's ledger namespace. We suggest that you read indy SDK documentation for more information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAttribRequest

func BuildAttribRequest(sDID, tDID, hasc, raw, enc string) ctx.Channel

BuildAttribRequest is a libindy wrapper function. See more information from indy SDK documentation.

The function builds a ledger transaction message which will be send to it with SignAndSubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, WriteSchema,...).

func BuildCredDefRequest

func BuildCredDefRequest(submitter, data string) ctx.Channel

BuildCredDefRequest builds an CRED_DEF request. Request to add a Credential Definition (in particular, public key), that Issuer creates for a particular Credential Schema.

Note! You should us WriteSchema, WriteDID, ... instead.

func BuildGetAttribRequest

func BuildGetAttribRequest(sDID, tDID, hasc, raw, enc string) ctx.Channel

BuildGetAttribRequest is a libindy wrapper function. See more information from indy SDK documentation.

The function builds a ledger transaction message which will be send to it with SubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, WriteSchema,...).

func BuildGetCredDefRequest

func BuildGetCredDefRequest(submitter, id string) ctx.Channel

BuildGetCredDefRequest builds a GET_CRED_DEF request. Request to get a Credential Definition (in particular, public key), that Issuer creates for a particular Credential Schema.

Note! You should us WriteSchema, WriteDID, ... instead.

func BuildGetNymRequest

func BuildGetNymRequest(submitterDid, targetDid string) ctx.Channel

BuildGetNymRequest is a libindy wrapper function. See more information from indy SDK documentation.

The function builds a ledger transaction message which will be send to it with SubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, WriteSchema,...).

func BuildGetSchemaRequest

func BuildGetSchemaRequest(submitter, id string) ctx.Channel

BuildGetSchemaRequest is a libindy wrapper function. See more information from indy SDK documentation.

The function builds a ledger transaction message which will be send to it with SubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, WriteSchema,...).

func BuildNymRequest

func BuildNymRequest(submitterDid, targetDid, verkey, alias, role string) ctx.Channel

BuildNymRequest is a libindy wrapper function. See more information from indy SDK documentation.

The function builds a ledger transaction message which will be send to it with SignAndSubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, WriteSchema,...).

func BuildSchemaRequest

func BuildSchemaRequest(submitterDid, data string) ctx.Channel

BuildSchemaRequest is a libindy wrapper function. See more information from indy SDK documentation.

The function builds a ledger transaction message which will be send to it with SighAndSubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, WriteSchema,...).

func ParseGetCredDefResponse

func ParseGetCredDefResponse(credDefResp string) ctx.Channel

ParseGetCredDefResponse is a libindy wrapper function. See more information from indy SDK documentation.

The function parses the results from SubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, ReadCredDef,...).

func ParseGetSchemaResponse

func ParseGetSchemaResponse(response string) ctx.Channel

ParseGetSchemaResponse is a libindy wrapper function. See more information from indy SDK documentation.

The function parses the results from SubmitRequest. Note that in normal cases, you should not use it for leger communication. You should use the special transaction functions from this package (e.g. ReadSchema, ReadCredDef,...).

func ReadCredDef

func ReadCredDef(
	_ int,
	submitter,
	credDefID string,
) (
	cdID,
	cd string,
	err error,
)

ReadCredDef reads cred def from ledgers by cred def ID. If multiple ledger plugins is used, it returns where it can find data first.

func ReadSchema

func ReadSchema(_ int, submitter, ID string) (sID, s string, err error)

ReadSchema reads schema from ledgers by ID. If multiple ledger plugins is used, it returns where it can find data first.

func SignAndSubmitRequest

func SignAndSubmitRequest(pool, wallet int, submitterDid, request string) ctx.Channel

SignAndSubmitRequest Signs and submits request message to validator pool.

Adds submitter information to passed request json, signs it with submitter sign key (see wallet_sign), and sends signed request message to validator pool (see write_request).

Note! You should us WriteSchema, WriteDID, ... instead.

func SubmitRequest

func SubmitRequest(poolHandle int, request string) ctx.Channel

SubmitRequest publishes request message to validator pool (no signing, unlike sign_and_submit_request).

The request is sent to the validator pool as is. It's assumed that it's already prepared.

Note! You should us WriteSchema, WriteDID, ... instead.

func WriteCredDef

func WriteCredDef(
	_,
	wallet int,
	submitter,
	credDef string,
) (err error)

WriteCredDef writes cred def to ledger. If multiple ledger plugins is in use, it writes data to all of them.

func WriteDID

func WriteDID(
	_,
	wallet int,
	submitterDID,
	targetDID,
	verKey,
	alias,
	role string,
) (err error)

WriteDID writes DID to ledger. If multiple ledger plugins in in use, it writes to all of them. Note! There are no ReadDID yet, because it is not used explicitly. Some of the indy SDK functions read ledger implicitly like did_get_key().

func WriteSchema

func WriteSchema(
	_ int,
	wallet int,
	submitter string,
	scJSON string,
) (err error)

WriteSchema writes schema to ledger. If multiple ledger plugins is in use, it writes to all of them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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