Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @fabric-es/operator

operator

Installation

yarn install @fabric-es/operator

Type aliases

CreateNetworkOperatorOption

CreateNetworkOperatorOption: object

Type declaration

  • caAdmin: string
  • caAdminPW: string
  • caName: string
  • channelName: string
  • connectionProfile: string
  • mspId: string
  • wallet: Wallet

EnrollAdminOption

EnrollAdminOption: object
about

enroll admin option

Type declaration

  • caName: string
  • connectionProfile: string
  • enrollmentID: string
  • enrollmentSecret: string
  • mspId: string
  • wallet: Wallet

NetworkOperator

NetworkOperator: object
about

network operator

Type declaration

  • getQueries: function
    about

    some queries

    param
      • (option?: object): Promise<Queries>
      • Parameters

        • Optional option: object
          • asLocalhost: boolean

        Returns Promise<Queries>

  • identityService: function
    about

    identiy server of Fabric CA server

    param
      • (option?: object): Promise<object>
      • Parameters

        • Optional option: object
          • asLocalhost: boolean

        Returns Promise<object>

  • registerAndEnroll: function
    about

    register and enroll user of Fabric CA server

    param
      • (option: object): Promise<object>
      • Parameters

        • option: object
          • Optional asLocalhost?: boolean
          • enrollmentId: string
          • enrollmentSecret: string
          • Optional eventHandlerStrategies?: any
          • Optional queryHandlerStrategies?: any

        Returns Promise<object>

  • submitOrEvaluateTx: function
    about

    submit or transaction transaction

    param
      • (option: object): Promise<object>
      • Parameters

        • option: object
          • Optional args?: string[]
          • asLocalhost: boolean
          • chaincodeId: string
          • Optional eventHandlerStrategies?: any
          • fcn: string
          • identity: string
          • Optional queryHandlerStrategies?: any

        Returns Promise<object>

Queries

Queries: object

Type declaration

  • disconnect: function
      • (): void
      • Returns void

  • getMspid: function
      • (): string
      • Returns string

Variables

Const CLOUD

CLOUD: 4 = 4

Const CONSOLE

CONSOLE: 1 = 1

Const FILE

FILE: 2 = 2

Const appendTimestamp

appendTimestamp: FormatWrap = format((info, opts) => {if (opts.tz) info.timestamp = moment().tz(opts.tz).format();return info;})

combine

combine: combine

label

label: label

Const logFormat

logFormat: Format = printf(({ level, message, label, timestamp }) => {return `${timestamp} [${level}]: ${message} (${label})`;})

Const loggers

loggers: Record<string, Logger>

printf

printf: printf

Functions

Const createCommitId

  • createCommitId(): string
  • about

    create commit id

    Returns string

Const createNetworkOperator

Const enrollAdmin

  • Parameters

    Returns Promise<any>

Const getFabricCaService

  • getFabricCaService(connectionProfile: string, caName: string): Promise<FabricCAServices>
  • about

    get Fabric CA service

    Parameters

    • connectionProfile: string
    • caName: string

    Returns Promise<FabricCAServices>

Const getGateway

  • getGateway(option: object): Promise<Gateway>
  • about

    get gateway

    Parameters

    • option: object
      • asLocalhost: boolean
      • connectionProfile: string
      • identity: string
      • wallet: Wallet

    Returns Promise<Gateway>

Const getLogger

  • getLogger(__namedParameters: object): Logger
  • Parameters

    • __namedParameters: object
      • level: string
      • name: string
      • target: string
      • timezone: string

    Returns Logger

Const isCommitRecord

  • isCommitRecord(input: unknown): input
  • about

    typeGuard

    Parameters

    • input: unknown

    Returns input

Const prepareOrgKeys

  • prepareOrgKeys(__namedParameters: object): Promise<object>
  • Parameters

    • __namedParameters: object
      • curve: string
      • keyPath: string

    Returns Promise<object>

Const readKey

  • readKey(keyPath: string, isPrivate?: boolean): Promise<string>
  • Parameters

    • keyPath: string
    • Default value isPrivate: boolean = false

    Returns Promise<string>

Const verify

  • verify(ec: ec, prv: string, pub: string): boolean
  • Parameters

    • ec: ec
    • prv: string
    • pub: string

    Returns boolean