Git Product home page Git Product logo

blockchain-explorer's Introduction

Hyperledger Labs

Hyperledger Labs provides a space (i.e., GitHub repos) where work can easily be started without the creation of a project. Please refer to the Hyperledger Labs wiki page for additional information.

Process to propose a new lab

  1. Fork the hyperledger-labs.github.io repository.

  2. Fill out the Proposal Template and save it into the labs subdirectory under the name of your lab, such as labs/mynewlab.md. It is expected that your lab repository will have the same name so keep that in mind.

  3. In the Proposal Template, there is an entry for sponsor(s). Although not required, proposers are encouraged to seek a sponsor who can help them create ties with the rest of the Hyperledger community and ensure that the proposal is cogent and novel (in conception, proposed execution, or interested community).

    To find sponsors:

    1. use your connections to existing projects and ask maintainers,
    2. find working groups or projects with affinities to the proposed lab and pitch the project (good to have the template already filled out) in associated channels and/or mailing lists. The WG chairs emails, the maintainers contacts etc can be found on the wiki or github. Make personal appeals if you can. Every repository contains a MAINTAINERS file that lists the current maintainers with their contact information and you can reach them all by posting to the Maintainers list.
  4. Commit your changes with proper sign-off. This means that your commit log message must contain a line that looks like the following one, with your actual name and email address:

     Signed-off-by: John Doe <[email protected]>
    

    Adding the -s flag to your git commit command will add that line automatically. You can also add it manually as part of your commit log message or add it afterwards with git commit --amend -s.

  5. Submit a Pull Request.

The labs stewards will then review your proposal. Like sponsors, stewards do not have a responsibility beyond this; ongoing work like contributing code or reviews is not tied to their role as stewards. In reviewing the proposal, the stewards make sure that the proposal is cogent and novel (in conception, proposed execution, or interested community).

IMPORTANT: It is up to the proposer to ensure that any comments or requested changes by the lab stewards are addressed. Failure to do so may delay the approval of your proposal.

Bringing in an existing repository

By default the Lab stewards will create a new repository for you to start from but if you have an existing github repo you would like to bring to your proposed lab you have the option to request for that repo to be reused instead. This is however only possible if every commit in your existing repo is signed-off so there is no DCO related issues. If that is not the case, you have two options:

  1. bring your code by squashing all of your commits into a single first commit made against your new lab repo with your sign-off.

  2. amend the commit history to include DCO sign-off for each of the commits. The Hyperledger Indy community has documented steps to fix DCO on previous commits. Also, the Fix DCO Guide from src-d contains some different steps you can take.

IMPORTANT: Regardless of which option you use, please be sure that the past committers to your project agree to the DCO.

Archiving

Stewards are responsible for curating the set of labs, archiving (see below) those that become dormant or unresponsive for an extended period (3+ months), or are explicitly deemed by the committers to be deprecated/obsoleted.

Deprecated, obsoleted, or dormant labs (as defined above) will be marked as "archived" in GitHub; that signifies that the lab is no longer maintained. Archived labs are read-only, and they can be moved back out of the archives, if there is interest in reviving them.

License requirement

All Hyperledger software must be made available under an Apache 2.0 license. This applies to Labs. Please, make sure to license all incoming code and new code accordingly, and ensure that all commits are made with proper sign-off so that no DCO related issue is introduced.

Code of Conduct

All Hyperledger community members must adhere to the Code of Conduct.

blockchain-explorer's People

Contributors

5pecia1 avatar aanugu avatar adamk1230 avatar adityajoshi12 avatar anilspecial avatar archanaarige avatar arigelas avatar deekshithvarma256 avatar dependabot[bot] avatar fnst-zhangxin avatar gcc2ge avatar jeevasang avatar jkopczyn avatar jojialex2 avatar ktalluri123 avatar mekiae avatar nekia avatar nfrunza avatar psandela avatar psaradhi avatar robertfeng1980 avatar ryjones avatar saksham1203 avatar skclusive avatar srinivas640 avatar thomasralee avatar udhayakumari avatar umaparam avatar vineeth2328 avatar xspeedcruiser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockchain-explorer's Issues

Frontend - Footer

What would you like to be added?

I would like to add a footer with more height. It will have an additional element logo and link.

Screenshot from 2023-05-13 16-16-36

Why is this needed?

The footer looks outdated and too small in comparison to the rest of the page. It would be beneficial to update it to make it more visually appealing.

Screenshot from 2023-05-13 15-17-00

Explorer docker image build failed

What happened?

In existing Dockerfile found issue with node-prune package

image

What did you expect to happen?

Expected the explorer docker image should be build. because of above issue not able to build it.

How can we reproduce it (as minimally and precisely as possible)?

Run ./build_docker_image.sh

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Deploying hyperledger explorer on kubernetes

What would you like to be added?

Deploying hyperledger explorer on Kubernetes

Why is this needed?

So far explorer was set up in a docker-based environment. it's a highly recommended/required feature for porting/deploying explorer on Kubernetes

Fetch data by block number, block range and transaction id

What would you like to be added?

This functionality enables the explorer to retrieve data using block id, block range (for example, blocks 1 to 10), and transaction data by giving the transaction id .Using these inputs, matching data are pulled in accordance with the user's search selection. First it will check whether the data is available in the PostgreSQL, if it is there it will fetch from there, otherwise it will fetch from blockchain.

Why is this needed?

With this new feature, data is fetched from the blockchain if it is not available in PostgreSQL using the block number, block number range, or transaction id.

Add CODEOWNERS file with list of maintainers GitHub IDs

Any PR that is raised against the repository should be notified to the maintainers. Either add list of all maintainer IDs or add the team's tag to the CODEOWNERS file. The CODEOWNERS can also be a curated to include UI vs backend only code committers.

mac M2 start.sh: applet not found npm ERR! code ELIFECYCLE npm ERR! syscall spawn 2 npm ERR! file sh npm ERR! errno ENOENT

What happened?

Facing issue after docker-compose -up -d explorer unable to start
2023-04-15 23:17:55 > [email protected] app-start /opt/explorer
2023-04-15 23:17:55 > ./start.sh
2023-04-15 23:17:55
2023-04-15 23:17:56 start.sh: applet not found
2023-04-15 23:17:56 npm ERR! code ELIFECYCLE
2023-04-15 23:17:56 npm ERR! syscall spawn
2023-04-15 23:17:56 npm ERR! file sh
2023-04-15 23:17:56 npm ERR! errno ENOENT
2023-04-15 23:17:56 npm ERR! [email protected] app-start: ./start.sh
2023-04-15 23:17:56 npm ERR! spawn ENOENT
2023-04-15 23:17:56 npm ERR!
2023-04-15 23:17:56 npm ERR! Failed at the [email protected] app-start script.
2023-04-15 23:17:56 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-04-15 23:17:56
2023-04-15 23:17:56 npm ERR! A complete log of this run can be found in:
2023-04-15 23:17:56 npm ERR! /root/.npm/_logs/2023-04-15T19_17_56_018Z-debug.log

Log File:
info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'app-start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preapp-start', 'app-start', 'postapp-start' ]
5 info lifecycle [email protected]preapp-start: [email protected]
6 info lifecycle [email protected]
app-start: [email protected]
7 verbose lifecycle [email protected]app-start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
app-start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/explorer/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle [email protected]app-start: CWD: /opt/explorer
10 silly lifecycle [email protected]
app-start: Args: [ '-c', './start.sh' ]
11 info lifecycle [email protected]~app-start: Failed to exec app-start script
12 verbose stack Error: [email protected] app-start: ./start.sh
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack

What did you expect to happen?

it working fine on ubuntu , can you please help is this error due to Mac m2?

How can we reproduce it (as minimally and precisely as possible)?

run hyperledger explorer on mac m2 machine using first option deplotment

Anything else we need to know?

No response

OS version

On mac os M2 Machine:

info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'app-start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preapp-start', 'app-start', 'postapp-start' ]
5 info lifecycle [email protected]preapp-start: [email protected]
6 info lifecycle [email protected]
app-start: [email protected]
7 verbose lifecycle [email protected]app-start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
app-start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/explorer/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle [email protected]app-start: CWD: /opt/explorer
10 silly lifecycle [email protected]
app-start: Args: [ '-c', './start.sh' ]
11 info lifecycle [email protected]~app-start: Failed to exec app-start script
12 verbose stack Error: [email protected] app-start: ./start.sh
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack

Frontend - Register Form

What would you like to be added?

We would like to improve the form's user interface by adding icons to each field. This will help users quickly identify the purpose of each field and provide a better user experience.

Screenshot from 2023-05-15 23-35-30

Why is this needed?

Currently, the register form looks plain. We need to improve its design and user interface to make it more appealing and user-friendly. Specifically, need to add icons to the form to make it easier for users to identify the purpose of each field.

Screenshot from 2023-05-15 22-00-26

Frontend - Search data by block number (or) transaction id

What would you like to be added?

The feature facilitates user to search data using a block number/transaction id. The Search field is provided in the dashboard screen. A modal with the appropriate data will be displayed in response to user input.

Why is this needed?

It provisions user for a quick data search pertaining to specific block or transaction.

TLS to PostGres Sequalize function error

What happened?

The fix provided through #30
is incomplete. The Sequelize function requires enabling TLS.

In the file https://github.com/hyperledger-labs/blockchain-explorer/blob/main/app/persistence/postgreSQL/PgService.ts

Please change the code for the below:
getUserModel(attributes, options) { const sequelize = new Sequelize(postgres://${this.pgconfig.user}:${this.pgconfig.password}@${this.pgconfig.host}:${this.pgconfig.port}/${this.pgconfig.database}, { logging: false } );

to

`const isPostgresSslEnabled = process.env.DATABASE_SSL_ENABLED || false;
if (isPostgresSslEnabled) {

const sequelize = new Sequelize(
postgres://${this.pgconfig.user}:${this.pgconfig.password}@${this.pgconfig.host}:${this.pgconfig.port}/${this.pgconfig.database},
{ logging: false, dialectOptions: { ssl: true, }, }
);
}else{

const sequelize = new Sequelize(
postgres://${this.pgconfig.user}:${this.pgconfig.password}@${this.pgconfig.host}:${this.pgconfig.port}/${this.pgconfig.database},
{ logging: false }
);
}`

What did you expect to happen?

TLS connection should work to PostGreSQL

How can we reproduce it (as minimally and precisely as possible)?

the current as is code will not work - will get a SequelizeConnectionError

Anything else we need to know?

I have tested with the above changes to code and it worked for me

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

FrontEnd- Display chaincode metadata

What would you like to be added?

The addition of a new feature in the Chaincodes tab that opens a dialogue model to show the details related to particular Chaincode. The new feature provides quick and easy access to important information related to the Chaincode.

Why is this needed?

With the new feature being added to the application, user can now have more visibility into the smart contracts they are using. One such feature is the ability to view the structure of the contract and its associated metadata information.

Argument of type 'unknown' is not assignable to parameter of type 'string'.

app/platform/fabric/FabricClient.ts
Error at line # 60 (highligted in bold)

try {
// Use Gateway to connect to fabric network
this.fabricGateway = new FabricGateway(this.config);
await this.fabricGateway.initialize();
} catch (error) {
// TODO in case of the failure, should terminate explorer?
logger.error(error);
throw new ExplorerError(error);
}

After the exploreris started, it is automatically closed

Thank you for your project!

The following command is used to start the test network
network.sh up createChannel -ca -c mychannel -s couchdb
but
After the exploreris started, it is automatically closed

image

Here is the container log(explorer.mynetwork.com)
image

I tried and I found:
When I started the test network, I found some files didn't match
image

image

Even though I changed the configuration file to the following, it still didn't work
image

Purging old records from explorer database

What would you like to be added?

Now explorer database is saving each transaction that is committed on to the ledger making replica copies of ledger. When number of transactions increases there is a chance of outage of postgres database. In order to address this we would keep only the recent data in database and provide a query back mechanism to read back from the blockchain for any of the purged data.

Implementation

  • Based on BLOCKCOUNT
  • Based on TIME

We can set the purgeMode attribute in config.json file and according to the purge mode, it enables purging from database.
If it is based on blockcount (mention the number of blocks as blockCount value in config.json) ,it will retain those many blocks in the database and the rest of the records would be purged.
If it is based on time (mention the number of days as daysToPurge value in config.json) then it will keep those many days of records in the database according to the daystoPurge provided in the config file.
If the purgeMode attribute is set to "NONE", then purging won't happen and it will retain the complete data as of ledger.

All the audit records of deletion is saved to explorer_audit_table which is further used for the sync process.

Why is this needed?

Explorer creates duplicate copy of complete ledger data in postgres which can be of larger number and can lead to database storage outage.

Frontend - Dashboard UI responsiveness

What would you like to be added?

This feature will make Dashboard page more accessible on different screen sizes.

Why is this needed?

The current dashboard data in cards overlap or do not show information on various screen sizes.
image

Also the pie chart is not visible on smaller screen sizes

image

Test Cases Failing (4)

What happened?

I have tried running the test-cases of which 4 are failing.
processBlockEvent
1) should return without error
✓ should throw an error if it has already been in process
✓ should raise new channel notification if genesis has not already been stored yet
2) should raise update channel notification if config block is processed
3) should be done without any errors when config block doesn't have any payload in last updated data
4) should be done without any errors when _lifecycle block is processed

Has anyone faced the same issue while running the testcases? Please help, in fixing these issues.

Testcases

What did you expect to happen?

Expected all the test cases would pass.

How can we reproduce it (as minimally and precisely as possible)?

Need to run the test- cases as per the ReadMe.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Frontend - Pagination implementation for Blocks Tab

What would you like to be added?

This feature integrates the Api calls to render server-side pagination for list of blocks to be fetched.

Why is this needed?

As of now the pagination is being handled from UI. Implementing pagination from backend addresses an issue when dealing with retrieval of huge data sets.

Add validations to blockId and blockRange search functionality

What would you like to be added?

In context to the Issue#334, this is to add some more validations to the search functionality blockId and blockRange.

BlockRangeSearch:
caseI: As we are purging the data based on block count (or) duration, sometimes the user may require to view the data that is not available as part of Posgres database. The requested data will be fetched directly from ledger if available.
caseII: A user can do a quick block range search by entering the start and endblock values.

Also introducted "blockRangeLimit" key in config.json where an user can configure the value.
Say for example, if blockRangeLimit is configured to value 10, then user can view the total blocks of 10.

config

If user tries to input the blocks which exceeds the blockRangeLimit configured value then it throws an error.

blockRangeMaxLimit

GUI view of blockRangeSearch:

blockRange_1

One more important point also to note here is to set the blockRangeLimit value to minimum, so that it won't impact the performance.

Why is this needed?

By adding validations, the code can handle the issues arising due to incorrect channelgenesishash etc. A backend configurable "blockRangeLimit" value can harness the user, with more flexibility of setting the blockRange value.

Backend - Block Pagination Query Fix

What happened?

Block Pagination does not fetch the correct data when querying with the Orgs.

What did you expect to happen?

Block Pagination needs to fetch the correct data when querying with or without the Orgs.

How can we reproduce it (as minimally and precisely as possible)?

Steps to reproduce:

  1. Add some transactions
  2. Go to the Blocks tab and observe the added transactions in the list
  3. Select any Orgs from the "Select Orgs" drop down and click on "Search" button
  4. Observe that the list does not show the correct transactions

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

run_e2e_test.sh is failing

What happened?

when we are running run_e2e_test.sh file, its failing

image

What did you expect to happen?

run_e2e_test.sh should provide us end to end API test results, but its not running instead its showing above error.

How can we reproduce it (as minimally and precisely as possible)?

Run run_e2e_test.sh

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Display health status of peers and orderers

What would you like to be added?

This feature enables the explorer to indicate the health status of peers and orderers that are online or offline.

Why is this needed?

As of now the explorer is not showing the status of peers/orderers that are part of HLF-Network. With this new feature enablement, we could display the health status of peers/orderers in the explorer dashboard.

Bug fix for UI

What happened?

While testing the main branch code after merging few of the PRs last week, we noticed that there are a few bugs.
1*. UI not loading( cause: missing Selector variable)
2*. Chaincode api call not working( cause: issue while code merge)
3. Transactions Query shows weird behaviour on selecting different organizations while querying the records.(cause: undesired state change)

What did you expect to happen?

For the bugs mentioned in order,

  1. UI to load properly.
  2. Chaincode view gives the list of chaincodes.
  3. Transactions Query to work just like the blocks Query.

How can we reproduce it (as minimally and precisely as possible)?

For the bugs mentioned in order,

  1. Login from the login screen and notice that the screen does not load.
  2. Go to the chaincode tab to observe that it shows 'No rows'.
  3. Go to the Transactions tab
    a. From Select Orgs dropdown, select Org1, Org2 and hit search. Observe the list.
    b. From Select Orgs dropdown, select Org2 and hit search. Observe that the list shows the Org2 list for a second and goes back to previous result with both Org1 and Org2.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Failed to create wallet, please check the configuration, and valid file paths

I am using docker option while deploying the explorer. I have copied my organization folder and changed test file and also .env file

however when I run docker-compose i get the following (Althoug the certif exists and the path is correct)

explorer.mynetwork.com      | [2023-01-20T09:34:36.655] [INFO] PgService - SSL to Postgresql disabled
explorer.mynetwork.com      | [2023-01-20T09:34:36.660] [INFO] PgService - connecting to Postgresql postgres://hppoc:******@explorerdb.mynetwork.com:5432/fabricexplorer
explorer.mynetwork.com      | [2023-01-20T09:34:36.756] [INFO] Platform -  network_config.id  test-network  network_config.profile  ./connection-profile/test-network.json
explorer.mynetwork.com      | [2023-01-20T09:34:36.886] [INFO] Platform - Already registered : admin
explorer.mynetwork.com      | [2023-01-20T09:34:36.889] [INFO] FabricConfig - config.client.tlsEnable  true
explorer.mynetwork.com      | [2023-01-20T09:34:36.890] [INFO] FabricConfig - FabricConfig, this.config.channels  mychannel
explorer.mynetwork.com      | [2023-01-20T09:34:36.894] [ERROR] FabricGateway - Failed to create wallet, please check the configuration, and valid file paths: {}
explorer.mynetwork.com      | [2023-01-20T09:34:36.895] [ERROR] FabricClient - ExplorerError {
explorer.mynetwork.com      |   name: 'ExplorerError',
explorer.mynetwork.com      |   message: '[\n' +
explorer.mynetwork.com      |     "  'Failed to create wallet, please check the configuration, and valid file paths'\n" +
explorer.mynetwork.com      |     ']'
explorer.mynetwork.com      | }
explorer.mynetwork.com      | [2023-01-20T09:34:36.898] [ERROR] main - <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>
explorer.mynetwork.com      | [2023-01-20T09:34:36.899] [ERROR] main - Error :  [ 'Invalid platform configuration, Please check the log' ]
explorer.mynetwork.com      | [2023-01-20T09:34:38.900] [INFO] main - Received kill signal, shutting down gracefully
explorer.mynetwork.com      | [2023-01-20T09:34:38.904] [INFO] main - Closed out connections

Backend - Block & Transaction Count Updation For Channel And Chaincode Tab w.r.t Purge

What would you like to be added?

This feature helps to update the total Transaction Count And Block Count in The Channels And Chaincode Tabs Respectively based on Purging Of Data .

Why is this needed?

After Purging was implemented the earlier feature of total transaction count and block count in the channels and chaincode tabs wasn't updating correctly so we needed to implement this feature so that the count gets updated correctly.

Can't connect to mychannel after setting everything up

Hello

I have started test network by this tutorial. Then created channel with this command:

sudo ./network up
sudo ./network createChannel
sudo ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

After that I have created explorer folder and used these commands:

sudo wget https://raw.githubusercontent.com/hyperledger/blockchain- explorer/main/examples/net1/config.json
sudo wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/examples/net1/connection-profile/test-network.json -P connection-profile
sudo wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/docker-compose.yaml
sudo cp -r ../fabric-samples/test-network/organizations/ .

The docker-compose.yaml changed into this:

volumes:
  - ./config.json:/opt/explorer/app/platform/fabric/config.json
  - ./connection-profile:/opt/explorer/app/platform/fabric/connection-profile
  - ./organizations:/tmp/crypto
  - walletstore:/opt/explorer/wallet

Then on test-network.json I have changed these fields into these:

"adminPrivateKey": {
   "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk"
  },
 "peers": ["peer0.org1.example.com"],
 "signedCert": {
   "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]"
  }

I launched it by sudo docker-compose up this error:

[2022-04-21T16:32:34.374] [INFO] FabricConfig - FabricConfig, this.config.channels  mychannel
2022-04-21T16:32:34.630Z - error: [DiscoveryService]: send[mychannel] - Channel:mychannel received discovery error:access denied
[2022-04-21T16:32:34.631] [ERROR] FabricClient - Error: DiscoveryService: mychannel error: access denied
at DiscoveryService.send (/opt/explorer/node_modules/fabric-common/lib/DiscoveryService.js:363:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async NetworkImpl._initializeInternalChannel (/opt/explorer/node_modules/fabric-network/lib/network.js:279:13)
at async NetworkImpl._initialize (/opt/explorer/node_modules/fabric-network/lib/network.js:231:9)
at async Gateway.getNetwork (/opt/explorer/node_modules/fabric-network/lib/gateway.js:330:9)

Why this is happening? I did exactrly as it was instructed.

Frontend - Pagination implementation for Transactions Tab

What would you like to be added?

This feature integrates the Api calls to render server-side pagination for list of transactions to be fetched.

Why is this needed?

As of now the pagination is being handled from UI. Implementing pagination from backend addresses an issue when dealing with retrieval of huge data sets.

Backend- Improper updation of Txn Count and Chaincodes list

What happened?

Backend - Issue in updating the Txn count w.r.t mutiple versions of the same chaincode and issue in fetching the chaincodes list w.r.t to other channel.
Considerations:
Tested with Hyperledger Fabric Version 2.2 and 2.4.7
No of Channels -2
channel Name:"mychannelb" In this channel the deployed chaincode name is "basic" and with versions 1 and 2. The other deployed chaincode is "auction" with version 1.
channel name: "channel2" In this channel the deployed chaincode name is "auction" - version 1.

Issue#1: When we invoke a Txn, the Txn count is incrementing by one in all the available versions of the same chaincode.

<style> </style>
CC Name CC version Txn Count Comments
basic 1 8 The Txn Count will be incremented by 1, when a txn is invoked in basic-V2.

The below screenshot shows the txn count increment in "basic-V1" with 9 txn count.
image

Isse#2: Issue in fetching the list of chaincodes when there are multiple channels.
The chaincode installed in channel2 is only "auction" but it is picking even the "basic- V2" chaincode which is installed in channel - mychannelb.
image

What did you expect to happen?

The correct Txn count w.r.t chaincode version.
Fetch the correct list of chanicodes installed with specific to channels.

How can we reproduce it (as minimally and precisely as possible)?

  1. The Hyperledger Fabric network consideration is mentioned in "What happened" section of this issue.
  2. click on the chaincodes tab w.r.t to each channel in the UI.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Chaincode count on Dashboard is incorrect

What happened?

The Chaincode Names with various versions are visible in the UI. In this case the total count of chaincodes seems to be 4.

image

What did you expect to happen?

As per the chaincodes and their versions there are only 2 chaincodes installed on the Fabric Network. So, the count displayed on the Dashboard for CHAINCODES should be 2 and not 4.

image

How can we reproduce it (as minimally and precisely as possible)?

You must install new Chaincode or upgrade any current Chaincode with upgraded version and bring up the Explorer Application.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

UI - Transaction by Orgs Pie chart Css fix

What would you like to be added?

Adjust the CSS for the Dashboard - Transaction by Orgs Pie chart, so we can see the organisation names below, without the names getting cropped.

Why is this needed?

In the Dashboard - Transaction by Orgs Pie chart, we should be able to see the organisation names below, without any crop.
Attached image of the current piechart with the css issue mentioned above:
piechart

Empty org is being displayed while fetching the list of orgs

What happened?

Test the Explorer compatibility with Hyperledger Fabric v2.4.7.
The functionality which fetches the list of orgs, is also fetching an empty org. This is due to the reason that the first transaction of type "config" is not associated with any creator organisation. So, while saving this transaction to the postgres, the field creator_msp_id is blank.

Screenshot 2023-04-03 121353

orgslist2

What did you expect to happen?

Expected only the list of orgs to be fetched.

How can we reproduce it (as minimally and precisely as possible)?

Deploy the Hyperledger Fabric Network with v2.4.7. Bring up the Explorer Application.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Backend - Display Correct Chaincode Metadata Fix

What happened?

Backend- Issue in fetching the details of Chaincode Metadata with respect to multiple channel.

Considerations:
Tested with Hyperledger Fabric Version 2.2 and 2.4.7
Number of Channels - 2
Channel Name: "mychannelb" - In this channel the deployed chaincode name is "basic" and with versions V1 and V2. The other deployed chaincode is "auction" with version V1.
Channel Name: "channel2" - In this channel the deployed chaincode name is "basic" with version V1 and other deployed chaincode is basic2 with Version V1

Issue#1: Chaincode does not fetch the Chaincode Metadata of other Channel
channel2: Chaincode name: basic2
mychannelb: CC name: basic

metadata-issue#1

Issue#2: If the Chaincode name is same in both the channels, the Chaincode Metadata is fetched from the mychannelb
channel2: Chaincode Name: basic
mychannelb: Chaincode Name : basic

Metadata-Issue#2

What did you expect to happen?

The Chaincode Metadata needs to be fetched and displayed for the correct Chaincodes present in the correct Channel that we are in.

How can we reproduce it (as minimally and precisely as possible)?

Steps to reproduce:

  1. Select any one of the Channel
  2. Go to the Chaincodes tab and "Click" any Chaincode under Chaincode Name
  3. Observe the details of the Metadata on the pop-up
  4. Change the Channel name from the Channel drop-down and go to the Chaincodes tab
  5. "Click" on the Chaincode under Chaincode Name that's not present in the first Channel
  6. Observe that the Display of Chaincode Metadata does not provide the Metadata of the Chaincode

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Frontend- Search data by block range

What would you like to be added?

The feature facilitates user to search data using a block range. The Search field is provided in the blocks tab. A modal with the appropriate data will be displayed in response to user input.

Why is this needed?

It provisions user for a quick data search pertaining to specific block range.

Failed to get block 0 from channel mychannel : Error: Invalid chain ID, mychannel

Hi BE-Team,

i have a working HLF Network with a Channel called tnschannel and i can connect with BE to this channel.

But after a while the cmd throws this Error:

 [ERROR] FabricGateway - Failed to get block 0 from channel mychannel :  Error: Invalid chain ID, mychannel
   at SingleQueryHandler.evaluate (/opt/explorer/node_modules/fabric-network/lib/impl/query/singlequeryhandler.js:41:57)
   at processTicksAndRejections (internal/process/task_queues.js:97:5)
   at async Transaction.evaluate (/opt/explorer/node_modules/fabric-network/lib/transaction.js:291:25) {
      status: 500,
      payload: <Buffer >,
      isEndorsed: false
   }
[2022-12-21T10:17:49.753] [ERROR] FabricClient - Failed to get genesis block

How can i customize the channel name and where?

Thanks for any help

Getting error on npm run start

Getting below error on npm run start in blockchain-explorer directory:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] app-start: ./start.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] app-start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/hammad/.npm/_logs/2022-04-26T10_56_32_697Z-debug.log
ERROR: "app-start" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: run-s build app-start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Sigint bad trap and unexpected error on startup

What happened?

On starting the explorer, we are getting the following error in terminal:
./start.sh: 24: Syntax error: "(" unexpected ERROR: "app-start" exited with 2.
On resolving the above issue, the terminal shows:
trap: SIGINT: bad trap Server running...

What did you expect to happen?

Explorer should start without any error.

How can we reproduce it (as minimally and precisely as possible)?

  1. Start the application by running 'npm start' in terminal.
  2. Observe the following error in terminal:
    ./start.sh: 24: Syntax error: "(" unexpected ERROR: "app-start" exited with 2.
  3. Remove 'function' in start.sh file and repeat step 1.
  4. Observe the following in terminal:
    trap: SIGINT: bad trap

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Duplicate PeerStatus api call

What happened?

For the network tab ledger height and the dashboard peer status, the same api is being called. But instead of calling it once, a duplicate api call is being made, making the api being hit two times consecutively. By these consecutive calls, one response gives the correct peer status, while the other response continuously gives the fetching status for the peers.

What did you expect to happen?

For the network tab ledger height and the dashboard peer status, the respective api should be called only once returning the correct peer status as response.

How can we reproduce it (as minimally and precisely as possible)?

  1. Start the explorer.
  2. Observe the dashboard peer status( green/red dots) and the network tab - ledger height.
  3. Open inspect tab in the browser and observe the network tab filtering the 'peer' api. Observe that on every sync, a duplicate api call is being made and the response is incorrect for the same.
  4. Stop one peer and repeat steps 2 & 3.
  5. Stop one orderer and repeat steps 2 & 3.
  6. Restart the peer and orderer. Observe in dashboard that the peer status shows 'fetching' continuously.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Backend - Pagination implementation for the Transactions tab

What would you like to be added?

This feature implements the pagination for list of transactions to be fetched from PostgreSQL.

Why is this needed?

As of now the pagination is being handled from UI. Implementing pagination from backend addresses an issue when dealing with retrieval of huge data sets.

Backend- Display chaincode metadata

What would you like to be added?

A new feature to display the chaincode metadata information in Blockchain Explorer. Explorer will look into the channel and identifies the chaincodes installed on it and enables the feature to view the metadata.

Why is this needed?

Users can see the how the contract is structured and its associated metadata information.

Support for Fabric v2.5 as lastest version

What would you like to be added?

hello devs,

I am now learning to build fabric, and I really wish there could be tested with Fabric v2.5 !!!

Why is this needed?

Learning with Fabric v2.5 !!

Thanks a lot.

moving container images from docker to ghcr registry

What would you like to be added?

I want to have a automated way of pushing the container images to ghcr registry. Right now the images are pushed to docker container image registry.

Why is this needed?

Storing container images to ghcr is the recommendation by TOC.

Ledger Height and Peers Status is not updating w.r.t multiple channels

What happened?

Hyperledger Fabric Network Considerations:
Created two channels:
1.mychannelb
2.channel2
The ledger height and status of the peers is dynamically fetched from the ledger periodically and thus send as response to UI.
The issue over here is the discovery service which we use for fetching the peers ledger height and status wasn't refreshing and updating when we try to switch to other channel.

mychannelb ledger height:

image

channel2 ledgerheight: Here if we observe the ledger height is of "mychannelb"
ledgerheighIssue

What did you expect to happen?

Fetch the updated and correct ledger height / status w.r.t the channels.

How can we reproduce it (as minimally and precisely as possible)?

Should deploy a fabric network having multiple channels.
Switch the channels in UI , observe the status of peers/orderers in dashboard and the ledger height in the network tab.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Frontent - ChannelForm

What would you like to be added?

New input fields for uploading org, channel, network path.

Screenshot from 2023-05-13 02-11-09

Why is this needed?

In current input fields label gets hidden behind th browse button. They look very different from input fields of name, org name.

Screenshot from 2023-05-13 01-00-09

FrontEnd - Display health status of peers and orderers

What would you like to be added?

This feature enables the explorer to indicate the health status of peers and orderers that are online or offline.
The status can be indicated with red being offline, green being online, green with flickering - fetching status.

Why is this needed?

As of now the explorer is not showing the status of peers/orderers that are part of HLF-Network. With this new feature enablement, we could display the health status of peers/orderers in the explorer dashboard.

UI - Display Correct Chaincode Metadata Fix

What happened?

In the Chaincodes tab, if we are not in the first Channel, then "Click" on the Chaincode under Chaincode Name, here it always fetches the details of the metadata from the first Channel only. If the same Chaincode Name is present in the first Channel, then it fetches the details of the Metadata from the first Channel, Or else if the Chaincode Name is not present in the first Channel, it gives undefined in the Chaincode Metadata Display.

What did you expect to happen?

The Chaincode Metadata needs to be fetched and displayed for the correct Chaincodes present in the correct Channel that we are in.

How can we reproduce it (as minimally and precisely as possible)?

Steps to reproduce:

  1. Select any one of the Channel
  2. Go to the Chaincodes tab and "Click" any Chaincode under Chaincode Name
  3. Observe the details of the Metadata on the pop-up
  4. Change the Channel name from the Channel drop-down and go to the Chaincodes tab
  5. "Click" on the Chaincode under Chaincode Name that's not present in the first Channel
  6. Observe that the Display of Chaincode Metadata does not provide the Metadata of the Chaincode

Anything else we need to know?

This issue is related to #405 . Please check it for more detailed info.

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Backend - Pagination implementation for Blocks Tab

What would you like to be added?

This feature implements the pagination for list of blocks to be fetched from PostgreSQL.

Why is this needed?

As of now the pagination is being handled from UI. Implementing pagination from backend addresses an issue when dealing with retrieval of huge data sets.

UI - Transaction Details for the first Config type transaction

What happened?

In the Blocks Tab, On clicking the Transaction hash of the first Config type txn (Block number '0'), a modal opens with a spinning circle instead of the actual Transaction Details. This only happens for the first 'Config' type Transaction where there is no Creator.

ConfigTxnLoading

What did you expect to happen?

In the Blocks Tab, On clicking the Transaction hash of any block, including the Config type txns, a modal opens with that specific Transaction Details.

How can we reproduce it (as minimally and precisely as possible)?

  1. Go to the Blocks Tab
  2. Search for the first Block by giving '0' in From and To fields of the Block No. and click on search icon.
  3. Click on the Transaction hash under the Transaction column.
  4. Observe that a Modal box opens with a loading circle instead of the Transaction Details.

Anything else we need to know?

This issue is observed in fabric 2.4.7. And in UI, it can also be observed from the Transactions Tab and the Dashboard Tab (by querying for the Transaction hash of the first block)

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Boot time and block/transaction loading for Explorer

What would you like to be added?

Load only the blocks and transactions as per the configuration. Currently the configuration defines to archive or delete old data from the database. But at the bootstrap time, the Explorer tries to read every data from block 0. This can be configured to load only the data from certain point in time that is as expected by the Explorer's configuration.

Why is this needed?

This will help in speeding up the bootstrap time of Explorer, the tool and the UI will be ready in shorter period.

Release new container images for Explorer

What would you like to be added?

Release new container images for Explorer into Hyperledger Labs' ghcr.io repository.

Why is this needed?

Use the Explorer as the work on it continues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.