diff --git a/.circleci/config.yml b/.circleci/config.yml index d86056974..a90698af0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ run_on_machine: &run_on_machine run_on_docker: &run_on_docker docker: - - image: circleci/golang:1.11.4 + - image: circleci/golang:1.13.0 restore_go_mod_cache: &restore_go_mod_cache - restore_cache: @@ -69,7 +69,7 @@ jobs: "lint": docker: - - image: golangci/golangci-lint:v1.12 + - image: golangci/golangci-lint:v1.18 environment: - GOCACHE: *go_cache_dir steps: @@ -91,9 +91,10 @@ jobs: <<: *run_on_machine steps: - checkout - - run: docker build -t mesg/engine:$CIRCLE_TAG -t mesg/engine:latest --build-arg version=$CIRCLE_TAG . + - run: docker build -t mesg/engine:$CIRCLE_TAG -t mesg/engine:latest -t `echo mesg/engine:$CIRCLE_TAG | cut -d'.' -f1-2` --build-arg version=$CIRCLE_TAG . - run: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: docker push mesg/engine:$CIRCLE_TAG + - run: docker push `echo mesg/engine:$CIRCLE_TAG | cut -d'.' -f1-2` - run: docker push mesg/engine:latest workflows: diff --git a/.gitignore b/.gitignore index 0702330ee..64394bdc4 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,7 @@ vendor tmp-systemservices # tendermint -.tendermint-validator/ \ No newline at end of file +.tendermint-validator/ + +# gogo extension +gogo/ \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 3a02f4071..90b208a50 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -34,3 +34,4 @@ linters: - gosec - lll - prealloc + - funlen diff --git a/CHANGELOG.md b/CHANGELOG.md index 3afeca623..0ae525928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,35 @@ #### Removed #### Experimental +## [v0.15.0](https://github.com/mesg-foundation/engine/releases/tag/v0.15.0) + +#### Breaking Changes + +- ([#1329](https://github.com/mesg-foundation/engine/pull/1329)) Calculate process hash based on the nodes. +- ([#1335](https://github.com/mesg-foundation/engine/pull/1335)) Remove plural form from instance list proto service. +- ([#1337](https://github.com/mesg-foundation/engine/pull/1337)) Namespace protobuf types and api. + +#### Experimental + +- ([#1267](https://github.com/mesg-foundation/engine/pull/1267)) Implement service SDK with Cosmos. +- ([#1308](https://github.com/mesg-foundation/engine/pull/1308)) Simplify cosmos keybase by just creating a NewMnemonic helper. +- ([#1331](https://github.com/mesg-foundation/engine/pull/1331)) Add --exp to dev command. +- ([#1343](https://github.com/mesg-foundation/engine/pull/1343)) Add account sdk and its api. + +#### Added + +- ([#1316](https://github.com/mesg-foundation/engine/pull/1316)) Add constant to process map. +- ([#1317](https://github.com/mesg-foundation/engine/pull/1317)) Add tests for orchestrator. +- ([#1342](https://github.com/mesg-foundation/engine/pull/1342)) Build and publish docker image with minor-only tag. + +#### Changed + +- ([#1305](https://github.com/mesg-foundation/engine/pull/1305)) Use protobuf struct in create function of service SDK. +- ([#1321](https://github.com/mesg-foundation/engine/pull/1321)) Only force hash calculation on interface containing struct. +- ([#1322](https://github.com/mesg-foundation/engine/pull/1322)) Update golang to 1.13. +- ([#1323](https://github.com/mesg-foundation/engine/pull/1323)) Remove unused docker api mocks. +- ([#1347](https://github.com/mesg-foundation/engine/pull/1347)) Update marketplace system service with latest mesg-js. + ## [v0.14.2](https://github.com/mesg-foundation/engine/releases/tag/v0.14.2) #### Fixed diff --git a/Dockerfile b/Dockerfile index cd4d1046e..cc36c7d8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # base Go image version. -FROM golang:1.11.4-stretch AS build +FROM golang:1.13.0-stretch AS build RUN apt-get update && \ apt-get install -y jq && \ diff --git a/Dockerfile.tools b/Dockerfile.tools index 129a20433..a2748c70b 100644 --- a/Dockerfile.tools +++ b/Dockerfile.tools @@ -1,5 +1,5 @@ # base Go image version. -FROM golang:1.11.4-stretch +FROM golang:1.13.0-stretch WORKDIR /project diff --git a/account/account.pb.go b/account/account.pb.go new file mode 100644 index 000000000..dab55fba3 --- /dev/null +++ b/account/account.pb.go @@ -0,0 +1,75 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: account.proto + +package account + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Account represents service's account. +type Account struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Account) Reset() { *m = Account{} } +func (m *Account) String() string { return proto.CompactTextString(m) } +func (*Account) ProtoMessage() {} +func (*Account) Descriptor() ([]byte, []int) { + return fileDescriptor_8e28828dcb8d24f0, []int{0} +} +func (m *Account) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Account.Unmarshal(m, b) +} +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Account.Marshal(b, m, deterministic) +} +func (m *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) +} +func (m *Account) XXX_Size() int { + return xxx_messageInfo_Account.Size(m) +} +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) +} + +var xxx_messageInfo_Account proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Account)(nil), "mesg.types.Account") +} + +func init() { proto.RegisterFile("account.proto", fileDescriptor_8e28828dcb8d24f0) } + +var fileDescriptor_8e28828dcb8d24f0 = []byte{ + // 159 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0x4c, 0x4e, 0xce, + 0x2f, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xca, 0x4d, 0x2d, 0x4e, 0xd7, + 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x96, 0x52, 0x4a, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x8b, 0x27, 0x95, + 0xa6, 0xe9, 0x83, 0x78, 0x60, 0x0e, 0x98, 0x05, 0x51, 0xaf, 0x64, 0xce, 0xc5, 0xee, 0x08, 0x31, + 0x40, 0x48, 0x88, 0x8b, 0x25, 0x2f, 0x31, 0x37, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, + 0xcc, 0x16, 0x92, 0xe0, 0x62, 0x4f, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x96, 0x60, 0x02, 0x0b, + 0xc3, 0xb8, 0x4e, 0xfa, 0x27, 0x1e, 0xca, 0x31, 0x44, 0x69, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x6c, 0xd6, 0x4d, 0xcb, 0x2f, 0xcd, 0x4b, 0x49, 0x2c, 0xc9, + 0xcc, 0xcf, 0xd3, 0x4f, 0xcd, 0x4b, 0xcf, 0xcc, 0x4b, 0xd5, 0x87, 0xba, 0x2f, 0x89, 0x0d, 0x6c, + 0xa1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x20, 0x87, 0x7e, 0x2d, 0xb1, 0x00, 0x00, 0x00, +} diff --git a/config/services.go b/config/services.go index d66eca2db..5505e4b01 100644 --- a/config/services.go +++ b/config/services.go @@ -4,7 +4,7 @@ import ( "encoding/json" "github.com/mesg-foundation/engine/instance" - "github.com/mesg-foundation/engine/service" + "github.com/mesg-foundation/engine/protobuf/api" ) // Default compiled version of the service. These compiled versions are overritten by the build @@ -30,7 +30,7 @@ var ( type ServiceConfig struct { Key string Env map[string]string - Definition *service.Service + Definition *api.CreateServiceRequest Instance *instance.Instance } @@ -58,13 +58,13 @@ func (c *Config) setupServices() error { } func (c *Config) createServiceConfig(key string, compilatedJSON string, env map[string]string) (*ServiceConfig, error) { - var srv service.Service - if err := json.Unmarshal([]byte(compilatedJSON), &srv); err != nil { + var req api.CreateServiceRequest + if err := json.Unmarshal([]byte(compilatedJSON), &req); err != nil { return nil, err } return &ServiceConfig{ Key: key, - Definition: &srv, + Definition: &req, Env: env, }, nil } diff --git a/core/main.go b/core/main.go index 866243161..6ba9066fc 100644 --- a/core/main.go +++ b/core/main.go @@ -176,8 +176,11 @@ func main() { logrus.WithField("module", "main").Fatalln(err) } + // create cosmos client + client := cosmos.NewClient(node, app.Cdc(), kb, cfg.Cosmos.ChainID) + // init sdk - sdk, err = enginesdk.New(c, instanceDB, executionDB, processDB, cfg.Name, strconv.Itoa(port)) + sdk, err = enginesdk.New(client, app.Cdc(), kb, c, instanceDB, executionDB, processDB, cfg.Name, strconv.Itoa(port)) if err != nil { logrus.WithField("module", "main").Fatalln(err) } diff --git a/cosmos/client.go b/cosmos/client.go index 51b09b2ee..19a7d35f7 100644 --- a/cosmos/client.go +++ b/cosmos/client.go @@ -33,23 +33,22 @@ func NewClient(node *node.Node, cdc *codec.Codec, kb keys.Keybase, chainID strin } } -// QueryWithData is abci.query wraper with errors check. -// It retruns slice of bytes, height and an error. -func (c *Client) QueryWithData(path string, data []byte) ([]byte, int64, error) { - result, err := c.ABCIQuery(path, data) +// Query is abci.query wrapper with errors check and decode data. +func (c *Client) Query(path string, ptr interface{}) error { + result, err := c.ABCIQuery(path, nil) if err != nil { - return nil, 0, err + return err } - resp := result.Response - if !resp.IsOK() { - return nil, 0, errors.New(resp.Log) + if !result.Response.IsOK() { + return errors.New(result.Response.Log) } - return resp.Value, resp.Height, nil + return c.cdc.UnmarshalJSON(result.Response.Value, ptr) } // BuildAndBroadcastMsg builds and signs message and broadcast it to node. -func (c *Client) BuildAndBroadcastMsg(msg sdktypes.Msg, accName, accPassword string, accNumber, accSeq uint64) (*tenderminttypes.TxResult, error) { +func (c *Client) BuildAndBroadcastMsg(msg sdktypes.Msg, accName, accPassword string, accNumber, accSeq uint64) (*abci.ResponseDeliverTx, error) { txBuilder := NewTxBuilder(c.cdc, accNumber, accSeq, c.kb, c.chainID) + // TODO: cannot sign 2 tx at the same time. Maybe keybase cannot be access at the same time. Add a lock? signedTx, err := txBuilder.BuildAndSignStdTx(msg, accName, accPassword) if err != nil { return nil, err @@ -72,10 +71,13 @@ func (c *Client) BuildAndBroadcastMsg(msg sdktypes.Msg, accName, accPassword str ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) defer cancel() - out, err := c.Subscribe(ctx, "", "tx.hash='"+txres.Hash.String()+"'") + subscriber := "engine" + query := tenderminttypes.EventQueryTxFor(encodedTx).String() + out, err := c.Subscribe(ctx, subscriber, query) if err != nil { return nil, err } + defer c.Unsubscribe(ctx, subscriber, query) select { case result := <-out: @@ -83,7 +85,10 @@ func (c *Client) BuildAndBroadcastMsg(msg sdktypes.Msg, accName, accPassword str if !ok { return nil, errors.New("result data is not the right type") } - return &data.TxResult, nil + if data.TxResult.Result.IsErr() { + return nil, errors.New("an error occurred in transaction") + } + return &data.TxResult.Result, nil case <-ctx.Done(): return nil, errors.New("i/o timeout") } diff --git a/cosmos/keybase.go b/cosmos/keybase.go index 1b653b278..f117c913f 100644 --- a/cosmos/keybase.go +++ b/cosmos/keybase.go @@ -22,19 +22,12 @@ func NewKeybase(dir string) (*Keybase, error) { return &Keybase{kb}, nil } -// GenerateAccount creates an account. -func (kb *Keybase) GenerateAccount(name, mnemonic, password string) (keys.Info, error) { +// NewMnemonic returns a new mnemonic phrase. +func (kn *Keybase) NewMnemonic() (string, error) { // read entropy seed straight from crypto.Rand and convert to mnemonic entropySeed, err := bip39.NewEntropy(mnemonicEntropySize) if err != nil { - return nil, err - } - - if mnemonic == "" { - mnemonic, err = bip39.NewMnemonic(entropySeed) - if err != nil { - return nil, err - } + return "", err } - return kb.CreateAccount(name, mnemonic, "", password, 0, 0) + return bip39.NewMnemonic(entropySeed) } diff --git a/cosmos/module.go b/cosmos/module.go index 0583e9023..2244f958b 100644 --- a/cosmos/module.go +++ b/cosmos/module.go @@ -114,6 +114,9 @@ func (m AppModule) NewQuerierHandler() sdk.Querier { return func(request sdk.Request, path []string, req abci.RequestQuery) ([]byte, sdk.Error) { data, err := m.querier(request, path, req) if err != nil { + if errsdk, ok := err.(sdk.Error); ok { + return nil, errsdk + } return nil, sdk.ErrInternal(err.Error()) } res, err := m.cdc.MarshalJSON(data) diff --git a/cosmos/node.go b/cosmos/node.go index c23a43a84..2c4dc7307 100644 --- a/cosmos/node.go +++ b/cosmos/node.go @@ -26,7 +26,7 @@ func NewNode(app *App, kb *Keybase, cfg *tmconfig.Config, ccfg *config.CosmosCon cdc := app.Cdc() // generate first user - account, err := kb.GenerateAccount(ccfg.GenesisAccount.Name, ccfg.GenesisAccount.Mnemonic, ccfg.GenesisAccount.Password) + account, err := kb.CreateAccount(ccfg.GenesisAccount.Name, ccfg.GenesisAccount.Mnemonic, "", ccfg.GenesisAccount.Password, 0, 0) if err != nil { return nil, err } diff --git a/dev b/dev index 7dc5fc245..bf6fc6131 100755 --- a/dev +++ b/dev @@ -4,8 +4,10 @@ set -e DIR=$(pwd) -# network to connect multiple engine instances -TENDERMINT_NETWORK="mesg-tendermint" +# Flags +if [[ $* == *--exp* ]]; then + EXPERIMENTAL_FLAGS+=" --experimental-network" +fi # mesg config variables MESG_NAME=${MESG_NAME:-"engine"} @@ -15,6 +17,8 @@ MESG_LOG_FORCECOLORS=${MESG_LOG_FORCECOLORS:-"false"} MESG_LOG_LEVEL=${MESG_LOG_LEVEL:-"debug"} MESG_SERVER_PORT=${MESG_SERVER_PORT:-"50052"} + # network to connect multiple engine instances +TENDERMINT_NETWORK="mesg-tendermint" TENDERMINT_HOME_CONFIG="$MESG_PATH/tendermint" TENDERMINT_NETWORK_ALIAS=${TENDERMINT_NETWORK_ALIAS:-$MESG_NAME} TENDERMINT_VALIDATOR_NAME=${TENDERMINT_VALIDATOR_NAME:-"validator"} @@ -155,6 +159,6 @@ docker service create \ --network name=$TENDERMINT_NETWORK,alias=$TENDERMINT_NETWORK_ALIAS \ --publish $MESG_SERVER_PORT:50052 \ $TENDERMINT_VALIDATOR_PORT_PUBLISH \ - mesg/engine:$VERSION ./engine --experimental-network + mesg/engine:$VERSION ./engine $EXPERIMENTAL_FLAGS docker service logs --follow --raw $MESG_NAME diff --git a/event/event.pb.go b/event/event.pb.go index d47de420a..770e36261 100644 --- a/event/event.pb.go +++ b/event/event.pb.go @@ -63,29 +63,29 @@ func (m *Event) XXX_DiscardUnknown() { var xxx_messageInfo_Event proto.InternalMessageInfo func init() { - proto.RegisterType((*Event)(nil), "types.Event") + proto.RegisterType((*Event)(nil), "mesg.types.Event") } func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } var fileDescriptor_2d17a9d3f0ddf27e = []byte{ - // 274 bytes of a gzipped FileDescriptorProto + // 277 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x2d, 0x4b, 0xcd, - 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0x96, 0x52, - 0x4a, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x0b, 0x25, 0x95, 0xa6, 0xe9, 0x83, 0x78, 0x60, 0x0e, 0x98, - 0x05, 0x51, 0x2a, 0x25, 0x0d, 0x97, 0x06, 0xeb, 0xd1, 0x2f, 0x2e, 0x29, 0x2a, 0x4d, 0x86, 0x9a, - 0xa3, 0xb4, 0x92, 0x89, 0x8b, 0xd5, 0x15, 0x64, 0xae, 0x50, 0x30, 0x17, 0x4b, 0x46, 0x62, 0x71, - 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x8f, 0x93, 0xfd, 0x89, 0x7b, 0xf2, 0x0c, 0xb7, 0xee, 0xc9, - 0x6b, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xe7, 0xa6, 0x16, 0xa7, - 0xeb, 0xa6, 0xe5, 0x97, 0xe6, 0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0xe9, 0xa7, 0xe6, 0xa5, 0x67, - 0xe6, 0xa5, 0xea, 0x83, 0x74, 0xe9, 0x79, 0x24, 0x16, 0x67, 0x7c, 0xba, 0x27, 0xcf, 0x01, 0xe2, - 0x58, 0x29, 0xe9, 0x2a, 0x05, 0x81, 0x0d, 0x13, 0xca, 0xe0, 0xe2, 0xc9, 0xcc, 0x2b, 0x2e, 0x49, - 0xcc, 0x4b, 0x4e, 0x05, 0xa9, 0x90, 0x60, 0x02, 0x1b, 0xee, 0x42, 0x9e, 0xe1, 0xbc, 0x10, 0xc3, - 0xf3, 0x12, 0x73, 0x53, 0xad, 0x8c, 0x94, 0x82, 0x50, 0x4c, 0x16, 0x52, 0xe6, 0x62, 0xce, 0x4e, - 0xad, 0x94, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x74, 0x12, 0x44, 0x53, 0x6d, 0xac, 0x14, 0x04, 0x92, - 0x15, 0xb2, 0xe1, 0x62, 0x49, 0x49, 0x2c, 0x49, 0x94, 0x60, 0x51, 0x60, 0xd4, 0xe0, 0x36, 0x12, - 0xd5, 0x03, 0x59, 0xaa, 0x07, 0x0b, 0x1e, 0xbd, 0x60, 0x70, 0xc0, 0x60, 0x68, 0x36, 0x51, 0x0a, - 0x02, 0xeb, 0x72, 0xd2, 0x3d, 0xf1, 0x50, 0x8e, 0x21, 0x4a, 0x9d, 0xb0, 0xa3, 0xc1, 0x11, 0x95, - 0xc4, 0x06, 0x36, 0xd8, 0x18, 0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x05, 0xa1, 0x98, 0x2c, 0xa4, 0xcc, + 0xc5, 0x9c, 0x9d, 0x5a, 0x29, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0x88, 0xa6, 0xda, 0x58, + 0x29, 0x08, 0x24, 0x2b, 0x64, 0xc3, 0xc5, 0x92, 0x92, 0x58, 0x92, 0x28, 0xc1, 0xa2, 0xc0, 0xa8, + 0xc1, 0x6d, 0x24, 0xaa, 0x07, 0x0e, 0x49, 0x58, 0xf0, 0xe8, 0x05, 0x83, 0x03, 0x06, 0x43, 0xb3, + 0x89, 0x52, 0x10, 0x58, 0x97, 0x93, 0xee, 0x89, 0x87, 0x72, 0x0c, 0x51, 0xea, 0x84, 0x1d, 0x0d, + 0x8e, 0xad, 0x24, 0x36, 0xb0, 0xc1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0xe1, 0xf4, + 0x23, 0xbd, 0x01, 0x00, 0x00, } diff --git a/execution/execution.pb.go b/execution/execution.pb.go index e805413f7..e6b914d3f 100644 --- a/execution/execution.pb.go +++ b/execution/execution.pb.go @@ -77,7 +77,7 @@ type Execution struct { // eventHash is unique event hash. EventHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=eventHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"eventHash" hash:"name:3"` // Status is the current status of execution. - Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=types.Status" json:"status,omitempty" hash:"-"` + Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=mesg.types.Status" json:"status,omitempty" hash:"-"` // instanceHash is hash of the instance that can proceed an execution InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,5,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:5"` // taskKey is the key of the task of this execution. @@ -124,46 +124,46 @@ func (m *Execution) XXX_DiscardUnknown() { var xxx_messageInfo_Execution proto.InternalMessageInfo func init() { - proto.RegisterEnum("types.Status", Status_name, Status_value) - proto.RegisterType((*Execution)(nil), "types.Execution") + proto.RegisterEnum("mesg.types.Status", Status_name, Status_value) + proto.RegisterType((*Execution)(nil), "mesg.types.Execution") } func init() { proto.RegisterFile("execution.proto", fileDescriptor_776e2c5022e94aef) } var fileDescriptor_776e2c5022e94aef = []byte{ - // 511 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xdf, 0x6a, 0xdb, 0x3e, - 0x14, 0xc7, 0xe3, 0x26, 0x71, 0xea, 0x93, 0x3f, 0xbf, 0xfc, 0x04, 0x03, 0xd3, 0x41, 0x13, 0x74, - 0x31, 0x4c, 0x4b, 0xed, 0x35, 0xa1, 0x1b, 0x14, 0xc6, 0x86, 0xdb, 0x8e, 0x95, 0x31, 0x18, 0x0e, - 0xbb, 0xd9, 0x9d, 0xe2, 0xa8, 0xb6, 0x69, 0x23, 0x19, 0x49, 0xde, 0xd6, 0x37, 0xda, 0xa3, 0xf4, - 0x11, 0xc6, 0x2e, 0x02, 0xdb, 0x23, 0xf4, 0x09, 0x86, 0xe4, 0xba, 0x8b, 0x57, 0x18, 0xa3, 0xf4, - 0xce, 0x47, 0xe7, 0x7c, 0x3f, 0xe7, 0xab, 0xa3, 0x83, 0xe1, 0x3f, 0xfa, 0x85, 0xc6, 0x85, 0xca, - 0x38, 0xf3, 0x73, 0xc1, 0x15, 0x47, 0x6d, 0x75, 0x99, 0x53, 0xb9, 0x85, 0x13, 0x9e, 0xf0, 0xc0, - 0x1c, 0xcd, 0x8b, 0xb3, 0x40, 0x47, 0x26, 0x30, 0x5f, 0x65, 0xe9, 0xd6, 0xe3, 0xdb, 0xb4, 0xd1, - 0x04, 0x52, 0x89, 0x22, 0x56, 0x65, 0x12, 0x7f, 0xb3, 0xc1, 0x39, 0xa9, 0xd8, 0x68, 0x06, 0xad, - 0x94, 0xc8, 0xd4, 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 512 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x51, 0x6a, 0xdb, 0x4c, + 0x10, 0xc7, 0xad, 0xd8, 0x91, 0xa3, 0xb1, 0xe3, 0xcf, 0xdf, 0x42, 0x41, 0xa4, 0x10, 0x8b, 0x7d, + 0x28, 0x22, 0x21, 0x52, 0xe3, 0x90, 0xb6, 0x04, 0x4a, 0x8b, 0x92, 0x94, 0x86, 0x52, 0x28, 0x32, + 0x7d, 0xe9, 0xdb, 0x5a, 0xde, 0x48, 0x22, 0xf1, 0xae, 0xd8, 0x5d, 0xb5, 0xcd, 0x8d, 0x7a, 0x94, + 0x9c, 0xa1, 0x50, 0x43, 0x7b, 0x84, 0x9c, 0xa0, 0xec, 0x2a, 0x4a, 0xac, 0x06, 0x4a, 0x09, 0x79, + 0xf3, 0xf8, 0x3f, 0xf3, 0x9b, 0xff, 0xce, 0x0c, 0x82, 0xff, 0xe8, 0x57, 0x9a, 0x94, 0x2a, 0xe7, + 0x2c, 0x28, 0x04, 0x57, 0x1c, 0xc1, 0x9c, 0xca, 0x34, 0x50, 0x17, 0x05, 0x95, 0x1b, 0x38, 0xe5, + 0x29, 0x0f, 0xcd, 0xff, 0xd3, 0xf2, 0x34, 0xd4, 0x91, 0x09, 0xcc, 0xaf, 0x2a, 0x7f, 0xe3, 0xf1, + 0x8d, 0x6c, 0x6a, 0x42, 0xa9, 0x44, 0x99, 0xa8, 0x4a, 0xc4, 0x3f, 0x6c, 0x70, 0x8e, 0xeb, 0x06, + 0x68, 0x02, 0x9d, 0x8c, 0xc8, 0xcc, 0xb5, 0x3c, 0xcb, 0xef, 0x47, 0xaf, 0x2e, 0x17, 0xa3, 0xd6, + 0xf7, 0xc5, 0x68, 0x3b, 0xcd, 0x55, 0x56, 0x4e, 0x83, 0x84, 0xcf, 0x43, 0xdd, 0x7b, 0xe7, 0x94, + 0x97, 0x6c, 0x46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xa0, 0xa3, 0x48, 0x2a, 0x5d, 0xf0, + 0xda, 0xbe, 0x13, 0xa1, 0xab, 0xc5, 0x68, 0xb0, 0xe4, 0x65, 0xf7, 0x29, 0x8e, 0x8d, 0x8e, 0x52, + 0xe8, 0x15, 0x82, 0x27, 0x54, 0x4a, 0x33, 0xe2, 0x9e, 0x19, 0xf1, 0xf1, 0xfd, 0x46, 0xdc, 0xe8, + 0xb0, 0x8b, 0xe3, 0x65, 0x32, 0xda, 0xd2, 0x67, 0x40, 0x8b, 0x93, 0x23, 0xb7, 0x6f, 0x5c, 0xdf, + 0xb1, 0x34, 0x36, 0x8b, 0xd7, 0x19, 0x5b, 0xef, 0xc1, 0xae, 0x0e, 0x03, 0xf5, 0xa0, 0xfb, 0x91, + 0x9d, 0x31, 0xfe, 0x85, 0x0d, 0x5b, 0x3a, 0x38, 0x14, 0x94, 0x28, 0x3a, 0x1b, 0x5a, 0x68, 0x00, + 0x70, 0xc2, 0x3e, 0x08, 0x9e, 0x0a, 0x2a, 0xe5, 0x70, 0x05, 0xad, 0x83, 0x73, 0xc8, 0xe7, 0xc5, + 0x39, 0xd5, 0x72, 0x1b, 0x01, 0xd8, 0x6f, 0x48, 0x7e, 0x4e, 0x67, 0xc3, 0x4e, 0xb4, 0x7f, 0xf9, + 0x73, 0xb3, 0xf5, 0xed, 0xd7, 0xa6, 0xf5, 0xe9, 0x1f, 0x1e, 0x74, 0xf3, 0xe1, 0x98, 0xda, 0x66, + 0x1d, 0x7b, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xed, 0x3a, 0x78, 0x4c, 0x04, 0x00, 0x00, } func (this *Execution) Equal(that interface{}) bool { diff --git a/go.mod b/go.mod index 4aa5b65ed..f7a13c267 100644 --- a/go.mod +++ b/go.mod @@ -73,3 +73,5 @@ require ( gopkg.in/go-playground/validator.v9 v9.29.1 gotest.tools v2.2.0+incompatible // indirect ) + +go 1.13 diff --git a/hash/structhash/structhash.go b/hash/structhash/structhash.go index 0d50188dd..9d706515b 100644 --- a/hash/structhash/structhash.go +++ b/hash/structhash/structhash.go @@ -102,7 +102,7 @@ func write(buf *bytes.Buffer, v reflect.Value) *bytes.Buffer { // NOTE: structhash will allow to process all interface types. // gogo/protobuf is not able to set tags for directly oneof interface. // see: https://github.com/gogo/protobuf/issues/623 - if to.name == "" && reflect.Zero(sf.Type).Kind() == reflect.Interface { + if to.name == "" && reflect.Zero(sf.Type).Kind() == reflect.Interface && (v.Field(i).Elem().Kind() == reflect.Struct || (v.Field(i).Elem().Kind() == reflect.Ptr && v.Field(i).Elem().Elem().Kind() == reflect.Struct)) { to.skip = false to.name = sf.Name } diff --git a/hash/structhash/structhash_test.go b/hash/structhash/structhash_test.go index 5ac573f46..b7c86a513 100644 --- a/hash/structhash/structhash_test.go +++ b/hash/structhash/structhash_test.go @@ -22,6 +22,7 @@ func TestMd5(t *testing.T) { //nolint:megacheck func TestDump(t *testing.T) { + int1 := int(1) tests := []struct { v interface{} s string @@ -139,6 +140,68 @@ func TestDump(t *testing.T) { }{b: false}}, "{a:{b:false}}", }, + { + struct { + a interface{} + }{ + struct { + b int + c interface{} + }{ + b: 1, + c: 2, + }, + }, + "{a:{}}", + }, + { + struct { + a interface{} + }{ + &struct { + b int `hash:"name:b"` + c interface{} `hash:"name:c"` + }{ + b: 1, + c: 2, + }, + }, + "{a:{b:1,c:2}}", + }, + { + struct { + a interface{} + }{ + &struct { + b *int + c interface{} + }{ + b: &int1, + c: &int1, + }, + }, + "{a:{}}", + }, + { + struct { + a interface{} + }{ + &struct { + b *int + c interface{} + }{ + b: nil, + c: nil, + }, + }, + "{a:{}}", + }, + { + struct { + a interface{} + }{nil}, + "{}", + }, } for _, tt := range tests { diff --git a/instance/instance.pb.go b/instance/instance.pb.go index 206622498..8a3357c50 100644 --- a/instance/instance.pb.go +++ b/instance/instance.pb.go @@ -56,23 +56,23 @@ func (m *Instance) XXX_DiscardUnknown() { var xxx_messageInfo_Instance proto.InternalMessageInfo func init() { - proto.RegisterType((*Instance)(nil), "types.Instance") + proto.RegisterType((*Instance)(nil), "mesg.types.Instance") } func init() { proto.RegisterFile("instance.proto", fileDescriptor_fd22322185b2070b) } var fileDescriptor_fd22322185b2070b = []byte{ - // 182 bytes of a gzipped FileDescriptorProto + // 185 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0xcc, 0x2b, 0x2e, - 0x49, 0xcc, 0x4b, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0xa9, 0x2c, 0x48, - 0x2d, 0x96, 0x52, 0x4a, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x0b, 0x25, 0x95, 0xa6, 0xe9, 0x83, 0x78, - 0x60, 0x0e, 0x98, 0x05, 0x51, 0xaa, 0xb4, 0x8a, 0x91, 0x8b, 0xc3, 0x13, 0xaa, 0x5b, 0xc8, 0x9d, - 0x8b, 0x25, 0x23, 0xb1, 0x38, 0x43, 0x82, 0x51, 0x81, 0x51, 0x83, 0xc7, 0xc9, 0xf8, 0xc4, 0x3d, - 0x79, 0x86, 0x5b, 0xf7, 0xe4, 0xb5, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, - 0xf5, 0x73, 0x53, 0x8b, 0xd3, 0x75, 0xd3, 0xf2, 0x4b, 0xf3, 0x52, 0x12, 0x4b, 0x32, 0xf3, 0xf3, - 0xf4, 0x53, 0xf3, 0xd2, 0x33, 0xf3, 0x52, 0xf5, 0x41, 0xba, 0xf4, 0x3c, 0x12, 0x8b, 0x33, 0x82, - 0xc0, 0x06, 0x08, 0x85, 0x72, 0x71, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x82, 0x04, 0x25, - 0x98, 0xc8, 0x37, 0x0f, 0xd9, 0x1c, 0x27, 0x83, 0x13, 0x0f, 0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03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x5a, 0x2d, 0xa5, 0xc4, 0x27, 0x01, 0x00, 0x00, } diff --git a/orchestrator/mocks/EventSDK.go b/orchestrator/mocks/EventSDK.go new file mode 100644 index 000000000..888406ca4 --- /dev/null +++ b/orchestrator/mocks/EventSDK.go @@ -0,0 +1,27 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import eventsdk "github.com/mesg-foundation/engine/sdk/event" +import mock "github.com/stretchr/testify/mock" + +// EventSDK is an autogenerated mock type for the EventSDK type +type EventSDK struct { + mock.Mock +} + +// GetStream provides a mock function with given fields: f +func (_m *EventSDK) GetStream(f *eventsdk.Filter) *eventsdk.Listener { + ret := _m.Called(f) + + var r0 *eventsdk.Listener + if rf, ok := ret.Get(0).(func(*eventsdk.Filter) *eventsdk.Listener); ok { + r0 = rf(f) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*eventsdk.Listener) + } + } + + return r0 +} diff --git a/orchestrator/mocks/ExecutionSDK.go b/orchestrator/mocks/ExecutionSDK.go new file mode 100644 index 000000000..de37e64d9 --- /dev/null +++ b/orchestrator/mocks/ExecutionSDK.go @@ -0,0 +1,77 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import execution "github.com/mesg-foundation/engine/execution" +import executionsdk "github.com/mesg-foundation/engine/sdk/execution" +import hash "github.com/mesg-foundation/engine/hash" +import mock "github.com/stretchr/testify/mock" + +import types "github.com/mesg-foundation/engine/protobuf/types" + +// ExecutionSDK is an autogenerated mock type for the ExecutionSDK type +type ExecutionSDK struct { + mock.Mock +} + +// Execute provides a mock function with given fields: processHash, instanceHash, eventHash, parentHash, stepID, taskKey, inputData, tags +func (_m *ExecutionSDK) Execute(processHash hash.Hash, instanceHash hash.Hash, eventHash hash.Hash, parentHash hash.Hash, stepID string, taskKey string, inputData *types.Struct, tags []string) (hash.Hash, error) { + ret := _m.Called(processHash, instanceHash, eventHash, parentHash, stepID, taskKey, inputData, tags) + + var r0 hash.Hash + if rf, ok := ret.Get(0).(func(hash.Hash, hash.Hash, hash.Hash, hash.Hash, string, string, *types.Struct, []string) hash.Hash); ok { + r0 = rf(processHash, instanceHash, eventHash, parentHash, stepID, taskKey, inputData, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(hash.Hash) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(hash.Hash, hash.Hash, hash.Hash, hash.Hash, string, string, *types.Struct, []string) error); ok { + r1 = rf(processHash, instanceHash, eventHash, parentHash, stepID, taskKey, inputData, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Get provides a mock function with given fields: _a0 +func (_m *ExecutionSDK) Get(_a0 hash.Hash) (*execution.Execution, error) { + ret := _m.Called(_a0) + + var r0 *execution.Execution + if rf, ok := ret.Get(0).(func(hash.Hash) *execution.Execution); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*execution.Execution) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(hash.Hash) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetStream provides a mock function with given fields: f +func (_m *ExecutionSDK) GetStream(f *executionsdk.Filter) *executionsdk.Listener { + ret := _m.Called(f) + + var r0 *executionsdk.Listener + if rf, ok := ret.Get(0).(func(*executionsdk.Filter) *executionsdk.Listener); ok { + r0 = rf(f) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*executionsdk.Listener) + } + } + + return r0 +} diff --git a/orchestrator/mocks/ProcessSDK.go b/orchestrator/mocks/ProcessSDK.go new file mode 100644 index 000000000..aa15b5a72 --- /dev/null +++ b/orchestrator/mocks/ProcessSDK.go @@ -0,0 +1,35 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +import process "github.com/mesg-foundation/engine/process" + +// ProcessSDK is an autogenerated mock type for the ProcessSDK type +type ProcessSDK struct { + mock.Mock +} + +// List provides a mock function with given fields: +func (_m *ProcessSDK) List() ([]*process.Process, error) { + ret := _m.Called() + + var r0 []*process.Process + if rf, ok := ret.Get(0).(func() []*process.Process); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*process.Process) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/orchestrator/orchestrator.go b/orchestrator/orchestrator.go index f0e0d410f..d75778932 100644 --- a/orchestrator/orchestrator.go +++ b/orchestrator/orchestrator.go @@ -8,27 +8,12 @@ import ( "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/process" "github.com/mesg-foundation/engine/protobuf/types" - eventsdk "github.com/mesg-foundation/engine/sdk/event" executionsdk "github.com/mesg-foundation/engine/sdk/execution" - processesdk "github.com/mesg-foundation/engine/sdk/process" "github.com/sirupsen/logrus" ) -// Orchestrator manages the executions based on the definition of the processes -type Orchestrator struct { - event *eventsdk.Event - eventStream *eventsdk.Listener - - execution *executionsdk.Execution - executionStream *executionsdk.Listener - - process *processesdk.Process - - ErrC chan error -} - // New creates a new Process instance -func New(event *eventsdk.Event, execution *executionsdk.Execution, process *processesdk.Process) *Orchestrator { +func New(event EventSDK, execution ExecutionSDK, process ProcessSDK) *Orchestrator { return &Orchestrator{ event: event, execution: execution, @@ -156,24 +141,23 @@ func (s *Orchestrator) processMap(mapping *process.Process_Node_Map, wf *process Fields: make(map[string]*types.Value), } for _, output := range mapping.Outputs { - ref := output.GetRef() - if ref == nil { - continue - } - - node, err := wf.FindNode(ref.NodeKey) - if err != nil { - return nil, err - } - - if node.GetTask() != nil { - value, err := s.resolveInput(wf.Hash, exec, ref.NodeKey, ref.Key) + if ref := output.GetRef(); ref != nil { + node, err := wf.FindNode(ref.NodeKey) if err != nil { return nil, err } - result.Fields[output.Key] = value - } else { - result.Fields[output.Key] = data.Fields[ref.Key] + + if node.GetTask() != nil { + value, err := s.resolveInput(wf.Hash, exec, ref.NodeKey, ref.Key) + if err != nil { + return nil, err + } + result.Fields[output.Key] = value + } else { + result.Fields[output.Key] = data.Fields[ref.Key] + } + } else if constant := output.GetConstant(); constant != nil { + result.Fields[output.Key] = constant } } return result, nil diff --git a/orchestrator/orchestrator_test.go b/orchestrator/orchestrator_test.go new file mode 100644 index 000000000..ea2fd3969 --- /dev/null +++ b/orchestrator/orchestrator_test.go @@ -0,0 +1,279 @@ +package orchestrator + +import ( + "fmt" + "testing" + + "github.com/mesg-foundation/engine/event" + "github.com/mesg-foundation/engine/execution" + "github.com/mesg-foundation/engine/hash" + "github.com/mesg-foundation/engine/orchestrator/mocks" + "github.com/mesg-foundation/engine/process" + "github.com/mesg-foundation/engine/protobuf/types" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" +) + +func TestFilter(t *testing.T) { + o := New(&mocks.EventSDK{}, &mocks.ExecutionSDK{}, &mocks.ProcessSDK{}) + p := process.Process{ + Hash: hash.Int(1), + Nodes: []*process.Process_Node{ + {Type: &process.Process_Node_Event_{Event: &process.Process_Node_Event{ + Key: "1", + InstanceHash: hash.Int(1), + EventKey: "1", + }}}, + {Type: &process.Process_Node_Task_{Task: &process.Process_Node_Task{ + InstanceHash: hash.Int(2), + Key: "2", + TaskKey: "2", + }}}, + {Type: &process.Process_Node_Task_{Task: &process.Process_Node_Task{ + InstanceHash: hash.Int(3), + Key: "3", + TaskKey: "3", + }}}, + }, + Edges: []*process.Process_Edge{ + {Src: "1", Dst: "2"}, + {Src: "2", Dst: "3"}, + }, + } + var tests = []struct { + filter func(wf *process.Process, node *process.Process_Node) (bool, error) + p *process.Process + n *process.Process_Node + res bool + err error + }{ + { + filter: o.eventFilter(&event.Event{InstanceHash: hash.Int(1), Key: "1"}), + n: p.Nodes[0], + res: true, + err: nil, + }, + { + filter: o.eventFilter(&event.Event{InstanceHash: hash.Int(1), Key: "2"}), + n: p.Nodes[0], + res: false, + err: nil, + }, + { + filter: o.eventFilter(&event.Event{InstanceHash: hash.Int(2), Key: "1"}), + n: p.Nodes[0], + res: false, + err: nil, + }, + { + filter: o.eventFilter(&event.Event{InstanceHash: hash.Int(2), Key: "1"}), + n: p.Nodes[1], + res: false, + err: nil, + }, + { + filter: o.resultFilter(&execution.Execution{InstanceHash: hash.Int(1), TaskKey: "1"}), + n: &process.Process_Node{Type: &process.Process_Node_Result_{Result: &process.Process_Node_Result{ + InstanceHash: hash.Int(1), + TaskKey: "1", + }}}, + res: true, + err: nil, + }, + { + filter: o.resultFilter(&execution.Execution{InstanceHash: hash.Int(1), TaskKey: "1"}), + n: &process.Process_Node{Type: &process.Process_Node_Result_{Result: &process.Process_Node_Result{ + InstanceHash: hash.Int(1), + TaskKey: "2", + }}}, + res: false, + err: nil, + }, + { + filter: o.resultFilter(&execution.Execution{InstanceHash: hash.Int(1), TaskKey: "1"}), + n: &process.Process_Node{Type: &process.Process_Node_Result_{Result: &process.Process_Node_Result{ + InstanceHash: hash.Int(2), + TaskKey: "1", + }}}, + res: false, + err: nil, + }, + { + filter: o.resultFilter(&execution.Execution{InstanceHash: hash.Int(1), TaskKey: "1"}), + n: p.Nodes[0], + res: false, + err: nil, + }, + { + filter: o.dependencyFilter(&execution.Execution{InstanceHash: hash.Int(3), TaskKey: "2", ProcessHash: hash.Int(1), StepID: "2"}), + p: &p, + n: p.Nodes[2], + res: true, + err: nil, + }, + { + filter: o.dependencyFilter(&execution.Execution{InstanceHash: hash.Int(3), TaskKey: "2", ProcessHash: hash.Int(2), StepID: "2"}), + p: &p, + n: p.Nodes[2], + res: false, + err: nil, + }, + { + filter: o.dependencyFilter(&execution.Execution{InstanceHash: hash.Int(3), TaskKey: "2", ProcessHash: hash.Int(1), StepID: "1"}), + p: &p, + n: p.Nodes[2], + res: false, + err: nil, + }, + { + filter: o.dependencyFilter(&execution.Execution{InstanceHash: hash.Int(3), TaskKey: "2", ProcessHash: hash.Int(1), StepID: "2"}), + p: &p, + n: p.Nodes[0], + res: false, + err: nil, + }, + } + for _, test := range tests { + ok, err := test.filter(test.p, test.n) + if test.err != nil { + require.Equal(t, test.err, err) + } else { + require.Equal(t, ok, test.res) + } + } +} + +func TestFindNode(t *testing.T) { + o := New(&mocks.EventSDK{}, &mocks.ExecutionSDK{}, &mocks.ProcessSDK{}) + data := &process.Process{ + Hash: hash.Int(1), + Nodes: []*process.Process_Node{ + { + Type: &process.Process_Node_Event_{ + Event: &process.Process_Node_Event{ + Key: "1", + }, + }, + }, + }, + } + require.Len(t, o.findNodes(data, func(p *process.Process, n *process.Process_Node) (bool, error) { + return true, nil + }), 1) + require.Len(t, o.findNodes(data, func(p *process.Process, n *process.Process_Node) (bool, error) { + return n.GetEvent().Key == "1", nil + }), 1) + require.Len(t, o.findNodes(data, func(p *process.Process, n *process.Process_Node) (bool, error) { + return n.GetEvent().Key == "2", nil + }), 0) +} + +// func TestProcessMap(t *testing.T) { +// e := &mocks.ExecutionSDK{} +// o := New(&mocks.EventSDK{}, e, &mocks.ProcessSDK{}) +// exec := &execution.Execution{ +// ProcessHash: hash.Int(1), +// StepID: "1", +// ParentHash: hash.Int(2), +// Outputs: &types.Struct{ +// Fields: map[string]*types.Value{ +// "xxx": &types.Value{ +// Kind: &types.Value_StringValue{StringValue: "str"}, +// }, +// }, +// }, +// } +// o.processMap(&process.Process_Node_Map{ +// Outputs: []*process.Process_Node_Map_Output{}, +// }, ) +// } + +func TestResolveInput(t *testing.T) { + e := &mocks.ExecutionSDK{} + o := New(&mocks.EventSDK{}, e, &mocks.ProcessSDK{}) + exec := &execution.Execution{ + ProcessHash: hash.Int(2), + StepID: "2", + ParentHash: hash.Int(3), + Outputs: &types.Struct{ + Fields: map[string]*types.Value{ + "xxx": { + Kind: &types.Value_StringValue{StringValue: "str"}, + }, + }, + }, + } + // Different processes + _, err := o.resolveInput(hash.Int(1), exec, "2", "xxx") + require.Error(t, err) + // Different steps, should return the value of the data + val, err := o.resolveInput(hash.Int(2), exec, "2", "xxx") + require.NoError(t, err) + require.Equal(t, val, exec.Outputs.Fields["xxx"]) + // Invalid execution parent hash + e.On("Get", mock.Anything).Once().Return(nil, fmt.Errorf("err")) + _, err = o.resolveInput(hash.Int(2), exec, "-", "xxx") + require.Error(t, err) + // Output from a previous exec + execMock := &execution.Execution{ + StepID: "3", + ProcessHash: hash.Int(2), + Outputs: &types.Struct{ + Fields: map[string]*types.Value{ + "yyy": { + Kind: &types.Value_StringValue{StringValue: "str2"}, + }, + }, + }, + } + e.On("Get", mock.Anything).Once().Return(execMock, nil) + val, err = o.resolveInput(hash.Int(2), exec, "3", "yyy") + require.NoError(t, err) + require.Equal(t, val, execMock.Outputs.Fields["yyy"]) +} + +func TestProcessTask(t *testing.T) { + e := &mocks.ExecutionSDK{} + e.On("Execute", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Once().Return(nil, nil) + o := New(&mocks.EventSDK{}, e, &mocks.ProcessSDK{}) + err := o.processTask(&process.Process_Node_Task{ + InstanceHash: hash.Int(1), + Key: "-", + TaskKey: "-", + }, &process.Process{ + Hash: hash.Int(2), + }, &execution.Execution{ + Hash: hash.Int(3), + }, nil, &types.Struct{ + Fields: map[string]*types.Value{}, + }) + require.NoError(t, err) + e.On("Execute", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Once().Return(nil, fmt.Errorf("error")) + err = o.processTask(&process.Process_Node_Task{ + InstanceHash: hash.Int(1), + Key: "-", + TaskKey: "-", + }, &process.Process{ + Hash: hash.Int(2), + }, nil, &event.Event{ + Hash: hash.Int(3), + }, &types.Struct{ + Fields: map[string]*types.Value{}, + }) + require.Error(t, err) +} + +// func TestStart(t *testing.T) { +// event := &mocks.EventSDK{} +// exec := &mocks.ExecutionSDK{} +// process := &mocks.ProcessSDK{} +// o := New(event, exec, process) +// eventListener := &eventsdk.Listener{} +// execListener := &executionsdk.Listener{} +// event.On("GetStream", mock.Anything).Return(eventListener) +// exec.On("GetStream", mock.Anything).Return(execListener) +// err := o.Start() +// eventListener.Close() +// execListener.Close() +// require.NoError(t, err) +// } diff --git a/orchestrator/type.go b/orchestrator/type.go new file mode 100644 index 000000000..94c6bc788 --- /dev/null +++ b/orchestrator/type.go @@ -0,0 +1,40 @@ +package orchestrator + +import ( + "github.com/mesg-foundation/engine/execution" + "github.com/mesg-foundation/engine/hash" + "github.com/mesg-foundation/engine/process" + "github.com/mesg-foundation/engine/protobuf/types" + eventsdk "github.com/mesg-foundation/engine/sdk/event" + executionsdk "github.com/mesg-foundation/engine/sdk/execution" +) + +// ExecutionSDK execution interface needed for the orchestrator +type ExecutionSDK interface { + GetStream(f *executionsdk.Filter) *executionsdk.Listener + Get(hash hash.Hash) (*execution.Execution, error) + Execute(processHash, instanceHash, eventHash, parentHash hash.Hash, stepID string, taskKey string, inputData *types.Struct, tags []string) (executionHash hash.Hash, err error) +} + +// EventSDK event interface needed for the orchestrator +type EventSDK interface { + GetStream(f *eventsdk.Filter) *eventsdk.Listener +} + +// ProcessSDK process interface needed for the orchestrator +type ProcessSDK interface { + List() ([]*process.Process, error) +} + +// Orchestrator manages the executions based on the definition of the processes +type Orchestrator struct { + event EventSDK + eventStream *eventsdk.Listener + + execution ExecutionSDK + executionStream *executionsdk.Listener + + process ProcessSDK + + ErrC chan error +} diff --git a/process/process.pb.go b/process/process.pb.go index f1bd1f4a0..2354e3f50 100644 --- a/process/process.pb.go +++ b/process/process.pb.go @@ -9,6 +9,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_mesg_foundation_engine_hash "github.com/mesg-foundation/engine/hash" + types "github.com/mesg-foundation/engine/protobuf/types" math "math" ) @@ -134,19 +135,19 @@ type isProcess_Node_Type interface { } type Process_Node_Result_ struct { - Result *Process_Node_Result `protobuf:"bytes,1,opt,name=result,proto3,oneof" json:"result,omitempty"` + Result *Process_Node_Result `protobuf:"bytes,1,opt,name=result,proto3,oneof" json:"result,omitempty" hash:"name:1"` } type Process_Node_Event_ struct { - Event *Process_Node_Event `protobuf:"bytes,2,opt,name=event,proto3,oneof" json:"event,omitempty"` + Event *Process_Node_Event `protobuf:"bytes,2,opt,name=event,proto3,oneof" json:"event,omitempty" hash:"name:2"` } type Process_Node_Task_ struct { - Task *Process_Node_Task `protobuf:"bytes,3,opt,name=task,proto3,oneof" json:"task,omitempty"` + Task *Process_Node_Task `protobuf:"bytes,3,opt,name=task,proto3,oneof" json:"task,omitempty" hash:"name:3"` } type Process_Node_Map_ struct { - Map *Process_Node_Map `protobuf:"bytes,4,opt,name=map,proto3,oneof" json:"map,omitempty"` + Map *Process_Node_Map `protobuf:"bytes,4,opt,name=map,proto3,oneof" json:"map,omitempty" hash:"name:4"` } type Process_Node_Filter_ struct { - Filter *Process_Node_Filter `protobuf:"bytes,5,opt,name=filter,proto3,oneof" json:"filter,omitempty"` + Filter *Process_Node_Filter `protobuf:"bytes,5,opt,name=filter,proto3,oneof" json:"filter,omitempty" hash:"name:5"` } func (*Process_Node_Result_) isProcess_Node_Type() {} @@ -355,6 +356,7 @@ type Process_Node_Map_Output struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty" hash:"name:1" validate:"required"` // Types that are valid to be assigned to Value: // *Process_Node_Map_Output_Ref + // *Process_Node_Map_Output_Constant Value isProcess_Node_Map_Output_Value `protobuf_oneof:"value"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -391,10 +393,14 @@ type isProcess_Node_Map_Output_Value interface { } type Process_Node_Map_Output_Ref struct { - Ref *Process_Node_Map_Output_Reference `protobuf:"bytes,2,opt,name=ref,proto3,oneof" json:"ref,omitempty" hash:"name:2" validate:"required"` + Ref *Process_Node_Map_Output_Reference `protobuf:"bytes,2,opt,name=ref,proto3,oneof" json:"ref,omitempty" hash:"name:2" validate:"required_without=Constant"` +} +type Process_Node_Map_Output_Constant struct { + Constant *types.Value `protobuf:"bytes,3,opt,name=constant,proto3,oneof" json:"constant,omitempty" hash:"name:3" validate:"required_without=Ref"` } -func (*Process_Node_Map_Output_Ref) isProcess_Node_Map_Output_Value() {} +func (*Process_Node_Map_Output_Ref) isProcess_Node_Map_Output_Value() {} +func (*Process_Node_Map_Output_Constant) isProcess_Node_Map_Output_Value() {} func (m *Process_Node_Map_Output) GetValue() isProcess_Node_Map_Output_Value { if m != nil { @@ -410,10 +416,18 @@ func (m *Process_Node_Map_Output) GetRef() *Process_Node_Map_Output_Reference { return nil } +func (m *Process_Node_Map_Output) GetConstant() *types.Value { + if x, ok := m.GetValue().(*Process_Node_Map_Output_Constant); ok { + return x.Constant + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*Process_Node_Map_Output) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Process_Node_Map_Output_Ref)(nil), + (*Process_Node_Map_Output_Constant)(nil), } } @@ -489,7 +503,7 @@ type Process_Node_Filter_Condition struct { // Key to check. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty" hash:"name:1" validate:"required,printascii"` // Type of condition to apply. - Predicate Process_Node_Filter_Condition_Predicate `protobuf:"varint,2,opt,name=predicate,proto3,enum=types.Process_Node_Filter_Condition_Predicate" json:"predicate,omitempty" hash:"name:2" validate:"required"` + Predicate Process_Node_Filter_Condition_Predicate `protobuf:"varint,2,opt,name=predicate,proto3,enum=mesg.types.Process_Node_Filter_Condition_Predicate" json:"predicate,omitempty" hash:"name:2" validate:"required"` // Value of the filter. Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty" hash:"name:3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -556,73 +570,79 @@ func (m *Process_Edge) XXX_DiscardUnknown() { var xxx_messageInfo_Process_Edge proto.InternalMessageInfo func init() { - proto.RegisterEnum("types.Process_Node_Filter_Condition_Predicate", Process_Node_Filter_Condition_Predicate_name, Process_Node_Filter_Condition_Predicate_value) - proto.RegisterType((*Process)(nil), "types.Process") - proto.RegisterType((*Process_Node)(nil), "types.Process.Node") - proto.RegisterType((*Process_Node_Result)(nil), "types.Process.Node.Result") - proto.RegisterType((*Process_Node_Event)(nil), "types.Process.Node.Event") - proto.RegisterType((*Process_Node_Task)(nil), "types.Process.Node.Task") - proto.RegisterType((*Process_Node_Map)(nil), "types.Process.Node.Map") - proto.RegisterType((*Process_Node_Map_Output)(nil), "types.Process.Node.Map.Output") - proto.RegisterType((*Process_Node_Map_Output_Reference)(nil), "types.Process.Node.Map.Output.Reference") - proto.RegisterType((*Process_Node_Filter)(nil), "types.Process.Node.Filter") - proto.RegisterType((*Process_Node_Filter_Condition)(nil), "types.Process.Node.Filter.Condition") - proto.RegisterType((*Process_Edge)(nil), "types.Process.Edge") + proto.RegisterEnum("mesg.types.Process_Node_Filter_Condition_Predicate", Process_Node_Filter_Condition_Predicate_name, Process_Node_Filter_Condition_Predicate_value) + proto.RegisterType((*Process)(nil), "mesg.types.Process") + proto.RegisterType((*Process_Node)(nil), "mesg.types.Process.Node") + proto.RegisterType((*Process_Node_Result)(nil), "mesg.types.Process.Node.Result") + proto.RegisterType((*Process_Node_Event)(nil), "mesg.types.Process.Node.Event") + proto.RegisterType((*Process_Node_Task)(nil), "mesg.types.Process.Node.Task") + proto.RegisterType((*Process_Node_Map)(nil), "mesg.types.Process.Node.Map") + proto.RegisterType((*Process_Node_Map_Output)(nil), "mesg.types.Process.Node.Map.Output") + proto.RegisterType((*Process_Node_Map_Output_Reference)(nil), "mesg.types.Process.Node.Map.Output.Reference") + proto.RegisterType((*Process_Node_Filter)(nil), "mesg.types.Process.Node.Filter") + proto.RegisterType((*Process_Node_Filter_Condition)(nil), "mesg.types.Process.Node.Filter.Condition") + proto.RegisterType((*Process_Edge)(nil), "mesg.types.Process.Edge") } func init() { proto.RegisterFile("process.proto", fileDescriptor_54c4d0e8c0aaf5c3) } var fileDescriptor_54c4d0e8c0aaf5c3 = []byte{ - // 780 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00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0x7e, - 0x54, 0xbc, 0x48, 0x1f, 0x36, 0x94, 0x55, 0xa5, 0xd4, 0x35, 0xda, 0x8e, 0x65, 0x10, 0xb4, 0xa1, - 0x04, 0xe8, 0x65, 0xe8, 0x04, 0xc8, 0x52, 0x74, 0x76, 0x80, 0x78, 0x1b, 0xf8, 0x16, 0xea, 0x49, - 0x5c, 0x29, 0x5d, 0xce, 0x6b, 0x57, 0xfa, 0x51, 0xf1, 0x52, 0x4c, 0x72, 0x8d, 0x0e, 0xda, 0xa8, - 0x26, 0x33, 0x29, 0x43, 0xdc, 0x85, 0x8c, 0xeb, 0x59, 0x08, 0x4b, 0x42, 0x89, 0x2f, 0x17, 0xaa, - 0x8b, 0x2a, 0x6b, 0x54, 0x1d, 0x34, 0xa0, 0x3e, 0xf4, 0x2c, 0xa4, 0xdd, 0xe8, 0x47, 0xc5, 0xab, - 0x63, 0x7a, 0xeb, 0xe3, 0x7a, 0x96, 0xd3, 0x45, 0x2b, 0x07, 0xa2, 0xb1, 0x1a, 0x95, 0x45, 0x96, - 0x8d, 0xb0, 0x94, 0x49, 0x94, 0xdd, 0xb4, 0xec, 0xe3, 0xb2, 0xb7, 0x26, 0xc9, 0x32, 0x35, 0xf9, - 0xdb, 0x19, 0x10, 0x68, 0x49, 0xe2, 0x3a, 0x64, 0x03, 0x84, 0xc3, 0x36, 0x61, 0xd6, 0x16, 0xaa, - 0x72, 0x42, 0xdd, 0xaa, 0xce, 0x10, 0xf5, 0x94, 0x3e, 0xc0, 0x8a, 0x6b, 0x90, 0x41, 0x5d, 0xe4, - 0x12, 0xe6, 0x53, 0xa1, 0x7a, 0x21, 0x89, 0xb4, 0x49, 0x01, 0xf5, 0x94, 0x1e, 0x23, 0x45, 0x15, - 0x04, 0x62, 0xe0, 0x96, 0xc4, 0x33, 0x86, 0x94, 0xc4, 0x78, 0x6a, 0xe0, 0x56, 0x3d, 0xa5, 0x33, - 0x9c, 0xb8, 0x0c, 0x7c, 0xc7, 0xf0, 0x25, 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xe9, 0xb1, 0x30, 0xd1, 0x6a, 0xfb, 0x3f, 0x96, 0x52, 0x9f, 0x7f, 0x2e, - 0xa5, 0x9f, 0x5f, 0xff, 0xfd, 0x2e, 0x1b, 0xdc, 0x02, 0xf7, 0xb2, 0xec, 0x6e, 0x57, 0xfb, 0x15, - 0x00, 0x00, 0xff, 0xff, 0xbf, 0x3c, 0x02, 0xe0, 0x17, 0x0a, 0x00, 0x00, + // 867 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x96, 0xcd, 0x8e, 0xdb, 0x54, + 0x14, 0xc7, 0x93, 0xd8, 0x49, 0x9a, 0x93, 0x29, 0x6a, 0x2d, 0x2a, 0x59, 0xa6, 0x8c, 0x83, 0x11, + 0x30, 0x85, 0x89, 0xc3, 0x38, 0x2d, 0x48, 0x23, 0x21, 0x24, 0x8f, 0xa6, 0x2a, 0xb4, 0x85, 0x12, + 0x3e, 0x84, 0xba, 0x01, 0x8f, 0x7d, 0xe2, 0x58, 0x49, 0x6c, 0xe3, 0x7b, 0x9d, 0x36, 0x12, 0x5b, + 0x16, 0x08, 0x96, 0x3c, 0x04, 0x12, 0x5b, 0x56, 0x3c, 0x41, 0x25, 0xde, 0x80, 0x85, 0x05, 0x3c, + 0x42, 0x9e, 0x00, 0xdd, 0x6b, 0x3b, 0xc9, 0xe0, 0xc9, 0xc7, 0x84, 0x15, 0x52, 0x77, 0x71, 0x7c, + 0xff, 0xbf, 0x73, 0xee, 0xff, 0x9c, 0x7b, 0xae, 0xe1, 0x6a, 0x18, 0x05, 0x36, 0x12, 0xa2, 0x87, + 0x51, 0x40, 0x03, 0x09, 0xc6, 0x48, 0x5c, 0x9d, 0x4e, 0x43, 0x24, 0x8a, 0xe6, 0x06, 0x6e, 0xd0, + 0xe1, 0xff, 0x9f, 0xc5, 0xfd, 0x0e, 0x7b, 0xe2, 0x0f, 0xfc, 0x57, 0xba, 0x5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} func (this *Process) Equal(that interface{}) bool { @@ -1018,6 +1038,30 @@ func (this *Process_Node_Map_Output_Ref) Equal(that interface{}) bool { } return true } +func (this *Process_Node_Map_Output_Constant) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Process_Node_Map_Output_Constant) + if !ok { + that2, ok := that.(Process_Node_Map_Output_Constant) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Constant.Equal(that1.Constant) { + return false + } + return true +} func (this *Process_Node_Map_Output_Reference) Equal(that interface{}) bool { if that == nil { return this == nil diff --git a/protobuf/api/account.pb.go b/protobuf/api/account.pb.go new file mode 100644 index 000000000..348ba5fb7 --- /dev/null +++ b/protobuf/api/account.pb.go @@ -0,0 +1,541 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: protobuf/api/account.proto + +package api + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + account "github.com/mesg-foundation/engine/account" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// The request's data for the `Get` API. +type GetAccountRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAccountRequest) Reset() { *m = GetAccountRequest{} } +func (m *GetAccountRequest) String() string { return proto.CompactTextString(m) } +func (*GetAccountRequest) ProtoMessage() {} +func (*GetAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3259f8b8a943c47e, []int{0} +} +func (m *GetAccountRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAccountRequest.Unmarshal(m, b) +} +func (m *GetAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAccountRequest.Marshal(b, m, deterministic) +} +func (m *GetAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAccountRequest.Merge(m, src) +} +func (m *GetAccountRequest) XXX_Size() int { + return xxx_messageInfo_GetAccountRequest.Size(m) +} +func (m *GetAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAccountRequest proto.InternalMessageInfo + +func (m *GetAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request's data for the `List` API. +type ListAccountRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListAccountRequest) Reset() { *m = ListAccountRequest{} } +func (m *ListAccountRequest) String() string { return proto.CompactTextString(m) } +func (*ListAccountRequest) ProtoMessage() {} +func (*ListAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3259f8b8a943c47e, []int{1} +} +func (m *ListAccountRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListAccountRequest.Unmarshal(m, b) +} +func (m *ListAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListAccountRequest.Marshal(b, m, deterministic) +} +func (m *ListAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAccountRequest.Merge(m, src) +} +func (m *ListAccountRequest) XXX_Size() int { + return xxx_messageInfo_ListAccountRequest.Size(m) +} +func (m *ListAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAccountRequest proto.InternalMessageInfo + +// The response's data for the `List` API. +type ListAccountResponse struct { + Accounts []*account.Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListAccountResponse) Reset() { *m = ListAccountResponse{} } +func (m *ListAccountResponse) String() string { return proto.CompactTextString(m) } +func (*ListAccountResponse) ProtoMessage() {} +func (*ListAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3259f8b8a943c47e, []int{2} +} +func (m *ListAccountResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListAccountResponse.Unmarshal(m, b) +} +func (m *ListAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListAccountResponse.Marshal(b, m, deterministic) +} +func (m *ListAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAccountResponse.Merge(m, src) +} +func (m *ListAccountResponse) XXX_Size() int { + return xxx_messageInfo_ListAccountResponse.Size(m) +} +func (m *ListAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAccountResponse proto.InternalMessageInfo + +func (m *ListAccountResponse) GetAccounts() []*account.Account { + if m != nil { + return m.Accounts + } + return nil +} + +// The request's data for the `Create` API. +type CreateAccountRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateAccountRequest) Reset() { *m = CreateAccountRequest{} } +func (m *CreateAccountRequest) String() string { return proto.CompactTextString(m) } +func (*CreateAccountRequest) ProtoMessage() {} +func (*CreateAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3259f8b8a943c47e, []int{3} +} +func (m *CreateAccountRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateAccountRequest.Unmarshal(m, b) +} +func (m *CreateAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateAccountRequest.Marshal(b, m, deterministic) +} +func (m *CreateAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateAccountRequest.Merge(m, src) +} +func (m *CreateAccountRequest) XXX_Size() int { + return xxx_messageInfo_CreateAccountRequest.Size(m) +} +func (m *CreateAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateAccountRequest proto.InternalMessageInfo + +func (m *CreateAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateAccountRequest) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +// The response's data for the `Create` API. +type CreateAccountResponse struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Mnemonic string `protobuf:"bytes,2,opt,name=mnemonic,proto3" json:"mnemonic,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateAccountResponse) Reset() { *m = CreateAccountResponse{} } +func (m *CreateAccountResponse) String() string { return proto.CompactTextString(m) } +func (*CreateAccountResponse) ProtoMessage() {} +func (*CreateAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3259f8b8a943c47e, []int{4} +} +func (m *CreateAccountResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateAccountResponse.Unmarshal(m, b) +} +func (m *CreateAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateAccountResponse.Marshal(b, m, deterministic) +} +func (m *CreateAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateAccountResponse.Merge(m, src) +} +func (m *CreateAccountResponse) XXX_Size() int { + return xxx_messageInfo_CreateAccountResponse.Size(m) +} +func (m *CreateAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateAccountResponse proto.InternalMessageInfo + +func (m *CreateAccountResponse) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *CreateAccountResponse) GetMnemonic() string { + if m != nil { + return m.Mnemonic + } + return "" +} + +// The request's data for the `Delete` API. +type DeleteAccountRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteAccountRequest) Reset() { *m = DeleteAccountRequest{} } +func (m *DeleteAccountRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteAccountRequest) ProtoMessage() {} +func (*DeleteAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3259f8b8a943c47e, []int{5} +} +func (m *DeleteAccountRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteAccountRequest.Unmarshal(m, b) +} +func (m *DeleteAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteAccountRequest.Marshal(b, m, deterministic) +} +func (m *DeleteAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteAccountRequest.Merge(m, src) +} +func (m *DeleteAccountRequest) XXX_Size() int { + return xxx_messageInfo_DeleteAccountRequest.Size(m) +} +func (m *DeleteAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteAccountRequest proto.InternalMessageInfo + +func (m *DeleteAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DeleteAccountRequest) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +// The response's data for the `Delete` API. +type DeleteAccountResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteAccountResponse) Reset() { *m = DeleteAccountResponse{} } +func (m *DeleteAccountResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteAccountResponse) ProtoMessage() {} +func (*DeleteAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3259f8b8a943c47e, []int{6} +} +func (m *DeleteAccountResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteAccountResponse.Unmarshal(m, b) +} +func (m *DeleteAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteAccountResponse.Marshal(b, m, deterministic) +} +func (m *DeleteAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteAccountResponse.Merge(m, src) +} +func (m *DeleteAccountResponse) XXX_Size() int { + return xxx_messageInfo_DeleteAccountResponse.Size(m) +} +func (m *DeleteAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteAccountResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*GetAccountRequest)(nil), "mesg.api.GetAccountRequest") + proto.RegisterType((*ListAccountRequest)(nil), "mesg.api.ListAccountRequest") + proto.RegisterType((*ListAccountResponse)(nil), "mesg.api.ListAccountResponse") + proto.RegisterType((*CreateAccountRequest)(nil), "mesg.api.CreateAccountRequest") + proto.RegisterType((*CreateAccountResponse)(nil), "mesg.api.CreateAccountResponse") + proto.RegisterType((*DeleteAccountRequest)(nil), "mesg.api.DeleteAccountRequest") + proto.RegisterType((*DeleteAccountResponse)(nil), "mesg.api.DeleteAccountResponse") +} + +func init() { proto.RegisterFile("protobuf/api/account.proto", fileDescriptor_3259f8b8a943c47e) } + +var fileDescriptor_3259f8b8a943c47e = []byte{ + // 330 bytes of a gzipped FileDescriptorProto + 0x1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x90, 0x41, 0x5b, 0x09, 0xad, 0xbf, 0x64, 0xb2, 0xf0, + 0x6a, 0x76, 0x5e, 0x68, 0xfe, 0x0a, 0xbd, 0x9d, 0x9c, 0x8c, 0xc8, 0x83, 0x96, 0x58, 0x2c, 0x12, + 0xd2, 0x3a, 0xcb, 0xca, 0x65, 0x1a, 0x17, 0xc5, 0x14, 0xc9, 0x38, 0x9c, 0xe7, 0x71, 0xb9, 0x4e, + 0xb1, 0x1e, 0xe9, 0x83, 0xfe, 0x8d, 0x75, 0x06, 0xbd, 0x9d, 0x1c, 0x87, 0x35, 0xfa, 0xa9, 0x41, + 0x2b, 0x9b, 0xe1, 0x2d, 0xd4, 0x27, 0x64, 0xf0, 0xdc, 0xcf, 0xeb, 0xf5, 0xf7, 0x9a, 0x61, 0x65, + 0x6b, 0xe4, 0x15, 0x7c, 0x82, 0x46, 0x5a, 0x03, 0xf6, 0xd7, 0x6f, 0xf7, 0xcb, 0x62, 0x17, 0x07, + 0x6e, 0x1d, 0x0b, 0xaf, 0xe0, 0x33, 0x34, 0xdd, 0xf6, 0xf0, 0x72, 0x6d, 0x2d, 0xeb, 0x85, 0x5d, + 0x1d, 0xbc, 0xdf, 0x0c, 0x73, 0xdf, 0xbc, 0x19, 0x56, 0xb6, 0xcd, 0xcd, 0xb0, 0xd2, 0x2d, 0xf1, + 0xca, 0xfd, 0xd1, 0x5b, 0x5d, 0xa8, 0x70, 0xd6, 0xb4, 0x3f, 0xed, 0xcd, 0x6f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x95, 0x3c, 0x3c, 0x9f, 0x1e, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// AccountClient is the client API for Account service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AccountClient interface { + // Get returns an Account matching the criteria of the request. + Get(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*account.Account, error) + // List returns all Accounts matching the criteria of the request. + List(ctx context.Context, in *ListAccountRequest, opts ...grpc.CallOption) (*ListAccountResponse, error) + // Create an Account with a name and password. + Create(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error) + // Delete an Account. + Delete(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) +} + +type accountClient struct { + cc *grpc.ClientConn +} + +func NewAccountClient(cc *grpc.ClientConn) AccountClient { + return &accountClient{cc} +} + +func (c *accountClient) Get(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*account.Account, error) { + out := new(account.Account) + err := c.cc.Invoke(ctx, "/mesg.api.Account/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountClient) List(ctx context.Context, in *ListAccountRequest, opts ...grpc.CallOption) (*ListAccountResponse, error) { + out := new(ListAccountResponse) + err := c.cc.Invoke(ctx, "/mesg.api.Account/List", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountClient) Create(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error) { + out := new(CreateAccountResponse) + err := c.cc.Invoke(ctx, "/mesg.api.Account/Create", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountClient) Delete(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) { + out := new(DeleteAccountResponse) + err := c.cc.Invoke(ctx, "/mesg.api.Account/Delete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountServer is the server API for Account service. +type AccountServer interface { + // Get returns an Account matching the criteria of the request. + Get(context.Context, *GetAccountRequest) (*account.Account, error) + // List returns all Accounts matching the criteria of the request. + List(context.Context, *ListAccountRequest) (*ListAccountResponse, error) + // Create an Account with a name and password. + Create(context.Context, *CreateAccountRequest) (*CreateAccountResponse, error) + // Delete an Account. + Delete(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error) +} + +// UnimplementedAccountServer can be embedded to have forward compatible implementations. +type UnimplementedAccountServer struct { +} + +func (*UnimplementedAccountServer) Get(ctx context.Context, req *GetAccountRequest) (*account.Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (*UnimplementedAccountServer) List(ctx context.Context, req *ListAccountRequest) (*ListAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (*UnimplementedAccountServer) Create(ctx context.Context, req *CreateAccountRequest) (*CreateAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (*UnimplementedAccountServer) Delete(ctx context.Context, req *DeleteAccountRequest) (*DeleteAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} + +func RegisterAccountServer(s *grpc.Server, srv AccountServer) { + s.RegisterService(&_Account_serviceDesc, srv) +} + +func _Account_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mesg.api.Account/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServer).Get(ctx, req.(*GetAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Account_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mesg.api.Account/List", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServer).List(ctx, req.(*ListAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Account_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mesg.api.Account/Create", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServer).Create(ctx, req.(*CreateAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Account_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mesg.api.Account/Delete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServer).Delete(ctx, req.(*DeleteAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Account_serviceDesc = grpc.ServiceDesc{ + ServiceName: "mesg.api.Account", + HandlerType: (*AccountServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _Account_Get_Handler, + }, + { + MethodName: "List", + Handler: _Account_List_Handler, + }, + { + MethodName: "Create", + Handler: _Account_Create_Handler, + }, + { + MethodName: "Delete", + Handler: _Account_Delete_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "protobuf/api/account.proto", +} diff --git a/protobuf/api/account.proto b/protobuf/api/account.proto new file mode 100644 index 000000000..d9908df4c --- /dev/null +++ b/protobuf/api/account.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +import "protobuf/types/account.proto"; +import "gogo/protobuf/gogoproto/gogo.proto"; + +package mesg.api; +option go_package = "api"; + +// This is the API to interact with the Accounts. +// +// This API is a [gRPC](https://grpc.io/) API. +// +// The source file of this API is hosted on [GitHub](https://github.com/mesg-foundation/engine/blob/master/protobuf/api/account.proto). +service Account { + + // Get returns an Account matching the criteria of the request. + rpc Get (GetAccountRequest) returns (types.Account) {} + + // List returns all Accounts matching the criteria of the request. + rpc List (ListAccountRequest) returns (ListAccountResponse) {} + + // Create an Account with a name and password. + rpc Create (CreateAccountRequest) returns (CreateAccountResponse) {} + + // Delete an Account. + rpc Delete (DeleteAccountRequest) returns (DeleteAccountResponse) {} +} + +// The request's data for the `Get` API. +message GetAccountRequest { + string name = 1; +} + +// The request's data for the `List` API. +message ListAccountRequest { +} + +// The response's data for the `List` API. +message ListAccountResponse { + repeated types.Account accounts = 1; +} + +// The request's data for the `Create` API. +message CreateAccountRequest { + string name = 1; + string password = 2; +} + +// The response's data for the `Create` API. +message CreateAccountResponse { + string address = 1; + string mnemonic = 2; +} + +// The request's data for the `Delete` API. +message DeleteAccountRequest { + string name = 1; + string password = 2; +} + +// The response's data for the `Delete` API. +message DeleteAccountResponse {} diff --git a/protobuf/api/event.pb.go b/protobuf/api/event.pb.go index 8cba869dc..cd32a920a 100644 --- a/protobuf/api/event.pb.go +++ b/protobuf/api/event.pb.go @@ -197,39 +197,40 @@ func (m *CreateEventResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateEventResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*StreamEventRequest)(nil), "api.StreamEventRequest") - proto.RegisterType((*StreamEventRequest_Filter)(nil), "api.StreamEventRequest.Filter") - proto.RegisterType((*CreateEventRequest)(nil), "api.CreateEventRequest") - proto.RegisterType((*CreateEventResponse)(nil), "api.CreateEventResponse") + proto.RegisterType((*StreamEventRequest)(nil), "mesg.api.StreamEventRequest") + proto.RegisterType((*StreamEventRequest_Filter)(nil), "mesg.api.StreamEventRequest.Filter") + proto.RegisterType((*CreateEventRequest)(nil), "mesg.api.CreateEventRequest") + proto.RegisterType((*CreateEventResponse)(nil), "mesg.api.CreateEventResponse") } func init() { proto.RegisterFile("protobuf/api/event.proto", fileDescriptor_c0ad091fa003d2ac) } var fileDescriptor_c0ad091fa003d2ac = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xcd, 0x4a, 0x33, 0x31, - 0x14, 0x6d, 0xda, 0x7e, 0x03, 0x5f, 0xda, 0x85, 0x44, 0xc4, 0x21, 0x82, 0x2d, 0xb3, 0xaa, 0x88, - 0x89, 0xb4, 0xe0, 0xce, 0x8d, 0xe2, 0xcf, 0x7a, 0x5c, 0xb8, 0x13, 0xd2, 0xe9, 0xed, 0x4c, 0xd0, - 0x26, 0xe3, 0x24, 0x23, 0x14, 0x1f, 0xc1, 0x37, 0xf1, 0x19, 0x7c, 0x00, 0x9f, 0xc1, 0x45, 0x9f, - 0x45, 0x92, 0xa9, 0xc5, 0x76, 0x76, 0xd2, 0x5d, 0x72, 0xee, 0xc9, 0xb9, 0x27, 0xf7, 0x1e, 0x1c, - 0xe6, 0x85, 0xb6, 0x7a, 0x5c, 0x4e, 0xb9, 0xc8, 0x25, 0x87, 0x17, 0x50, 0x96, 0x79, 0x88, 0xb4, - 0x44, 0x2e, 0x69, 0x94, 0xea, 0x54, 0xf3, 0x15, 0xc7, 0xdd, 0xfc, 0xc5, 0x9f, 0x2a, 0x22, 0x3d, - 0x58, 0x95, 0xed, 0x3c, 0x07, 0xc3, 0x8d, 0x2d, 0xca, 0x64, 0xa9, 0x42, 0xe9, 0x46, 0xf1, 0x57, - 0x87, 0xe8, 0xad, 0x89, 0xc9, 0x9d, 0x2d, 0x40, 0xcc, 0xae, 0x1c, 0x1a, 0xc3, 0x73, 0x09, 0xc6, - 0x92, 0x33, 0x1c, 0x4c, 0xe5, 0x93, 0x85, 0x22, 0x44, 0x7d, 0x34, 0xe8, 0x0c, 0x0f, 0x99, 0xc8, - 0x25, 0xab, 0x13, 0xd9, 0xb5, 0x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0xcf, 0xa3, 0xef, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xc2, 0x69, 0x1c, 0xd6, 0x1c, 0x03, 0x00, 0x00, + // 376 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x4d, 0x4e, 0xeb, 0x30, + 0x18, 0xac, 0xfb, 0x13, 0xbd, 0xe7, 0x76, 0xf1, 0x9e, 0x11, 0x52, 0x14, 0x40, 0xad, 0xc2, 0xa6, + 0x08, 0xe1, 0xa0, 0x76, 0x89, 0xd8, 0x14, 0x41, 0x59, 0x87, 0x05, 0x12, 0x0b, 0x24, 0x37, 0xfd, + 0x9a, 0x58, 0x50, 0x3b, 0xc4, 0x0e, 0x52, 0x4f, 0x01, 0xe7, 0xe0, 0x0c, 0x1c, 0x80, 0x33, 0xb0, + 0xe8, 0x59, 0x50, 0xec, 0xb6, 0xf4, 0x47, 0x6c, 0x50, 0x77, 0xf6, 0x37, 0xe3, 0xf1, 0x68, 0xbe, + 0xc1, 0x6e, 0x9a, 0x49, 0x2d, 0x07, 0xf9, 0x28, 0x60, 0x29, 0x0f, 0xe0, 0x19, 0x84, 0xa6, 0x66, + 0x44, 0xfe, 0x8c, 0x41, 0xc5, 0x94, 0xa5, 0xdc, 0xf3, 0x63, 0x19, 0xcb, 0x60, 0x41, 0x2c, 0x6e, + 0xe6, 0x62, 0x4e, 0x96, 0xed, 0xed, 0x2d, 0x60, 0x3d, 0x49, 0x41, 0x05, 0x4a, 0x67, 0x79, 0x34, + 0x93, 0xf2, 0xbc, 0x35, 0x70, 0xe9, 0x1b, 0xff, 0xb5, 0x8c, 0xc9, 0x8d, 0xce, 0x80, 0x8d, 0x2f, + 0x8b, 0x69, 0x08, 0x4f, 0x39, 0x28, 0x4d, 0xce, 0xb0, 0x33, 0xe2, 0x8f, 0x1a, 0x32, 0x17, 0xb5, + 0x50, 0xbb, 0xde, 0x39, 0xa4, 0x73, 0x3b, 0x74, 0x93, 0x4d, 0xaf, 0x0c, 0x35, 0x9c, 0x3d, 0xf1, + 0xde, 0x11, 0x76, 0xec, 0x88, 0xf4, 0x71, 0x35, 0x61, 0x2a, 0x31, 0x2a, 0x8d, 0x5e, 0xf7, 0x63, + 0xda, 0x2c, 0x7d, 0x4e, 0x9b, 0xc7, 0x31, 0xd7, 0x49, 0x3e, 0xa0, 0x91, 0x1c, 0x07, 0x85, 0xee, + 0xc9, 0x48, 0xe6, 0x62, 0xc8, 0x34, 0x97, 0x22, 0x00, 0x11, 0x73, 0x01, 0x41, 0xf1, 0x8a, 0x5e, + 0x33, 0x95, 0x84, 0x46, 0x80, 0xdc, 0xe2, 0x06, 0x17, 0x4a, 0x33, 0x11, 0x41, 0x31, 0x75, 0xcb, + 0xbf, 0x17, 0x5c, 0x11, 0x22, 0xff, 0x70, 0xe5, 0x01, 0x26, 0x6e, 0xa5, 0x85, 0xda, 0x7f, 0xc3, + 0xe2, 0xe8, 0xbf, 0x21, 0x4c, 0x2e, 0x32, 0x60, 0x1a, 0x56, 0x22, 0x59, 0x77, 0x80, 0xb6, 0xec, + 0xa0, 0xbc, 0x70, 0x40, 0x8e, 0x70, 0x75, 0xc8, 0x34, 0x33, 0xa6, 0xea, 0x9d, 0x5d, 0x9b, 0xfd, + 0x7c, 0x89, 0xc5, 0x02, 0xf2, 0x48, 0x87, 0x86, 0xe2, 0xdf, 0xe3, 0x9d, 0x15, 0xaf, 0x2a, 0x95, + 0x42, 0xc1, 0xd6, 0x72, 0xef, 0xbc, 0x20, 0x5c, 0x33, 0xd2, 0xa4, 0x8f, 0x1d, 0xfb, 0x13, 0xd9, + 0xff, 0x2e, 0xc3, 0x66, 0x4e, 0xde, 0xc1, 0x0f, 0xa8, 0x75, 0xe6, 0x97, 0xc8, 0x39, 0x76, 0x6c, + 0x87, 0x96, 0x85, 0x36, 0x5b, 0xe5, 0xfd, 0xb7, 0xa8, 0xe9, 0x2c, 0x35, 0x88, 0x5f, 0x3a, 0x45, + 0xbd, 0xda, 0x5d, 0x85, 0xa5, 0x7c, 0xe0, 0x98, 0x3c, 0xba, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xea, 0x67, 0xd1, 0x98, 0x42, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -261,7 +262,7 @@ func NewEventClient(cc *grpc.ClientConn) EventClient { func (c *eventClient) Create(ctx context.Context, in *CreateEventRequest, opts ...grpc.CallOption) (*CreateEventResponse, error) { out := new(CreateEventResponse) - err := c.cc.Invoke(ctx, "/api.Event/Create", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Event/Create", in, out, opts...) if err != nil { return nil, err } @@ -269,7 +270,7 @@ func (c *eventClient) Create(ctx context.Context, in *CreateEventRequest, opts . } func (c *eventClient) Stream(ctx context.Context, in *StreamEventRequest, opts ...grpc.CallOption) (Event_StreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_Event_serviceDesc.Streams[0], "/api.Event/Stream", opts...) + stream, err := c.cc.NewStream(ctx, &_Event_serviceDesc.Streams[0], "/mesg.api.Event/Stream", opts...) if err != nil { return nil, err } @@ -334,7 +335,7 @@ func _Event_Create_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Event/Create", + FullMethod: "/mesg.api.Event/Create", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EventServer).Create(ctx, req.(*CreateEventRequest)) @@ -364,7 +365,7 @@ func (x *eventStreamServer) Send(m *event.Event) error { } var _Event_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Event", + ServiceName: "mesg.api.Event", HandlerType: (*EventServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/protobuf/api/event.proto b/protobuf/api/event.proto index 300880f00..4c73ae6ff 100644 --- a/protobuf/api/event.proto +++ b/protobuf/api/event.proto @@ -4,7 +4,8 @@ import "gogo/protobuf/gogoproto/gogo.proto"; import "protobuf/types/struct.proto"; import "protobuf/types/event.proto"; -package api; +package mesg.api; +option go_package = "api"; // This is the API to interact with the Events. // diff --git a/protobuf/api/execution.pb.go b/protobuf/api/execution.pb.go index 3e9fcc4f5..ed5b80cda 100644 --- a/protobuf/api/execution.pb.go +++ b/protobuf/api/execution.pb.go @@ -193,7 +193,7 @@ func (m *StreamExecutionRequest) GetFilter() *StreamExecutionRequest_Filter { // Filter contains filtering criteria. type StreamExecutionRequest_Filter struct { // Statuses to filter executions. One status needs to be present in the execution. - Statuses []execution.Status `protobuf:"varint,1,rep,packed,name=statuses,proto3,enum=types.Status" json:"statuses,omitempty"` + Statuses []execution.Status `protobuf:"varint,1,rep,packed,name=statuses,proto3,enum=mesg.types.Status" json:"statuses,omitempty"` // Instance's hash to filter executions. InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash"` // taskKey to filter executions. @@ -364,51 +364,52 @@ func (m *UpdateExecutionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_UpdateExecutionResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*CreateExecutionRequest)(nil), "api.CreateExecutionRequest") - proto.RegisterType((*CreateExecutionResponse)(nil), "api.CreateExecutionResponse") - proto.RegisterType((*GetExecutionRequest)(nil), "api.GetExecutionRequest") - proto.RegisterType((*StreamExecutionRequest)(nil), "api.StreamExecutionRequest") - proto.RegisterType((*StreamExecutionRequest_Filter)(nil), "api.StreamExecutionRequest.Filter") - proto.RegisterType((*UpdateExecutionRequest)(nil), "api.UpdateExecutionRequest") - proto.RegisterType((*UpdateExecutionResponse)(nil), "api.UpdateExecutionResponse") + proto.RegisterType((*CreateExecutionRequest)(nil), "mesg.api.CreateExecutionRequest") + proto.RegisterType((*CreateExecutionResponse)(nil), "mesg.api.CreateExecutionResponse") + proto.RegisterType((*GetExecutionRequest)(nil), "mesg.api.GetExecutionRequest") + proto.RegisterType((*StreamExecutionRequest)(nil), "mesg.api.StreamExecutionRequest") + proto.RegisterType((*StreamExecutionRequest_Filter)(nil), "mesg.api.StreamExecutionRequest.Filter") + proto.RegisterType((*UpdateExecutionRequest)(nil), "mesg.api.UpdateExecutionRequest") + proto.RegisterType((*UpdateExecutionResponse)(nil), "mesg.api.UpdateExecutionResponse") } func init() { proto.RegisterFile("protobuf/api/execution.proto", fileDescriptor_96e2c86581f82f05) } var fileDescriptor_96e2c86581f82f05 = []byte{ - // 503 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xb5, 0xe3, 0xe0, 0x36, 0xd3, 0x82, 0xd0, 0x22, 0x52, 0x93, 0x56, 0x34, 0xf2, 0xc9, 0x08, - 0x75, 0x0d, 0xc9, 0x0d, 0x6e, 0x45, 0x25, 0x91, 0xb8, 0x39, 0x42, 0xdc, 0x90, 0x36, 0xe9, 0xc4, - 0xb6, 0x68, 0xbc, 0xc6, 0x3b, 0x2b, 0xd1, 0x6f, 0xe0, 0xc4, 0xcf, 0x70, 0xe0, 0x0b, 0x38, 0xf1, - 0x01, 0x1c, 0xfa, 0x2d, 0xc8, 0x6b, 0xc7, 0x52, 0x6b, 0xc3, 0x85, 0xf6, 0xe6, 0x99, 0xf7, 0x66, - 0x66, 0xdf, 0xcc, 0x33, 0x1c, 0xe5, 0x85, 0x24, 0xb9, 0xd4, 0xeb, 0x50, 0xe4, 0x69, 0x88, 0x5f, - 0x70, 0xa5, 0x29, 0x95, 0x19, 0x37, 0x69, 0xe6, 0x88, 0x3c, 0x1d, 0xf9, 0xb1, 0x8c, 0x65, 0xd8, - 0xf0, 0xca, 0xc8, 0x04, 0xe6, 0xab, 0x22, 0x8e, 0x0e, 0x1b, 0x98, 0x2e, 0x73, 0x54, 0xa1, 0xa2, - 0x42, 0xaf, 0xa8, 0x06, 0x9f, 0xde, 0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17, 0x05, 0x00, 0x00, + // 519 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xed, 0x38, 0x75, 0x93, 0x69, 0xc5, 0x61, 0x51, 0x53, 0x13, 0xfe, 0xd4, 0xf8, 0x42, + 0x24, 0xd4, 0x35, 0xa4, 0x67, 0x84, 0x14, 0x54, 0x12, 0x89, 0x03, 0x92, 0x23, 0x84, 0xc4, 0x01, + 0x69, 0x93, 0x4e, 0x1c, 0x8b, 0xc6, 0x6b, 0xbc, 0xb3, 0x12, 0x7d, 0x16, 0x1e, 0x03, 0x89, 0x2b, + 0x57, 0x4e, 0x3c, 0x00, 0x87, 0x3e, 0x0b, 0xca, 0x6e, 0x92, 0xa6, 0x8d, 0xdb, 0x0b, 0xed, 0xcd, + 0xb3, 0xf3, 0xed, 0xb7, 0xfb, 0xed, 0xfc, 0x0c, 0x8f, 0x8a, 0x52, 0x92, 0x1c, 0xe9, 0x49, 0x2c, + 0x8a, 0x2c, 0xc6, 0x6f, 0x38, 0xd6, 0x94, 0xc9, 0x9c, 0x9b, 0x65, 0xd6, 0x98, 0xa1, 0x4a, 0xb9, + 0x28, 0xb2, 0x76, 0x94, 0xca, 0x54, 0xc6, 0x2b, 0xf1, 0xbc, 0x32, 0x85, 0xf9, 0xb2, 0xea, 0xf6, + 0xc3, 0x55, 0x9b, 0xce, 0x0a, 0x54, 0xb1, 0xa2, 0x52, 0x8f, 0x69, 0xd1, 0x7c, 0x72, 0xa5, 0x79, + 0xe5, 0xa8, 0xe8, 0x8f, 0x0b, 0xad, 0x37, 0x25, 0x0a, 0xc2, 0xe3, 0x65, 0x27, 0xc1, 0xaf, 0x1a, + 0x15, 0xb1, 0x8f, 0xb0, 0x9b, 0xe5, 0x8a, 0x44, 0x3e, 0xc6, 0x81, 0x50, 0xd3, 0xc0, 0x0d, 0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x34, 0xbd, 0x64, 0xa5, 0xd9, 0x00, 0xa2, 0x76, 0x07, 0x40, 0x78, 0x97, + 0x81, 0xa8, 0x9a, 0xf0, 0x4f, 0x17, 0x5a, 0x1f, 0x8a, 0x93, 0x2a, 0x64, 0x6f, 0x6b, 0x02, 0xec, + 0x25, 0x6c, 0x4b, 0x4d, 0x86, 0xc4, 0xda, 0x0d, 0x24, 0x0e, 0x9c, 0x64, 0xa9, 0x63, 0x2d, 0xd8, + 0xc2, 0xb2, 0x94, 0xa5, 0x8d, 0x30, 0x70, 0x12, 0x5b, 0xf6, 0x1a, 0xe0, 0x97, 0xa8, 0xf4, 0x29, + 0x45, 0x0f, 0x60, 0x7f, 0xe3, 0xde, 0x16, 0xcd, 0xee, 0x8f, 0x1a, 0x34, 0x57, 0xab, 0xec, 0x3d, + 0xf8, 0x96, 0x61, 0x16, 0x5e, 0x8c, 0xb7, 0xfa, 0x2f, 0x6d, 0x3f, 0xbd, 0x41, 0x61, 0xcd, 0x23, + 0x87, 0xbd, 0x02, 0xaf, 0x8f, 0xc4, 0x1e, 0x5f, 0x68, 0x2b, 0xf8, 0x6d, 0xef, 0xad, 0x4f, 0x7f, + 0xd5, 0x8d, 0x1c, 0x76, 0x0c, 0xbe, 0x85, 0x6b, 0xfd, 0x3e, 0xd5, 0xb8, 0x5d, 0x6b, 0xf2, 0xc2, + 0x9d, 0xc7, 0xb2, 0xf9, 0xd7, 0x6d, 0xaa, 0x27, 0xb9, 0x1e, 0xeb, 0x9a, 0x37, 0x8b, 0x9c, 0xde, + 0xd6, 0x27, 0x4f, 0x14, 0xd9, 0xc8, 0x37, 0x53, 0x39, 0xfa, 0x17, 0x00, 0x00, 0xff, 0xff, 0x9d, + 0xc6, 0x54, 0x3a, 0x55, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -444,7 +445,7 @@ func NewExecutionClient(cc *grpc.ClientConn) ExecutionClient { func (c *executionClient) Create(ctx context.Context, in *CreateExecutionRequest, opts ...grpc.CallOption) (*CreateExecutionResponse, error) { out := new(CreateExecutionResponse) - err := c.cc.Invoke(ctx, "/api.Execution/Create", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Execution/Create", in, out, opts...) if err != nil { return nil, err } @@ -453,7 +454,7 @@ func (c *executionClient) Create(ctx context.Context, in *CreateExecutionRequest func (c *executionClient) Get(ctx context.Context, in *GetExecutionRequest, opts ...grpc.CallOption) (*execution.Execution, error) { out := new(execution.Execution) - err := c.cc.Invoke(ctx, "/api.Execution/Get", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Execution/Get", in, out, opts...) if err != nil { return nil, err } @@ -461,7 +462,7 @@ func (c *executionClient) Get(ctx context.Context, in *GetExecutionRequest, opts } func (c *executionClient) Stream(ctx context.Context, in *StreamExecutionRequest, opts ...grpc.CallOption) (Execution_StreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_Execution_serviceDesc.Streams[0], "/api.Execution/Stream", opts...) + stream, err := c.cc.NewStream(ctx, &_Execution_serviceDesc.Streams[0], "/mesg.api.Execution/Stream", opts...) if err != nil { return nil, err } @@ -494,7 +495,7 @@ func (x *executionStreamClient) Recv() (*execution.Execution, error) { func (c *executionClient) Update(ctx context.Context, in *UpdateExecutionRequest, opts ...grpc.CallOption) (*UpdateExecutionResponse, error) { out := new(UpdateExecutionResponse) - err := c.cc.Invoke(ctx, "/api.Execution/Update", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Execution/Update", in, out, opts...) if err != nil { return nil, err } @@ -545,7 +546,7 @@ func _Execution_Create_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Execution/Create", + FullMethod: "/mesg.api.Execution/Create", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServer).Create(ctx, req.(*CreateExecutionRequest)) @@ -563,7 +564,7 @@ func _Execution_Get_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Execution/Get", + FullMethod: "/mesg.api.Execution/Get", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServer).Get(ctx, req.(*GetExecutionRequest)) @@ -602,7 +603,7 @@ func _Execution_Update_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Execution/Update", + FullMethod: "/mesg.api.Execution/Update", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServer).Update(ctx, req.(*UpdateExecutionRequest)) @@ -611,7 +612,7 @@ func _Execution_Update_Handler(srv interface{}, ctx context.Context, dec func(in } var _Execution_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Execution", + ServiceName: "mesg.api.Execution", HandlerType: (*ExecutionServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/protobuf/api/execution.proto b/protobuf/api/execution.proto index 41c45e289..e99dbdfd6 100644 --- a/protobuf/api/execution.proto +++ b/protobuf/api/execution.proto @@ -4,7 +4,8 @@ import "gogo/protobuf/gogoproto/gogo.proto"; import "protobuf/types/struct.proto"; import "protobuf/types/execution.proto"; -package api; +package mesg.api; +option go_package = "api"; // This is the API to interact with the Executions. // diff --git a/protobuf/api/instance.pb.go b/protobuf/api/instance.pb.go index 492485ede..d13004777 100644 --- a/protobuf/api/instance.pb.go +++ b/protobuf/api/instance.pb.go @@ -60,7 +60,7 @@ func (m *GetInstanceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GetInstanceRequest proto.InternalMessageInfo // The request's data for the `List` API. -type ListInstancesRequest struct { +type ListInstanceRequest struct { // Filter by Services' hash. ServiceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=serviceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"serviceHash"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -68,32 +68,32 @@ type ListInstancesRequest struct { XXX_sizecache int32 `json:"-"` } -func (m *ListInstancesRequest) Reset() { *m = ListInstancesRequest{} } -func (m *ListInstancesRequest) String() string { return proto.CompactTextString(m) } -func (*ListInstancesRequest) ProtoMessage() {} -func (*ListInstancesRequest) Descriptor() ([]byte, []int) { +func (m *ListInstanceRequest) Reset() { *m = ListInstanceRequest{} } +func (m *ListInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*ListInstanceRequest) ProtoMessage() {} +func (*ListInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_71d44b8f4a870f63, []int{1} } -func (m *ListInstancesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListInstancesRequest.Unmarshal(m, b) +func (m *ListInstanceRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListInstanceRequest.Unmarshal(m, b) } -func (m *ListInstancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListInstancesRequest.Marshal(b, m, deterministic) +func (m *ListInstanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListInstanceRequest.Marshal(b, m, deterministic) } -func (m *ListInstancesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListInstancesRequest.Merge(m, src) +func (m *ListInstanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListInstanceRequest.Merge(m, src) } -func (m *ListInstancesRequest) XXX_Size() int { - return xxx_messageInfo_ListInstancesRequest.Size(m) +func (m *ListInstanceRequest) XXX_Size() int { + return xxx_messageInfo_ListInstanceRequest.Size(m) } -func (m *ListInstancesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListInstancesRequest.DiscardUnknown(m) +func (m *ListInstanceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListInstanceRequest.DiscardUnknown(m) } -var xxx_messageInfo_ListInstancesRequest proto.InternalMessageInfo +var xxx_messageInfo_ListInstanceRequest proto.InternalMessageInfo // The response's data for the `List` API. -type ListInstancesResponse struct { +type ListInstanceResponse struct { // List of instances that match the request's filters. Instances []*instance.Instance `protobuf:"bytes,1,rep,name=instances,proto3" json:"instances,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -101,31 +101,31 @@ type ListInstancesResponse struct { XXX_sizecache int32 `json:"-"` } -func (m *ListInstancesResponse) Reset() { *m = ListInstancesResponse{} } -func (m *ListInstancesResponse) String() string { return proto.CompactTextString(m) } -func (*ListInstancesResponse) ProtoMessage() {} -func (*ListInstancesResponse) Descriptor() ([]byte, []int) { +func (m *ListInstanceResponse) Reset() { *m = ListInstanceResponse{} } +func (m *ListInstanceResponse) String() string { return proto.CompactTextString(m) } +func (*ListInstanceResponse) ProtoMessage() {} +func (*ListInstanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_71d44b8f4a870f63, []int{2} } -func (m *ListInstancesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListInstancesResponse.Unmarshal(m, b) +func (m *ListInstanceResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListInstanceResponse.Unmarshal(m, b) } -func (m *ListInstancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListInstancesResponse.Marshal(b, m, deterministic) +func (m *ListInstanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListInstanceResponse.Marshal(b, m, deterministic) } -func (m *ListInstancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListInstancesResponse.Merge(m, src) +func (m *ListInstanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListInstanceResponse.Merge(m, src) } -func (m *ListInstancesResponse) XXX_Size() int { - return xxx_messageInfo_ListInstancesResponse.Size(m) +func (m *ListInstanceResponse) XXX_Size() int { + return xxx_messageInfo_ListInstanceResponse.Size(m) } -func (m *ListInstancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListInstancesResponse.DiscardUnknown(m) +func (m *ListInstanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListInstanceResponse.DiscardUnknown(m) } -var xxx_messageInfo_ListInstancesResponse proto.InternalMessageInfo +var xxx_messageInfo_ListInstanceResponse proto.InternalMessageInfo -func (m *ListInstancesResponse) GetInstances() []*instance.Instance { +func (m *ListInstanceResponse) GetInstances() []*instance.Instance { if m != nil { return m.Instances } @@ -281,44 +281,44 @@ func (m *DeleteInstanceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteInstanceResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*GetInstanceRequest)(nil), "api.GetInstanceRequest") - proto.RegisterType((*ListInstancesRequest)(nil), "api.ListInstancesRequest") - proto.RegisterType((*ListInstancesResponse)(nil), "api.ListInstancesResponse") - proto.RegisterType((*CreateInstanceRequest)(nil), "api.CreateInstanceRequest") - proto.RegisterType((*CreateInstanceResponse)(nil), "api.CreateInstanceResponse") - proto.RegisterType((*DeleteInstanceRequest)(nil), "api.DeleteInstanceRequest") - proto.RegisterType((*DeleteInstanceResponse)(nil), "api.DeleteInstanceResponse") + proto.RegisterType((*GetInstanceRequest)(nil), "mesg.api.GetInstanceRequest") + proto.RegisterType((*ListInstanceRequest)(nil), "mesg.api.ListInstanceRequest") + proto.RegisterType((*ListInstanceResponse)(nil), "mesg.api.ListInstanceResponse") + proto.RegisterType((*CreateInstanceRequest)(nil), "mesg.api.CreateInstanceRequest") + proto.RegisterType((*CreateInstanceResponse)(nil), "mesg.api.CreateInstanceResponse") + proto.RegisterType((*DeleteInstanceRequest)(nil), "mesg.api.DeleteInstanceRequest") + proto.RegisterType((*DeleteInstanceResponse)(nil), "mesg.api.DeleteInstanceResponse") } func init() { proto.RegisterFile("protobuf/api/instance.proto", fileDescriptor_71d44b8f4a870f63) } var fileDescriptor_71d44b8f4a870f63 = []byte{ - // 386 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xc1, 0x0e, 0xd2, 0x40, - 0x10, 0x6d,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x04, - 0x00, 0x00, + // 400 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xcd, 0x8e, 0xd3, 0x30, + 0x10, 0x4e, 0x1a, 0x58, 0x75, 0x67, 0x39, 0x20, 0xb3, 0xac, 0xa2, 0x40, 0xdb, 0xc8, 0xa7, 0x48, + 0x08, 0x47, 0x6a, 0x8f, 0xdc, 0x4a, 0xa5, 0x16, 0x04, 0x97, 0x48, 0x5c, 0x90, 0x38, 0xb8, 0xed, + 0x34, 0xb1, 0xd4, 0xda, 0xa1, 0x76, 0x2a, 0x71, 0xe3, 0x89, 0x78, 0x0e, 0x9e, 0x81, 0x43, 0x9f, + 0x05, 0xc5, 0xe9, 0x4f, 0x68, 0xd3, 0x13, 0xd5, 0xde, 0xec, 0xf1, 0xcc, 0x37, 0xdf, 0x37, 0xf3, + 0x19, 0x5e, 0xe5, 0x6b, 0x65, 0xd4, 0xb4, 0x58, 0xc4, 0x3c, 0x17, 0xb1, 0x90, 0xda, 0x70, 0x39, + 0x43, 0x66, 0xa3, 0xa4, 0xbd, 0x42, 0x9d, 0x32, 0x9e, 0x8b, 0x80, 0xa6, 0x2a, 0x55, 0xf1, 0x21, + 0xb7, 0xbc, 0xd9, 0x8b, 0x3d, 0x55, 0xd9, 0x41, 0xe7, 0xf0, 0x6c, 0x7e, 0xe4, 0xa8, 0x4f, 0xc0, + 0xe8, 0x37, 0x20, 0x63, 0x34, 0x1f, 0x76, 0xc1, 0x04, 0xbf, 0x17, 0xa8, 0x0d, 0x19, 0xc3, 0x93, + 0x8c, 0xeb, 0xcc, 0x77, 0x43, 0x37, 0x7a, 0x36, 0x1c, 0xfc, 0xde, 0xf6, 0x9c, 0x3f, 0xdb, 0xde, + 0x9b, 0x54, 0x98, 0xac, 0x98, 0xb2, 0x99, 0x5a, 0xc5, 0x25, 0x87, 0xb7, 0x0b, 0x55, 0xc8, 0x39, + 0x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0x10, 0x5e, 0x4e, 0xa8, 0xc3, 0x55, 0xda, 0xeb, 0x70, 0x8d, + 0xfb, 0xa8, 0xc3, 0x35, 0x8f, 0x8b, 0x3a, 0xc3, 0xa7, 0x5f, 0x3d, 0x9e, 0x8b, 0xe9, 0x8d, 0xfd, + 0xda, 0x83, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x4a, 0xfe, 0x8c, 0x46, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -336,7 +336,7 @@ type InstanceClient interface { // Get returns an Instance matching the criteria of the request. Get(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*instance.Instance, error) // List returns all Instances matching the criteria of the request. - List(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) + List(ctx context.Context, in *ListInstanceRequest, opts ...grpc.CallOption) (*ListInstanceResponse, error) // Create an Instance from a Service's hash and custom environmental variables. // It will return an unique identifier which is used to interact with the Instance. Create(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*CreateInstanceResponse, error) @@ -354,16 +354,16 @@ func NewInstanceClient(cc *grpc.ClientConn) InstanceClient { func (c *instanceClient) Get(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*instance.Instance, error) { out := new(instance.Instance) - err := c.cc.Invoke(ctx, "/api.Instance/Get", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Instance/Get", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *instanceClient) List(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) { - out := new(ListInstancesResponse) - err := c.cc.Invoke(ctx, "/api.Instance/List", in, out, opts...) +func (c *instanceClient) List(ctx context.Context, in *ListInstanceRequest, opts ...grpc.CallOption) (*ListInstanceResponse, error) { + out := new(ListInstanceResponse) + err := c.cc.Invoke(ctx, "/mesg.api.Instance/List", in, out, opts...) if err != nil { return nil, err } @@ -372,7 +372,7 @@ func (c *instanceClient) List(ctx context.Context, in *ListInstancesRequest, opt func (c *instanceClient) Create(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*CreateInstanceResponse, error) { out := new(CreateInstanceResponse) - err := c.cc.Invoke(ctx, "/api.Instance/Create", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Instance/Create", in, out, opts...) if err != nil { return nil, err } @@ -381,7 +381,7 @@ func (c *instanceClient) Create(ctx context.Context, in *CreateInstanceRequest, func (c *instanceClient) Delete(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*DeleteInstanceResponse, error) { out := new(DeleteInstanceResponse) - err := c.cc.Invoke(ctx, "/api.Instance/Delete", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Instance/Delete", in, out, opts...) if err != nil { return nil, err } @@ -393,7 +393,7 @@ type InstanceServer interface { // Get returns an Instance matching the criteria of the request. Get(context.Context, *GetInstanceRequest) (*instance.Instance, error) // List returns all Instances matching the criteria of the request. - List(context.Context, *ListInstancesRequest) (*ListInstancesResponse, error) + List(context.Context, *ListInstanceRequest) (*ListInstanceResponse, error) // Create an Instance from a Service's hash and custom environmental variables. // It will return an unique identifier which is used to interact with the Instance. Create(context.Context, *CreateInstanceRequest) (*CreateInstanceResponse, error) @@ -408,7 +408,7 @@ type UnimplementedInstanceServer struct { func (*UnimplementedInstanceServer) Get(ctx context.Context, req *GetInstanceRequest) (*instance.Instance, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } -func (*UnimplementedInstanceServer) List(ctx context.Context, req *ListInstancesRequest) (*ListInstancesResponse, error) { +func (*UnimplementedInstanceServer) List(ctx context.Context, req *ListInstanceRequest) (*ListInstanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } func (*UnimplementedInstanceServer) Create(ctx context.Context, req *CreateInstanceRequest) (*CreateInstanceResponse, error) { @@ -432,7 +432,7 @@ func _Instance_Get_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Instance/Get", + FullMethod: "/mesg.api.Instance/Get", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InstanceServer).Get(ctx, req.(*GetInstanceRequest)) @@ -441,7 +441,7 @@ func _Instance_Get_Handler(srv interface{}, ctx context.Context, dec func(interf } func _Instance_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListInstancesRequest) + in := new(ListInstanceRequest) if err := dec(in); err != nil { return nil, err } @@ -450,10 +450,10 @@ func _Instance_List_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Instance/List", + FullMethod: "/mesg.api.Instance/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InstanceServer).List(ctx, req.(*ListInstancesRequest)) + return srv.(InstanceServer).List(ctx, req.(*ListInstanceRequest)) } return interceptor(ctx, in, info, handler) } @@ -468,7 +468,7 @@ func _Instance_Create_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Instance/Create", + FullMethod: "/mesg.api.Instance/Create", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InstanceServer).Create(ctx, req.(*CreateInstanceRequest)) @@ -486,7 +486,7 @@ func _Instance_Delete_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Instance/Delete", + FullMethod: "/mesg.api.Instance/Delete", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InstanceServer).Delete(ctx, req.(*DeleteInstanceRequest)) @@ -495,7 +495,7 @@ func _Instance_Delete_Handler(srv interface{}, ctx context.Context, dec func(int } var _Instance_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Instance", + ServiceName: "mesg.api.Instance", HandlerType: (*InstanceServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/protobuf/api/instance.proto b/protobuf/api/instance.proto index c458c9c50..e802e677b 100644 --- a/protobuf/api/instance.proto +++ b/protobuf/api/instance.proto @@ -3,7 +3,8 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; import "protobuf/types/instance.proto"; -package api; +package mesg.api; +option go_package = "api"; // This is the API to interact with the Instances. // @@ -16,7 +17,7 @@ service Instance { rpc Get (GetInstanceRequest) returns (types.Instance) {} // List returns all Instances matching the criteria of the request. - rpc List (ListInstancesRequest) returns (ListInstancesResponse) {} + rpc List (ListInstanceRequest) returns (ListInstanceResponse) {} // Create an Instance from a Service's hash and custom environmental variables. // It will return an unique identifier which is used to interact with the Instance. @@ -35,7 +36,7 @@ message GetInstanceRequest { } // The request's data for the `List` API. -message ListInstancesRequest { +message ListInstanceRequest { // Filter by Services' hash. bytes serviceHash = 1 [ (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", @@ -44,7 +45,7 @@ message ListInstancesRequest { } // The response's data for the `List` API. -message ListInstancesResponse { +message ListInstanceResponse { // List of instances that match the request's filters. repeated types.Instance instances = 1; } diff --git a/protobuf/api/process.pb.go b/protobuf/api/process.pb.go index 31f9e3133..a59de0959 100644 --- a/protobuf/api/process.pb.go +++ b/protobuf/api/process.pb.go @@ -284,43 +284,45 @@ func (m *ListProcessResponse) GetProcesses() []*process.Process { } func init() { - proto.RegisterType((*CreateProcessRequest)(nil), "api.CreateProcessRequest") - proto.RegisterType((*CreateProcessResponse)(nil), "api.CreateProcessResponse") - proto.RegisterType((*DeleteProcessRequest)(nil), "api.DeleteProcessRequest") - proto.RegisterType((*DeleteProcessResponse)(nil), "api.DeleteProcessResponse") - proto.RegisterType((*GetProcessRequest)(nil), "api.GetProcessRequest") - proto.RegisterType((*ListProcessRequest)(nil), "api.ListProcessRequest") - proto.RegisterType((*ListProcessResponse)(nil), "api.ListProcessResponse") + proto.RegisterType((*CreateProcessRequest)(nil), "mesg.api.CreateProcessRequest") + proto.RegisterType((*CreateProcessResponse)(nil), "mesg.api.CreateProcessResponse") + proto.RegisterType((*DeleteProcessRequest)(nil), "mesg.api.DeleteProcessRequest") + proto.RegisterType((*DeleteProcessResponse)(nil), "mesg.api.DeleteProcessResponse") + proto.RegisterType((*GetProcessRequest)(nil), "mesg.api.GetProcessRequest") + proto.RegisterType((*ListProcessRequest)(nil), "mesg.api.ListProcessRequest") + proto.RegisterType((*ListProcessResponse)(nil), "mesg.api.ListProcessResponse") } func init() { proto.RegisterFile("protobuf/api/process.proto", fileDescriptor_e79ddb1ea8859998) } var fileDescriptor_e79ddb1ea8859998 = []byte{ - // 383 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x41, 0x4f, 0xf2, 0x40, - 0x10, 0x6d, 0xbf, 0x02, 0x5f, 0x98, 0xef, 0x8b, 0xd1, 0x05, 0xa4, 0x36, 0x26, 0x90, 0x9e, 0x30, - 0xea, 0x36, 0x81, 0xa3, 0x27, 0x45, 0x83, 0x07, 0x63, 0x4c, 0xcf, 0x26, 0x5a, 0xe8, 0xd0, 0x36, - 0x4a, 0xb7, 0xb2, 0xdb, 0x03, 0x17, 0x7f, 0x9f, 0xbf, 0xc1, 0x03, 0xff, 0xc4, 0xc4, 0x74, 0xbb, - 0x62, 0x68, 0x7b, 0xd4, 0xdb, 0xce, 0xcc, 0x9b, 0xf7, 0x32, 0xef, 0xb5, 0x60, 0x25, 0x4b, 0x26, - 0xd8, 0x34, 0x9d, 0x3b, 0x5e, 0x12, 0x39, 0xc9, 0x92, 0xcd, 0x90, 0x73, 0x2a, 0x9b, 0xc4, 0xf0, - 0x92, 0xc8, 0xb2, 0x03, 0x16, 0x30, 0x67, 0x83, 0xca, 0x2a, 0x59, 0xc8, 0x57, 0x0e, 0xb4, 0x0e, - 0x37, 0x63, 0xb1, 0x4a, 0x90, 0x6f, 0xd3, 0xd8, 0xaf, 0xd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aa, 0x4d, - 0xce, 0xa1, 0x91, 0x07, 0x44, 0x0e, 0xa8, 0x97, 0x44, 0xb4, 0xea, 0x6b, 0xb1, 0xac, 0xaa, 0x91, - 0x72, 0x41, 0xcb, 0x28, 0x72, 0x83, 0x14, 0x45, 0x55, 0x1c, 0x8a, 0xa2, 0xda, 0x48, 0x8d, 0x38, - 0x60, 0x4c, 0x50, 0x90, 0x7d, 0x09, 0x2a, 0x99, 0x6a, 0x15, 0x6e, 0xb1, 0x35, 0x72, 0x06, 0xb5, - 0xcc, 0x07, 0xd2, 0x95, 0x1b, 0x65, 0xa3, 0x2c, 0xb3, 0x3c, 0xf8, 0x52, 0x9b, 0x36, 0xe4, 0xbf, - 0x31, 0xfa, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xb7, 0xb3, 0x6c, 0x80, 0x03, 0x00, 0x00, + // 402 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xcd, 0x6e, 0xe2, 0x40, + 0x0c, 0x4e, 0x08, 0xb0, 0x8b, 0x77, 0x0f, 0xbb, 0x03, 0x68, 0xa3, 0x2c, 0x2d, 0x28, 0x27, 0xa4, + 0xaa, 0x13, 0x15, 0x4e, 0xbd, 0xd2, 0x22, 0x90, 0x5a, 0x55, 0x55, 0x8e, 0x55, 0xa5, 0x36, 0x10, + 0x93, 0x44, 0x2d, 0x99, 0x94, 0x99, 0x1c, 0x78, 0x83, 0xbe, 0x48, 0xdf, 0xa5, 0xcf, 0xd0, 0x03, + 0xcf, 0x52, 0x65, 0x12, 0xfe, 0xc3, 0xad, 0xbd, 0x8d, 0xed, 0xcf, 0x9f, 0xed, 0xcf, 0x1e, 0x30, + 0xa2, 0x19, 0x13, 0x6c, 0x14, 0x4f, 0x2c, 0x27, 0x0a, 0xac, 0x68, 0xc6, 0xc6, 0xc8, 0x39, 0x95, + 0x4e, 0xf2, 0x73, 0x8a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, 0xd7, 0x01, 0xdf, 0xa1, 0x37, 0x87, 0x50, + 0xdd, 0xf2, 0x66, 0x6a, 0x9e, 0x41, 0x25, 0x3b, 0x01, 0xe4, 0xba, 0x2a, 0x57, 0x53, 0xcd, 0x59, + 0x8d, 0xbd, 0x46, 0x75, 0xde, 0x0a, 0xf0, 0x23, 0x73, 0x93, 0x2b, 0x28, 0xa7, 0x5b, 0x22, 0xc7, + 0x74, 0x79, 0x87, 0x34, 0xef, 0x82, 0x8c, 0xe6, 0xc1, 0x78, 0x26, 0x8a, 0x92, 0x90, 0xa5, 0x7a, + 0x6d, 0x92, 0xe5, 0xad, 0x68, 0x93, 0x2c, 0x5f, 0x61, 0x85, 0x9c, 0x83, 0x36, 0x40, 0x41, 0xfe, + 0xaf, 0x91, 0x7b, 0x92, 0x1b, 0x79, 0x93, 0x9a, 0x0a, 0xe9, 0x43, 0x31, 0x91, 0x8a, 0x34, 0xd6, + 0xb9, 0xfb, 0x82, 0x1a, 0x47, 0x07, 0xa2, 0xcb, 0x0e, 0x7a, 0xa5, 0x3b, 0xcd, 0x89, 0x82, 0x51, + 0x59, 0x7e, 0xad, 0xee, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x20, 0x62, 0x36, 0xc4, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -357,7 +359,7 @@ func NewProcessClient(cc *grpc.ClientConn) ProcessClient { func (c *processClient) Create(ctx context.Context, in *CreateProcessRequest, opts ...grpc.CallOption) (*CreateProcessResponse, error) { out := new(CreateProcessResponse) - err := c.cc.Invoke(ctx, "/api.Process/Create", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Process/Create", in, out, opts...) if err != nil { return nil, err } @@ -366,7 +368,7 @@ func (c *processClient) Create(ctx context.Context, in *CreateProcessRequest, op func (c *processClient) Delete(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteProcessResponse, error) { out := new(DeleteProcessResponse) - err := c.cc.Invoke(ctx, "/api.Process/Delete", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Process/Delete", in, out, opts...) if err != nil { return nil, err } @@ -375,7 +377,7 @@ func (c *processClient) Delete(ctx context.Context, in *DeleteProcessRequest, op func (c *processClient) Get(ctx context.Context, in *GetProcessRequest, opts ...grpc.CallOption) (*process.Process, error) { out := new(process.Process) - err := c.cc.Invoke(ctx, "/api.Process/Get", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Process/Get", in, out, opts...) if err != nil { return nil, err } @@ -384,7 +386,7 @@ func (c *processClient) Get(ctx context.Context, in *GetProcessRequest, opts ... func (c *processClient) List(ctx context.Context, in *ListProcessRequest, opts ...grpc.CallOption) (*ListProcessResponse, error) { out := new(ListProcessResponse) - err := c.cc.Invoke(ctx, "/api.Process/List", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Process/List", in, out, opts...) if err != nil { return nil, err } @@ -436,7 +438,7 @@ func _Process_Create_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Process/Create", + FullMethod: "/mesg.api.Process/Create", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProcessServer).Create(ctx, req.(*CreateProcessRequest)) @@ -454,7 +456,7 @@ func _Process_Delete_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Process/Delete", + FullMethod: "/mesg.api.Process/Delete", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProcessServer).Delete(ctx, req.(*DeleteProcessRequest)) @@ -472,7 +474,7 @@ func _Process_Get_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Process/Get", + FullMethod: "/mesg.api.Process/Get", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProcessServer).Get(ctx, req.(*GetProcessRequest)) @@ -490,7 +492,7 @@ func _Process_List_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Process/List", + FullMethod: "/mesg.api.Process/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProcessServer).List(ctx, req.(*ListProcessRequest)) @@ -499,7 +501,7 @@ func _Process_List_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Process_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Process", + ServiceName: "mesg.api.Process", HandlerType: (*ProcessServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/protobuf/api/process.proto b/protobuf/api/process.proto index 7c5419588..c76d00183 100644 --- a/protobuf/api/process.proto +++ b/protobuf/api/process.proto @@ -3,7 +3,8 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; import "protobuf/types/process.proto"; -package api; +package mesg.api; +option go_package = "api"; // This is the API to interact with the Processes. // diff --git a/protobuf/api/service.pb.go b/protobuf/api/service.pb.go index 758bb0e8b..180abe8f1 100644 --- a/protobuf/api/service.pb.go +++ b/protobuf/api/service.pb.go @@ -341,50 +341,51 @@ func (m *ListServiceResponse) GetServices() []*service.Service { } func init() { - proto.RegisterType((*CreateServiceRequest)(nil), "api.CreateServiceRequest") - proto.RegisterType((*CreateServiceResponse)(nil), "api.CreateServiceResponse") - proto.RegisterType((*DeleteServiceRequest)(nil), "api.DeleteServiceRequest") - proto.RegisterType((*DeleteServiceResponse)(nil), "api.DeleteServiceResponse") - proto.RegisterType((*GetServiceRequest)(nil), "api.GetServiceRequest") - proto.RegisterType((*ListServiceRequest)(nil), "api.ListServiceRequest") - proto.RegisterType((*ListServiceResponse)(nil), "api.ListServiceResponse") + proto.RegisterType((*CreateServiceRequest)(nil), "mesg.api.CreateServiceRequest") + proto.RegisterType((*CreateServiceResponse)(nil), "mesg.api.CreateServiceResponse") + proto.RegisterType((*DeleteServiceRequest)(nil), "mesg.api.DeleteServiceRequest") + proto.RegisterType((*DeleteServiceResponse)(nil), "mesg.api.DeleteServiceResponse") + proto.RegisterType((*GetServiceRequest)(nil), "mesg.api.GetServiceRequest") + proto.RegisterType((*ListServiceRequest)(nil), "mesg.api.ListServiceRequest") + proto.RegisterType((*ListServiceResponse)(nil), "mesg.api.ListServiceResponse") } func init() { proto.RegisterFile("protobuf/api/service.proto", fileDescriptor_0615fe53b372bcb1) } var fileDescriptor_0615fe53b372bcb1 = []byte{ - // 494 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x4d, 0x1a, 0xd7, 0x6d, 0xa7, 0x05, 0xc1, 0x36, 0x6d, 0xb7, 0x56, 0x45, 0x23, 0x9f, 0xc2, - 0x97, 0x2d, 0xa5, 0x47, 0xc4, 0xa1, 0x1f, 0x28, 0x3d, 0x70, 0x32, 0x1c, 0x91, 0x60, 0x63, 0x4f, - 0x9c, 0x55, 0xc9, 0xae, 0xf1, 0xae, 0x2b, 0xe5, 0x1f, 0xf2, 0x1b, 0x38, 0xf4, 0x77, 0x70, 0x41, - 0x42, 0x1e, 0xbb, 0x51, 0xec, 0xe4, 0x08, 0xb7, 0x9d, 0xf7, 0xde, 0xbc, 0xf1, 0xbe, 0xb1, 0x0d, - 0x5e, 0x96, 0x6b, 0xab, 0x27, 0xc5, 0x34, 0x14, 0x99, 0x0c, 0x0d, 0xe6, 0xf7, 0x32, 0xc6, 0x80, - 0x40, 0xd6, 0x13, 0x99, 0xf4, 0xfc, 0x54, 0xa7, 0x3a, 0x5c, 0xaa, 0xca, 0x8a, 0x0a, 0x3a, 0x55, - 0x42, 0xef, 0x6c, 0x49, 0xdb, 0x45, 0x86, 0xa6, 0x69, 0xe3, 0xff, 0xde, 0x82, 0xfe, 0x75, 0x8e, - 0xc2, 0xe2, 0xa7, 0x0a, 0x8f, 0xf0, 0x47, 0x81, 0xc6, 0xb2, 0x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, 0x5f, 0xa7, 0xd2, 0xce, 0x8a, 0x49, 0x10, 0xeb, 0x79, 0x38, 0x47, 0x93, 0xbe, 0x9d, 0xea, - 0x42, 0x25, 0x14, 0x4d, 0x88, 0x2a, 0x95, 0x0a, 0xc3, 0xb2, 0x2b, 0xb8, 0x15, 0x66, 0x16, 0x91, - 0x81, 0xff, 0x15, 0xfa, 0x37, 0xf8, 0x1d, 0xd7, 0x76, 0xfb, 0xcf, 0x06, 0x9c, 0xc0, 0x51, 0x6b, - 0x40, 0x75, 0x05, 0xff, 0x0b, 0x3c, 0x1f, 0xa3, 0xfd, 0x5f, 0x63, 0xfb, 0xc0, 0x3e, 0x4a, 0xd3, - 0xb2, 0xf7, 0x2f, 0xe1, 0xb0, 0x81, 0xd6, 0x69, 0xbe, 0x82, 0xdd, 0xfa, 0x95, 0x37, 0xbc, 0x4b, - 0x9b, 0x7d, 0xda, 0xdc, 0x6c, 0xb4, 0xe4, 0x47, 0x7f, 0xba, 0xb0, 0x53, 0xa3, 0xec, 0x12, 0xdc, - 0x6a, 0x3d, 0xec, 0x34, 0x10, 0x99, 0x0c, 0x36, 0x7d, 0x25, 0x9e, 0xb7, 0x89, 0xaa, 0x33, 0xe8, - 0x94, 0x16, 0x55, 0x3c, 0xb5, 0xc5, 0xa6, 0x65, 0xd4, 0x16, 0x9b, 0x63, 0xec, 0xb0, 0x10, 0x7a, - 0x63, 0xb4, 0xec, 0x98, 0x44, 0x6b, 0x91, 0x7a, 0xad, 0xab, 0xf8, 0x1d, 0xf6, 0x0e, 0x9c, 0x32, - 0x05, 0x76, 0x42, 0x1d, 0xeb, 0x31, 0x79, 0x7c, 0x9d, 0x78, 0x9c, 0x36, 0x71, 0xe9, 0xa7, 0x70, - 0xf1, 0x37, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xb3, 0xd6, 0x0b, 0x79, 0x04, 0x00, 0x00, + // 512 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 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 0xbc, 0xff, 0xda, 0x80, 0x47, 0x70, 0xbc, 0x35, 0xa0, 0xb8, 0x82, 0xf7, 0x19, 0x1e, 0x4c, + 0xd1, 0xfc, 0xab, 0xb1, 0x7d, 0x20, 0xef, 0xb8, 0xde, 0x92, 0xf7, 0x5e, 0xc3, 0xd1, 0x46, 0xb5, + 0x74, 0x33, 0x80, 0x6e, 0xf9, 0x0c, 0x34, 0x6d, 0xda, 0x78, 0x8f, 0x6a, 0xe2, 0x0d, 0xd7, 0xa0, + 0xf1, 0xcf, 0x3d, 0xd8, 0x2f, 0xab, 0xe4, 0x2d, 0x74, 0x8a, 0x8c, 0x48, 0xf9, 0x4d, 0x30, 0xc5, + 0xfd, 0xba, 0x37, 0xe4, 0x0e, 0xee, 0xed, 0x97, 0x96, 0x34, 0x72, 0xb1, 0xc2, 0xad, 0xaa, 0x58, + 0x5d, 0x40, 0x55, 0xb1, 0x7a, 0x7f, 0x1b, 0xe4, 0x15, 0x38, 0x53, 0x34, 0xe4, 0xc9, 0x1d, 0x72, + 0xc7, 0x70, 0xb7, 0xee, 0xa2, 0x5e, 0x83, 0x5c, 0x42, 0x2b, 0x37, 0x8a, 0x9c, 0xdc, 0x71, 0x77, + 0xed, 0x74, 0x9f, 0xde, 0xd3, 0xbd, 0x3d, 0xc1, 0xa4, 0xfd, 0xc9, 0x61, 0x8a, 0xcf, 0x3a, 0xf6, + 0xe7, 0x72, 0xf6, 0x27, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xa7, 0x76, 0xbe, 0xc6, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -421,7 +422,7 @@ func NewServiceClient(cc *grpc.ClientConn) ServiceClient { func (c *serviceClient) Create(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*CreateServiceResponse, error) { out := new(CreateServiceResponse) - err := c.cc.Invoke(ctx, "/api.Service/Create", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Service/Create", in, out, opts...) if err != nil { return nil, err } @@ -430,7 +431,7 @@ func (c *serviceClient) Create(ctx context.Context, in *CreateServiceRequest, op func (c *serviceClient) Delete(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*DeleteServiceResponse, error) { out := new(DeleteServiceResponse) - err := c.cc.Invoke(ctx, "/api.Service/Delete", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Service/Delete", in, out, opts...) if err != nil { return nil, err } @@ -439,7 +440,7 @@ func (c *serviceClient) Delete(ctx context.Context, in *DeleteServiceRequest, op func (c *serviceClient) Get(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*service.Service, error) { out := new(service.Service) - err := c.cc.Invoke(ctx, "/api.Service/Get", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Service/Get", in, out, opts...) if err != nil { return nil, err } @@ -448,7 +449,7 @@ func (c *serviceClient) Get(ctx context.Context, in *GetServiceRequest, opts ... func (c *serviceClient) List(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error) { out := new(ListServiceResponse) - err := c.cc.Invoke(ctx, "/api.Service/List", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Service/List", in, out, opts...) if err != nil { return nil, err } @@ -500,7 +501,7 @@ func _Service_Create_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Service/Create", + FullMethod: "/mesg.api.Service/Create", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).Create(ctx, req.(*CreateServiceRequest)) @@ -518,7 +519,7 @@ func _Service_Delete_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Service/Delete", + FullMethod: "/mesg.api.Service/Delete", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).Delete(ctx, req.(*DeleteServiceRequest)) @@ -536,7 +537,7 @@ func _Service_Get_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Service/Get", + FullMethod: "/mesg.api.Service/Get", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).Get(ctx, req.(*GetServiceRequest)) @@ -554,7 +555,7 @@ func _Service_List_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Service/List", + FullMethod: "/mesg.api.Service/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).List(ctx, req.(*ListServiceRequest)) @@ -563,7 +564,7 @@ func _Service_List_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Service_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Service", + ServiceName: "mesg.api.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/protobuf/api/service.proto b/protobuf/api/service.proto index 2741b474d..928515d0e 100644 --- a/protobuf/api/service.proto +++ b/protobuf/api/service.proto @@ -3,7 +3,8 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; import "protobuf/types/service.proto"; -package api; +package mesg.api; +option go_package = "api"; // This is the API to interact with the Services. // diff --git a/protobuf/convert/pbstruct.go b/protobuf/convert/pbstruct.go deleted file mode 100644 index 80808db99..000000000 --- a/protobuf/convert/pbstruct.go +++ /dev/null @@ -1,44 +0,0 @@ -package convert - -import ( - "bytes" - "encoding/json" - "sync" - - "github.com/gogo/protobuf/jsonpb" - "github.com/gogo/protobuf/proto" -) - -var marshaler = jsonpb.Marshaler{EmitDefaults: true} - -var bufPool = sync.Pool{ - New: func() interface{} { - return &bytes.Buffer{} - }, -} - -// Marshal converts protobuf struct to map[string]interface{}. -func Marshal(in proto.Message, out interface{}) error { - buf := bufPool.Get().(*bytes.Buffer) - buf.Reset() - defer bufPool.Put(buf) - - dec := json.NewDecoder(buf) - if err := marshaler.Marshal(buf, in); err != nil { - return err - } - return dec.Decode(out) -} - -// Unmarshal converts map[string]interface{} to protobuf struct. -func Unmarshal(in interface{}, out proto.Message) error { - buf := bufPool.Get().(*bytes.Buffer) - buf.Reset() - defer bufPool.Put(buf) - - enc := json.NewEncoder(buf) - if err := enc.Encode(in); err != nil { - return err - } - return jsonpb.Unmarshal(buf, out) -} diff --git a/protobuf/coreapi/api.pb.go b/protobuf/coreapi/api.pb.go index 23b796ab2..c0a5e85f9 100644 --- a/protobuf/coreapi/api.pb.go +++ b/protobuf/coreapi/api.pb.go @@ -168,30 +168,30 @@ func (m *InfoReply_CoreService) GetKey() string { } func init() { - proto.RegisterType((*InfoRequest)(nil), "api.InfoRequest") - proto.RegisterType((*InfoReply)(nil), "api.InfoReply") - proto.RegisterType((*InfoReply_CoreService)(nil), "api.InfoReply.CoreService") + proto.RegisterType((*InfoRequest)(nil), "mesg.api.InfoRequest") + proto.RegisterType((*InfoReply)(nil), "mesg.api.InfoReply") + proto.RegisterType((*InfoReply_CoreService)(nil), "mesg.api.InfoReply.CoreService") } func init() { proto.RegisterFile("protobuf/coreapi/api.proto", fileDescriptor_10679b8ed3075b1e) } var fileDescriptor_10679b8ed3075b1e = []byte{ - // 227 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x41, 0x4b, 0x03, 0x31, - 0x10, 0x85, 0x8d, 0x09, 0xd6, 0x9d, 0x55, 0x29, 0x73, 0x0a, 0x39, 0x2d, 0x7b, 0x5a, 0x3c, 0x6c, - 0x61, 0x05, 0x7f, 0x80, 0x9e, 0xbc, 0xc6, 0x83, 0xe0, 0x2d, 0xad, 0x53, 0x1a, 0x5c, 0x9a, 0x98, - 0x34, 0x85, 0xfe, 0x31, 0x7f, 0x9f, 0x24, 0x5b, 0x4b, 0x7b, 0x7b, 0x33, 0x7c, 0xf3, 0x78, 0xf3, - 0x40, 0xf9, 0xe0, 0x76, 0x6e, 0x99, 0xd6, 0x8b, 0x95, 0x0b, 0x64, 0xbc, 0x5d, 0x18, 0x6f, 0xfb, - 0xb2, 0x44, 0x6e, 0xbc, 0x6d, 0xef, 0xa1, 0x7e, 0xdb, 0xae, 0x9d, 0xa6, 0x9f, 0x44, 0x71, 0xd7, - 0xfe, 0x32, 0xa8, 0xa6, 0xd9, 0x8f, 0x07, 0x7c, 0x86, 0xdb, 0x48, 0x61, 0x6f, 0x57, 0x14, 0x25, - 0x6b, 0x78, 0x57, 0x0f, 0xaa, 0xcf, 0xf7, 0x27, 0xa2, 0x7f, 0x75, 0x81, 0xde, 0x27, 0x44, 0x9f, - 0x58, 0x94, 0x30, 0xdb, 0x53, 0x88, 0xd6, 0x6d, 0xa5, 0x68, 0x58, 0x57, 0xe9, 0xff, 0x51, 0x7d, - 0x40, 0x7d, 0x76, 0x82, 0x73, 0xe0, 0xd1, 0x7e, 0x49, 0x56, 0xa0, 0x2c, 0x11, 0x41, 0x6c, 0x4c, - 0xdc, 0xc8, 0xeb, 0x86, 0x75, 0x77, 0xba, 0xe8, 0x4c, 0xa5, 0x30, 0x4a, 0x3e, 0x51, 0x29, 0x8c, - 0x79, 0xf3, 0x4d, 0x87, 0xa3, 0x79, 0x96, 0xc3, 0x00, 0x22, 0x1b, 0xe3, 0x23, 0x88, 0x9c, 0x0e, - 0xe7, 0x67, 0x41, 0xcb, 0x6b, 0xea, 0xe1, 0x32, 0x7a, 0x7b, 0xf5, 0x52, 0x7d, 0xce, 0x8e, 0xad, - 0x2c, 0x6f, 0x4a, 0x25, 0x4f, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xab, 0xc3, 0x31, 0x10, 0x30, - 0x01, 0x00, 0x00, + // 234 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x28, 0xca, 0x2f, + 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xce, 0x2f, 0x4a, 0x4d, 0x2c, 0xc8, 0xd4, 0x4f, 0x2c, 0xc8, + 0xd4, 0x03, 0x0b, 0x0a, 0x71, 0xe4, 0xa6, 0x16, 0xa7, 0xeb, 0x25, 0x16, 0x64, 0x2a, 0xf1, 0x72, + 0x71, 0x7b, 0xe6, 0xa5, 0xe5, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0xed, 0x66, 0xe4, + 0xe2, 0x84, 0xf0, 0x0b, 0x72, 0x2a, 0x85, 0xac, 0xb9, 0x38, 0x8a, 0x53, 0x8b, 0xca, 0x32, 0x93, + 0x53, 0x8b, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0xe4, 0xf5, 0x60, 0x3a, 0xf5, 0xe0, 0xca, + 0xf4, 0x9c, 0xf3, 0x8b, 0x52, 0x83, 0x21, 0xea, 0x82, 0xe0, 0x1a, 0x84, 0x24, 0xb8, 0xd8, 0xcb, + 0x52, 0x8b, 0x8a, 0x33, 0xf3, 0xf3, 0x24, 0x58, 0x14, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0xa9, + 0x70, 0x2e, 0x6e, 0x24, 0x2d, 0x42, 0x02, 0x5c, 0xcc, 0xc5, 0x99, 0x29, 0x12, 0x8c, 0x60, 0x45, + 0x20, 0xa6, 0x90, 0x10, 0x17, 0x4b, 0x46, 0x62, 0x71, 0x86, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x4f, + 0x10, 0x98, 0x0d, 0x52, 0x55, 0x5a, 0x94, 0x23, 0xc1, 0x0c, 0x51, 0x55, 0x5a, 0x94, 0x03, 0x12, + 0xc9, 0x4e, 0xad, 0x84, 0x1a, 0x0e, 0x62, 0x1a, 0xd9, 0x70, 0xb1, 0x80, 0x0c, 0x16, 0x32, 0xe1, + 0x62, 0x01, 0xb9, 0x4e, 0x48, 0x14, 0xdd, 0xb5, 0x60, 0x4f, 0x4a, 0x09, 0x63, 0xf1, 0x84, 0x12, + 0x83, 0x13, 0x67, 0x14, 0x3b, 0x34, 0xa4, 0x92, 0xd8, 0xc0, 0xc1, 0x64, 0x0c, 0x08, 0x00, 0x00, + 0xff, 0xff, 0x39, 0xa7, 0x3e, 0x9d, 0x44, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -220,7 +220,7 @@ func NewCoreClient(cc *grpc.ClientConn) CoreClient { func (c *coreClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoReply, error) { out := new(InfoReply) - err := c.cc.Invoke(ctx, "/api.Core/Info", in, out, opts...) + err := c.cc.Invoke(ctx, "/mesg.api.Core/Info", in, out, opts...) if err != nil { return nil, err } @@ -255,7 +255,7 @@ func _Core_Info_Handler(srv interface{}, ctx context.Context, dec func(interface } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.Core/Info", + FullMethod: "/mesg.api.Core/Info", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CoreServer).Info(ctx, req.(*InfoRequest)) @@ -264,7 +264,7 @@ func _Core_Info_Handler(srv interface{}, ctx context.Context, dec func(interface } var _Core_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Core", + ServiceName: "mesg.api.Core", HandlerType: (*CoreServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/protobuf/coreapi/api.proto b/protobuf/coreapi/api.proto index def70d20e..eb0c385a1 100644 --- a/protobuf/coreapi/api.proto +++ b/protobuf/coreapi/api.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package api; +package mesg.api; option go_package = "coreapi"; // This is the primary API to interact with MESG Engine functionalities. diff --git a/protobuf/types/account.proto b/protobuf/types/account.proto new file mode 100644 index 000000000..38cd6b6fe --- /dev/null +++ b/protobuf/types/account.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +import "gogo/protobuf/gogoproto/gogo.proto"; + +package mesg.types; +option go_package = "github.com/mesg-foundation/engine/account"; + +option (gogoproto.goproto_getters_all) = false; + +// Account represents service's account. +message Account { + string name = 1; + string address = 2; +} diff --git a/protobuf/types/event.proto b/protobuf/types/event.proto index f7afaf188..6d403a12d 100644 --- a/protobuf/types/event.proto +++ b/protobuf/types/event.proto @@ -3,7 +3,7 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; import "protobuf/types/struct.proto"; -package types; +package mesg.types; option go_package = "github.com/mesg-foundation/engine/event"; option (gogoproto.goproto_getters_all) = false; diff --git a/protobuf/types/execution.proto b/protobuf/types/execution.proto index 0966165fe..60fdb99bd 100644 --- a/protobuf/types/execution.proto +++ b/protobuf/types/execution.proto @@ -3,7 +3,7 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; import "protobuf/types/struct.proto"; -package types; +package mesg.types; option go_package = "github.com/mesg-foundation/engine/execution"; option (gogoproto.goproto_getters_all) = false; diff --git a/protobuf/types/instance.proto b/protobuf/types/instance.proto index 13920dd4f..8e457fbe6 100644 --- a/protobuf/types/instance.proto +++ b/protobuf/types/instance.proto @@ -2,7 +2,7 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; -package types; +package mesg.types; option go_package = "github.com/mesg-foundation/engine/instance"; option (gogoproto.goproto_getters_all) = false; diff --git a/protobuf/types/process.proto b/protobuf/types/process.proto index e608937ef..c0fb987b2 100644 --- a/protobuf/types/process.proto +++ b/protobuf/types/process.proto @@ -1,8 +1,9 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; +import "protobuf/types/struct.proto"; -package types; +package mesg.types; option go_package = "github.com/mesg-foundation/engine/process"; option (gogoproto.goproto_getters_all) = false; @@ -91,7 +92,10 @@ message Process { oneof value { // Input defined as reference. Reference ref = 2 [ - (gogoproto.moretags) = 'hash:"name:2" validate:"required"' + (gogoproto.moretags) = 'hash:"name:2" validate:"required_without=Constant"' + ]; + mesg.protobuf.Value constant = 3 [ + (gogoproto.moretags) = 'hash:"name:3" validate:"required_without=Ref"' ]; } } @@ -148,15 +152,25 @@ message Process { oneof type { // Result is a trigger that listens for a specific result. - Result result = 1; + Result result = 1 [ + (gogoproto.moretags) = 'hash:"name:1"' + ]; // Event is a trigger that listens for a specific event. - Event event = 2; + Event event = 2 [ + (gogoproto.moretags) = 'hash:"name:2"' + ]; // Task is a command to execute a specific task. - Task task = 3; + Task task = 3 [ + (gogoproto.moretags) = 'hash:"name:3"' + ]; // Map is a set of instructions to convert data. - Map map = 4; + Map map = 4 [ + (gogoproto.moretags) = 'hash:"name:4"' + ]; // Filter is a list of condition to apply on data. - Filter filter = 5; + Filter filter = 5 [ + (gogoproto.moretags) = 'hash:"name:5"' + ]; } } diff --git a/protobuf/types/service.proto b/protobuf/types/service.proto index 132340f1f..094b3b9b9 100644 --- a/protobuf/types/service.proto +++ b/protobuf/types/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; import "gogo/protobuf/gogoproto/gogo.proto"; -package types; +package mesg.types; option go_package = "github.com/mesg-foundation/engine/service"; option (gogoproto.goproto_getters_all) = false; diff --git a/scripts/build-mocks.sh b/scripts/build-mocks.sh index 839c43f5a..b6aea56d1 100755 --- a/scripts/build-mocks.sh +++ b/scripts/build-mocks.sh @@ -6,3 +6,6 @@ source $(dirname $0)/require-mesg-tools.sh # generate mocks mockery -name Container -dir ./container -output ./container/mocks mockery -name CommonAPIClient -dir ./internal/mocks -output ./utils/docker/mocks +mockery -name ExecutionSDK -dir ./orchestrator -output ./orchestrator/mocks +mockery -name EventSDK -dir ./orchestrator -output ./orchestrator/mocks +mockery -name ProcessSDK -dir ./orchestrator -output ./orchestrator/mocks \ No newline at end of file diff --git a/scripts/build-proto.sh b/scripts/build-proto.sh index 90729bdae..a6dffab9d 100755 --- a/scripts/build-proto.sh +++ b/scripts/build-proto.sh @@ -8,7 +8,7 @@ APIS_PATH=protobuf/api CORE_APIS_PATH=protobuf/coreapi # generate type -for file in "${TYPES_PATH}"/{event,execution,instance,service,process}.proto +for file in "${TYPES_PATH}"/{account,event,execution,instance,service,process}.proto do file=$(basename ${file}) dir="${file%.*}" @@ -20,7 +20,7 @@ done protoc --gogo_out=paths=source_relative:. protobuf/types/struct.proto # generate services -for file in "${APIS_PATH}"/{event,execution,instance,service,process}.proto +for file in "${APIS_PATH}"/{account,event,execution,instance,service,process}.proto do protoc --gogo_out=plugins=grpc:. --proto_path . "${file}" done diff --git a/scripts/changelog.sh b/scripts/changelog.sh index 716545451..30415a421 100755 --- a/scripts/changelog.sh +++ b/scripts/changelog.sh @@ -2,8 +2,8 @@ MILESTONE="$1" -LABELS=("experimental" "breaking change" "release:add" "release:change" "release:fix" "release:remove") -CATEGORIES=("Experimental" "Breaking Changes" "Added" "Changed" "Fixed" "Removed") +LABELS=("breaking change" "experimental" "release:add" "release:change" "release:fix" "release:remove") +CATEGORIES=("Breaking Changes" "Experimental" "Added" "Changed" "Fixed" "Removed") PR=$(hub pr list -s merged -f "%Mt %L|- ([%i](%U)) %t.%n" --sort-ascending | grep $MILESTONE) diff --git a/sdk/account/sdk.go b/sdk/account/sdk.go new file mode 100644 index 000000000..65a34507d --- /dev/null +++ b/sdk/account/sdk.go @@ -0,0 +1,69 @@ +package servicesdk + +import ( + "github.com/mesg-foundation/engine/account" + "github.com/mesg-foundation/engine/cosmos" +) + +// SDK is the account SDK. +type SDK struct { + kb *cosmos.Keybase +} + +// NewSDK returns the account sdk. +func NewSDK(kb *cosmos.Keybase) *SDK { + sdk := &SDK{ + kb: kb, + } + return sdk +} + +// Create generates a new mnemonic and its associated account from a name and password. +func (s *SDK) Create(name, password string) (address *account.Account, mnemonic string, err error) { + // TODO: should throw error if name already exist + mnemonic, err = s.kb.NewMnemonic() + if err != nil { + return nil, "", err + } + acct, err := s.kb.CreateAccount(name, mnemonic, "", password, 0, 0) + if err != nil { + return nil, "", err + } + return &account.Account{ + Name: acct.GetName(), + Address: acct.GetAddress().String(), + }, mnemonic, nil +} + +// Delete removes the account corresponding the name and password. +func (s *SDK) Delete(name, password string) error { + return s.kb.Delete(name, password, false) +} + +// Get returns the account from a name. +func (s *SDK) Get(name string) (*account.Account, error) { + acct, err := s.kb.Get(name) + if err != nil { + return nil, err + } + return &account.Account{ + Name: acct.GetName(), + Address: acct.GetAddress().String(), + }, nil +} + +// List returns all account. +func (s *SDK) List() ([]*account.Account, error) { + accts, err := s.kb.List() + if err != nil { + return nil, err + } + accounts := make([]*account.Account, len(accts)) + for i, acct := range accts { + accounts[i] = &account.Account{ + Name: acct.GetName(), + Address: acct.GetAddress().String(), + } + } + return accounts, nil +} diff --git a/sdk/backend.go b/sdk/backend.go index 2c03138f3..3add83578 100644 --- a/sdk/backend.go +++ b/sdk/backend.go @@ -18,13 +18,13 @@ import ( // Backend handles all the backend functions. type Backend struct { - Service *servicesdk.Module + Service *servicesdk.Backend } // NewBackend creates a new backend and init the sub-backend modules. func NewBackend(appFactory *cosmos.AppFactory, c container.Container) *Backend { initDefaultCosmosModules(appFactory) - service := servicesdk.NewModule(appFactory, c) + service := servicesdk.NewBackend(appFactory, c) return &Backend{ Service: service, } diff --git a/sdk/sdk.go b/sdk/sdk.go index 0794f2311..43af2efb5 100644 --- a/sdk/sdk.go +++ b/sdk/sdk.go @@ -1,9 +1,12 @@ package sdk import ( + "github.com/cosmos/cosmos-sdk/codec" "github.com/cskr/pubsub" "github.com/mesg-foundation/engine/container" + "github.com/mesg-foundation/engine/cosmos" "github.com/mesg-foundation/engine/database" + accountsdk "github.com/mesg-foundation/engine/sdk/account" eventsdk "github.com/mesg-foundation/engine/sdk/event" executionsdk "github.com/mesg-foundation/engine/sdk/execution" instancesdk "github.com/mesg-foundation/engine/sdk/instance" @@ -18,22 +21,25 @@ type SDK struct { Execution *executionsdk.Execution Event *eventsdk.Event Process *processesdk.Process + Account *accountsdk.SDK } // New creates a new SDK with given options. -func New(c container.Container, instanceDB database.InstanceDB, execDB database.ExecutionDB, processDB database.ProcessDB, engineName, port string) (*SDK, error) { +func New(client *cosmos.Client, cdc *codec.Codec, kb *cosmos.Keybase, c container.Container, instanceDB database.InstanceDB, execDB database.ExecutionDB, processDB database.ProcessDB, engineName, port string) (*SDK, error) { ps := pubsub.New(0) - serviceSDK := servicesdk.NewSDK() + serviceSDK := servicesdk.NewSDK(cdc, client) instanceSDK := instancesdk.New(c, serviceSDK, instanceDB, engineName, port) processSDK := processesdk.New(instanceSDK, processDB) executionSDK := executionsdk.New(ps, serviceSDK, instanceSDK, processSDK, execDB) eventSDK := eventsdk.New(ps, serviceSDK, instanceSDK) + accountSDK := accountsdk.NewSDK(kb) return &SDK{ Service: serviceSDK, Instance: instanceSDK, Execution: executionSDK, Event: eventSDK, Process: processSDK, + Account: accountSDK, }, nil } diff --git a/sdk/service/backend.go b/sdk/service/backend.go new file mode 100644 index 000000000..cc0d80b6d --- /dev/null +++ b/sdk/service/backend.go @@ -0,0 +1,104 @@ +package servicesdk + +import ( + "errors" + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/mesg-foundation/engine/container" + "github.com/mesg-foundation/engine/cosmos" + "github.com/mesg-foundation/engine/database" + "github.com/mesg-foundation/engine/database/store" + "github.com/mesg-foundation/engine/hash" + "github.com/mesg-foundation/engine/service" + abci "github.com/tendermint/tendermint/abci/types" +) + +const backendName = "service" + +// Backend is the service backend. +type Backend struct { + container container.Container + cdc *codec.Codec + storeKey *cosmostypes.KVStoreKey +} + +// NewBackend returns the backend of the service sdk. +func NewBackend(appFactory *cosmos.AppFactory, c container.Container) *Backend { + backend := &Backend{ + container: c, + cdc: appFactory.Cdc(), + storeKey: cosmostypes.NewKVStoreKey(backendName), + } + appBackendBasic := cosmos.NewAppModuleBasic(backendName) + appBackend := cosmos.NewAppModule(appBackendBasic, backend.cdc, backend.handler, backend.querier) + appFactory.RegisterModule(appBackend) + appFactory.RegisterStoreKey(backend.storeKey) + + backend.cdc.RegisterConcrete(msgCreateService{}, "service/create", nil) + backend.cdc.RegisterConcrete(msgDeleteService{}, "service/delete", nil) + + return backend +} + +func (s *Backend) db(request cosmostypes.Request) *database.ServiceDB { + return database.NewServiceDB(store.NewCosmosStore(request.KVStore(s.storeKey)), s.cdc) +} + +func (s *Backend) handler(request cosmostypes.Request, msg cosmostypes.Msg) cosmostypes.Result { + switch msg := msg.(type) { + case msgCreateService: + srv, err := s.Create(request, &msg) + if err != nil { + return cosmostypes.ErrInternal(err.Error()).Result() + } + return cosmostypes.Result{ + Data: srv.Hash, + } + case msgDeleteService: + err := s.Delete(request, msg.Hash) + if err != nil { + return cosmostypes.ErrInternal(err.Error()).Result() + } + return cosmostypes.Result{} + default: + errmsg := fmt.Sprintf("Unrecognized service Msg type: %v", msg.Type()) + return cosmostypes.ErrUnknownRequest(errmsg).Result() + } +} + +func (s *Backend) querier(request cosmostypes.Request, path []string, req abci.RequestQuery) (interface{}, error) { + switch path[0] { + case "get": + hash, err := hash.Decode(path[1]) + if err != nil { + return nil, err + } + return s.Get(request, hash) + case "list": + return s.List(request) + default: + return nil, errors.New("unknown service query endpoint" + path[0]) + } +} + +// Create creates a new service from definition. +func (s *Backend) Create(request cosmostypes.Request, msg *msgCreateService) (*service.Service, error) { + return create(s.container, s.db(request), msg.Request) +} + +// Delete deletes the service by hash. +func (s *Backend) Delete(request cosmostypes.Request, hash hash.Hash) error { + return s.db(request).Delete(hash) +} + +// Get returns the service that matches given hash. +func (s *Backend) Get(request cosmostypes.Request, hash hash.Hash) (*service.Service, error) { + return s.db(request).Get(hash) +} + +// List returns all services. +func (s *Backend) List(request cosmostypes.Request) ([]*service.Service, error) { + return s.db(request).All() +} diff --git a/sdk/service/deprecated.go b/sdk/service/deprecated.go index 6f5c470d8..88a420e84 100644 --- a/sdk/service/deprecated.go +++ b/sdk/service/deprecated.go @@ -4,6 +4,7 @@ import ( "github.com/mesg-foundation/engine/container" "github.com/mesg-foundation/engine/database" "github.com/mesg-foundation/engine/hash" + "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/service" ) @@ -22,8 +23,8 @@ func NewDeprecated(c container.Container, serviceDB *database.ServiceDB) Service } // Create creates a new service from definition. -func (s *deprecated) Create(srv *service.Service) (*service.Service, error) { - return create(s.container, s.serviceDB, srv) +func (s *deprecated) Create(req *api.CreateServiceRequest) (*service.Service, error) { + return create(s.container, s.serviceDB, req) } // Delete deletes the service by hash. diff --git a/sdk/service/module.go b/sdk/service/module.go deleted file mode 100644 index 811d8cf98..000000000 --- a/sdk/service/module.go +++ /dev/null @@ -1,98 +0,0 @@ -package servicesdk - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/mesg-foundation/engine/container" - "github.com/mesg-foundation/engine/cosmos" - "github.com/mesg-foundation/engine/database" - "github.com/mesg-foundation/engine/database/store" - "github.com/mesg-foundation/engine/hash" - "github.com/mesg-foundation/engine/service" - abci "github.com/tendermint/tendermint/abci/types" -) - -// Module is the service module. -type Module struct { - container container.Container - name string - cdc *codec.Codec - storeKey *cosmostypes.KVStoreKey -} - -// NewModule returns the module of the service sdk. -func NewModule(app *cosmos.AppFactory, c container.Container) *Module { - name := "service" - module := &Module{ - container: c, - name: name, - cdc: app.Cdc(), - storeKey: cosmostypes.NewKVStoreKey(name), - } - appModuleBasic := cosmos.NewAppModuleBasic(name) - appModule := cosmos.NewAppModule(appModuleBasic, module.cdc, module.handler, module.querier) - app.RegisterModule(appModule) - app.RegisterStoreKey(module.storeKey) - return module -} - -func (s *Module) db(request cosmostypes.Request) *database.ServiceDB { - return database.NewServiceDB(store.NewCosmosStore(request.KVStore(s.storeKey)), s.cdc) -} - -func (s *Module) handler(request cosmostypes.Request, msg cosmostypes.Msg) cosmostypes.Result { - panic("to implement") - // switch msg := msg.(type) { - // case MsgCreateService: - // _, err := s.Create(request, msg.Service) - // if err != nil { - // return cosmostypes.ErrInternal(err.Error()).Result() - // } - // return cosmostypes.Result{} - // case MsgRemoveService: - // err := s.Delete(request, msg.Hash) - // if err != nil { - // return cosmostypes.ErrInternal(err.Error()).Result() - // } - // return cosmostypes.Result{} - // default: - // errmsg := fmt.Sprintf("Unrecognized service Msg type: %v", msg.Type()) - // return cosmostypes.ErrUnknownRequest(errmsg).Result() - // } -} - -func (s *Module) querier(request cosmostypes.Request, path []string, req abci.RequestQuery) (interface{}, error) { - panic("to implement") - // switch path[0] { - // case "get": - // hash, err := hash.Decode(path[1]) - // if err != nil { - // return nil, err - // } - // return s.Get(request, hash) - // case "list": - // return s.All(request) - // default: - // return nil, fmt.Errorf("unknown service query endpoint %q", path[0]) - // } -} - -// Create creates a new service from definition. -func (s *Module) Create(request cosmostypes.Request, srv *service.Service) (*service.Service, error) { - return create(s.container, s.db(request), srv) -} - -// Delete deletes the service by hash. -func (s *Module) Delete(request cosmostypes.Request, hash hash.Hash) error { - return s.db(request).Delete(hash) -} - -// Get returns the service that matches given hash. -func (s *Module) Get(request cosmostypes.Request, hash hash.Hash) (*service.Service, error) { - return s.db(request).Get(hash) -} - -// List returns all services. -func (s *Module) List(request cosmostypes.Request) ([]*service.Service, error) { - return s.db(request).All() -} diff --git a/sdk/service/msgs.go b/sdk/service/msgs.go new file mode 100644 index 000000000..6dfede766 --- /dev/null +++ b/sdk/service/msgs.go @@ -0,0 +1,99 @@ +package servicesdk + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/mesg-foundation/engine/hash" + "github.com/mesg-foundation/engine/protobuf/api" +) + +// msgCreateService defines a state transition to create a service. +type msgCreateService struct { + Request *api.CreateServiceRequest `json:"request"` + // Owner cosmostypes.AccAddress `json:"owner"` + cdc *codec.Codec +} + +// newMsgCreateService is a constructor function for msgCreateService. +func newMsgCreateService(cdc *codec.Codec, req *api.CreateServiceRequest) *msgCreateService { + return &msgCreateService{ + Request: req, + // Owner: owner, + cdc: cdc, + } +} + +// Route should return the name of the module. +func (msg msgCreateService) Route() string { + return backendName +} + +// Type returns the action. +func (msg msgCreateService) Type() string { + return "create_service" +} + +// ValidateBasic runs stateless checks on the message. +func (msg msgCreateService) ValidateBasic() cosmostypes.Error { + // if msg.Owner.Empty() { + // return cosmostypes.ErrInvalidAddress(msg.Owner.String()) + // } + return nil +} + +// GetSignBytes encodes the message for signing. +func (msg msgCreateService) GetSignBytes() []byte { + return cosmostypes.MustSortJSON(msg.cdc.MustMarshalJSON(msg)) +} + +// GetSigners defines whose signature is required. +func (msg msgCreateService) GetSigners() []cosmostypes.AccAddress { + return []cosmostypes.AccAddress{} + // return []cosmostypes.AccAddress{msg.Owner} +} + +// -------------------------------------------------------- +// +// -------------------------------------------------------- + +// msgDeleteService defines a state transition to delete a service. +type msgDeleteService struct { + Hash hash.Hash `json:"hash"` + cdc *codec.Codec +} + +// newMsgDeleteService is a constructor function for msgSetService. +func newMsgDeleteService(cdc *codec.Codec, hash hash.Hash) *msgDeleteService { + return &msgDeleteService{ + Hash: hash, + cdc: cdc, + } +} + +// Route should return the name of the module. +func (msg msgDeleteService) Route() string { + return backendName +} + +// Type returns the action. +func (msg msgDeleteService) Type() string { + return "delete_service" +} + +// ValidateBasic runs stateless checks on the message. +func (msg msgDeleteService) ValidateBasic() cosmostypes.Error { + // if msg.Owner.Empty() { + // return cosmostypes.ErrInvalidAddress(msg.Owner.String()) + // } + return nil +} + +// GetSignBytes encodes the message for signing. +func (msg msgDeleteService) GetSignBytes() []byte { + return cosmostypes.MustSortJSON(msg.cdc.MustMarshalJSON(msg)) +} + +// GetSigners defines whose signature is required. +func (msg msgDeleteService) GetSigners() []cosmostypes.AccAddress { + return []cosmostypes.AccAddress{} +} diff --git a/sdk/service/sdk.go b/sdk/service/sdk.go index 59630a99c..87668d5ea 100644 --- a/sdk/service/sdk.go +++ b/sdk/service/sdk.go @@ -1,37 +1,65 @@ package servicesdk import ( - "fmt" - + "github.com/cosmos/cosmos-sdk/codec" + "github.com/mesg-foundation/engine/cosmos" "github.com/mesg-foundation/engine/hash" + "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/service" ) -type sdk struct { +// SDK is the service sdk. +type SDK struct { + cdc *codec.Codec + client *cosmos.Client } // NewSDK returns the service sdk. -func NewSDK() Service { - sdk := &sdk{} +func NewSDK(cdc *codec.Codec, client *cosmos.Client) Service { + sdk := &SDK{ + cdc: cdc, + client: client, + } return sdk } // Create creates a new service from definition. -func (s *sdk) Create(srv *service.Service) (*service.Service, error) { - return nil, fmt.Errorf("create not implemented") +func (s *SDK) Create(req *api.CreateServiceRequest) (*service.Service, error) { + // TODO: pass account by parameters + accountName, accountPassword := "bob", "pass" + accNumber, accSeq := uint64(0), uint64(0) + msg := newMsgCreateService(s.cdc, req) + tx, err := s.client.BuildAndBroadcastMsg(msg, accountName, accountPassword, accNumber, accSeq) + if err != nil { + return nil, err + } + return s.Get(tx.Data) } // Delete deletes the service by hash. -func (s *sdk) Delete(hash hash.Hash) error { - return fmt.Errorf("delete not implemented") +func (s *SDK) Delete(hash hash.Hash) error { + // TODO: pass account by parameters + accountName, accountPassword := "bob", "pass" + accNumber, accSeq := uint64(0), uint64(0) + msg := newMsgDeleteService(s.cdc, hash) + _, err := s.client.BuildAndBroadcastMsg(msg, accountName, accountPassword, accNumber, accSeq) + return err } // Get returns the service that matches given hash. -func (s *sdk) Get(hash hash.Hash) (*service.Service, error) { - return nil, fmt.Errorf("get not implemented") +func (s *SDK) Get(hash hash.Hash) (*service.Service, error) { + var service service.Service + if err := s.client.Query("custom/"+backendName+"/get/"+hash.String(), &service); err != nil { + return nil, err + } + return &service, nil } // List returns all services. -func (s *sdk) List() ([]*service.Service, error) { - return nil, fmt.Errorf("list not implemented") +func (s *SDK) List() ([]*service.Service, error) { + var services []*service.Service + if err := s.client.Query("custom/"+backendName+"/list", &services); err != nil { + return nil, err + } + return services, nil } diff --git a/sdk/service/type.go b/sdk/service/type.go index 651033ec6..5e4e7433b 100644 --- a/sdk/service/type.go +++ b/sdk/service/type.go @@ -4,12 +4,13 @@ import ( "fmt" "github.com/mesg-foundation/engine/hash" + "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/service" ) // Service is the interface of this sdk type Service interface { - Create(srv *service.Service) (*service.Service, error) + Create(*api.CreateServiceRequest) (*service.Service, error) Delete(hash hash.Hash) error Get(hash hash.Hash) (*service.Service, error) List() ([]*service.Service, error) diff --git a/sdk/service/utils.go b/sdk/service/utils.go index 4d45afc76..eda0654b6 100644 --- a/sdk/service/utils.go +++ b/sdk/service/utils.go @@ -11,12 +11,13 @@ import ( "github.com/mesg-foundation/engine/database" "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/hash/dirhash" + "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/service" "github.com/mesg-foundation/engine/service/validator" "github.com/mr-tron/base58" ) -func create(container container.Container, db *database.ServiceDB, srv *service.Service) (*service.Service, error) { +func create(container container.Container, db *database.ServiceDB, req *api.CreateServiceRequest) (*service.Service, error) { // download and untar service context into path. path, err := ioutil.TempDir("", "mesg") if err != nil { @@ -24,7 +25,7 @@ func create(container container.Container, db *database.ServiceDB, srv *service. } defer os.RemoveAll(path) - resp, err := http.Get("http://ipfs.app.mesg.com:8080/ipfs/" + srv.Source) + resp, err := http.Get("http://ipfs.app.mesg.com:8080/ipfs/" + req.Source) if err != nil { return nil, err } @@ -37,6 +38,19 @@ func create(container container.Container, db *database.ServiceDB, srv *service. return nil, err } + // create service + srv := &service.Service{ + Sid: req.Sid, + Name: req.Name, + Description: req.Description, + Configuration: req.Configuration, + Tasks: req.Tasks, + Events: req.Events, + Dependencies: req.Dependencies, + Repository: req.Repository, + Source: req.Source, + } + // calculate and apply hash to service. dh := dirhash.New(path) srv.Hash, err = dh.Sum(hash.Dump(srv)) diff --git a/server/grpc/api/account.go b/server/grpc/api/account.go new file mode 100644 index 000000000..d103c3d7f --- /dev/null +++ b/server/grpc/api/account.go @@ -0,0 +1,53 @@ +package api + +import ( + "context" + + "github.com/mesg-foundation/engine/account" + protobuf_api "github.com/mesg-foundation/engine/protobuf/api" + "github.com/mesg-foundation/engine/sdk" +) + +// AccountServer is the type to aggregate all Account APIs. +type AccountServer struct { + sdk *sdk.SDK +} + +// NewAccountServer creates a new ServiceServer. +func NewAccountServer(sdk *sdk.SDK) *AccountServer { + return &AccountServer{sdk: sdk} +} + +// List accounts. +func (s *AccountServer) List(ctx context.Context, request *protobuf_api.ListAccountRequest) (*protobuf_api.ListAccountResponse, error) { + accounts, err := s.sdk.Account.List() + if err != nil { + return nil, err + } + return &protobuf_api.ListAccountResponse{Accounts: accounts}, nil +} + +// Create creates a new account from service. +func (s *AccountServer) Create(ctx context.Context, request *protobuf_api.CreateAccountRequest) (*protobuf_api.CreateAccountResponse, error) { + account, mnemonic, err := s.sdk.Account.Create(request.Name, request.Password) + if err != nil { + return nil, err + } + return &protobuf_api.CreateAccountResponse{ + Address: account.Address, + Mnemonic: mnemonic, + }, nil +} + +// Get retrives account. +func (s *AccountServer) Get(ctx context.Context, request *protobuf_api.GetAccountRequest) (*account.Account, error) { + return s.sdk.Account.Get(request.Name) +} + +// Delete an account +func (s *AccountServer) Delete(ctx context.Context, request *protobuf_api.DeleteAccountRequest) (*protobuf_api.DeleteAccountResponse, error) { + if err := s.sdk.Account.Delete(request.Name, request.Password); err != nil { + return nil, err + } + return &protobuf_api.DeleteAccountResponse{}, nil +} diff --git a/server/grpc/api/instance.go b/server/grpc/api/instance.go index cb8f2a67d..05b62ac6c 100644 --- a/server/grpc/api/instance.go +++ b/server/grpc/api/instance.go @@ -20,12 +20,12 @@ func NewInstanceServer(sdk *sdk.SDK) *InstanceServer { } // List instances. -func (s *InstanceServer) List(ctx context.Context, request *protobuf_api.ListInstancesRequest) (*protobuf_api.ListInstancesResponse, error) { +func (s *InstanceServer) List(ctx context.Context, request *protobuf_api.ListInstanceRequest) (*protobuf_api.ListInstanceResponse, error) { instances, err := s.sdk.Instance.List(&instancesdk.Filter{ServiceHash: request.ServiceHash}) if err != nil { return nil, err } - return &protobuf_api.ListInstancesResponse{Instances: instances}, nil + return &protobuf_api.ListInstanceResponse{Instances: instances}, nil } // Create creates a new instance from service. diff --git a/server/grpc/api/service.go b/server/grpc/api/service.go index 74977dee1..22b4b3871 100644 --- a/server/grpc/api/service.go +++ b/server/grpc/api/service.go @@ -22,18 +22,7 @@ func NewServiceServer(sdk *sdk.SDK) *ServiceServer { // Create creates a new service from definition. func (s *ServiceServer) Create(ctx context.Context, req *protobuf_api.CreateServiceRequest) (*protobuf_api.CreateServiceResponse, error) { - definition := &service.Service{ - Sid: req.Sid, - Name: req.Name, - Description: req.Description, - Configuration: req.Configuration, - Tasks: req.Tasks, - Events: req.Events, - Dependencies: req.Dependencies, - Repository: req.Repository, - Source: req.Source, - } - srv, err := s.sdk.Service.Create(definition) + srv, err := s.sdk.Service.Create(req) if err != nil { return nil, err } diff --git a/server/grpc/server.go b/server/grpc/server.go index 1a88d2512..c0c9bc970 100644 --- a/server/grpc/server.go +++ b/server/grpc/server.go @@ -68,6 +68,7 @@ func (s *Server) register() { protobuf_api.RegisterInstanceServer(s.instance, api.NewInstanceServer(s.sdk)) protobuf_api.RegisterServiceServer(s.instance, api.NewServiceServer(s.sdk)) protobuf_api.RegisterProcessServer(s.instance, api.NewProcessServer(s.sdk)) + protobuf_api.RegisterAccountServer(s.instance, api.NewAccountServer(s.sdk)) reflection.Register(s.instance) } diff --git a/service/service.pb.go b/service/service.pb.go index 45e9218cb..21ca657a0 100644 --- a/service/service.pb.go +++ b/service/service.pb.go @@ -289,75 +289,75 @@ func (m *Service_Dependency) XXX_DiscardUnknown() { var xxx_messageInfo_Service_Dependency proto.InternalMessageInfo func init() { - proto.RegisterType((*Service)(nil), "types.Service") - proto.RegisterType((*Service_Event)(nil), "types.Service.Event") - proto.RegisterType((*Service_Task)(nil), "types.Service.Task") - proto.RegisterType((*Service_Parameter)(nil), "types.Service.Parameter") - proto.RegisterType((*Service_Configuration)(nil), "types.Service.Configuration") - proto.RegisterType((*Service_Dependency)(nil), "types.Service.Dependency") + proto.RegisterType((*Service)(nil), "mesg.types.Service") + proto.RegisterType((*Service_Event)(nil), "mesg.types.Service.Event") + proto.RegisterType((*Service_Task)(nil), "mesg.types.Service.Task") + proto.RegisterType((*Service_Parameter)(nil), "mesg.types.Service.Parameter") + proto.RegisterType((*Service_Configuration)(nil), "mesg.types.Service.Configuration") + proto.RegisterType((*Service_Dependency)(nil), "mesg.types.Service.Dependency") } func init() { proto.RegisterFile("service.proto", fileDescriptor_a0b84a42fa06f626) } var fileDescriptor_a0b84a42fa06f626 = []byte{ - // 937 bytes of a gzipped FileDescriptorProto + // 940 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x97, 0xdf, 0x72, 0xdb, 0x44, - 0x14, 0xc6, 0xeb, 0x48, 0xb6, 0xe3, 0x4d, 0x7c, 0xc1, 0xc2, 0xc5, 0xe2, 0xe9, 0x20, 0x21, 0x66, - 0xc0, 0x05, 0xc7, 0x6e, 0xec, 0x36, 0x34, 0xe9, 0x04, 0xa8, 0x29, 0x1d, 0xca, 0x0c, 0xff, 0x14, - 0x3a, 0x74, 0x18, 0x86, 0x99, 0xb5, 0xb4, 0x51, 0x96, 0x44, 0xbb, 0xea, 0xee, 0xca, 0x83, 0x9f, - 0x80, 0x17, 0xe1, 0x92, 0x17, 0xe0, 0x96, 0xab, 0x3e, 0x03, 0x17, 0x9a, 0xe1, 0x15, 0xf4, 0x02, - 0x30, 0x5a, 0xdb, 0xa9, 0x6c, 0xcb, 0x76, 0xdc, 0x70, 0x43, 0xef, 0xa4, 0xe4, 0x7c, 0xbf, 0xb3, - 0x3a, 0xe7, 0x3b, 0xbb, 0x5e, 0x50, 0x97, 0x44, 0x0c, 0xa9, 0x47, 0xda, 0x91, 0xe0, 0x8a, 0xc3, - 0xb2, 0x1a, 0x45, 0x44, 0x36, 0x9c, 0x80, 0x07, 0xbc, 0xa3, 0xff, 0x34, 0x88, 0x4f, 0x3b, 0xd9, - 0x9b, 0x7e, 0xd1, 0x4f, 0xe3, 0x50, 0xe7, 0x77, 0x04, 0xaa, 0x27, 0x63, 0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a, 0xcb, 0x7c, 0x00, 0x15, 0x16, 0x92, 0xe0, + 0xda, 0xdb, 0x3c, 0x51, 0x15, 0xb3, 0xf3, 0x1a, 0x83, 0x5e, 0x96, 0x1d, 0xa3, 0x14, 0xd9, 0xbf, + 0x79, 0x76, 0xcc, 0xd2, 0xec, 0xdc, 0xbf, 0x6e, 0x76, 0xae, 0x30, 0xb7, 0x9b, 0x66, 0xe7, 0xc1, + 0x55, 0xb3, 0x53, 0x2f, 0xbd, 0x87, 0xbd, 0x4b, 0xb3, 0x33, 0xe8, 0xbe, 0xfa, 0xe7, 0xf6, 0xad, + 0xe7, 0x77, 0x2f, 0xff, 0x74, 0x98, 0x7e, 0xbd, 0x0c, 0xab, 0xfa, 0x73, 0xa4, 0xff, 0x6f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x2b, 0x25, 0x13, 0xd6, 0xcf, 0x0c, 0x00, 0x00, } diff --git a/systemservices/ethwallet/Dockerfile b/systemservices/ethwallet/Dockerfile index 52f4fa9f8..2857b828e 100644 --- a/systemservices/ethwallet/Dockerfile +++ b/systemservices/ethwallet/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11.4 +FROM golang:1.13 WORKDIR /project COPY go.mod go.sum ./ ENV GOPROXY=https://proxy.golang.org diff --git a/systemservices/ethwallet/client/encoding.go b/systemservices/ethwallet/client/encoding.go deleted file mode 100644 index b09efe1f0..000000000 --- a/systemservices/ethwallet/client/encoding.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -import ( - "encoding/json" -) - -// Marshal returns the MESG format encoding of v. -func Marshal(input interface{}) (map[string]interface{}, error) { - b, err := json.Marshal(input) - if err != nil { - return nil, err - } - - var output map[string]interface{} - if err := json.Unmarshal(b, &output); err != nil { - return nil, err - } - - return output, nil -} - -// Unmarshal parses the MESG-encoded data input and stores the result in the value pointed to by v. -func Unmarshal(input map[string]interface{}, output interface{}) error { - b, err := json.Marshal(input) - if err != nil { - return err - } - - return json.Unmarshal(b, output) -} diff --git a/systemservices/ethwallet/client/task_runner.go b/systemservices/ethwallet/client/task_runner.go index 036ed703b..5e7f20e51 100644 --- a/systemservices/ethwallet/client/task_runner.go +++ b/systemservices/ethwallet/client/task_runner.go @@ -4,14 +4,13 @@ import ( "context" "fmt" - structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/mesg-foundation/engine/execution" pb "github.com/mesg-foundation/engine/protobuf/api" - "github.com/mesg-foundation/engine/protobuf/convert" "github.com/mesg-foundation/engine/protobuf/types" ) // TaskFn is a task function handler prototype. -type TaskFn func(inputs map[string]interface{}) (map[string]interface{}, error) +type TaskFn func(inputs *types.Struct) (*types.Struct, error) // TaskRunner handles running task in a loop. type TaskRunner struct { @@ -28,7 +27,7 @@ func (r *TaskRunner) Add(name string, fn TaskFn) { func (r *TaskRunner) Run() error { stream, err := r.client.ExecutionClient.Stream(context.Background(), &pb.StreamExecutionRequest{ Filter: &pb.StreamExecutionRequest_Filter{ - Statuses: []types.Status{types.Status_InProgress}, + Statuses: []execution.Status{execution.Status_InProgress}, InstanceHash: r.client.InstanceHash, }, }) @@ -46,20 +45,11 @@ func (r *TaskRunner) Run() error { return fmt.Errorf("servic has no %s task", exec.TaskKey) } - inputs := make(map[string]interface{}) - if err := convert.Marshal(exec.Inputs, &inputs); err != nil { - return err - } - - output, err := r.defs[exec.TaskKey](inputs) + outputs, err := r.defs[exec.TaskKey](exec.Inputs) req := &pb.UpdateExecutionRequest{ Hash: exec.Hash, } if err == nil { - outputs := &structpb.Struct{} - if err := convert.Unmarshal(output, outputs); err != nil { - return err - } req.Result = &pb.UpdateExecutionRequest_Outputs{ Outputs: outputs, } diff --git a/systemservices/ethwallet/compiled.json b/systemservices/ethwallet/compiled.json index edaaa1d44..2f18551ac 100644 --- a/systemservices/ethwallet/compiled.json +++ b/systemservices/ethwallet/compiled.json @@ -1 +1 @@ -{"sid":"ethwallet","name":"Ethereum Wallet","description":"Manage Ethereum accounts and sign transactions.","configuration":{"env":["MESG_KEYSTORE=/keystore"],"volumes":["/keystore"]},"dependencies":[],"tasks":[{"key":"list","name":"List accounts","description":"Return the addresses of existing account.","inputs":[],"outputs":[{"key":"addresses","name":"Addresses","description":"List of addresses.","type":"String","repeated":true,"object":[]}]},{"key":"create","name":"Create a new account","description":"Create a new account with a passphrase. Make sure to backup the passphrase.","inputs":[{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]},{"key":"delete","name":"Delete an account","description":"Delete an account from the wallet. Need the address and its associated passphrase.","inputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]},{"key":"export","name":"Export an account","description":"Export an existing account in order to backup it and import it in an other wallet. Respect the Web3 Secret Storage specification. See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information.","inputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"id","name":"ID","description":"The id of the account.","type":"String","object":[]},{"key":"version","name":"Version","description":"The version used to export the account.","type":"Number","object":[]},{"key":"crypto","name":"Crypto","description":"The encrypted account.","type":"Object","object":[]}]},{"key":"import","name":"Import an account","description":"Import an account. The account have to respect the Web3 Secret Storage specification. See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information.","inputs":[{"key":"account","name":"Account","description":"The JSON encoded account.","type":"Object","object":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"id","name":"ID","description":"The id of the account.","type":"String","object":[]},{"key":"version","name":"Version","description":"The version used to export the account.","type":"Number","object":[]},{"key":"crypto","name":"Crypto","description":"The encrypted account.","type":"Object","object":[]}]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]},{"key":"sign","name":"Sign transaction","description":"Sign a transaction with the specified account.","inputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]},{"key":"transaction","name":"Transaction","description":"The transaction to sign.","type":"Object","object":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]}],"outputs":[{"key":"signedTransaction","name":"Signed transaction","description":"The signed transaction.","type":"String","object":[]}]},{"key":"importFromPrivateKey","name":"Import an account from a private key","description":"Import an account from a private key.","inputs":[{"key":"privateKey","name":"Private key","description":"The private key to import.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]}],"events":[],"workflows":[],"source":"QmTqJXKdqLL5FjJ8yaTa4M32nLCE8vJQzKdm1xsEKxxCKR"} +{"sid":"ethwallet","name":"Ethereum Wallet","description":"Manage Ethereum accounts and sign transactions.","configuration":{"env":["MESG_KEYSTORE=/keystore"],"volumes":["/keystore"]},"dependencies":[],"tasks":[{"key":"list","name":"List accounts","description":"Return the addresses of existing account.","inputs":[],"outputs":[{"key":"addresses","name":"Addresses","description":"List of addresses.","type":"String","repeated":true,"object":[]}]},{"key":"create","name":"Create a new account","description":"Create a new account with a passphrase. Make sure to backup the passphrase.","inputs":[{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]},{"key":"delete","name":"Delete an account","description":"Delete an account from the wallet. Need the address and its associated passphrase.","inputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]},{"key":"export","name":"Export an account","description":"Export an existing account in order to backup it and import it in an other wallet. Respect the Web3 Secret Storage specification. See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information.","inputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"account","name":"Account","description":"The JSON encoded account.","type":"String","object":[]}]},{"key":"import","name":"Import an account","description":"Import an account. The account have to respect the Web3 Secret Storage specification. See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information.","inputs":[{"key":"account","name":"Account","description":"The JSON encoded account.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]},{"key":"sign","name":"Sign transaction","description":"Sign a transaction with the specified account.","inputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]},{"key":"transaction","name":"Transaction","description":"The transaction to sign.","type":"Object","object":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]}],"outputs":[{"key":"signedTransaction","name":"Signed transaction","description":"The signed transaction.","type":"String","object":[]}]},{"key":"importFromPrivateKey","name":"Import an account from a private key","description":"Import an account from a private key.","inputs":[{"key":"privateKey","name":"Private key","description":"The private key to import.","type":"String","object":[]},{"key":"passphrase","name":"Passphrase","description":"Passphrase to use with the account.","type":"String","object":[]}],"outputs":[{"key":"address","name":"Address","description":"The public address of the account.","type":"String","object":[]}]}],"events":[],"source":"QmTWWr2rohfmj5ihmisVntvg4mZfGAJ5Tsh39bUpZzKV4F"} diff --git a/systemservices/ethwallet/ethwallet/create.go b/systemservices/ethwallet/ethwallet/create.go index b6040d2e4..89d7111dc 100644 --- a/systemservices/ethwallet/ethwallet/create.go +++ b/systemservices/ethwallet/ethwallet/create.go @@ -1,30 +1,16 @@ package ethwallet import ( - "github.com/ethereum/go-ethereum/common" - "github.com/mesg-foundation/engine/systemservices/ethwallet/client" + "github.com/mesg-foundation/engine/protobuf/types" ) -type createInputs struct { - Passphrase string `json:"passphrase"` -} - -type createOutputSuccess struct { - Address common.Address `json:"address"` -} - -func (s *Ethwallet) create(input map[string]interface{}) (map[string]interface{}, error) { - var inputs createInputs - if err := client.Unmarshal(input, &inputs); err != nil { - return nil, err - } - - account, err := s.keystore.NewAccount(inputs.Passphrase) +func (s *Ethwallet) create(inputs *types.Struct) (*types.Struct, error) { + account, err := s.keystore.NewAccount(inputs.Fields["passphrase"].GetStringValue()) if err != nil { return nil, err } - return client.Marshal(createOutputSuccess{ - Address: account.Address, - }) + return &types.Struct{Fields: map[string]*types.Value{ + "address": &types.Value{Kind: &types.Value_StringValue{account.Address.String()}}, + }}, nil } diff --git a/systemservices/ethwallet/ethwallet/delete.go b/systemservices/ethwallet/ethwallet/delete.go index 41198cdae..e0d581e45 100644 --- a/systemservices/ethwallet/ethwallet/delete.go +++ b/systemservices/ethwallet/ethwallet/delete.go @@ -2,35 +2,23 @@ package ethwallet import ( "github.com/ethereum/go-ethereum/common" - "github.com/mesg-foundation/engine/systemservices/ethwallet/client" + "github.com/mesg-foundation/engine/protobuf/types" "github.com/mesg-foundation/engine/systemservices/ethwallet/x/xgo-ethereum/xaccounts" ) -type deleteInputs struct { - Address common.Address `json:"address"` - Passphrase string `json:"passphrase"` -} - -type deleteOutputSuccess struct { - Address common.Address `json:"address"` -} - -func (s *Ethwallet) delete(input map[string]interface{}) (map[string]interface{}, error) { - var inputs deleteInputs - if err := client.Unmarshal(input, &inputs); err != nil { +func (s *Ethwallet) delete(inputs *types.Struct) (*types.Struct, error) { + address := common.HexToAddress(inputs.Fields["address"].GetStringValue()) + account, err := xaccounts.GetAccount(s.keystore, address) + if err != nil { return nil, err } - account, err := xaccounts.GetAccount(s.keystore, inputs.Address) + err = s.keystore.Delete(account, inputs.Fields["passphrase"].GetStringValue()) if err != nil { - return nil, errAccountNotFound - } - - if err := s.keystore.Delete(account, inputs.Passphrase); err != nil { return nil, err } - return client.Marshal(deleteOutputSuccess{ - Address: account.Address, - }) + return &types.Struct{Fields: map[string]*types.Value{ + "address": &types.Value{Kind: &types.Value_StringValue{account.Address.String()}}, + }}, nil } diff --git a/systemservices/ethwallet/ethwallet/error.go b/systemservices/ethwallet/ethwallet/error.go deleted file mode 100644 index 2bf1f7dc7..000000000 --- a/systemservices/ethwallet/ethwallet/error.go +++ /dev/null @@ -1,9 +0,0 @@ -package ethwallet - -import "errors" - -var ( - errAccountNotFound = errors.New("Account not found") - errCannotParseValue = errors.New("Cannot parse value") - errCannotParseGasPrice = errors.New("Cannot parse gasPrice") -) diff --git a/systemservices/ethwallet/ethwallet/export.go b/systemservices/ethwallet/ethwallet/export.go index f3405a0ba..3b1d6bd4c 100644 --- a/systemservices/ethwallet/ethwallet/export.go +++ b/systemservices/ethwallet/ethwallet/export.go @@ -1,37 +1,26 @@ package ethwallet import ( - "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/mesg-foundation/engine/systemservices/ethwallet/client" + "github.com/mesg-foundation/engine/protobuf/types" "github.com/mesg-foundation/engine/systemservices/ethwallet/x/xgo-ethereum/xaccounts" ) -type exportInputs struct { - Address common.Address `json:"address"` - Passphrase string `json:"passphrase"` -} - -func (s *Ethwallet) export(input map[string]interface{}) (map[string]interface{}, error) { - var inputs exportInputs - if err := client.Unmarshal(input, &inputs); err != nil { - return nil, err - } +func (s *Ethwallet) export(inputs *types.Struct) (*types.Struct, error) { + address := common.HexToAddress(inputs.Fields["address"].GetStringValue()) + passphrase := inputs.Fields["passphrase"].GetStringValue() - account, err := xaccounts.GetAccount(s.keystore, inputs.Address) + account, err := xaccounts.GetAccount(s.keystore, address) if err != nil { - return nil, errAccountNotFound + return nil, err } - keyJSON, err := s.keystore.Export(account, inputs.Passphrase, inputs.Passphrase) + accountJSON, err := s.keystore.Export(account, passphrase, passphrase) if err != nil { return nil, err } - var accountJSON encryptedKeyJSONV3 - if err = json.Unmarshal(keyJSON, &accountJSON); err != nil { - return nil, err - } - return client.Marshal(accountJSON) + return &types.Struct{Fields: map[string]*types.Value{ + "account": &types.Value{Kind: &types.Value_StringValue{string(accountJSON)}}, + }}, nil } diff --git a/systemservices/ethwallet/ethwallet/import.go b/systemservices/ethwallet/ethwallet/import.go index 5c458413d..c77dc2303 100644 --- a/systemservices/ethwallet/ethwallet/import.go +++ b/systemservices/ethwallet/ethwallet/import.go @@ -1,38 +1,19 @@ package ethwallet import ( - "encoding/json" - - "github.com/ethereum/go-ethereum/common" - "github.com/mesg-foundation/engine/systemservices/ethwallet/client" + "github.com/mesg-foundation/engine/protobuf/types" ) -type importInputs struct { - Account encryptedKeyJSONV3 `json:"account"` - Passphrase string `json:"passphrase"` -} - -type importOutputSuccess struct { - Address common.Address `json:"address"` -} - -func (s *Ethwallet) importA(input map[string]interface{}) (map[string]interface{}, error) { - var inputs importInputs - if err := client.Unmarshal(input, &inputs); err != nil { - return nil, err - } - - accountJSON, err := json.Marshal(inputs.Account) - if err != nil { - return nil, err - } +func (s *Ethwallet) importA(inputs *types.Struct) (*types.Struct, error) { + accountJSON := inputs.Fields["account"].GetStringValue() + passphrase := inputs.Fields["passphrase"].GetStringValue() - account, err := s.keystore.Import(accountJSON, inputs.Passphrase, inputs.Passphrase) + importedAccount, err := s.keystore.Import([]byte(accountJSON), passphrase, passphrase) if err != nil { return nil, err } - return client.Marshal(importOutputSuccess{ - Address: account.Address, - }) + return &types.Struct{Fields: map[string]*types.Value{ + "address": &types.Value{Kind: &types.Value_StringValue{importedAccount.Address.String()}}, + }}, nil } diff --git a/systemservices/ethwallet/ethwallet/importFromPrivateKey.go b/systemservices/ethwallet/ethwallet/importFromPrivateKey.go index 0d65b06d9..1830f41db 100644 --- a/systemservices/ethwallet/ethwallet/importFromPrivateKey.go +++ b/systemservices/ethwallet/ethwallet/importFromPrivateKey.go @@ -3,37 +3,22 @@ package ethwallet import ( "errors" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/mesg-foundation/engine/systemservices/ethwallet/client" + "github.com/mesg-foundation/engine/protobuf/types" ) -type importFromPrivateKeyInputs struct { - PrivateKey string `json:"privateKey"` - Passphrase string `json:"passphrase"` -} - -type importFromPrivateKeyOutputSuccess struct { - Address common.Address `json:"address"` -} - -func (s *Ethwallet) importFromPrivateKey(input map[string]interface{}) (map[string]interface{}, error) { - var inputs importFromPrivateKeyInputs - if err := client.Unmarshal(input, &inputs); err != nil { - return nil, err - } - - privateKey, err := crypto.HexToECDSA(inputs.PrivateKey) +func (s *Ethwallet) importFromPrivateKey(inputs *types.Struct) (*types.Struct, error) { + privateKey, err := crypto.HexToECDSA(inputs.Fields["privateKey"].GetStringValue()) if err != nil { return nil, errors.New("cannot parse private key") } - account, err := s.keystore.ImportECDSA(privateKey, inputs.Passphrase) + account, err := s.keystore.ImportECDSA(privateKey, inputs.Fields["passphrase"].GetStringValue()) if err != nil { return nil, err } - return client.Marshal(importOutputSuccess{ - Address: account.Address, - }) + return &types.Struct{Fields: map[string]*types.Value{ + "address": &types.Value{Kind: &types.Value_StringValue{account.Address.String()}}, + }}, nil } diff --git a/systemservices/ethwallet/ethwallet/list.go b/systemservices/ethwallet/ethwallet/list.go index 7e83092c7..5a9f79d85 100644 --- a/systemservices/ethwallet/ethwallet/list.go +++ b/systemservices/ethwallet/ethwallet/list.go @@ -1,21 +1,16 @@ package ethwallet import ( - "github.com/ethereum/go-ethereum/common" - "github.com/mesg-foundation/engine/systemservices/ethwallet/client" + "github.com/mesg-foundation/engine/protobuf/types" ) -type listOutputSuccess struct { - Addresses []common.Address `json:"addresses"` -} - -func (s *Ethwallet) list(input map[string]interface{}) (map[string]interface{}, error) { - addresses := make([]common.Address, 0) +func (s *Ethwallet) list(inputs *types.Struct) (*types.Struct, error) { + var addresses []*types.Value for _, account := range s.keystore.Accounts() { - addresses = append(addresses, account.Address) + addresses = append(addresses, &types.Value{Kind: &types.Value_StringValue{account.Address.String()}}) } - return client.Marshal(listOutputSuccess{ - Addresses: addresses, - }) + return &types.Struct{Fields: map[string]*types.Value{ + "addresses": &types.Value{Kind: &types.Value_ListValue{&types.ListValue{Values: addresses}}}, + }}, nil } diff --git a/systemservices/ethwallet/ethwallet/sign.go b/systemservices/ethwallet/ethwallet/sign.go index e8a86f17e..9503c7f5e 100644 --- a/systemservices/ethwallet/ethwallet/sign.go +++ b/systemservices/ethwallet/ethwallet/sign.go @@ -2,69 +2,66 @@ package ethwallet import ( "bytes" + "errors" "fmt" "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/mesg-foundation/engine/systemservices/ethwallet/client" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/mesg-foundation/engine/protobuf/types" "github.com/mesg-foundation/engine/systemservices/ethwallet/x/xgo-ethereum/xaccounts" ) -type signInputs struct { - Address common.Address `json:"address"` - Passphrase string `json:"passphrase"` - Transaction *transaction `json:"transaction"` -} - -type transaction struct { - ChainID int64 `json:"chainID"` - Nonce uint64 `json:"nonce"` - To common.Address `json:"to"` - Value string `json:"value"` - Gas uint64 `json:"gas"` - GasPrice string `json:"gasPrice"` - Data hexutil.Bytes `json:"data"` -} - -type signOutputSuccess struct { - SignedTransaction string `json:"signedTransaction"` -} - -func (s *Ethwallet) sign(input map[string]interface{}) (map[string]interface{}, error) { - var inputs signInputs - if err := client.Unmarshal(input, &inputs); err != nil { - return nil, err - } +func (s *Ethwallet) sign(inputs *types.Struct) (*types.Struct, error) { + address := common.HexToAddress(inputs.Fields["address"].GetStringValue()) + passphrase := inputs.Fields["passphrase"].GetStringValue() + tx := inputs.Fields["transaction"].GetStructValue() - account, err := xaccounts.GetAccount(s.keystore, inputs.Address) + account, err := xaccounts.GetAccount(s.keystore, address) if err != nil { - return nil, errAccountNotFound + return nil, err } value := new(big.Int) - if _, ok := value.SetString(inputs.Transaction.Value, 0); !ok { - return nil, errCannotParseValue + if _, ok := value.SetString(tx.Fields["value"].GetStringValue(), 0); !ok { + return nil, errors.New("cannot parse value") } gasPrice := new(big.Int) - if _, ok := gasPrice.SetString(inputs.Transaction.GasPrice, 0); !ok { - return nil, errCannotParseGasPrice + if _, ok := gasPrice.SetString(tx.Fields["gasPrice"].GetStringValue(), 0); !ok { + return nil, errors.New("cannot parse gasPrice") + } + + data, err := hexutil.Decode(tx.Fields["data"].GetStringValue()) + if err != nil { + return nil, fmt.Errorf("cannot parse data: %w", err) } - transaction := types.NewTransaction(inputs.Transaction.Nonce, inputs.Transaction.To, value, inputs.Transaction.Gas, gasPrice, inputs.Transaction.Data) + transaction := ethtypes.NewTransaction( + uint64(tx.Fields["nonce"].GetNumberValue()), + common.HexToAddress(tx.Fields["to"].GetStringValue()), + value, + uint64(tx.Fields["gas"].GetNumberValue()), + gasPrice, + data, + ) - signedTransaction, err := s.keystore.SignTxWithPassphrase(account, inputs.Passphrase, transaction, big.NewInt(inputs.Transaction.ChainID)) + signedTransaction, err := s.keystore.SignTxWithPassphrase( + account, + passphrase, + transaction, + big.NewInt(int64(tx.Fields["chainID"].GetNumberValue())), + ) if err != nil { return nil, err } - var buff bytes.Buffer - signedTransaction.EncodeRLP(&buff) - rawTx := fmt.Sprintf("0x%x", buff.Bytes()) + var buf bytes.Buffer + signedTransaction.EncodeRLP(&buf) + rawTx := fmt.Sprintf("0x%x", buf.Bytes()) - return client.Marshal(signOutputSuccess{ - SignedTransaction: rawTx, - }) + return &types.Struct{Fields: map[string]*types.Value{ + "signedTransaction": &types.Value{Kind: &types.Value_StringValue{rawTx}}, + }}, nil } diff --git a/systemservices/ethwallet/ethwallet/type.go b/systemservices/ethwallet/ethwallet/type.go deleted file mode 100644 index 8f546300a..000000000 --- a/systemservices/ethwallet/ethwallet/type.go +++ /dev/null @@ -1,13 +0,0 @@ -package ethwallet - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" -) - -// From https://github.com/ethereum/go-ethereum/blob/master/accounts/keystore/key.go#L67 -type encryptedKeyJSONV3 struct { - Address string `json:"address"` - Crypto keystore.CryptoJSON `json:"crypto"` - ID string `json:"id"` - Version int `json:"version"` -} diff --git a/systemservices/ethwallet/go.mod b/systemservices/ethwallet/go.mod index 675a85f16..37d593673 100644 --- a/systemservices/ethwallet/go.mod +++ b/systemservices/ethwallet/go.mod @@ -3,33 +3,14 @@ module github.com/mesg-foundation/engine/systemservices/ethwallet go 1.12 require ( - github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect github.com/allegro/bigcache v1.2.1 // indirect - github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect github.com/aristanetworks/goarista v0.0.0-20190628180533-8e7d5b18fe7a // indirect github.com/cespare/cp v1.1.1 // indirect github.com/deckarep/golang-set v1.7.1 // indirect - github.com/emirpasic/gods v1.12.0 // indirect github.com/ethereum/go-ethereum v1.8.27 - github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect - github.com/gliderlabs/ssh v0.2.2 // indirect - github.com/golang/protobuf v1.3.2 - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e // indirect - github.com/mesg-foundation/engine v0.5.1-0.20190830132122-7f4f7dd94c4f - github.com/mitchellh/mapstructure v1.1.2 + github.com/mesg-foundation/engine v0.14.3-0.20190921080958-f6312737cdb8 github.com/pborman/uuid v1.2.0 // indirect - github.com/pelletier/go-buffruneio v0.2.0 // indirect github.com/rjeczalik/notify v0.9.2 // indirect - github.com/sergi/go-diff v1.0.0 // indirect - github.com/src-d/gcfg v1.4.0 // indirect github.com/stretchr/testify v1.4.0 - github.com/xanzy/ssh-agent v0.2.1 // indirect google.golang.org/grpc v1.23.0 - gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect - gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect - gopkg.in/src-d/go-billy.v4 v4.3.0 // indirect - gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 // indirect - gopkg.in/src-d/go-git.v4 v4.5.0 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/systemservices/ethwallet/go.sum b/systemservices/ethwallet/go.sum index 51201b7ab..af8295cbb 100644 --- a/systemservices/ethwallet/go.sum +++ b/systemservices/ethwallet/go.sum @@ -1,6 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= @@ -10,28 +11,30 @@ github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcy github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/aristanetworks/goarista v0.0.0-20190628180533-8e7d5b18fe7a h1:AtHySZzzzJyE9NDlY3MNxkR12HsSxE1QmntYzuc0uEw= github.com/aristanetworks/goarista v0.0.0-20190628180533-8e7d5b18fe7a/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d h1:1aAija9gr0Hyv4KfQcRcwlmFIrhkDmIj2dz5bkg/s/8= github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d/go.mod h1:icNx/6QdFblhsEjZehARqbNumymUT/ydwlLojFdv7Sk= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= -github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8 h1:mOg8/RgDSHTQ1R0IR+LMDuW4TDShPv+JzYHuR4GLoNA= -github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a h1:We35J+0yvVFrEXbtViYUW8H/wNOhqjIF3PsrW4yYmGw= github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= @@ -42,8 +45,6 @@ github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cnf/structhash v0.0.0-20180104161610-62a607eb0224 h1:rnCKRrdSBqc061l0CDuYB+7X3w6w8IK/VCSChJXv62g= -github.com/cnf/structhash v0.0.0-20180104161610-62a607eb0224/go.mod h1:pCxVEbcm3AMg7ejXyorUXi6HQCzOIBf7zEDVPtw0/U4= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc h1:TP+534wVlf61smEIq1nwLLAjQVEK2EADoW3CX9AuT+8= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -52,10 +53,14 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/cosmos-sdk v0.36.0/go.mod h1:3b/k/Zd+YDuttSmEJdNkxga1H5EIiDUhSYeErAHQN7A= +github.com/cosmos/cosmos-sdk v0.37.0 h1:S2I3NDGN2wqfGlY5KqkAHTpfezjhgeqDxrCxhlhd528= +github.com/cosmos/cosmos-sdk v0.37.0/go.mod h1:3b/k/Zd+YDuttSmEJdNkxga1H5EIiDUhSYeErAHQN7A= github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/ledger-cosmos-go v0.10.3 h1:Qhi5yTR5Pg1CaTpd00pxlGwNl4sFRdtK1J96OTjeFFc= github.com/cosmos/ledger-cosmos-go v0.10.3/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= +github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= @@ -76,23 +81,24 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/etcd-io/bbolt v1.3.2/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/go-ethereum v1.8.27 h1:d+gkiLaBDk5fn3Pe/xNVaMrB/ozI+AUB2IlVBp29IrY= github.com/ethereum/go-ethereum v1.8.27/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-bindata/go-bindata v0.0.0-20181025070752-41975c0ccc30/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-kit/kit v0.6.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= @@ -103,11 +109,14 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.0 h1:G8O7TerXerS4F6sx9OV7/nRfJdnXgHZu/S/7F2SN+UE= +github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= @@ -121,30 +130,33 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.2 h1:zoNxOV7WjqXptQOVngLmcSQgXmgk4NMz1HibBchjl/I= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20180522105215-e9c5d9645c43/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= @@ -153,12 +165,14 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kelseyhightower/envconfig v1.3.0 h1:IvRS4f2VcIQy6j4ORGIf9145T/AsUB+oY8LyvN8BXNM= github.com/kelseyhightower/envconfig v1.3.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -168,20 +182,22 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= +github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/lyft/protoc-gen-validate v0.1.0/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mesg-foundation/engine v0.5.1-0.20190725113935-3e817175f412 h1:pltHBuy2yeuf83rg2QsbB7YXk1dCnxTXll1mbmTk47w= -github.com/mesg-foundation/engine v0.5.1-0.20190725113935-3e817175f412/go.mod h1:KiMM6s34FwClc1niXN9NO/QG7VKPh4bS/PxBO0b0H48= -github.com/mesg-foundation/engine v0.5.1-0.20190830132122-7f4f7dd94c4f h1:8wLF76t7ifkdknMSJLZFfN4nyIwWEcUmFULjJdCSsOU= -github.com/mesg-foundation/engine v0.5.1-0.20190830132122-7f4f7dd94c4f/go.mod h1:g9sx1sUJ5s9awqvwCcbX7T6H2rT1Kkrg3C1L0gTpsIo= -github.com/mesg-foundation/engine v0.13.0 h1:F+DiDrKuyb26dJ5BSEU2U/C54g9kyaR+JnQzhvuWQzA= -github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747 h1:eQox4Rh4ewJF+mqYPxCkmBAirRnPaHEB26UkNuPyjlk= -github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mesg-foundation/engine v0.14.3-0.20190921080958-f6312737cdb8 h1:LuGRONlHPX5X8oQn8AaflgKWaVdKn3HulDXmG1ZxBRs= +github.com/mesg-foundation/engine v0.14.3-0.20190921080958-f6312737cdb8/go.mod h1:YMr8ecDOi7kxUKweWMUqBG4/5HzMQxBO8675ccNgAo8= +github.com/mesg-foundation/engine v0.14.3-0.20190921085101-56b854765b71 h1:hZDIw3/JshRA4T4fCcZve0AmoltoCj6rm8uj7dMdjQU= +github.com/mesg-foundation/engine v0.14.3-0.20190921085101-56b854765b71/go.mod h1:YMr8ecDOi7kxUKweWMUqBG4/5HzMQxBO8675ccNgAo8= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -209,8 +225,8 @@ github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJ github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= @@ -221,9 +237,11 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= @@ -231,75 +249,92 @@ github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7q github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190227231451-bbced9601137/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pseudomuto/protoc-gen-doc v1.3.0/go.mod h1:fwtQAY9erXp3mC92O8OTECnDlJT2r0Ff4KSEKbGEmy0= github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= github.com/rakyll/statik v0.1.5/go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs= +github.com/rakyll/statik v0.1.6 h1:uICcfUXpgqtw2VopbIncslhAmE5hwc4g20TEyEENBNs= github.com/rakyll/statik v0.1.6/go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs= github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962 h1:eUm8ma4+yPknhXtkYlWh3tMkE6gBjXZToDned9s2gbQ= github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.0.6 h1:hcP1GmhGigz/O7h1WVUM5KklBp1JoNS9FggWKdj/j3s= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/syndtr/goleveldb v0.0.0-20180708030551-c4c61651e9e3 h1:sAlSBRDl4psFR3ysKXRSE8ss6Mt90+ma1zRTroTNBJA= -github.com/syndtr/goleveldb v0.0.0-20180708030551-c4c61651e9e3/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= +github.com/tendermint/crypto v0.0.0-20180820045704-3764759f34a5 h1:u8i49c+BxloX3XQ55cvzFNXplizZP/q00i+IlttUjAU= github.com/tendermint/crypto v0.0.0-20180820045704-3764759f34a5/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= +github.com/tendermint/go-amino v0.15.0 h1:TC4e66P59W7ML9+bxio17CPKnxW3nKIRAYskntMAoRk= github.com/tendermint/go-amino v0.15.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tendermint/iavl v0.12.4 h1:hd1woxUGISKkfUWBA4mmmTwOua6PQZTJM/F0FDrmMV8= github.com/tendermint/iavl v0.12.4/go.mod h1:8LHakzt8/0G3/I8FUU0ReNx98S/EP6eyPJkAUvEXT/o= github.com/tendermint/tendermint v0.32.1/go.mod h1:jmPDAKuNkev9793/ivn/fTBnfpA9mGBww8MPRNPNxnU= github.com/tendermint/tendermint v0.32.2/go.mod h1:NwMyx58S8VJ7tEpFKqRVlVWKO9N9zjTHu+Dx96VsnOE= +github.com/tendermint/tendermint v0.32.3 h1:GEnWpGQ795h5oTFNbfBLsY0LW/CW2j6p6HtiYNfxsgg= +github.com/tendermint/tendermint v0.32.3/go.mod h1:ZK2c29jl1QRYznIRyRWRDsmm1yvtPzBRT00x4t1JToY= +github.com/tendermint/tm-db v0.1.1 h1:G3Xezy3sOk9+ekhjZ/kjArYIs1SmwV+1OUgNkj7RgV0= github.com/tendermint/tm-db v0.1.1/go.mod h1:0cPKWu2Mou3IlxecH+MEUSYc1Ch537alLe6CpFrKzgw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5/go.mod h1:ppEjwdhyy7Y31EnHRDm1JkChoC7LXIJ7Ex0VYLWtZtQ= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -307,12 +342,9 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -342,7 +374,6 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -350,13 +381,11 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -365,6 +394,7 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZe golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181112210238-4b1f3b6b1646/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -378,8 +408,6 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601 h1:9VBRTdmgQxbs6HE0sUnMrSWNePppAJU07NYvX5dIB04= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 h1:iKtrH9Y8mcbADOP0YFaEMth7OfuHY9xHOwNj4znpM1A= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -389,31 +417,23 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.26.0 h1:2NPPsBpD0ZoxshmLWewQru8rWmbT5JqSzz9D1ZrAjYQ= -gopkg.in/go-playground/validator.v9 v9.26.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.5.0/go.mod h1:CzbUWqMn4pvmvndg3gnh5iZFmSsbhyhUWdI0IQ60AQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= diff --git a/systemservices/ethwallet/mesg.yml b/systemservices/ethwallet/mesg.yml index bbfd81d5c..37a1be8a1 100644 --- a/systemservices/ethwallet/mesg.yml +++ b/systemservices/ethwallet/mesg.yml @@ -43,29 +43,16 @@ tasks: inputs: address: *address passphrase: *passphrase - outputs: &account - address: *address - id: - name: "ID" - description: "The id of the account." + outputs: + account: &account + name: "Account" + description: "The JSON encoded account." type: String - version: - name: "Version" - description: "The version used to export the account." - type: Number - crypto: - name: "Crypto" - description: "The encrypted account." - type: Object import: name: "Import an account" description: "Import an account. The account have to respect the Web3 Secret Storage specification. See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information." inputs: - account: - name: "Account" - description: "The JSON encoded account." - type: Object - object: *account + account: *account passphrase: *passphrase outputs: address: *address diff --git a/systemservices/ethwallet/test-data/create.json b/systemservices/ethwallet/test-data/create.json deleted file mode 100644 index 768f24b24..000000000 --- a/systemservices/ethwallet/test-data/create.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "passphrase": "1" -} \ No newline at end of file diff --git a/systemservices/ethwallet/test-data/delete.json b/systemservices/ethwallet/test-data/delete.json deleted file mode 100644 index 19005e28d..000000000 --- a/systemservices/ethwallet/test-data/delete.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "address": "0x383Cfb1A2d54A372F5C9F7210b1FF23B0dcd50c3", - "passphrase": "1" -} \ No newline at end of file diff --git a/systemservices/ethwallet/test-data/export.json b/systemservices/ethwallet/test-data/export.json deleted file mode 100644 index 19005e28d..000000000 --- a/systemservices/ethwallet/test-data/export.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "address": "0x383Cfb1A2d54A372F5C9F7210b1FF23B0dcd50c3", - "passphrase": "1" -} \ No newline at end of file diff --git a/systemservices/ethwallet/test-data/import.json b/systemservices/ethwallet/test-data/import.json deleted file mode 100644 index e9e07111c..000000000 --- a/systemservices/ethwallet/test-data/import.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "passphrase": "1", - "account": { - "address": "383cfb1a2d54a372f5c9f7210b1ff23b0dcd50c3", - "crypto": { - "cipher": "aes-128-ctr", - "cipherparams": { - "iv": "3c5f036d2c542ee33ff71dde413152ee" - }, - "ciphertext": "b902e494f36e9cd9c133c9bc96f07f048d0ba7efa957533962beae5ea7cd5ad1", - "kdf": "scrypt", - "kdfparams": { - "dklen": 32, - "n": 262144, - "p": 1, - "r": 8, - "salt": "4489e8c76a08b6aec33efa6b4c6e024df26ce56dfe84304033bddb20fd27dcb4" - }, - "mac": "e47ff70af60cd55c67128dd6061a4826fa50c41bf075e1f36c0248535f90db8a" - }, - "id": "1dcdd0a6-f9f9-4b7b-938c-3dc245c2d1ae", - "version": 3 - } -} \ No newline at end of file diff --git a/systemservices/ethwallet/test-data/importFromPrivateKey.json b/systemservices/ethwallet/test-data/importFromPrivateKey.json deleted file mode 100644 index 44b2cc56c..000000000 --- a/systemservices/ethwallet/test-data/importFromPrivateKey.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "passphrase": "1", - "privateKey": "69227b0739f4e33de151d3caaca1ff8260dd558aec238b4d36bebd1c87d892f9" -} \ No newline at end of file diff --git a/systemservices/ethwallet/test-data/sign.json b/systemservices/ethwallet/test-data/sign.json deleted file mode 100644 index 360faf275..000000000 --- a/systemservices/ethwallet/test-data/sign.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "address": "0xf3C21FD07B1D4c40d3cE6EfaC81a3E49f6c04592", - "passphrase": "1", - "transaction": { - "chainID": 3, - "data": "0x5d03323c7465737432000000000000000000000000000000000000000000000000000000", - "gas": 1000000, - "gasPrice": "1000000000", - "nonce": 12, - "to": "0x4b013d9bb4c50CE183A79094cb6626dEB7e009e1", - "value": "0" - } -} \ No newline at end of file diff --git a/systemservices/ethwallet/x/xgo-ethereum/xaccounts/accounts.go b/systemservices/ethwallet/x/xgo-ethereum/xaccounts/accounts.go index fe705dcf7..ecb9cf03b 100644 --- a/systemservices/ethwallet/x/xgo-ethereum/xaccounts/accounts.go +++ b/systemservices/ethwallet/x/xgo-ethereum/xaccounts/accounts.go @@ -15,5 +15,5 @@ func GetAccount(keystore *keystore.KeyStore, address common.Address) (accounts.A return account, nil } } - return accounts.Account{}, fmt.Errorf("Account not found") + return accounts.Account{}, fmt.Errorf("account not found") } diff --git a/systemservices/marketplace/compiled.json b/systemservices/marketplace/compiled.json index d909c3f2f..de1e04c76 100644 --- a/systemservices/marketplace/compiled.json +++ b/systemservices/marketplace/compiled.json @@ -1 +1 @@ -{"sid":"marketplace","name":"Marketplace","description":"","configuration":{"env":["BLOCK_CONFIRMATIONS=0","POLLING_TIME=1000","TIMEOUT=30000","IPFS_PROVIDER=ipfs.app.mesg.com","PROVIDER_ENDPOINT=","MARKETPLACE_ADDRESS=","TOKEN_ADDRESS="]},"dependencies":[],"tasks":[{"key":"listServices","inputs":[],"outputs":[{"key":"services","type":"Object","repeated":true,"object":[{"key":"sid","type":"String","object":[]},{"key":"createTime","type":"String","object":[]},{"key":"owner","type":"String","object":[]}]}]},{"key":"getService","inputs":[{"key":"sid","type":"String","object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"createTime","type":"String","object":[]},{"key":"owner","type":"String","object":[]},{"key":"offers","type":"Object","repeated":true,"optional":true,"object":[{"key":"offerIndex","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"active","type":"Boolean","object":[]},{"key":"createTime","type":"String","object":[]}]},{"key":"purchases","type":"Object","repeated":true,"optional":true,"object":[{"key":"purchaser","type":"String","object":[]},{"key":"expire","type":"String","object":[]},{"key":"createTime","type":"String","object":[]}]},{"key":"versions","type":"Object","repeated":true,"optional":true,"object":[{"key":"versionHash","type":"String","object":[]},{"key":"manifest","type":"String","object":[]},{"key":"manifestProtocol","type":"String","object":[]},{"key":"createTime","type":"String","object":[]},{"key":"manifestData","type":"Object","optional":true,"object":[{"key":"version","type":"String","object":[]},{"key":"service","type":"Object","object":[{"key":"deployment","type":"Object","object":[{"key":"type","type":"String","object":[]},{"key":"source","type":"String","object":[]}]},{"key":"definition","type":"Object","object":[{"key":"hash","type":"String","object":[]},{"key":"sid","type":"String","object":[]},{"key":"name","type":"String","object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"tasks","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"inputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]},{"key":"outputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"events","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"data","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"configuration","type":"Object","optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]}]},{"key":"dependencies","type":"Object","repeated":true,"optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]},{"key":"key","type":"String","object":[]},{"key":"image","type":"String","object":[]}]},{"key":"repository","type":"String","optional":true,"object":[]}]},{"key":"readme","type":"String","optional":true,"object":[]}]}]}]}]},{"key":"preparePublishServiceVersion","inputs":[{"key":"service","type":"Object","object":[{"key":"deployment","type":"Object","object":[{"key":"type","type":"String","object":[]},{"key":"source","type":"String","object":[]}]},{"key":"definition","type":"Object","object":[{"key":"hash","type":"String","object":[]},{"key":"sid","type":"String","object":[]},{"key":"name","type":"String","object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"tasks","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"inputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]},{"key":"outputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"events","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"data","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"configuration","type":"Object","optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]}]},{"key":"dependencies","type":"Object","repeated":true,"optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]},{"key":"key","type":"String","object":[]},{"key":"image","type":"String","object":[]}]},{"key":"repository","type":"String","optional":true,"object":[]}]},{"key":"readme","type":"String","optional":true,"object":[]}]},{"key":"from","type":"String","object":[]},{"key":"gas","type":"Number","optional":true,"object":[]},{"key":"gasPrice","type":"String","optional":true,"object":[]}],"outputs":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]},{"key":"publishPublishServiceVersion","inputs":[{"key":"signedTransaction","type":"String","object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"versionHash","type":"String","object":[]},{"key":"manifest","type":"String","object":[]},{"key":"manifestProtocol","type":"String","object":[]}]},{"key":"prepareCreateServiceOffer","inputs":[{"key":"sid","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"from","type":"String","object":[]},{"key":"gas","type":"Number","optional":true,"object":[]},{"key":"gasPrice","type":"String","optional":true,"object":[]}],"outputs":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]},{"key":"publishCreateServiceOffer","inputs":[{"key":"signedTransaction","type":"String","object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]}]},{"key":"preparePurchase","inputs":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"from","type":"String","object":[]},{"key":"gas","type":"Number","optional":true,"object":[]},{"key":"gasPrice","type":"String","optional":true,"object":[]}],"outputs":[{"key":"transactions","type":"Object","repeated":true,"object":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]}]},{"key":"publishPurchase","inputs":[{"key":"signedTransactions","type":"String","repeated":true,"object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"purchaser","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"expire","type":"String","object":[]}]},{"key":"isAuthorized","inputs":[{"key":"sid","type":"String","optional":true,"object":[]},{"key":"versionHash","type":"String","optional":true,"object":[]},{"key":"addresses","type":"String","repeated":true,"object":[]}],"outputs":[{"key":"authorized","type":"Boolean","object":[]},{"key":"sid","type":"String","object":[]},{"key":"source","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]}]}],"events":[{"key":"serviceCreated","data":[{"key":"sid","type":"String","object":[]},{"key":"owner","type":"String","object":[]}]},{"key":"serviceOwnershipTransferred","data":[{"key":"sid","type":"String","object":[]},{"key":"previousOwner","type":"String","object":[]},{"key":"newOwner","type":"String","object":[]}]},{"key":"serviceVersionCreated","data":[{"key":"sid","type":"String","object":[]},{"key":"versionHash","type":"String","object":[]},{"key":"manifest","type":"String","object":[]},{"key":"manifestProtocol","type":"String","object":[]}]},{"key":"serviceOfferCreated","data":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]}]},{"key":"serviceOfferDisabled","data":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]}]},{"key":"servicePurchased","data":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"purchaser","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"expire","type":"String","object":[]}]}],"workflows":[],"source":"Qmegz7ECFrf96rScVKjagTo5yJRzBVkRTUYRRbJzbnNCzP"} +{"sid":"marketplace","name":"Marketplace","description":"","configuration":{"env":["BLOCK_CONFIRMATIONS=0","POLLING_TIME=1000","TIMEOUT=30000","IPFS_PROVIDER=ipfs.app.mesg.com","PROVIDER_ENDPOINT=","MARKETPLACE_ADDRESS=","TOKEN_ADDRESS="]},"dependencies":[],"tasks":[{"key":"listServices","inputs":[],"outputs":[{"key":"services","type":"Object","repeated":true,"object":[{"key":"sid","type":"String","object":[]},{"key":"createTime","type":"String","object":[]},{"key":"owner","type":"String","object":[]}]}]},{"key":"getService","inputs":[{"key":"sid","type":"String","object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"createTime","type":"String","object":[]},{"key":"owner","type":"String","object":[]},{"key":"offers","type":"Object","repeated":true,"optional":true,"object":[{"key":"offerIndex","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"active","type":"Boolean","object":[]},{"key":"createTime","type":"String","object":[]}]},{"key":"purchases","type":"Object","repeated":true,"optional":true,"object":[{"key":"purchaser","type":"String","object":[]},{"key":"expire","type":"String","object":[]},{"key":"createTime","type":"String","object":[]}]},{"key":"versions","type":"Object","repeated":true,"optional":true,"object":[{"key":"versionHash","type":"String","object":[]},{"key":"manifest","type":"String","object":[]},{"key":"manifestProtocol","type":"String","object":[]},{"key":"createTime","type":"String","object":[]},{"key":"manifestData","type":"Object","optional":true,"object":[{"key":"version","type":"String","object":[]},{"key":"service","type":"Object","object":[{"key":"deployment","type":"Object","object":[{"key":"type","type":"String","object":[]},{"key":"source","type":"String","object":[]}]},{"key":"definition","type":"Object","object":[{"key":"hash","type":"String","object":[]},{"key":"sid","type":"String","object":[]},{"key":"name","type":"String","object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"tasks","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"inputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]},{"key":"outputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"events","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"data","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"configuration","type":"Object","optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]}]},{"key":"dependencies","type":"Object","repeated":true,"optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]},{"key":"key","type":"String","object":[]},{"key":"image","type":"String","object":[]}]},{"key":"repository","type":"String","optional":true,"object":[]}]},{"key":"readme","type":"String","optional":true,"object":[]}]}]}]}]},{"key":"preparePublishServiceVersion","inputs":[{"key":"service","type":"Object","object":[{"key":"deployment","type":"Object","object":[{"key":"type","type":"String","object":[]},{"key":"source","type":"String","object":[]}]},{"key":"definition","type":"Object","object":[{"key":"hash","type":"String","object":[]},{"key":"sid","type":"String","object":[]},{"key":"name","type":"String","object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"tasks","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"inputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]},{"key":"outputs","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"events","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"data","type":"Object","repeated":true,"optional":true,"object":[{"key":"key","type":"String","object":[]},{"key":"name","type":"String","optional":true,"object":[]},{"key":"description","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]},{"key":"optional","type":"Boolean","optional":true,"object":[]},{"key":"repeated","type":"Boolean","optional":true,"object":[]},{"key":"object","type":"Object","optional":true,"object":[]}]}]},{"key":"configuration","type":"Object","optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]}]},{"key":"dependencies","type":"Object","repeated":true,"optional":true,"object":[{"key":"volumes","type":"String","repeated":true,"optional":true,"object":[]},{"key":"volumesFrom","type":"String","repeated":true,"optional":true,"object":[]},{"key":"ports","type":"String","repeated":true,"optional":true,"object":[]},{"key":"args","type":"String","repeated":true,"optional":true,"object":[]},{"key":"command","type":"String","optional":true,"object":[]},{"key":"key","type":"String","object":[]},{"key":"image","type":"String","object":[]}]},{"key":"repository","type":"String","optional":true,"object":[]}]},{"key":"readme","type":"String","optional":true,"object":[]}]},{"key":"from","type":"String","object":[]},{"key":"gas","type":"Number","optional":true,"object":[]},{"key":"gasPrice","type":"String","optional":true,"object":[]}],"outputs":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]},{"key":"publishPublishServiceVersion","inputs":[{"key":"signedTransaction","type":"String","object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"versionHash","type":"String","object":[]},{"key":"manifest","type":"String","object":[]},{"key":"manifestProtocol","type":"String","object":[]}]},{"key":"prepareCreateServiceOffer","inputs":[{"key":"sid","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"from","type":"String","object":[]},{"key":"gas","type":"Number","optional":true,"object":[]},{"key":"gasPrice","type":"String","optional":true,"object":[]}],"outputs":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]},{"key":"publishCreateServiceOffer","inputs":[{"key":"signedTransaction","type":"String","object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]}]},{"key":"preparePurchase","inputs":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"from","type":"String","object":[]},{"key":"gas","type":"Number","optional":true,"object":[]},{"key":"gasPrice","type":"String","optional":true,"object":[]}],"outputs":[{"key":"transactions","type":"Object","repeated":true,"object":[{"key":"chainID","name":"Chain ID","description":"The ID of the chain the transaction is for. See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids.","type":"Number","object":[]},{"key":"nonce","name":"Nonce","description":"Nonce to use.","type":"Number","object":[]},{"key":"to","name":"To","description":"The to address.","type":"String","object":[]},{"key":"value","name":"Value","description":"The value in Wei.","type":"String","object":[]},{"key":"gas","name":"Gas","description":"The maximum gas to use to execute this transaction","type":"Number","object":[]},{"key":"gasPrice","name":"Gas price","description":"The gas price in Wei.","type":"String","object":[]},{"key":"data","name":"Data","description":"The data of the transaction.","type":"String","object":[]}]}]},{"key":"publishPurchase","inputs":[{"key":"signedTransactions","type":"String","repeated":true,"object":[]}],"outputs":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"purchaser","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"expire","type":"String","object":[]}]},{"key":"isAuthorized","inputs":[{"key":"sid","type":"String","optional":true,"object":[]},{"key":"versionHash","type":"String","optional":true,"object":[]},{"key":"addresses","type":"String","repeated":true,"object":[]}],"outputs":[{"key":"authorized","type":"Boolean","object":[]},{"key":"sid","type":"String","object":[]},{"key":"source","type":"String","optional":true,"object":[]},{"key":"type","type":"String","optional":true,"object":[]}]}],"events":[{"key":"serviceCreated","data":[{"key":"sid","type":"String","object":[]},{"key":"owner","type":"String","object":[]}]},{"key":"serviceOwnershipTransferred","data":[{"key":"sid","type":"String","object":[]},{"key":"previousOwner","type":"String","object":[]},{"key":"newOwner","type":"String","object":[]}]},{"key":"serviceVersionCreated","data":[{"key":"sid","type":"String","object":[]},{"key":"versionHash","type":"String","object":[]},{"key":"manifest","type":"String","object":[]},{"key":"manifestProtocol","type":"String","object":[]}]},{"key":"serviceOfferCreated","data":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]}]},{"key":"serviceOfferDisabled","data":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]}]},{"key":"servicePurchased","data":[{"key":"sid","type":"String","object":[]},{"key":"offerIndex","type":"String","object":[]},{"key":"purchaser","type":"String","object":[]},{"key":"price","type":"String","object":[]},{"key":"duration","type":"String","object":[]},{"key":"expire","type":"String","object":[]}]}],"source":"QmQbyuQa66fSmCv54cScAFEcjwd82R8vfyy7xtirmYiCpz"} diff --git a/systemservices/marketplace/package-lock.json b/systemservices/marketplace/package-lock.json index 5e299b4e9..85e2f831a 100644 --- a/systemservices/marketplace/package-lock.json +++ b/systemservices/marketplace/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@grpc/proto-loader": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.1.tgz", - "integrity": "sha512-3y0FhacYAwWvyXshH18eDkUI40wT/uGio7MAegzY8lO5+wVsc19+1A7T0pPptae4kl7bdITL+0cHpnAPmryBjQ==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.2.tgz", + "integrity": "sha512-eBKD/FPxQoY1x6QONW2nBd54QUEyzcFP9FenujmoeDPy1rutVSHki1s/wR68F6O1QfCNDx+ayBH1O2CVNMzyyw==", "requires": { "lodash.camelcase": "^4.3.0", "protobufjs": "^6.8.6" @@ -4154,9 +4154,9 @@ "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, "mesg-js": { - "version": "4.3.0-beta.2", - "resolved": "https://registry.npmjs.org/mesg-js/-/mesg-js-4.3.0-beta.2.tgz", - "integrity": "sha512-dSIeOTFB0aMmtQSuDrFieQl6OLbmssMLH5JHHCnMZ/GRy1BEXuhbtQVfOXRHBFEprp/gXYAmdKehN6l1R80FsA==", + "version": "4.4.0-beta.2", + "resolved": "https://registry.npmjs.org/mesg-js/-/mesg-js-4.4.0-beta.2.tgz", + "integrity": "sha512-PR9xNohuzh4sNrsGcq6+r0YwsFCRL1nXnoha+M2NRu858lUxvWzlwjeCRyani6TIEvscIbTdTHwmkXbt6oTbrg==", "requires": { "@grpc/proto-loader": "^0.5.1", "base-x": "^3.0.6", diff --git a/systemservices/marketplace/package.json b/systemservices/marketplace/package.json index b44267bd9..9b338f065 100644 --- a/systemservices/marketplace/package.json +++ b/systemservices/marketplace/package.json @@ -8,7 +8,7 @@ "bignumber.js": "^8.1.1", "ipfs-http-client": "^30.1.4", "jsonschema": "^1.2.4", - "mesg-js": "^4.3.0-beta.2", + "mesg-js": "^4.4.0-beta.2", "request": "^2.88.0", "request-promise-native": "^1.0.7", "web3": "1.0.0-beta.37" diff --git a/utils/dockermock/mock.go b/utils/dockermock/mock.go deleted file mode 100644 index 1e04d839f..000000000 --- a/utils/dockermock/mock.go +++ /dev/null @@ -1,870 +0,0 @@ -package dockermock - -import ( - "context" - "io" - "net" - "net/http" - "time" - - "github.com/docker/docker/api/types" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - networktypes "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - volumetypes "github.com/docker/docker/api/types/volume" - "github.com/stretchr/testify/mock" -) - -// CommonAPIClientMock is the common methods between stable and experimental versions of APIClient. -type CommonAPIClientMock struct { - *mock.Mock - *ConfigAPIClientMock - *ContainerAPIClientMock - *DistributionAPIClientMock - *ImageAPIClientMock - *NodeAPIClientMock - *NetworkAPIClientMock - *PluginAPIClientMock - *ServiceAPIClientMock - *SwarmAPIClientMock - *SecretAPIClientMock - *SystemAPIClientMock - *VolumeAPIClientMock -} - -// NewCommonAPIClientMock creates docker ContainerAPIClient mock. -func NewCommonAPIClientMock() *CommonAPIClientMock { - m := &mock.Mock{} - return &CommonAPIClientMock{ - Mock: m, - ConfigAPIClientMock: &ConfigAPIClientMock{m}, - ContainerAPIClientMock: &ContainerAPIClientMock{m}, - DistributionAPIClientMock: &DistributionAPIClientMock{m}, - ImageAPIClientMock: &ImageAPIClientMock{m}, - NodeAPIClientMock: &NodeAPIClientMock{m}, - NetworkAPIClientMock: &NetworkAPIClientMock{m}, - PluginAPIClientMock: &PluginAPIClientMock{m}, - ServiceAPIClientMock: &ServiceAPIClientMock{m}, - SwarmAPIClientMock: &SwarmAPIClientMock{m}, - SecretAPIClientMock: &SecretAPIClientMock{m}, - SystemAPIClientMock: &SystemAPIClientMock{m}, - VolumeAPIClientMock: &VolumeAPIClientMock{m}, - } -} - -// ClientVersion returns the API version used by this client. -func (m *CommonAPIClientMock) ClientVersion() string { - args := m.Called() - return args.String(0) -} - -// DaemonHost returns the host address used by the client. -func (m *CommonAPIClientMock) DaemonHost() string { - args := m.Called() - return args.String(0) -} - -// HTTPClient returns a copy of the HTTP client bound to the server. -func (m *CommonAPIClientMock) HTTPClient() *http.Client { - args := m.Called() - return args.Get(0).(*http.Client) -} - -// ServerVersion returns information of the docker client and server host. -func (m *CommonAPIClientMock) ServerVersion(ctx context.Context) (types.Version, error) { - args := m.Called(ctx) - return args.Get(0).(types.Version), args.Error(1) -} - -// NegotiateAPIVersion queries the API and updates the version to match the API -// version. Any errors are silently ignored. -func (m *CommonAPIClientMock) NegotiateAPIVersion(ctx context.Context) { - m.Called(ctx) -} - -// NegotiateAPIVersionPing updates the client version to match the -// Ping.APIVersion if the ping version is less than the default version. -func (m *CommonAPIClientMock) NegotiateAPIVersionPing(ping types.Ping) { - m.Called(ping) -} - -// DialSession returns a connection that can be used communication with daemon. -func (m *CommonAPIClientMock) DialSession(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) { - args := m.Called(ctx, proto, meta) - return args.Get(0).(net.Conn), args.Error(1) -} - -// Dialer returns a dialer for a raw stream connection, with HTTP/1.1 header, -// that can be used for proxying the daemon connection. Used by `docker -// dial-stdio`. -func (m *CommonAPIClientMock) Dialer() func(context.Context) (net.Conn, error) { - args := m.Called() - return args.Get(0).(func(context.Context) (net.Conn, error)) -} - -// Close the transport used by the client. -func (m *CommonAPIClientMock) Close() error { - args := m.Called() - return args.Error(0) -} - -// ContainerAPIClientMock defines API client methods for the containers -type ContainerAPIClientMock struct { - *mock.Mock -} - -// ContainerAttach attaches a connection to a container in the server. It -// returns a types.HijackedConnection with the hijacked connection and the a -// reader to get output. It's up to the called to close the hijacked connection -// by calling types.HijackedResponse.Close. -func (m *ContainerAPIClientMock) ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) { - args := m.Called(ctx, container, options) - return args.Get(0).(types.HijackedResponse), args.Error(1) -} - -// ContainerCommit applies changes into a container and creates a new tagged -// image. -func (m *ContainerAPIClientMock) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) { - args := m.Called(ctx, container, options) - return args.Get(0).(types.IDResponse), args.Error(1) -} - -// ContainerCreate creates a new container based in the given configuration. It -// can be associated with a name, but it's not mandatory. -func (m *ContainerAPIClientMock) ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, containerName string) (containertypes.ContainerCreateCreatedBody, error) { - args := m.Called(ctx, config, hostConfig, networkingConfig, containerName) - return args.Get(0).(containertypes.ContainerCreateCreatedBody), args.Error(1) -} - -// ContainerDiff shows differences in a container filesystem since it was -// started. -func (m *ContainerAPIClientMock) ContainerDiff(ctx context.Context, container string) ([]containertypes.ContainerChangeResponseItem, error) { - args := m.Called(ctx, container) - return args.Get(0).([]containertypes.ContainerChangeResponseItem), args.Error(1) -} - -// ContainerExecAttach attaches a connection to an exec process in the server. -// It returns a types.HijackedConnection with the hijacked connection and the a -// reader to get output. It's up to the called to close the hijacked connection -// by calling types.HijackedResponse.Close. -func (m *ContainerAPIClientMock) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) { - args := m.Called(ctx, execID, config) - return args.Get(0).(types.HijackedResponse), args.Error(1) -} - -// ContainerExecCreate creates a new exec configuration to run an exec process. -func (m *ContainerAPIClientMock) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) { - args := m.Called(ctx, container, config) - return args.Get(0).(types.IDResponse), args.Error(1) -} - -// ContainerExecInspect returns information about a specific exec process on -// the docker host. -func (m *ContainerAPIClientMock) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) { - args := m.Called(ctx, execID) - return args.Get(0).(types.ContainerExecInspect), args.Error(1) -} - -// ContainerExecResize changes the size of the tty for an exec process running -// inside a container. -func (m *ContainerAPIClientMock) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error { - args := m.Called(ctx, execID, options) - return args.Error(0) -} - -// ContainerExecStart starts an exec process already created in the docker -// host. -func (m *ContainerAPIClientMock) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error { - args := m.Called(ctx, execID, config) - return args.Error(0) -} - -// ContainerExport retrieves the raw contents of a container and returns them -// as an io.ReadCloser. It's up to the caller to close the stream. -func (m *ContainerAPIClientMock) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) { - args := m.Called(ctx, container) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// ContainerInspect returns the container information. -func (m *ContainerAPIClientMock) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) { - args := m.Called(ctx, container) - return args.Get(0).(types.ContainerJSON), args.Error(1) -} - -// ContainerInspectWithRaw returns the container information and its raw -// representation. -func (m *ContainerAPIClientMock) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) { - args := m.Called(ctx, container, getSize) - return args.Get(0).(types.ContainerJSON), args.Get(1).([]byte), args.Error(2) -} - -// ContainerKill terminates the container process but does not remove the -// container from the docker host. -func (m *ContainerAPIClientMock) ContainerKill(ctx context.Context, container, signal string) error { - args := m.Called(ctx, container, signal) - return args.Error(0) -} - -// ContainerList returns the list of containers in the docker host. -func (m *ContainerAPIClientMock) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) { - args := m.Called(ctx, options) - return args.Get(0).([]types.Container), args.Error(1) -} - -// ContainerLogs returns the logs generated by a container in an io.ReadCloser. -// It's up to the caller to close the stream. -func (m *ContainerAPIClientMock) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) { - args := m.Called(ctx, container, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// ContainerPause pauses the main process of a given container without -// terminating it. -func (m *ContainerAPIClientMock) ContainerPause(ctx context.Context, container string) error { - args := m.Called(ctx, container) - return args.Error(0) -} - -// ContainerRemove kills and removes a container from the docker host. -func (m *ContainerAPIClientMock) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error { - args := m.Called(ctx, container, options) - return args.Error(0) -} - -// ContainerRename changes the name of a given container. -func (m *ContainerAPIClientMock) ContainerRename(ctx context.Context, container, newContainerName string) error { - args := m.Called(ctx, container, newContainerName) - return args.Error(0) -} - -// ContainerResize changes the size of the tty for a container. -func (m *ContainerAPIClientMock) ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error { - args := m.Called(ctx, container, options) - return args.Error(0) -} - -// ContainerRestart stops and starts a container again. It makes the daemon to -// wait for the container to be up again for a specific amount of time, given -// the timeout. -func (m *ContainerAPIClientMock) ContainerRestart(ctx context.Context, container string, timeout *time.Duration) error { - args := m.Called(ctx, container, timeout) - return args.Error(0) -} - -// ContainerStatPath returns Stat information about a path inside the container -// filesystem. -func (m *ContainerAPIClientMock) ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) { - args := m.Called(ctx, container, path) - return args.Get(0).(types.ContainerPathStat), args.Error(1) -} - -// ContainerStats returns near realtime stats for a given container. It's up to -// the caller to close the io.ReadCloser returned. -func (m *ContainerAPIClientMock) ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error) { - args := m.Called(ctx, container, stream) - return args.Get(0).(types.ContainerStats), args.Error(1) -} - -// ContainerStart sends a request to the docker daemon to start a container. -func (m *ContainerAPIClientMock) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error { - args := m.Called(ctx, container, options) - return args.Error(0) -} - -// ContainerStop stops a container without terminating the process. The process -// is blocked until the container stops or the timeout expires. -func (m *ContainerAPIClientMock) ContainerStop(ctx context.Context, container string, timeout *time.Duration) error { - args := m.Called(ctx, container, timeout) - return args.Error(0) -} - -// ContainerTop shows process information from within a container. -func (m *ContainerAPIClientMock) ContainerTop(ctx context.Context, container string, arguments []string) (containertypes.ContainerTopOKBody, error) { - args := m.Called(ctx, container, arguments) - return args.Get(0).(containertypes.ContainerTopOKBody), args.Error(1) -} - -// ContainerUnpause resumes the process execution within a container -func (m *ContainerAPIClientMock) ContainerUnpause(ctx context.Context, container string) error { - args := m.Called(ctx, container) - return args.Error(0) -} - -// ContainerUpdate updates resources of a container. -func (m *ContainerAPIClientMock) ContainerUpdate(ctx context.Context, container string, updateConfig containertypes.UpdateConfig) (containertypes.ContainerUpdateOKBody, error) { - args := m.Called(ctx, container, updateConfig) - return args.Get(0).(containertypes.ContainerUpdateOKBody), args.Error(1) -} - -// ContainerWait pauses execution until a container exits. It returns the API -// status code as response of its readiness. -func (m *ContainerAPIClientMock) ContainerWait(ctx context.Context, container string, condition containertypes.WaitCondition) (<-chan containertypes.ContainerWaitOKBody, <-chan error) { - args := m.Called(ctx, container, condition) - return args.Get(0).(<-chan containertypes.ContainerWaitOKBody), args.Get(1).(<-chan error) -} - -// CopyFromContainer gets the content from the container and returns it as a -// Reader to manipulate it in the host. It's up to the caller to close the -// reader. -func (m *ContainerAPIClientMock) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) { - args := m.Called(ctx, container, srcPath) - return args.Get(0).(io.ReadCloser), args.Get(1).(types.ContainerPathStat), args.Error(2) -} - -// CopyToContainer copies content into the container filesystem. -func (m *ContainerAPIClientMock) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error { - args := m.Called(ctx, container, path, content, options) - return args.Error(0) -} - -// ContainersPrune requests the daemon to delete unused data. -func (m *ContainerAPIClientMock) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) { - args := m.Called(ctx, pruneFilters) - return args.Get(0).(types.ContainersPruneReport), args.Error(1) -} - -// DistributionAPIClientMock defines API client methods for the registry. -type DistributionAPIClientMock struct { - *mock.Mock -} - -// DistributionInspect returns the image digest with full Manifest. -func (m *DistributionAPIClientMock) DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registry.DistributionInspect, error) { - args := m.Called(ctx, image, encodedRegistryAuth) - return args.Get(0).(registry.DistributionInspect), args.Error(1) -} - -// ImageAPIClientMock defines API client methods for the images. -type ImageAPIClientMock struct { - *mock.Mock -} - -// ImageBuild sends request to the daemon to build images. The Body in the -// response implement an io.ReadCloser and it's up to the caller to close it. -func (m *ImageAPIClientMock) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { - args := m.Called(ctx, context, options) - return args.Get(0).(types.ImageBuildResponse), args.Error(1) -} - -// BuildCachePrune requests the daemon to delete unused cache data. -func (m *ImageAPIClientMock) BuildCachePrune(ctx context.Context) (*types.BuildCachePruneReport, error) { - args := m.Called(ctx) - return args.Get(0).(*types.BuildCachePruneReport), args.Error(1) -} - -// BuildCancel requests the daemon to cancel ongoing build request. -func (m *ImageAPIClientMock) BuildCancel(ctx context.Context, id string) error { - args := m.Called(ctx, id) - return args.Error(0) -} - -// ImageCreate creates a new image based in the parent options. It returns the -// JSON content in the response body. -func (m *ImageAPIClientMock) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { - args := m.Called(ctx, parentReference, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// ImageHistory returns the changes in an image in history format. -func (m *ImageAPIClientMock) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error) { - args := m.Called(ctx, imageID) - return args.Get(0).([]image.HistoryResponseItem), args.Error(1) -} - -// ImageImport creates a new image based in the source options. It returns the -// JSON content in the response body. -func (m *ImageAPIClientMock) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { - args := m.Called(ctx, source, ref, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// ImageInspectWithRaw returns the image information and its raw -// representation. -func (m *ImageAPIClientMock) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error) { - args := m.Called(ctx, image) - return args.Get(0).(types.ImageInspect), args.Get(1).([]byte), args.Error(2) -} - -// ImageList returns a list of images in the docker host. -func (m *ImageAPIClientMock) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) { - args := m.Called(ctx, options) - return args.Get(0).([]types.ImageSummary), args.Error(1) -} - -// ImageLoad loads an image in the docker host from the client host. It's up to -// the caller to close the io.ReadCloser in the ImageLoadResponse returned by -// this function. -func (m *ImageAPIClientMock) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) { - args := m.Called(ctx, input, quiet) - return args.Get(0).(types.ImageLoadResponse), args.Error(1) -} - -// ImagePull requests the docker host to pull an image from a remote registry. -// It executes the privileged function if the operation is unauthorized and it -// tries one more time. It's up to the caller to handle the io.ReadCloser and -// close it properly. -func (m *ImageAPIClientMock) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) { - args := m.Called(ctx, ref, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// ImagePush requests the docker host to push an image to a remote registry. It -// executes the privileged function if the operation is unauthorized and it -// tries one more time. It's up to the caller to handle the io.ReadCloser and -// close it properly. -func (m *ImageAPIClientMock) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) { - args := m.Called(ctx) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// ImageRemove removes an image from the docker host. -func (m *ImageAPIClientMock) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) { - args := m.Called(ctx, image, options) - return args.Get(0).([]types.ImageDeleteResponseItem), args.Error(1) -} - -// ImageSearch makes the docker host to search by a term in a remote registry. -// The list of results is not sorted in any fashion. -func (m *ImageAPIClientMock) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) { - args := m.Called(ctx, term, options) - return args.Get(0).([]registry.SearchResult), args.Error(1) -} - -// ImageSave retrieves one or more images from the docker host as an -// io.ReadCloser. It's up to the caller to store the images and close the -// stream. -func (m *ImageAPIClientMock) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) { - args := m.Called(ctx, images) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// ImageTag tags an image in the docker host. -func (m *ImageAPIClientMock) ImageTag(ctx context.Context, image, ref string) error { - args := m.Called(ctx, image, ref) - return args.Error(0) -} - -// ImagesPrune requests the daemon to delete unused data -func (m *ImageAPIClientMock) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (types.ImagesPruneReport, error) { - args := m.Called(ctx, pruneFilter) - return args.Get(0).(types.ImagesPruneReport), args.Error(0) -} - -// NetworkAPIClientMock defines API client methods for the networks -type NetworkAPIClientMock struct { - *mock.Mock -} - -// NetworkConnect connects a container to an existent network in the docker -// host. -func (m *NetworkAPIClientMock) NetworkConnect(ctx context.Context, network, container string, config *networktypes.EndpointSettings) error { - args := m.Called(ctx, network, container, config) - return args.Error(0) -} - -// NetworkCreate creates a new network in the docker host. -func (m *NetworkAPIClientMock) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) { - args := m.Called(ctx, name, options) - return args.Get(0).(types.NetworkCreateResponse), args.Error(1) -} - -// NetworkDisconnect disconnects a container from an existent network in the -// docker host. -func (m *NetworkAPIClientMock) NetworkDisconnect(ctx context.Context, network, container string, force bool) error { - args := m.Called(ctx, network, container, force) - return args.Error(0) -} - -// NetworkInspect returns the information for a specific network configured in -// the docker host. -func (m *NetworkAPIClientMock) NetworkInspect(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, error) { - args := m.Called(ctx, network, options) - return args.Get(0).(types.NetworkResource), args.Error(1) -} - -// NetworkInspectWithRaw returns the information for a specific network -// configured in the docker host and its raw representation. -func (m *NetworkAPIClientMock) NetworkInspectWithRaw(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) { - args := m.Called(ctx, network, options) - return args.Get(0).(types.NetworkResource), args.Get(1).([]byte), args.Error(2) -} - -// NetworkList returns the list of networks configured in the docker host. -func (m *NetworkAPIClientMock) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { - args := m.Called(ctx, options) - return args.Get(0).([]types.NetworkResource), args.Error(1) -} - -// NetworkRemove removes an existent network from the docker host. -func (m *NetworkAPIClientMock) NetworkRemove(ctx context.Context, network string) error { - args := m.Called(ctx, network) - return args.Error(0) -} - -// NetworksPrune requests the daemon to delete unused networks. -func (m *NetworkAPIClientMock) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error) { - args := m.Called(ctx, pruneFilter) - return args.Get(0).(types.NetworksPruneReport), args.Error(1) -} - -// NodeAPIClientMock defines API client methods for the nodes. -type NodeAPIClientMock struct { - *mock.Mock -} - -// NodeInspectWithRaw returns the node information. -func (m *NodeAPIClientMock) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) { - args := m.Called(ctx, nodeID) - return args.Get(0).(swarm.Node), args.Get(1).([]byte), args.Error(2) -} - -// NodeList returns the list of nodes. -func (m *NodeAPIClientMock) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) { - args := m.Called(ctx, options) - return args.Get(0).([]swarm.Node), args.Error(1) -} - -// NodeRemove removes a Node. -func (m *NodeAPIClientMock) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { - args := m.Called(ctx, nodeID, options) - return args.Error(0) -} - -// NodeUpdate updates a Node. -func (m *NodeAPIClientMock) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error { - args := m.Called(ctx, nodeID, version, node) - return args.Error(0) -} - -// PluginAPIClientMock defines API client methods for the plugins. -type PluginAPIClientMock struct { - *mock.Mock -} - -// PluginList returns the installed plugins. -func (m *PluginAPIClientMock) PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error) { - args := m.Called(ctx, filter) - return args.Get(0).(types.PluginsListResponse), args.Error(1) -} - -// PluginRemove removes a plugin. -func (m *PluginAPIClientMock) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { - args := m.Called(ctx, name, options) - return args.Error(0) -} - -// PluginEnable enables a plugin. -func (m *PluginAPIClientMock) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { - args := m.Called(ctx, name, options) - return args.Error(0) -} - -// PluginDisable disables a plugin. -func (m *PluginAPIClientMock) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error { - args := m.Called(ctx, name, options) - return args.Error(0) -} - -// PluginInstall installs a plugin. -func (m *PluginAPIClientMock) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) { - args := m.Called(ctx, name, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// PluginUpgrade upgrades a plugin. -func (m *PluginAPIClientMock) PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) { - args := m.Called(ctx, name, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// PluginPush pushes a plugin to a registry. -func (m *PluginAPIClientMock) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { - args := m.Called(ctx, name, registryAuth) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// PluginSet modifies settings for an existing plugin. -func (m *PluginAPIClientMock) PluginSet(ctx context.Context, name string, args []string) error { - arg := m.Called(ctx, name, args) - return arg.Error(0) -} - -// PluginInspectWithRaw inspects an existing plugin. -func (m *PluginAPIClientMock) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { - args := m.Called(ctx, name) - return args.Get(0).(*types.Plugin), args.Get(1).([]byte), args.Error(2) -} - -// PluginCreate creates a plugin. -func (m *PluginAPIClientMock) PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error { - args := m.Called(ctx, createContext, options) - return args.Error(0) -} - -// ServiceAPIClientMock defines API client methods for the services. -type ServiceAPIClientMock struct { - *mock.Mock -} - -// ServiceCreate creates a new Service. -func (m *ServiceAPIClientMock) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { - args := m.Called(ctx, service, options) - return args.Get(0).(types.ServiceCreateResponse), args.Error(0) -} - -// ServiceInspectWithRaw returns the service information and the raw data. -func (m *ServiceAPIClientMock) ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) { - args := m.Called(ctx, serviceID, options) - return args.Get(0).(swarm.Service), args.Get(1).([]byte), args.Error(2) -} - -// ServiceList returns the list of services. -func (m *ServiceAPIClientMock) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { - args := m.Called(ctx, options) - return args.Get(0).([]swarm.Service), args.Error(1) -} - -// ServiceRemove kills and removes a service. -func (m *ServiceAPIClientMock) ServiceRemove(ctx context.Context, serviceID string) error { - args := m.Called(ctx, serviceID) - return args.Error(0) -} - -// ServiceUpdate updates a Service. -func (m *ServiceAPIClientMock) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) { - args := m.Called(ctx, serviceID, version, service, options) - return args.Get(0).(types.ServiceUpdateResponse), args.Error(1) -} - -// ServiceLogs returns the logs generated by a service in an io.ReadCloser. -// It's up to the caller to close the stream. -func (m *ServiceAPIClientMock) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { - args := m.Called(ctx, serviceID, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// TaskLogs returns the logs generated by a task in an io.ReadCloser. It's up -// to the caller to close the stream. -func (m *ServiceAPIClientMock) TaskLogs(ctx context.Context, taskID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { - args := m.Called(ctx, taskID, options) - return args.Get(0).(io.ReadCloser), args.Error(1) -} - -// TaskInspectWithRaw returns the task information and its raw representation.. -func (m *ServiceAPIClientMock) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { - args := m.Called(ctx, taskID) - return args.Get(0).(swarm.Task), args.Get(1).([]byte), args.Error(2) -} - -// TaskList returns the list of tasks. -func (m *ServiceAPIClientMock) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) { - args := m.Called(ctx, options) - return args.Get(0).([]swarm.Task), args.Error(1) -} - -// SwarmAPIClientMock defines API client methods for the swarm. -type SwarmAPIClientMock struct { - *mock.Mock -} - -// SwarmInit initializes the Swarm. -func (m *SwarmAPIClientMock) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { - args := m.Called(ctx, req) - return args.String(0), args.Error(1) -} - -// SwarmJoin joins the Swarm. -func (m *SwarmAPIClientMock) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { - args := m.Called(ctx, req) - return args.Error(0) -} - -// SwarmGetUnlockKey retrieves the swarm's unlock key. -func (m *SwarmAPIClientMock) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) { - args := m.Called(ctx) - return args.Get(0).(types.SwarmUnlockKeyResponse), args.Error(1) -} - -// SwarmUnlock unlocks locked swarm. -func (m *SwarmAPIClientMock) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { - args := m.Called(ctx, req) - return args.Error(0) -} - -// SwarmLeave leaves the Swarm. -func (m *SwarmAPIClientMock) SwarmLeave(ctx context.Context, force bool) error { - args := m.Called(ctx, force) - return args.Error(0) -} - -// SwarmInspect inspects the Swarm. -func (m *SwarmAPIClientMock) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { - args := m.Called(ctx) - return args.Get(0).(swarm.Swarm), args.Error(1) -} - -// SwarmUpdate updates the Swarm. -func (m *SwarmAPIClientMock) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { - args := m.Called(ctx, version, swarm, flags) - return args.Error(0) -} - -// SystemAPIClientMock defines API client methods for the system. -type SystemAPIClientMock struct { - *mock.Mock -} - -// Events returns a stream of events in the daemon. It's up to the caller to -// close the stream by canceling the context. Once the stream has been -// completely read an io.EOF error will be sent over the error channel. If an -// error is sent all processing will be stopped. It's up to the caller to -// reopen the stream in the event of an error by reinvoking this method. -func (m *SystemAPIClientMock) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) { - args := m.Called(ctx, options) - return args.Get(0).(<-chan events.Message), args.Get(1).(<-chan error) -} - -// Info returns information about the docker server. -func (m *SystemAPIClientMock) Info(ctx context.Context) (types.Info, error) { - args := m.Called(ctx) - return args.Get(0).(types.Info), args.Error(1) -} - -// RegistryLogin authenticates the docker server with a given docker registry. -// It returns UnauthorizerError when the authentication fails. -func (m *SystemAPIClientMock) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) { - args := m.Called(ctx, auth) - return args.Get(0).(registry.AuthenticateOKBody), args.Error(0) -} - -// DiskUsage requests the current data usage from the daemon -func (m *SystemAPIClientMock) DiskUsage(ctx context.Context) (types.DiskUsage, error) { - args := m.Called(ctx) - return args.Get(0).(types.DiskUsage), args.Error(1) -} - -// Ping pings the server and return the value of the "Docker-Experimental" -// "API-Version" headers -func (m *SystemAPIClientMock) Ping(ctx context.Context) (types.Ping, error) { - args := m.Called(ctx) - return args.Get(0).(types.Ping), args.Error(1) -} - -// VolumeAPIClientMock defines API client methods for the volumes. -type VolumeAPIClientMock struct { - *mock.Mock -} - -// VolumeCreate creates a volume in the docker host. -func (m *VolumeAPIClientMock) VolumeCreate(ctx context.Context, options volumetypes.VolumeCreateBody) (types.Volume, error) { - args := m.Called(ctx, options) - return args.Get(0).(types.Volume), args.Error(1) -} - -// VolumeInspect returns the information about a specific volume in the docker -// host. -func (m *VolumeAPIClientMock) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) { - args := m.Called(ctx, volumeID) - return args.Get(0).(types.Volume), args.Error(1) -} - -// VolumeInspectWithRaw returns the information about a specific volume in the -// docker host and its raw representation. -func (m *VolumeAPIClientMock) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) { - args := m.Called(ctx, volumeID) - return args.Get(0).(types.Volume), args.Get(1).([]byte), args.Error(2) -} - -// VolumeList returns the volumes configured in the docker host. -func (m *VolumeAPIClientMock) VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumeListOKBody, error) { - args := m.Called(ctx, filter) - return args.Get(0).(volumetypes.VolumeListOKBody), args.Error(1) -} - -// VolumeRemove removes a volume from the docker host. -func (m *VolumeAPIClientMock) VolumeRemove(ctx context.Context, volumeID string, force bool) error { - args := m.Called(ctx, volumeID, force) - return args.Error(0) -} - -// VolumesPrune requests the daemon to delete unused data. -func (m *VolumeAPIClientMock) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (types.VolumesPruneReport, error) { - args := m.Called(ctx, pruneFilter) - return args.Get(0).(types.VolumesPruneReport), args.Error(1) -} - -// SecretAPIClientMock defines API client methods for secrets. -type SecretAPIClientMock struct { - *mock.Mock -} - -// SecretList returns the list of secrets. -func (m *SecretAPIClientMock) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { - args := m.Called(ctx, options) - return args.Get(0).([]swarm.Secret), args.Error(1) -} - -// SecretCreate creates a new Secret. -func (m *SecretAPIClientMock) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { - args := m.Called(ctx, secret) - return args.Get(0).(types.SecretCreateResponse), args.Error(1) -} - -// SecretRemove removes a Secret. -func (m *SecretAPIClientMock) SecretRemove(ctx context.Context, id string) error { - args := m.Called(ctx, id) - return args.Error(0) -} - -// SecretInspectWithRaw returns the secret information with raw data. -func (m *SecretAPIClientMock) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) { - args := m.Called(ctx, name) - return args.Get(0).(swarm.Secret), args.Get(1).([]byte), args.Error(2) -} - -// SecretUpdate updates a Secret. Currently, the only part of a secret spec -// which can be updated is Labels. -func (m *SecretAPIClientMock) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { - args := m.Called(ctx, id, version, secret) - return args.Error(0) -} - -// ConfigAPIClientMock defines API client methods for configs. -type ConfigAPIClientMock struct { - *mock.Mock -} - -// ConfigList returns the list of configs. -func (m *ConfigAPIClientMock) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { - args := m.Called(ctx, options) - return args.Get(0).([]swarm.Config), args.Error(1) -} - -// ConfigCreate creates a new Config. -func (m *ConfigAPIClientMock) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) { - args := m.Called(ctx, config) - return args.Get(0).(types.ConfigCreateResponse), args.Error(1) -} - -// ConfigRemove removes a Config. -func (m *ConfigAPIClientMock) ConfigRemove(ctx context.Context, id string) error { - args := m.Called(ctx, id) - return args.Error(0) -} - -// ConfigInspectWithRaw returns the config information with raw data. -func (m *ConfigAPIClientMock) ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error) { - args := m.Called(ctx, name) - return args.Get(0).(swarm.Config), args.Get(1).([]byte), args.Error(2) -} - -// ConfigUpdate attempts to update a Config. -func (m *ConfigAPIClientMock) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error { - args := m.Called(ctx, id, version, config) - return args.Error(0) -}