Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabric 1.4.x All In One Docker Image #132

Closed
petermetz opened this issue May 14, 2020 · 2 comments · Fixed by #222
Closed

Fabric 1.4.x All In One Docker Image #132

petermetz opened this issue May 14, 2020 · 2 comments · Fixed by #222
Assignees
Labels
enhancement New feature or request Fabric good-first-issue Good for newcomers
Milestone

Comments

@petermetz
Copy link
Member

petermetz commented May 14, 2020

Description

As a developer I want to have Cactus ship with an all in one Fabric 1.4.x image so that I can write (relatively) lightweight and fully automated test cases where a ledger is brought up from scratch, used for testing and then stopped and cleaned up.

These files are examples of the same thing already done for Quorum and Besu in action (e.g. there are passing tests with contract deployment for them)

Ledger class:
packages/bif-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts

Test case using the Ledger class for test tooling:
packages/bif-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/deploy-contract-from-json.ts

The same classes exist for Besu.

An example of the all in one image for Besu can be seen here:
https://github.com/petermetz/besu-docker-all-in-one
Notice how it uses docker build stages to combine together orion and besu's base images.

One thing that is not yet done in the besu all in one docker image (but sorely needed) is the possibility to inject a custom genesis JSON object through code directly from the tests, meaning that a test could generate it's own list of test account addresses with specific balances to create any kind of scenario.

Acceptance Criteria

  1. docker pull fabric-all-in-one (or similar) works out of the box
    1.1 Avoid using docker volumes and host ports by default to make sure container instantiation is re-entrant e.g. I can blindly start multiple containers with the same image with default options and it doesn't start crashing because of volume/port conflicts.
  2. Have a class FabricV1TestLedger in the test-tooling package that is responsible for managing the all in one docker image (can start, stop, destroy it and allows for customization) similarly as the class linked above (QuorumTestLedger)
  3. Customizable initial state through parameters of the constructor/start method of the FabricV1TestLedger class.
  4. A test case in the *test-tooling package that verifies the image and the FabricV1TestLedger in action for deploying a hello world sort of contract. Very similar to this here: packages/bif-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/deploy-contract-from-json.ts

FYI: I'm working on REST API endpoints that expose contract compilation as a feature. Starting with solidity but would be nice to have go as well for chaincode.

cc: @sownak @jonathan-m-hamilton

@petermetz petermetz added enhancement New feature or request Fabric good-first-issue Good for newcomers labels May 14, 2020
@sownak
Copy link
Contributor

sownak commented May 26, 2020

Working on this.

@petermetz
Copy link
Member Author

Broke this one into two as requested, second part here: #252

petermetz pushed a commit to sownak/cacti that referenced this issue Aug 15, 2020
Fix hyperledger#132

Signed-off-by: Roy,Sownak <sownak.roy@accenture.com>
petermetz pushed a commit to petermetz/cacti that referenced this issue Aug 15, 2020
Fix hyperledger#132

Signed-off-by: Roy,Sownak <sownak.roy@accenture.com>
petermetz pushed a commit to petermetz/cacti that referenced this issue Aug 15, 2020
Fix hyperledger#132

Signed-off-by: Roy,Sownak <sownak.roy@accenture.com>
petermetz pushed a commit to petermetz/cacti that referenced this issue Aug 15, 2020
Fix hyperledger#132

Signed-off-by: Roy,Sownak <sownak.roy@accenture.com>
petermetz pushed a commit to petermetz/cacti that referenced this issue Aug 15, 2020
Fix hyperledger#132

Signed-off-by: Roy,Sownak <sownak.roy@accenture.com>
petermetz pushed a commit that referenced this issue Aug 18, 2020
Fix #132

Signed-off-by: Roy,Sownak <sownak.roy@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Fabric good-first-issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants