-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(examples): include sample apps in monorepo build
- Include discounted-cartrade and electricity trade in monorepo setup, - Update the devcontainer and include new environment setup instructions in BUILD.md, - Fix sample apps build error, - Rename of sample apps to cactus-example-*, - Change any "car" references to "asset" (in code, comments, documentation, etc..), - Rename asset-trade files to match the format of the rest of this repository. - Remove asset-trade eth asset management class and endpoint (not used right now, and it would confuse with fabric asset). - Renamed some uses of cartrade to asset-trade, (more complete changes are included in follow-up commit), - Add indy build artifacts to .gitignore, - Add cmake to devcontainer build (fixed warning during npm dependency build stage), - Fix random whitespace and typos errors, BREAKING CHANGE: building discounted-asset-trade app (or any future app that use indy validator) requires Indy SDK to be installed on the build machine. Closes: 2029 Signed-off-by: Michal Bajer <[email protected]>
- Loading branch information
Showing
112 changed files
with
786 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,18 @@ jobs: | |
nuclei-scan: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Install Indy SDK | ||
run: > | ||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 \ | ||
&& sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb bionic stable" \ | ||
&& sudo apt-get update \ | ||
&& sudo apt-get install -y \ | ||
libindy \ | ||
libnullpay \ | ||
libvcx \ | ||
indy-cli \ | ||
&& sudo rm -f /etc/apt/sources.list.d/sovrin.list* | ||
- name: Set up NodeJS v16.9.1 | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -27,7 +39,7 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
|
||
- run: go install -v github.com/projectdiscovery/nuclei/v2/cmd/[email protected] | ||
|
||
- run: nuclei --version | ||
|
@@ -72,7 +84,7 @@ jobs: | |
|
||
- name: Install Fabric connector into the API server | ||
run: echo "$(jq '.plugins += [{"packageName":"@hyperledger/cactus-plugin-ledger-connector-fabric", "type":"org.hyperledger.cactus.plugin_import_type.LOCAL", "action":"org.hyperledger.cactus.plugin_import_action.INSTALL", "options":{"instanceId":"some-unique-fabric-connector-instance-id", "peerBinary":"/fabric-samples/bin/peer", "connectionProfile":"{}", "dockerBinary":"usr/local/bin/docker","cliContainerEnv":{"CORE_PEER_LOCALMSPID":"Org1MSP","CORE_PEER_ADDRESS":"peer0.org1.example.com:7051","CORE_PEER_MSPCONFIGPATH":"/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp","CORE_PEER_TLS_ROOTCERT_FILE":"/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt","ORDERER_TLS_ROOTCERT_FILE":"/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem"},"discoveryOptions":{"enabled":true,"asLocalhost":true}}}] ' .config.json)" > .config.json | ||
|
||
- name: Install Besu connector into the API server | ||
run: echo "$(jq '.plugins += [{"packageName":"@hyperledger/cactus-plugin-ledger-connector-besu","type":"org.hyperledger.cactus.plugin_import_type.LOCAL","action":"org.hyperledger.cactus.plugin_import_action.INSTALL","options":{"rpcApiHttpHost":"http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId":"some-unique-besu-connector-instance-id"}}]' .config.json)" > .config.json | ||
|
||
|
@@ -91,7 +103,7 @@ jobs: | |
# && echo -e " project-name: \"${GITHUB_REPOSITORY#*/}\"" >> ~/nuclei-github-config.yaml \ | ||
# && echo -e " issue-label: \"Nuclei\"" >> ~/nuclei-github-config.yaml \ | ||
# && echo "githubconfig=-rc ~/nuclei-github-config.yaml" >> $GITHUB_ENV | ||
|
||
# shell: bash | ||
|
||
# - run: ls -alt | ||
|
@@ -102,7 +114,7 @@ jobs: | |
# Needed because the wait-on syntax otherwise keeps thinking that | ||
# there is a problem due to our self signed certificates on the | ||
# test instance of the API server | ||
NODE_TLS_REJECT_UNAUTHORIZED: 0 | ||
NODE_TLS_REJECT_UNAUTHORIZED: 0 | ||
with: | ||
build: yarn --version | ||
start: yarn start:api-server | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,8 +88,9 @@ The `npm run watch` script in action: | |
![Fast Developer Flow / Code Iterations](./docs/hyperledger-cactus-watch-script-tutorial-2021-03-06.gif) | ||
|
||
## Getting Started | ||
|
||
* Install OS level dependencies: | ||
* Use preset environment: | ||
* [VSCode docker container](./.devcontainer) | ||
* ... or install OS level dependencies manually: | ||
* Windows Only | ||
* WSL2 or any virtual machine running Ubuntu 20.04 LTS | ||
* Git | ||
|
@@ -98,13 +99,15 @@ The `npm run watch` script in action: | |
nvm install 16.14.2 | ||
nvm use 16.14.2 | ||
``` | ||
* Yarn | ||
* Yarn | ||
* `npm run install-yarn` (from within the project directory) | ||
* [Docker Engine](https://docs.docker.com/engine/install/ubuntu/). Make sure that Docker is working and running, for example, running ``docker ps -aq`` | ||
* Docker Compose | ||
* [Docker Engine](https://docs.docker.com/engine/install/ubuntu/). Make sure that Docker is working and running, for example, running ``docker ps -aq`` | ||
* Docker Compose | ||
* OpenJDK (Corda support Java 8 JDK but do not currently support Java 9 or higher) | ||
* `sudo apt install openjdk-8-jdk-headless` | ||
* Indy SDK | ||
* [Installing the SDK](https://github.com/hyperledger/indy-sdk#installing-the-sdk) | ||
* [Build the SDK from source](https://github.com/hyperledger/indy-sdk#how-to-build-indy-sdk-from-source) | ||
* Clone the repository | ||
|
@@ -220,16 +223,16 @@ the following decision tree (and keep in mind that we have `npm run watch` too) | |
## Configuring SSH to use upterm | ||
Upload your public key onto github if not done so already. A public key is necessary to join the ssh connection to use upterm. For a comprehensive guide, see the [Generating a new SSH key and adding it to the ssh-agent](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). | ||
|
||
Locate the `ci.yml` within `.github/workflows` and add to the `ci.yml` code listed below: | ||
Locate the `ci.yml` within `.github/workflows` and add to the `ci.yml` code listed below: | ||
- name: Setup upterm session | ||
uses: lhotari/action-upterm@v1 | ||
with: | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
Keep in mind that the SSH upterm session should come after the checkout step (uses: actions/[email protected]) to ensure that the CI doesn't hang without before the debugging step occurs. Editing the `ci.yml` will create a new upterm session within `.github/workflows` by adding a new build step. For more details, see the [Debug your GitHub Actions by using ssh](https://github.com/marketplace/actions/debugging-with-ssh). | ||
Keep in mind that the SSH upterm session should come after the checkout step (uses: actions/[email protected]) to ensure that the CI doesn't hang without before the debugging step occurs. Editing the `ci.yml` will create a new upterm session within `.github/workflows` by adding a new build step. For more details, see the [Debug your GitHub Actions by using ssh](https://github.com/marketplace/actions/debugging-with-ssh). | ||
|
||
By creating a PR for the edited `ci.yml` file, this will the CI to run their tests. There are two ways to navigate to CIs. | ||
By creating a PR for the edited `ci.yml` file, this will the CI to run their tests. There are two ways to navigate to CIs. | ||
1) Go to the PR and click the `checks` tab | ||
2) Go to the `Actions` tab within the main Hyperledger Cactus Repository | ||
|
||
Click on the `CI Cactus workflow`. There should be a new job you've created be listed underneath the `build (ubuntu-20.04)` jobs. Click on the the new job (what's you've named your build) and locate the SSH Session within the `Setup Upterm Session` dropdown. Copy the SSH command that start with `ssh` and ends in `.dev` (ex. ssh **********:***********@uptermd.upterm.dev). Open your OS and paste the SSH command script in order to begin an upterm session. | ||
Click on the `CI Cactus workflow`. There should be a new job you've created be listed underneath the `build (ubuntu-20.04)` jobs. Click on the the new job (what's you've named your build) and locate the SSH Session within the `Setup Upterm Session` dropdown. Copy the SSH command that start with `ssh` and ends in `.dev` (ex. ssh **********:***********@uptermd.upterm.dev). Open your OS and paste the SSH command script in order to begin an upterm session. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/discounted-cartrade/.gitignore → ...example-discounted-asset-trade/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# BLP artifacts | ||
TransactionInfo.json | ||
transaction-Info.json | ||
etc/ | ||
|
||
# don't commit package-lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.