diff --git a/token-sdk/auditor/conf/core.yaml b/token-sdk/auditor/conf/core.yaml index e1f52927..48d4c535 100644 --- a/token-sdk/auditor/conf/core.yaml +++ b/token-sdk/auditor/conf/core.yaml @@ -7,9 +7,9 @@ logging: fsc: identity: cert: - file: /var/fsc/keys/auditor/fsc/msp/signcerts/cert.pem + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/auditor/fsc/msp/signcerts/cert.pem key: - file: /var/fsc/keys/auditor/fsc/msp/keystore/priv_sk + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/auditor/fsc/msp/keystore/priv_sk tls: enabled: false # TODO p2p: @@ -21,7 +21,7 @@ fsc: persistence: type: badger # badger or memory opts: - path: /var/fsc/data/auditor/kvs + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/auditor/kvs # The endpoint section tells how to reach other FSC node in the network. # For each node, the name, the domain, the identity of the node, and its addresses must be specified. @@ -30,19 +30,19 @@ fsc: - name: issuer identity: id: issuer - path: /var/fsc/keys/issuer/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/issuer/fsc/msp/signcerts/cert.pem addresses: P2P: issuer.example.com:9101 - name: owner1 identity: id: owner1 - path: /var/fsc/keys/owner1/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner1/fsc/msp/signcerts/cert.pem addresses: P2P: owner1.example.com:9201 - name: owner2 identity: id: owner2 - path: /var/fsc/keys/owner2/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner2/fsc/msp/signcerts/cert.pem addresses: P2P: owner2.example.com:9301 @@ -51,13 +51,13 @@ fabric: enabled: true mynetwork: default: true - mspConfigPath: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + mspConfigPath: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp defaultMSP: Org1MSP msps: - id: Org1MSP mspType: bccsp mspID: Org1MSP - path: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp tls: enabled: true # If the keepalive values are too low, Fabric peers will complain with: ENHANCE_YOUR_CALM, debug data: "too_many_pings" @@ -69,14 +69,14 @@ fabric: - address: orderer.example.com:7050 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt serverNameOverride: orderer.example.com # List of trusted peers this node can connect to. There must be at least one trusted peer. Others are discovered. peers: - address: peer0.org1.example.com:7051 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt serverNameOverride: peer0.org1.example.com # Channel where the token chaincode is deployed channels: @@ -87,7 +87,7 @@ fabric: persistence: type: badger opts: - path: /var/fsc/data/auditor/vault + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/auditor/vault # ------------------- Token SDK Configuration ------------------------- token: @@ -102,11 +102,11 @@ token: auditors: - id: auditor # the unique identifier of this wallet. Here is an example of use: `ttx.GetIssuerWallet(context, "issuer)` default: true # is this the default issuer wallet - path: /var/fsc/keys/auditor/aud/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/auditor/aud/msp # Internal database to keep track of token transactions. # It is used by auditors and token owners to track history ttxdb: persistence: type: badger opts: - path: /var/fsc/data/auditor/txdb + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/auditor/txdb diff --git a/token-sdk/auditor/routes/routes.gen.go b/token-sdk/auditor/routes/routes.gen.go index 59067555..d1244674 100644 --- a/token-sdk/auditor/routes/routes.gen.go +++ b/token-sdk/auditor/routes/routes.gen.go @@ -1,6 +1,6 @@ -// Package auditor provides primitives to interact with the openapi HTTP API. +// Package routes provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT. package routes import ( @@ -16,9 +16,10 @@ import ( "strings" "time" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" + "github.com/oapi-codegen/runtime" + strictecho "github.com/oapi-codegen/runtime/strictmiddleware/echo" ) // Account Information about an account and its balance @@ -114,10 +115,10 @@ type ServerInterface interface { // Get all transactions for an account // (GET /auditor/accounts/{id}/transactions) AuditorTransactions(ctx echo.Context, id Id) error - + // Returns 200 if the service is healthy // (GET /healthz) Healthz(ctx echo.Context) error - + // Returns 200 if the service is ready to accept calls // (GET /readyz) Readyz(ctx echo.Context) error } @@ -359,16 +360,16 @@ type StrictServerInterface interface { // Get all transactions for an account // (GET /auditor/accounts/{id}/transactions) AuditorTransactions(ctx context.Context, request AuditorTransactionsRequestObject) (AuditorTransactionsResponseObject, error) - + // Returns 200 if the service is healthy // (GET /healthz) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error) - + // Returns 200 if the service is ready to accept calls // (GET /readyz) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error) } -type StrictHandlerFunc = runtime.StrictEchoHandlerFunc -type StrictMiddlewareFunc = runtime.StrictEchoMiddlewareFunc +type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc +type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { return &strictHandler{ssi: ssi, middlewares: middlewares} @@ -400,7 +401,7 @@ func (sh *strictHandler) AuditorAccount(ctx echo.Context, id Id, params AuditorA } else if validResponse, ok := response.(AuditorAccountResponseObject); ok { return validResponse.VisitAuditorAccountResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -425,7 +426,7 @@ func (sh *strictHandler) AuditorTransactions(ctx echo.Context, id Id) error { } else if validResponse, ok := response.(AuditorTransactionsResponseObject); ok { return validResponse.VisitAuditorTransactionsResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -448,7 +449,7 @@ func (sh *strictHandler) Healthz(ctx echo.Context) error { } else if validResponse, ok := response.(HealthzResponseObject); ok { return validResponse.VisitHealthzResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -471,7 +472,7 @@ func (sh *strictHandler) Readyz(ctx echo.Context) error { } else if validResponse, ok := response.(ReadyzResponseObject); ok { return validResponse.VisitReadyzResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -479,31 +480,35 @@ func (sh *strictHandler) Readyz(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RZUW/bNhD+KwduDy2gRrKzDa3esrZYi70UaQoMbfNwls4WG4pUScqZl/q/DyQlWbJk", - "J826onlKJFLH7767++4I37BMlZWSJK1h6Q2rUGN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bI4dlAxS4cMiXtUUOBfIV6mghK40G", + "9cZxXWmxoayB2rjfPqFW8D+pbvxVeK+VyswMrnJh4OL9O+CYCSl8+mZaSWvgOXCRZahdQnmbDE0EN7lg", + "eeizVUEDjvbWQmpVYBcVZMo0xmI5g4VcyCsFVjcgLKjaRlBgUCrvuQ5dCowqEbJacuM6l5J983AVYmbw", + "f2pZ7j+0fdEs5Aot1JULK/eEGcT9lIVcGKt0M4OrjlrheyOVyuaO6NDSo11zXMi+Z3ksHI3VqnGWfeO0", + "wvpWfuVvOD1DbUIsz2aJS2BVoaSVICk5nyWzcy+yNvdFEtOaC6t03L5r4lvBt+5khb60nTb5keydaycX", + "4XY3wkWjzfTztGbtrsTCzZx33vLq7Aay0SY3T5Jjqtjfi/fWPT+btqPBXX863p38zIp60zm2N3cFGkhE", + "al2QlOTWVmkcF4rRIlfGpi+TJIlpJeLNWexdMXVZUt2QlPwXD+Zam6PQXR65PKPAUFvqsteVbUQsXTkc", + "/cPXPxTeNjqSB/FwG7krKYbL0YMy40ERn1rJftmwFwWM9ju3Juxy4afEOfcb+h9Hg/m2PX9ILMbb/zYi", + "/0rOHxSBnrVLtLWWBuZJAiLobyv/IAwEX5oBb70vhlw7S7EXcx1++F38KJnh5gkuz47G1jeOgUIPQuow", + "qBuJu8I6jcJPk14Uwph5DMx8CCbat8KoLpTxZjiVJ8ycH+THGGzfDR4X4jh0zl8Y+DjJ/Vz1ZFlr+bRN", + "I3LMs31FfmSB6QbKRxKafkgbFvdoUPOB0kh5c1xTL8PxY5BU74l3kzGsLDBaFOaowP7I7hT9NUGOfrEc", + "agk7tCeBaaS27xdu3JMNrIXkUbs1hJGw9IuHqyHoe8fuv1sCOVOsjUJqc2rBIQyf19gEZzqL7nn3nt9q", + "dub9sxPWV2h9EbjNBjeom9Fu025brECqgy9rxMoA7bae3QNdchw+8aFFHpp7u3hSLqQrgB3AXR5ur7d/", + "BgAA///nhAFuMBsAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/token-sdk/docker-compose.yaml b/token-sdk/docker-compose.yaml index e1497667..ee3bea95 100644 --- a/token-sdk/docker-compose.yaml +++ b/token-sdk/docker-compose.yaml @@ -16,9 +16,9 @@ services: context: ./auditor dockerfile: ../Dockerfile volumes: - - ./data/auditor:/var/fsc/data/auditor + - ./data/auditor:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/auditor - ./auditor/conf:/conf:ro - - ./keys:/var/fsc/keys:ro + - ./keys:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys:ro ports: - 9000:9000 expose: @@ -38,9 +38,9 @@ services: context: ./issuer dockerfile: ../Dockerfile volumes: - - ./data/issuer:/var/fsc/data/issuer + - ./data/issuer:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/issuer - ./issuer/conf:/conf:ro - - ./keys:/var/fsc/keys:ro + - ./keys:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys:ro ports: - 9100:9000 expose: @@ -58,9 +58,9 @@ services: context: ./owner dockerfile: ../Dockerfile volumes: - - ./data/owner1:/var/fsc/data/owner1 + - ./data/owner1:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner1 - ./owner/conf/owner1:/conf:ro - - ./keys:/var/fsc/keys:ro + - ./keys:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys:ro ports: - 9200:9000 expose: @@ -78,9 +78,9 @@ services: context: ./owner dockerfile: ../Dockerfile volumes: - - ./data/owner2:/var/fsc/data/owner2 + - ./data/owner2:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner2 - ./owner/conf/owner2:/conf:ro - - ./keys:/var/fsc/keys:ro + - ./keys:/Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys:ro ports: - 9300:9000 expose: diff --git a/token-sdk/e2e/client.gen.go b/token-sdk/e2e/client.gen.go index b6b8039e..836c5657 100644 --- a/token-sdk/e2e/client.gen.go +++ b/token-sdk/e2e/client.gen.go @@ -1,6 +1,6 @@ // Package e2e provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT. package e2e import ( @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/oapi-codegen/runtime" ) // Account Information about an account and its balance diff --git a/token-sdk/go.work.sum b/token-sdk/go.work.sum index eb4ed8f7..85a79b76 100644 --- a/token-sdk/go.work.sum +++ b/token-sdk/go.work.sum @@ -1,7 +1,28 @@ github.com/bits-and-blooms/bitset v1.2.1 h1:M+/hrU9xlMp7t4TyTDQW97d3tRPVuKFC6zBEK16QnXY= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/containerd/containerd v1.5.18 h1:doHr6cNxfOLTotWmZs6aZF6LrfJFcjmYFcWlRmQgYPM= github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/fsouza/go-dockerclient v1.7.3 h1:i6iMcktl688vsKUEExA6gU1UjPgIvmGtJeQ0mbuFqZo= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= +github.com/miracl/conflate v1.2.1 h1:QlB+Hjh8vnPIjimCK2VKEvtLVxVGIVxNQ4K95JRpi90= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= +github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= +gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= +gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= diff --git a/token-sdk/issuer/conf/core.yaml b/token-sdk/issuer/conf/core.yaml index 7517e777..ebcdb8ad 100644 --- a/token-sdk/issuer/conf/core.yaml +++ b/token-sdk/issuer/conf/core.yaml @@ -7,9 +7,9 @@ logging: fsc: identity: cert: - file: /var/fsc/keys/issuer/fsc/msp/signcerts/cert.pem + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/issuer/fsc/msp/signcerts/cert.pem key: - file: /var/fsc/keys/issuer/fsc/msp/keystore/priv_sk + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/issuer/fsc/msp/keystore/priv_sk tls: enabled: false # TODO p2p: @@ -21,7 +21,7 @@ fsc: persistence: type: badger # badger or memory opts: - path: /var/fsc/data/issuer/kvs + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/issuer/kvs # The endpoint section tells how to reach other FSC node in the network. # For each node, the name, the domain, the identity of the node, and its addresses must be specified. @@ -30,21 +30,21 @@ fsc: - name: auditor identity: id: auditor - path: /var/fsc/keys/auditor/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/auditor/fsc/msp/signcerts/cert.pem addresses: P2P: auditor.example.com:9001 - - name: owner1 + - name: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk identity: - id: owner1 - path: /var/fsc/keys/owner1/fsc/msp/signcerts/cert.pem + id: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner1/fsc/msp/signcerts/cert.pem addresses: - P2P: owner1.example.com:9201 + P2P: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk.example.com:9201 aliases: - - owner1 + - /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk - name: owner2 identity: id: owner2 - path: /var/fsc/keys/owner2/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner2/fsc/msp/signcerts/cert.pem addresses: P2P: owner2.example.com:9301 aliases: @@ -55,13 +55,13 @@ fabric: enabled: true mynetwork: default: true - mspConfigPath: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + mspConfigPath: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp defaultMSP: Org1MSP msps: - id: Org1MSP mspType: bccsp mspID: Org1MSP - path: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp tls: enabled: true # If the keepalive values are too low, Fabric peers will complain with: ENHANCE_YOUR_CALM, debug data: "too_many_pings" @@ -73,14 +73,14 @@ fabric: - address: orderer.example.com:7050 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt serverNameOverride: orderer.example.com # List of trusted peers this node can connect to. There must be at least one trusted peer. Others are discovered. peers: - address: peer0.org1.example.com:7051 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt serverNameOverride: peer0.org1.example.com # Channel where the token chaincode is deployed channels: @@ -91,7 +91,7 @@ fabric: persistence: type: badger opts: - path: /var/fsc/data/issuer/vault + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/issuer/vault # ------------------- Token SDK Configuration ------------------------- token: @@ -106,11 +106,11 @@ token: issuers: - id: issuer # the unique identifier of this wallet. Here is an example of use: `ttx.GetIssuerWallet(context, "issuer)` default: true # is this the default issuer wallet - path: /var/fsc/keys/issuer/iss/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/issuer/iss/msp # Internal database to keep track of token transactions. # It is used by auditors and token owners to track history ttxdb: persistence: type: badger opts: - path: /var/fsc/data/issuer/txdb + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/issuer/txdb diff --git a/token-sdk/issuer/routes/routes.gen.go b/token-sdk/issuer/routes/routes.gen.go index 648cd429..28d413dc 100644 --- a/token-sdk/issuer/routes/routes.gen.go +++ b/token-sdk/issuer/routes/routes.gen.go @@ -1,6 +1,6 @@ // Package routes provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT. package routes import ( @@ -15,9 +15,9 @@ import ( "path" "strings" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" + strictecho "github.com/oapi-codegen/runtime/strictmiddleware/echo" ) // Amount The amount to issue, transfer or redeem. @@ -80,13 +80,13 @@ type IssueJSONRequestBody = TransferRequest // ServerInterface represents all server handlers. type ServerInterface interface { - + // Returns 200 if the service is healthy // (GET /healthz) Healthz(ctx echo.Context) error - // Issue tokens to an account + // Issue tokens of any kind to an account // (POST /issuer/issue) Issue(ctx echo.Context) error - + // Returns 200 if the service is ready to accept calls // (GET /readyz) Readyz(ctx echo.Context) error } @@ -252,19 +252,19 @@ func (response Readyz503JSONResponse) VisitReadyzResponse(w http.ResponseWriter) // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - + // Returns 200 if the service is healthy // (GET /healthz) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error) - // Issue tokens to an account + // Issue tokens of any kind to an account // (POST /issuer/issue) Issue(ctx context.Context, request IssueRequestObject) (IssueResponseObject, error) - + // Returns 200 if the service is ready to accept calls // (GET /readyz) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error) } -type StrictHandlerFunc = runtime.StrictEchoHandlerFunc -type StrictMiddlewareFunc = runtime.StrictEchoMiddlewareFunc +type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc +type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { return &strictHandler{ssi: ssi, middlewares: middlewares} @@ -293,7 +293,7 @@ func (sh *strictHandler) Healthz(ctx echo.Context) error { } else if validResponse, ok := response.(HealthzResponseObject); ok { return validResponse.VisitHealthzResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -322,7 +322,7 @@ func (sh *strictHandler) Issue(ctx echo.Context) error { } else if validResponse, ok := response.(IssueResponseObject); ok { return validResponse.VisitIssueResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -345,7 +345,7 @@ func (sh *strictHandler) Readyz(ctx echo.Context) error { } else if validResponse, ok := response.(ReadyzResponseObject); ok { return validResponse.VisitReadyzResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -353,26 +353,30 @@ func (sh *strictHandler) Readyz(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RWQW/jNhP9K8R832EXICIlaQtUt912gQS9FNkUKLrNYUyNLW4oUktSTt1A/70gKcu2", - "LDvxNkCzJ1sSOXxv5s3jPIIwdWM0ae+geARLrjHaUXz4YK2xN/2b8EIY7Un78BebRkmBXhqdfXZGh3dO", - "VFRj+Pd/S3Mo4H/ZJnqWvrosRoWu6ziU5ISVTQgCRTqOrRFAx+GKUPnqYysEOXcSAPoL60ZF0DU5hwuC", - "Asx9CNpY05D1MnEcvj6O0Jh74OBXTdjovJV6AQGypS+ttFRC8WnYezcsNLPPJPwUuZ7EDr1r51r6GnYH", - "KYzwcmhwpQyW+/RuLWqHIjwxWT6b6ibiKaSNZTQqbsd7PpHCu9q0ifgIZUUM4zfmDZMhX5z5AH1OlsWA", - "JVF9Bny74sKUAdeH325+Bw5LVC1BcZ7ne8VPC8Ohc2yV3+zZReErYmEpM3MW/ntzT3o/ZcNRYxbxNZOa", - "zdARa7X0jr1pXYtKrZgIzfEWOMyNrTFgkNr/8B1wqKWWdVtDkQ9HSe1pQXavPJHI+vz9ynD4KeSQbIPW", - "r6bTLLZWBKzIbrfyHKSKWlBKftLNKOsoRCoioJIiwNGpDuZBkz3fb71hw4Ru9VCZMc7whfkKPauMKl0s", - "iCUhG0nas3XMp/SsU8LWy6dSlnzqkJckPe+3RQEneMyVXFRM0ZIUG8d7fif/TB6lcgxnpvUxHTHWi7Q0", - "h7UIbuhLS26iRa+187aNgnBDkwbJDG0a2yV+Q71VoJEYBgc4dnf0PtFxECNBH9u1I/6OH/H8+AfVug5J", - "Zw9SKTYj5qLAdMmcN5ZK9iB9lfxgYLppjifTv0OAr/lPu6rUczOR+WSHoQ22TDEATK7YJ/6MvUdxTyWb", - "rRiyUgY8s9ZTyRSVC7L8T91Ycm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zVF2a3ZV0f+mwi", + "5aOuOVNj+y1lmszCAUw3kn1DpY5yMyb+BDXPJtTcL3rA1/e2zoGpBnZCZQe56Kve+br5TwBNQXiOhaFr", + "aOIHWtbPa0EHN3pzAsyrfTB0boUzI7UNZjKmTpg5P+j/KdivEbZniDiJl8AzBj4VsTAivNjURr3saESO", + "RfYI9X+Ohelno++kNFdLg/Nk5giFMsiy5videRmXv4crM0QSwuQcKwecSWmPXqAnBfWR0wf9d4JMnxmH", + "uoQd2lPADTK3dIHRbgD2V1kRPhog9BAMdwclipU4Jmcpa5OSdl/n1sXXO2xiML1F7977CwP6aD64XbC+", + "RReawA/peIummYzp3YcDl8hMjGWHWFlg/QA/OujJcejiY4c8Dm/dNxTLhPINMAIcedjetP8EAAD//+/z", + "pA07FQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/token-sdk/main b/token-sdk/main new file mode 100755 index 00000000..9825ec6e Binary files /dev/null and b/token-sdk/main differ diff --git a/token-sdk/owner/conf/owner1/core.yaml b/token-sdk/owner/conf/owner1/core.yaml index 01f1ac56..c4c4d08a 100644 --- a/token-sdk/owner/conf/owner1/core.yaml +++ b/token-sdk/owner/conf/owner1/core.yaml @@ -7,9 +7,9 @@ logging: fsc: identity: cert: - file: /var/fsc/keys/owner1/fsc/msp/signcerts/cert.pem + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner1/fsc/msp/signcerts/cert.pem key: - file: /var/fsc/keys/owner1/fsc/msp/keystore/priv_sk + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner1/fsc/msp/keystore/priv_sk tls: enabled: false # TODO p2p: @@ -21,7 +21,7 @@ fsc: persistence: type: badger # badger or memory opts: - path: /var/fsc/data/owner1/kvs + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner1/kvs # The endpoint section tells how to reach other FSC node in the network. # For each node, the name, the domain, the identity of the node, and its addresses must be specified. @@ -30,19 +30,19 @@ fsc: - name: auditor identity: id: auditor - path: /var/fsc/keys/auditor/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/auditor/fsc/msp/signcerts/cert.pem addresses: P2P: auditor.example.com:9001 - name: issuer identity: id: issuer - path: /var/fsc/keys/issuer/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/issuer/fsc/msp/signcerts/cert.pem addresses: P2P: issuer.example.com:9101 - name: owner2 identity: id: owner2 - path: /var/fsc/keys/owner2/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner2/fsc/msp/signcerts/cert.pem addresses: P2P: owner2.example.com:9201 aliases: @@ -53,13 +53,13 @@ fabric: enabled: true mynetwork: default: true - mspConfigPath: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + mspConfigPath: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp defaultMSP: Org1MSP msps: - id: Org1MSP mspType: bccsp mspID: Org1MSP - path: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp tls: enabled: true # If the keepalive values are too low, Fabric peers will complain with: ENHANCE_YOUR_CALM, debug data: "too_many_pings" @@ -71,14 +71,14 @@ fabric: - address: orderer.example.com:7050 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt serverNameOverride: orderer.example.com # List of trusted peers this node can connect to. There must be at least one trusted peer. Others are discovered. peers: - address: peer0.org1.example.com:7051 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt serverNameOverride: peer0.org1.example.com # Channel where the token chaincode is deployed channels: @@ -89,7 +89,7 @@ fabric: persistence: type: badger opts: - path: /var/fsc/data/owner1/vault + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner1/vault # ------------------- Token SDK Configuration ------------------------- token: @@ -105,9 +105,9 @@ token: owners: - id: alice # the unique identifier of this wallet. Here is an example of use: `ttx.GetWallet(context, "alice")` # default: true # is this the default owner wallet - path: /var/fsc/keys/owner1/wallet/alice/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner1/wallet/alice/msp - id: bob - path: /var/fsc/keys/owner1/wallet/bob/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner1/wallet/bob/msp # Internal database to keep track of token transactions. # It is used by auditors and token owners to track history @@ -116,4 +116,4 @@ token: # type can be badger (disk) or memory type: badger opts: - path: /var/fsc/data/owner1/txdb + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner1/txdb diff --git a/token-sdk/owner/conf/owner2/core.yaml b/token-sdk/owner/conf/owner2/core.yaml index 8b5a5b95..d4d37fcd 100644 --- a/token-sdk/owner/conf/owner2/core.yaml +++ b/token-sdk/owner/conf/owner2/core.yaml @@ -7,9 +7,9 @@ logging: fsc: identity: cert: - file: /var/fsc/keys/owner2/fsc/msp/signcerts/cert.pem + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner2/fsc/msp/signcerts/cert.pem key: - file: /var/fsc/keys/owner2/fsc/msp/keystore/priv_sk + file: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner2/fsc/msp/keystore/priv_sk tls: enabled: false # TODO p2p: @@ -21,7 +21,7 @@ fsc: persistence: type: badger # badger or memory opts: - path: /var/fsc/data/owner2/kvs + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner2/kvs # The endpoint section tells how to reach other FSC node in the network. # For each node, the name, the domain, the identity of the node, and its addresses must be specified. @@ -30,19 +30,19 @@ fsc: - name: auditor identity: id: auditor - path: /var/fsc/keys/auditor/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/auditor/fsc/msp/signcerts/cert.pem addresses: P2P: auditor.example.com:9001 - name: issuer identity: id: issuer - path: /var/fsc/keys/issuer/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/issuer/fsc/msp/signcerts/cert.pem addresses: P2P: issuer.example.com:9101 - name: owner1 identity: id: owner1 - path: /var/fsc/keys/owner1/fsc/msp/signcerts/cert.pem + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner1/fsc/msp/signcerts/cert.pem addresses: P2P: owner1.example.com:9201 aliases: @@ -53,13 +53,13 @@ fabric: enabled: true mynetwork: default: true - mspConfigPath: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + mspConfigPath: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp defaultMSP: Org1MSP msps: - id: Org1MSP mspType: bccsp mspID: Org1MSP - path: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp tls: enabled: true # If the keepalive values are too low, Fabric peers will complain with: ENHANCE_YOUR_CALM, debug data: "too_many_pings" @@ -71,14 +71,14 @@ fabric: - address: orderer.example.com:7050 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt serverNameOverride: orderer.example.com # List of trusted peers this node can connect to. There must be at least one trusted peer. Others are discovered. peers: - address: peer0.org1.example.com:7051 connectionTimeout: 10s tlsEnabled: true - tlsRootCertFile: /var/fsc/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFile: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt serverNameOverride: peer0.org1.example.com # Channel where the token chaincode is deployed channels: @@ -89,7 +89,7 @@ fabric: persistence: type: badger opts: - path: /var/fsc/data/owner2/vault + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner2/vault # ------------------- Token SDK Configuration ------------------------- token: @@ -105,9 +105,9 @@ token: owners: - id: carlos # the unique identifier of this wallet. Here is an example of use: `ttx.GetWallet(context, "alice")` # default: true # is this the default owner wallet - path: /var/fsc/keys/owner2/wallet/carlos/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner2/wallet/carlos/msp - id: dan - path: /var/fsc/keys/owner2/wallet/dan/msp + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/keys/owner2/wallet/dan/msp # Internal database to keep track of token transactions. # It is used by auditors and token owners to track history @@ -116,4 +116,4 @@ token: # type can be badger (disk) or memory type: badger opts: - path: /var/fsc/data/owner2/txdb + path: /Users/garvwadhwa/garv-internal-testing-repos/fabric-samples/token-sdk/data/owner2/txdb diff --git a/token-sdk/owner/routes/routes.gen.go b/token-sdk/owner/routes/routes.gen.go index d1ccd4a1..0c018228 100644 --- a/token-sdk/owner/routes/routes.gen.go +++ b/token-sdk/owner/routes/routes.gen.go @@ -1,6 +1,6 @@ // Package routes provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT. package routes import ( @@ -16,9 +16,10 @@ import ( "strings" "time" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" + "github.com/oapi-codegen/runtime" + strictecho "github.com/oapi-codegen/runtime/strictmiddleware/echo" ) // Account Information about an account and its balance @@ -165,13 +166,13 @@ type TransferJSONRequestBody = TransferRequest // ServerInterface represents all server handlers. type ServerInterface interface { - + // Returns 200 if the service is healthy // (GET /healthz) Healthz(ctx echo.Context) error - // Get all accounts on this node and their balances + // Get all accounts on this node and their balances of each type // (GET /owner/accounts) OwnerAccounts(ctx echo.Context) error - // Get an account and their balances + // Get an account and its balances of each token type // (GET /owner/accounts/{id}) OwnerAccount(ctx echo.Context, id Id, params OwnerAccountParams) error // Redeem (burn) tokens @@ -183,7 +184,7 @@ type ServerInterface interface { // Transfer tokens to another account // (POST /owner/accounts/{id}/transfer) Transfer(ctx echo.Context, id Id) error - + // Returns 200 if the service is ready to accept calls // (GET /readyz) Readyz(ctx echo.Context) error } @@ -570,13 +571,13 @@ func (response Readyz503JSONResponse) VisitReadyzResponse(w http.ResponseWriter) // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - + // Returns 200 if the service is healthy // (GET /healthz) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error) - // Get all accounts on this node and their balances + // Get all accounts on this node and their balances of each type // (GET /owner/accounts) OwnerAccounts(ctx context.Context, request OwnerAccountsRequestObject) (OwnerAccountsResponseObject, error) - // Get an account and their balances + // Get an account and its balances of each token type // (GET /owner/accounts/{id}) OwnerAccount(ctx context.Context, request OwnerAccountRequestObject) (OwnerAccountResponseObject, error) // Redeem (burn) tokens @@ -588,13 +589,13 @@ type StrictServerInterface interface { // Transfer tokens to another account // (POST /owner/accounts/{id}/transfer) Transfer(ctx context.Context, request TransferRequestObject) (TransferResponseObject, error) - + // Returns 200 if the service is ready to accept calls // (GET /readyz) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error) } -type StrictHandlerFunc = runtime.StrictEchoHandlerFunc -type StrictMiddlewareFunc = runtime.StrictEchoMiddlewareFunc +type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc +type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { return &strictHandler{ssi: ssi, middlewares: middlewares} @@ -623,7 +624,7 @@ func (sh *strictHandler) Healthz(ctx echo.Context) error { } else if validResponse, ok := response.(HealthzResponseObject); ok { return validResponse.VisitHealthzResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -646,7 +647,7 @@ func (sh *strictHandler) OwnerAccounts(ctx echo.Context) error { } else if validResponse, ok := response.(OwnerAccountsResponseObject); ok { return validResponse.VisitOwnerAccountsResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -672,7 +673,7 @@ func (sh *strictHandler) OwnerAccount(ctx echo.Context, id Id, params OwnerAccou } else if validResponse, ok := response.(OwnerAccountResponseObject); ok { return validResponse.VisitOwnerAccountResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -703,7 +704,7 @@ func (sh *strictHandler) Redeem(ctx echo.Context, id Id) error { } else if validResponse, ok := response.(RedeemResponseObject); ok { return validResponse.VisitRedeemResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -728,7 +729,7 @@ func (sh *strictHandler) OwnerTransactions(ctx echo.Context, id Id) error { } else if validResponse, ok := response.(OwnerTransactionsResponseObject); ok { return validResponse.VisitOwnerTransactionsResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -759,7 +760,7 @@ func (sh *strictHandler) Transfer(ctx echo.Context, id Id) error { } else if validResponse, ok := response.(TransferResponseObject); ok { return validResponse.VisitTransferResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -782,7 +783,7 @@ func (sh *strictHandler) Readyz(ctx echo.Context) error { } else if validResponse, ok := response.(ReadyzResponseObject); ok { return validResponse.VisitReadyzResponse(ctx.Response()) } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) + return fmt.Errorf("unexpected response type: %T", response) } return nil } @@ -790,38 +791,45 @@ func (sh *strictHandler) Readyz(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+RaW2/bOBb+KwR3H2YANZKdzU1vnXawLfZhB2kKLKbNAy0eW5xQpEpSznpT//cFL7rL", - "l6SZou08JTapw3O+850b5QecyaKUAoTROH3AJVGkAAPKfcokBfuXCZziTxWoDY6wIAXg1K9FWGc5FMRu", - "oqAzxUrDpN19kwMy8g4EshuRkWjJuAGFpMARhv+SouRWzK/vr/+DI2w2pf2kjWJihbfbCDPanFwSk7cH", - "M4ojrOBTxRRQnBpVwW41SJbJShjEKCIaKVgxbUABRcQgkwN6BcqwJcuIAfSyMrlUzGx6ChLOMpjQcGuV", - "0KUUGhxW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yIWdwEFQUJ2o04aYSuMU", - "v5JiyVTobFkB2pCixCmeJ7PLF8npi3lyk1yls3k6v/x9Ijof6Zup+mIO9At7PFppUKhUcs0o0H1x0UHk", - "YSJvt6mhTt49r4zE1XBOyfJrxwoKbhgKei/uhLwX6DP6DQRlYoU+o8ZT6DN6DRzMdIfcceJIvXrJpm6r", - "na8mKfo46e6PuFtwKDHwwko4rpAHiLrQRzVduko2GER75sC2lz46x7g2wBalphEI6cbI50w22aBk7nuq", - "V16fnqg0hE5VG2nbsHtm8pZrztJ9pBs1BR2lot3pzF23iaWcQN43XLbQdtouq2Avz5+gX0h2BxQtNogg", - "yqw+i8oARRzoClT0UZQKNKi1pXup2JpkG1Rp++l3UBL9S8h7txX9pqRc6hPHI+M6zJt6LlqD0l6t2Uli", - "QZYlCFIynOLTk+Tk1BUykztfxyHHx4EMOn5gdOuGV1Brd735YdQMN2WhUhynODemTOOYy4zwXGqTXiVJ", - "EpOSxetZjLe322jHMXF35n3+M3N35fM/K3gFjs+W5W7seWv7jzdhfXBBOU+SXSxu9sX966RthM+S08NP", - "9W/BLJ0MWVlzW800trrrqiiI2uAUX4OplNBoniSI+Xzq+GEnIY28iS6SYhftyv/ZD6bfuQfLWQ/LrjqO", - "6NNpxOrgOtjGyTuR/7fdVl+NPgn/4b2qG47DbPJ4L+zhne0VXCD7JmIXYvMuYtFQSkYUl9qJoUTsEXO6", - "E/h/gkGE8xptjaQtX0z7Nt9KNjkwVY/tFtWGWxZtT6tv084xc5osdJA+Lpm172I+TDu/3RIz6hQ/sMv1", - "m9YDT6bmX4uZ/fujH46KsS/j7nZQ6glK+unvSWS89c0IaPOLpJtnezfSn0e3/Z7HqAq2TyF3/z3DD89t", - "by76aVEp8XN78/zd0PmgLbv4PuzMdufh7quRp/P/sTyceiHzl+kBeq+KllL1h7nvPtfW89PubFtPwt9S", - "vh1O58+VcYdv0H54lt9MXVZIk9uB+vsj+SMtszGhgNDN7rH12i9/x1OrM9BZn2VQGpQRzvUhej7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URsm1lexIsOHG0fLrephcodLel5NRbCNTlihoycmMnIzi0Ynr/iZzCTIOjXEc7tXjD5xt", + "3MSPauV2wu92Joiml1YqJzOSGVPOxuNcJjTPpDazyziOx7Tk49VkTDY3m2jPNePuouDx78zcnux/VvAS", + "XRGwpcHNii8taXsRnm9tdadxvC/1m3Pj/g5uE5HT+OT+X/VXh27GrYqCqjWZkSs0lRIapnEM3IdaiHTg", + "GrwtNqUNXVqAWls0ubGSxi5ulf/nMJj+5AEsJz0su1q6HBmuvVYHR/sbJ+9F/pU9Vu+TH4T/9jLabRTC", + "QPcAL+yPO0uwXDJ75rUPsWkXsWhbSkJVLrUTw6g4IOZkL/D/RAM0z2u0NUhb2rj2s5GVbDLkqqlGtly5", + "yugKfydsLPTk5us1ejeMmpJ0byy5yta+zXo3HAntkTFnTvF7TjnGbt3x4Dj9c4Xp3g1cJyrde8LvJDbH", + "vlG7havUAzHqB+oHReeN53eozU+SrR/tdVN/xN/0aaRRFW4eEu39VzfffbB7c+HJolLiabvM/2bC+V5b", + "9sX7Nm8Lhbmv1L+lCaOO4zKOf1v2rOGt0KVl8t1XC68qU1ZGw5O317++ejqai39IBbQZQCJYy+rveQ4y", + "NSg8s76T0HvT1ExOmhYInNmJwvN10CUmPOWWl/vN8lJawh6WQ92hKfLM3bL/QMj9D574xUJBuXADDVXN", + "doGLsjIesqdOMCxochs2T3PhR+e/uMHDNuxEVjmzk18iReoHotTZajUdwTPQvChzO4Hkld+i6O7fUoR9", + "337L6xvDzBbG9dHcxsVA6+y+D3x4hfrUSjH0FvJPw+F6vnO+724wvvluWOfs/n5Yz75fU0fcXkk9Vk/c", + "fm383Uf59dCGrrfc+FZ75BGW2ZxQSNl6/9rhyj/+FrYOzhJnZpJgaSChea737iAOO/HTFjjR5+0soq8s", + "hgJgu/IEJAqpaVYqMgUq1nDLBQtMBP1oX7g1pM2WZgXQ+ftID84Qaj2Xhleo2vivb3HtjWmXCinY+9yO", + "sxXvk3RX+hKNSwLLxnCFat3bdIbda5IjVd6WW8RSA613oO0FdXDsXvEmaO73X4HSUMaFTYBWwTYONzeb", + "/wcAAP//QP9j4uEqAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/token-sdk/owner/routes/routes.go b/token-sdk/owner/routes/routes.go index 9e267393..e6de60c8 100644 --- a/token-sdk/owner/routes/routes.go +++ b/token-sdk/owner/routes/routes.go @@ -92,6 +92,7 @@ func (c Controller) OwnerAccount(ctx context.Context, request OwnerAccountReques code = *request.Params.Code } balance, err := c.Service.GetBalance(request.Id, code) + fmt.Print("balance is: ", balance) if err != nil { return OwnerAccountdefaultJSONResponse{ Body: Error{ @@ -111,7 +112,7 @@ func (c Controller) OwnerAccount(ctx context.Context, request OwnerAccountReques } return OwnerAccount200JSONResponse{ AccountSuccessJSONResponse: AccountSuccessJSONResponse{ - Message: fmt.Sprintf("got balances for %s", request.Id), + Message: fmt.Sprintf("GOT balances for %s:", request.Id), Payload: Account{ Id: request.Id, Balance: amounts, @@ -137,6 +138,8 @@ func (c Controller) OwnerTransactions(ctx context.Context, request OwnerTransact }, nil } + fmt.Print("history is: ", history) + pl := []TransactionRecord{} for _, tx := range history { pl = append(pl, TransactionRecord{ @@ -154,7 +157,7 @@ func (c Controller) OwnerTransactions(ctx context.Context, request OwnerTransact } return OwnerTransactions200JSONResponse{ TransactionsSuccessJSONResponse: TransactionsSuccessJSONResponse{ - Message: fmt.Sprintf("got %d transactions for %s", len(pl), request.Id), + Message: fmt.Sprintf("GOT %d transactions for %s", len(pl), request.Id), Payload: pl, }, }, nil diff --git a/token-sdk/owner/service/transfer.go b/token-sdk/owner/service/transfer.go index d0394c09..99305caf 100644 --- a/token-sdk/owner/service/transfer.go +++ b/token-sdk/owner/service/transfer.go @@ -29,6 +29,7 @@ func (s TokenService) TransferTokens(tokenType string, quantity uint64, sender s Message: message, }, }) + logger.Info("GW TransferTokens: %s", res) if err != nil { logger.Error(err) return @@ -75,6 +76,7 @@ func (v *TransferView) Call(context view.Context) (interface{}, error) { // Get recipient identity from own wallet logger.Infof("getting local identity for %s", v.Recipient) recipient, err = w.GetRecipientIdentity() + logger.Info("GW log-1: %s", recipient) if err != nil { return nil, errors.Wrapf(err, "failed getting recipient identity from own node: %s", v.Recipient) } @@ -90,6 +92,7 @@ func (v *TransferView) Call(context view.Context) (interface{}, error) { // Request recipient identity from other node logger.Infof("requesting [%s] identity from [%s]", v.Recipient, v.RecipientNode) recipient, err = ttx.RequestRecipientIdentity(context, rec) + logger.Info("GW log-2: %s", recipient) if err != nil { return "", errors.Wrapf(err, "failed getting recipient identity from %s", v.RecipientNode) } diff --git a/token-sdk/scripts/enroll-users.sh b/token-sdk/scripts/enroll-users.sh index 70a6ddf0..c8cd1e41 100755 --- a/token-sdk/scripts/enroll-users.sh +++ b/token-sdk/scripts/enroll-users.sh @@ -31,6 +31,13 @@ fabric-ca-client enroll -u http://alice:password@localhost:27054 -M "$(pwd)/key fabric-ca-client register -u http://localhost:27054 --id.name bob --id.secret password --id.type client --enrollment.type idemix --idemix.curve gurvy.Bn254 fabric-ca-client enroll -u http://bob:password@localhost:27054 -M "$(pwd)/keys/owner1/wallet/bob/msp" --enrollment.type idemix --idemix.curve gurvy.Bn254 +fabric-ca-client register -u http://localhost:27054 --id.name garv --id.secret password --id.type client --enrollment.type idemix --idemix.curve gurvy.Bn254 +fabric-ca-client enroll -u http://bob:password@localhost:27054 -M "$(pwd)/keys/owner1/wallet/garv/msp" --enrollment.type idemix --idemix.curve gurvy.Bn254 + + +fabric-ca-client register -u http://localhost:27054 --id.name garv-2 --id.secret password --id.type client --enrollment.type idemix --idemix.curve gurvy.Bn254 +fabric-ca-client enroll -u http://bob:password@localhost:27054 -M "$(pwd)/keys/owner1/wallet/garv-2/msp" --enrollment.type idemix --idemix.curve gurvy.Bn254 + # Owner wallet users (pseudonymous) on the owner2 node fabric-ca-client register -u http://localhost:27054 --id.name carlos --id.secret password --id.type client --enrollment.type idemix --idemix.curve gurvy.Bn254 fabric-ca-client enroll -u http://carlos:password@localhost:27054 -M "$(pwd)/keys/owner2/wallet/carlos/msp" --enrollment.type idemix --idemix.curve gurvy.Bn254 diff --git a/token-sdk/scripts/up.sh b/token-sdk/scripts/up.sh index 69ecaabc..011012ba 100755 --- a/token-sdk/scripts/up.sh +++ b/token-sdk/scripts/up.sh @@ -23,7 +23,7 @@ export TEST_NETWORK_HOME=\"$TEST_NETWORK_HOME\" # Generate identities for the nodes, issuer, auditor and owner mkdir -p keys/ca docker-compose -f compose-ca.yaml up -d -while ! fabric-ca-client getcainfo -u localhost:27054 2>/dev/null; do echo "waiting for CA to start..." && sleep 1; done +#while ! fabric-ca-client getcainfo -u localhost:27054 2>/dev/null; do echo "waiting for CA to start..." && sleep 1; done ./scripts/enroll-users.sh # generate the parameters needed for the tokenchaincode tokengen gen dlog --base 300 --exponent 5 --issuers keys/issuer/iss/msp --idemix keys/owner1/wallet/alice --auditors keys/auditor/aud/msp --output tokenchaincode