diff --git a/package.json b/package.json index 05ba54fde5..6dad04a45a 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "build:prod:frontend": "lerna run build:prod:frontend", "build:dev": "npm-run-all build:dev:backend webpack:dev:web build:dev:frontend", "build:dev:backend": "npm-run-all lint clean codegen tsc build:dev:backend:postbuild", - "build:dev:frontend": "lerna run build:dev:frontend --scope=\"@hyperledger/cactus-example-supply-chain-frontend\" && lerna run build:dev:frontend --scope=\"@hyperledger/cactus-example-carbon-accounting-frontend\"", + "build:dev:frontend": "lerna run build:dev:frontend --scope=\"@hyperledger/cactus-example-supply-chain-frontend\" && lerna run build:dev:frontend --scope=\"@hyperledger/cactus-example-carbon-accounting-frontend\"&& lerna run build:dev:frontend --scope=\"packages/cacti-cmd-gui-app\"", "build:dev:common": "lerna exec --stream --scope '*/*common' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'", "build:dev:backend:postbuild": "lerna run build:dev:backend:postbuild", "test:cmd-api-server": "tap --ts --timeout=600 \"packages/cactus-*cmd-api-server/src/test/typescript/{unit,integration}/\"", diff --git a/packages/cacti-cmd-gui-app/README.md b/packages/cacti-cmd-gui-app/README.md new file mode 100644 index 0000000000..8f63795e1e --- /dev/null +++ b/packages/cacti-cmd-gui-app/README.md @@ -0,0 +1,61 @@ +# `@hyperledger/cacti-cmd-gui-app` + +This component allows viewing ledger data in Supabase or other postgreSQL compatible database. The data is fed to supabase by persistence plugins for each ledgers. + +## Summary + +- [`@hyperledger/cacti-cmd-gui-app`](#hyperledgercacti-cmd-gui-app) + - [Summary](#summary) + - [Remarks](#remarks) + - [Getting Started](#getting-started) + - [Prerequisites using yarn](#prerequisites-using-yarn) + - [Alternative Prerequisites using npm](#alternative-prerequisites-using-npm) + - [Usage](#usage) + - [Contributing](#contributing) + - [License](#license) + - [Acknowledgments](#acknowledgments) + +## Remarks + +- Plugin requires running Supabase or other database and persistence plugins in order to properly view ledger data. +- Currently, fabric and ethereum based ledgers are supported. + +## Getting Started + +Clone the git repository on your local machine. Follow these instructions that will get you a copy of the project up and running on your local machine for development and testing purposes. + +### Prerequisites using yarn + +In the root of the project, execute the command to install and build the dependencies. It will also build this GUI front-end component: + +```sh +yarn run build +``` +### Alternative Prerequisites using npm + +In the root of the project, execute the command to install and build the dependencies. It will also build this GUI front-end component: + +```sh +npm install +``` + +### Usage +- Run Supabase instance (see documentation for detailed instructions). For development purposes, you can use our image located in `tools/docker/supabase-all-in-one`. +- Run one or more persistence plugins: + - [Ethereum](../cacti-plugin-persistence-ethereum) + - [Fabric] (../cacti-plugin-persistence-fabric) +- Edit [Supabase configuration file](./src/supabase-client.tsx), set correct supabase API URL and service_role key. +- Execute `yarn run start` or `npm start` in this package directory. +- The running application address: http://localhost:3001/ (can be changed in [Vite configuration](./vite.config.ts)) + +## Contributing + +We welcome contributions to Hyperledger Cacti in many forms, and there’s always plenty to do! + +Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. + +## License + +This distribution is published under the Apache License Version 2.0 found in the [LICENSE](../../LICENSE) file. + +## Acknowledgments \ No newline at end of file diff --git a/packages/cacti-cmd-gui-app/index.html b/packages/cacti-cmd-gui-app/index.html new file mode 100644 index 0000000000..6da7c5535b --- /dev/null +++ b/packages/cacti-cmd-gui-app/index.html @@ -0,0 +1,16 @@ + + +
+ + + + +{props.created_at.toLocaleString()}
+{props.number}
+
+
+ Address: {props.token_address} +
++ Created at: {tokenData()?.created_at} +
++ Total supply: + {tokenData()?.total_supply} +
+{col.display} | + ))} +
---|
handleRowClick(row)}> + {getObjPropVal(col.objProp, row)} + | + ))} +
+ {heading.display} + | ++ {getObjPropVal( + props.cols.schema[idx].objProp, + row, + )} + | +
+ Address: {details().number}{" "} +
++ {" "} + Created at: + {details().created_at} +
++ Hash: + {details().hash} +
++ Number of transaction: + {details().number_of_tx} +
++ Sync at: + {details().sync_at} +
+ ++ Adress: {tokenData()?.address}{" "} +
++ Created at: + {tokenData()?.created_at} +
++ Name: + {tokenData()?.name} +
++ Symbol: + {tokenData()?.symbol} +
+ {params.standard === STANDARDS.erc20 && ( +total_supply : {tokenData()?.total_supply}
+ )} ++ {" "} + Address: + {txnData()?.account_address}{" "} +
++ {" "} + Created_at: + {txnData()?.token_address} +
+ {params.standard === STANDARDS.erc20 && ( ++ {" "} + Balance: + {txnData()?.balance} +
+ )} + {params.standard === STANDARDS.erc721 && ( ++ {" "} + Uri: + {txnData()?.uri} +
+ )} ++ {" "} + Hash: {details().hash}{" "} +
++ Block: + {details().block_number} +
++ From: + {details().from} +
++ To: + {details().to}{" "} +
++ {" "} + Value: {details().eth_value} +
++ ID: {details().id}{" "} +
++ {" "} + Block Number: + {details().block_number} +
++ Hash: + {details().data_hash} +
++ Tx Count: + {details().tx_count} +
++ Created at: + {details().created_at} +
++ {" "} + Previous Blockhash: + {details().prev_blockhash} +
+ ++ {" "} + Channel name: + {details().channel_id} +
+ {/* ++ {" "} + Blk Size: + {details().blksize} +
++ {" "} + Network name: + {details().network_name} +
*/ + } + ++ Created at: + {details().created_at} +
++ Block ID: {details().block_id}{" "} +
++ {" "} + Transaction ID: + {details().transaction_id} +
++ {" "} + Channel name: + {details().channel_id} +
+ ++ {" "} + Status + {details().status} +
+ ++ {" "} + Type + {details().type} +
+ {/* ++ {" "} + Validation Code + {details().validation_code} +
++ {" "} + Network name: + {details().network_name} +
+ */} ++ {" "} + Chaincode Name: + {details().chaincode_name} +
++ {" "} + Creator ID Bytes: + {details().creator_id_bytes} + +
++ {" "} + Creator nonce: + {details().creator_nonce} +
++ {" "} + Creator MSP ID: + {details().creator_msp_id} +
++ {" "} + Endorser MSP ID: + {details().endorser_msp_id} +
++ {" "} + Payload Proposal Hash: + {details().payload_proposal_hash} +
+ +Select ledger from the dropdown menu
+ +