fabric

package
v0.0.0-...-ce092e3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 8 Imported by: 0

README

fabric-invoke Trigger

Fix flogo-web

To use this trigger with flogo-web UI, you need to fix the flogo-web docker image as follows:

First, start flogo-web, i.e.,

docker run -it -p 3303:3303 flogo/flogo-docker eula-accept

Then, in a second terminal, find the docker container and fix it as follows:

docker exec -it $(docker ps | grep "flogo/flogo-docker" | awk '{print $1}') bash
apk add --no-cache musl-dev
cd /tmp/flogo-web/build/server/local/engines/flogo-web/src/flogo-web
rm -Rf Gopkg.* vendor

Edit the file imports.go to add the following line to force dependency on hyperledger fabric shim:

    _ "github.com/hyperledger/fabric/core/chaincode/shim"

Rebuild the flogo-web, and exit the docker container:

export GOPATH=/tmp/flogo-web/build/server/local/engines/flogo-web
dep init
go build -o ../../bin/flogo-web
exit

Finally, you can save the image for later use from another terminal, i.e.,

docker commit $(docker ps | grep "flogo/flogo-docker" | awk '{print $1}') new/flogo-docker

Documentation

Index

Constants

View Source
const (

	// FabricStub is the name of flow property for passing chaincode stub to activities
	FabricStub = "_chaincode_stub"
)

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(md *trigger.Metadata) trigger.Factory

NewFactory create a new Trigger factory

Types

type Trigger

type Trigger struct {
	// contains filtered or unexported fields
}

Trigger is a stub for your Trigger implementation

func GetTrigger

func GetTrigger(fn string) (*Trigger, bool)

GetTrigger returns the cached trigger for a specified function name; return false in the second value if no trigger is cached for the specified fn

func (*Trigger) Initialize

func (t *Trigger) Initialize(ctx trigger.InitContext) error

Initialize implements trigger.Init.Initialize

func (*Trigger) Invoke

func (t *Trigger) Invoke(stub shim.ChaincodeStubInterface, fn string, args []string) (string, error)

Invoke starts the trigger and invokes the action registered in the handler, and returns result as JSON string

func (*Trigger) Metadata

func (t *Trigger) Metadata() *trigger.Metadata

Metadata implements trigger.Trigger.Metadata

func (*Trigger) Start

func (t *Trigger) Start() error

Start implements trigger.Trigger.Start

func (*Trigger) Stop

func (t *Trigger) Stop() error

Stop implements trigger.Trigger.Start

type TriggerFactory

type TriggerFactory struct {
	// contains filtered or unexported fields
}

TriggerFactory Fabric Trigger factory

func (*TriggerFactory) New

func (t *TriggerFactory) New(config *trigger.Config) trigger.Trigger

New Creates a new trigger instance for a given id

Jump to

Keyboard shortcuts

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