Commit graph

149 commits

Author SHA1 Message Date
Tommy TIAN
9d04fc9a2e
fix typo in asset-transfer-basic (#744)
Signed-off-by: Tommy TIAN <xtianae@connect.ust.hk>
2022-05-18 12:27:08 -04:00
Mark S. Lewis
f2fbfa410f
Enable engine-strict checks for TypeScript Gateway samples (#726)
Use an .npmrc to enable engine-strict checks so that `npm install` will fail for projects when an incompatible Node version is used, rather than confusing errors about unsupported language features occuring at runtime.

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-04-29 15:59:50 +01:00
jkneubuh
eeb4e611c7
Provide clear guidance for debugging Java chaincode as a service #684 (#724)
* Addresses Issue #548 by providing a simple guide for running Java chaincode as a service with a local debugger.

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* missed a couple of bash syntax errors

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Add metadata and activate examples to the CC README

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* move ccpackage/ contents into network script

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Fix CI test - Azure mounts git checkout at a different folder root path

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Update test-network-k8s README with updated cc deploy commands

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Run basic-asset transfer CI tests with Java + golang CC in Azure

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* remove (obsolete) test-net chaincode/ folder

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Address some PR review feedback points - README reorg

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Use the SDKs contract router Main, not a local entrypoint

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* bump the build - remove trailing newlines from a README

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-04-26 15:33:14 +01:00
dependabot[bot]
c4886eda11
Bump moment in /asset-transfer-basic/rest-api-typescript (#711)
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-18 09:40:29 -04:00
Tatsuya Sato
2df09e554d
Fix typos and broken links in docs (#712)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2022-04-18 09:36:49 -04:00
Matthew B White
99e7ae8536
CORS Enablement (#696)
After feedback from the community, this PR adds CORS support in, but as an option
to enable.

Along with warnings that the default wildcard origin might not be applicable
in a production use case

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2022-04-01 09:35:57 -04:00
Matthew B White
9fa171f824
Update the REST Example (#689)
1. The default chaincode use Capitalized JSON Names, whereas for new asset the REST validation didn't.. Adjusted
so it matches the chaincode

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2022-03-31 08:19:34 -04:00
Dave Kelsey
57919f528d
fix chaincode breakage in asset-transfer-basic (#694)
only broken in main branch, not in release-2.2

Signed-off-by: D <d_kelsey@uk.ibm.com>

Co-authored-by: D <d_kelsey@uk.ibm.com>
2022-03-31 08:38:05 +01:00
Arnaud J Le Hors
8d7f3ca037
Fix sample external chaincode Dockerfile (#645)
Podman isn't as lenient as docker when it comes to the syntax of the
Dockerfile and insists on getting the ARG command properly scoped.
This fixes this error:
...
[2/2] STEP 12/15: EXPOSE $CC_SERVER_PORT
Error: error building at STEP "EXPOSE $CC_SERVER_PORT": EXPOSE requires at least one argument

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2022-03-09 08:47:59 +00:00
Arnaud J Le Hors
75bdde97cd
Improve REST sample README (#647)
Add that one needs to have the ledger initialized for the sample to
work.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2022-02-17 16:55:26 +00:00
dependabot[bot]
6739199db2
Bump follow-redirects in /asset-transfer-basic/rest-api-typescript (#643)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 15:36:23 +01:00
Mark S. Lewis
bee24a7615
Add README to asset-transfer-basic sample (#638)
Also:
- Refactor application-gateway-java slightly to reflect more idiomatic Java class structure, in line with asset-transfer-events sample.
- Correctly handle unexpected error case where key file is missing.
- Update Gradle wrapper for application-gateway-java.

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-02-10 13:52:46 +00:00
jkneubuh
fee6a44fcd
Run a basic-asset-transfer CI test on Kubernetes (#637)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-02-08 15:51:02 +00:00
Matthew B White
ecbf3f5db1
Support for using podman with the test-network (#596)
* Experimental Support for using podman with the test-network

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* supplement podman with nerdctl

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* adds experimental support for nerdctl compose

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* install fabric images to containerd with 'nerdctl' pull

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Podman Support

Use a core set of compose files, with overlays for specific details.
In the case of podman, the overlays refer to a specific core.yaml for the peer that distables the use of teh
docker daemon

In the case of docker, the overlays add enable the docker daemon accesss for the peer to create chaincode
containers

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

Co-authored-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-02-08 06:41:56 -05:00
James Taylor
e7074ba941
Update REST sample with Redis password (#629)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-04 14:27:40 +00:00
James Taylor
5edae7c444
Update samples to use published fabric-rest-sample (#626)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-03 12:15:29 -05:00
James Taylor
980da6f8aa
Add REST sample to CI (#611)
Build, test, and publish the REST server sample

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-02 16:34:08 +00:00
James Taylor
5d3cc66c25
Convert comments to tsdoc in REST sample (#606)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-01 17:12:07 +01:00
deeptiraom
e372006be7
client java application using gateway api in java sdk (#572)
* Added for client java application using gateway api in java sdk

Signed-off-by: deeptiraom <41100100+deeptiraom@users.noreply.github.com>

* removed eclipse plugin for gradle

Signed-off-by: deeptiraom <41100100+deeptiraom@users.noreply.github.com>
2022-01-27 13:57:14 +00:00
Mark S. Lewis
0f877fad4d
Remove JCenter as a Gradle package repository (#589)
JCenter is deprecated, can no longer be published to, and is scheduled for removal. It is now causing build failures. Replace with Maven Central.

Also remove mavenLocal() as this is not recommended practice:

- https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven-local

Note that Jitpack still needs to be included as a package repository for Java chaincode since it has dependencies on an old version of com.github.everit-org.json-schema:org.everit.json.schema that is only published there.

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-01-26 16:29:09 -05:00
dependabot[bot]
84c101fb8a
Bump follow-redirects in /asset-transfer-basic/rest-api-typescript (#584)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.6 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.6...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-19 14:36:23 +01:00
sapthasurendran
48fe95ee30
Added missing dependency,Updated ci pipelines to include gateway go application (#577)
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2022-01-12 13:41:38 +00:00
James Taylor
887e4a3578
Update REST sample readme (#575)
Move signposts to sample source files from index.ts to the readme and reinforce the key aspects of the sample

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-01-12 10:38:44 +00:00
Mark S. Lewis
3457690148
Default timeouts for basic Gateway TypeScript sample (#573)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-01-07 15:37:13 +00:00
Matthew B White
96623f1bd5
Adding examples of CCAAS and support into the test-network (#560)
- Updated the test-network with examples of runnig CCAAS
- Updating the asset transfer basic with how to run chaincode as a service.

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2021-12-17 13:18:22 +00:00
James Taylor
dd59991b57 Merge remote-tracking branch 'fabric-rest-sample/prepare-samples-pr' into rest-sample 2021-12-15 14:26:49 +00:00
James Taylor
af2f6e005c Prepare REST sample for fabric-samples repository
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-15 14:25:09 +00:00
James Taylor
fce803af24 Add jobs spec tests
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-15 14:24:58 +00:00
James Taylor
dfe79f7fb4 Add comments to jobs.ts
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-15 14:24:34 +00:00
sapthasurendran
0208892429
Go samples Migration to fabric-gateway (#561)
* go packages

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* Go sample Migration  to fabric-gateway

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

lint script changes

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

lint fixes

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Upgrade go to 1.16

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

add go mod

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

To match with docs

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

lint updates

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-15 10:26:46 +00:00
James Taylor
5447e3534d Add node, and npm version requirements
Match the versions required in asset-transfer-basic/application-typescript

Also update to latest version of fabric-network

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
711f1f560b Use app.locals to store contracts and jobq
“The app.locals object has properties that are local variables within the application.”

…which looks like a better option than app.get and app.set for app settings.

Also passes app to the initJobQueueWorker function for consistency.

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
66199000ca Fix lint errors
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
5d92abc52d Clarify retry logic
Improve the separation between Fabric logic and the job queue implementation details

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
b0256a57b5 Signpost configuration details
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
5a32d803c9 Use user credentials
Use User1 certificate and private key for org1 and org2 instead of Admin credentials

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
2d7da062d8 Update Dockerfile
Fabric is on alpine 3.14 so update the sample to match

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
b1bc6663b8 Update readme
Minor changes for Fabric 2.4 and the main branch of fabric-samples

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
ad3fd7e832 Update retry logic
Previously transactions were only retried after being successfully endorsed, and always with the same transaction ID

Transactions will now be added to a queue for processing and will also be retried if endorsement fails (with a different transaction id for invalid transactions)

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
0456a9e94c Move error related functions to errors.ts
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
fd269237d4 Add comments to fabric.ts
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
00a2dea50b Add block event listener config
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
f1a9fea77d Fix lint errors
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
e6738818e5 Update readmes
Move usage instructions to the node sample directory and add overview/next steps
to top level readme

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
sapthasurendran
9aec7ffd2a Clear Transaction when no contract found
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
bf91df7ef3 Update transaction retry to use correct user
Also improves test coverage

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
82b1249f4e Improve Docker support
- default command should be start, rather than start:dev in the docker image
- added a multistage build
- fixed node-gyp error
- removed dev dependencies
- added a start:dotenv script to support a .env file in production (may be useful for
k8s later)
- updated Readme and generateEnv script to simplify the setup
- updated external network in docker-compose.yaml to match the test network

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
5d1adddd03 Refactor health routes in to separate file
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
45683b2a1a Simplify fabric code
Attempt to make fabric code easier to document

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
862080773e Initial API tests
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00