-
Notifications
You must be signed in to change notification settings - Fork 62
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
Enable to run Local network with a consensus node and mirror node #1
Conversation
Signed-off-by: Neeharika-Sompalli <[email protected]>
db: | ||
host: 127.0.0.1 | ||
loadBalance: true | ||
name: mirror_node | ||
owner: ${hedera.mirror.importer.db.username} | ||
ownerPassword: ${hedera.mirror.importer.db.password} | ||
password: mirror_node_pass | ||
port: 5432 | ||
restPassword: mirror_api_pass | ||
restUsername: mirror_api | ||
schema: public | ||
username: mirror_node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section can be removed as it is the application defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. Thanks
.gitignore
Outdated
network-logs/node/*.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should ignore log files generated anywhere.
network-logs/node/logs/*.log | |
network-logs/node/*.log | |
*.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Modified
.idea/hedera-network-e2e.iml
Outdated
@@ -0,0 +1,12 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't check in the .idea folder and add it to gitignore. Especially since this isn't a real project that needs anything more than a simple text editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed .idea folder
docker-compose.yml
Outdated
mem_limit: 512m | ||
memswap_limit: 512m | ||
depends_on: | ||
network-node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't depend upon network-node. Should depend upon importer instead since he creates the schema.
network-node: | |
importer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depend on network-node
is intentionally added to make sure consensus node is started first , before any mirror node components, to resolve some error. Modified to depend on importer
, will re-test multiple times to see if no issues occur.
docker-compose.yml
Outdated
volumes: | ||
- ./compose-network/mirror-node/application.yml:/usr/etc/hedera-mirror-web3/application.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks to be unneeded right now along with SPRING_CONFIG_ADDITIONAL_LOCATION.
volumes: | |
- ./compose-network/mirror-node/application.yml:/usr/etc/hedera-mirror-web3/application.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it ! Was added from mirror-node project. Removed.
docker-compose.yml
Outdated
mem_limit: 512m | ||
memswap_limit: 512m | ||
depends_on: | ||
network-node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
network-node: | |
importer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before modified. But will re-test multiple times
docker-compose.yml
Outdated
mem_limit: 768m | ||
memswap_limit: 768m | ||
depends_on: | ||
network-node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on minio, not node
network-node: | |
minio: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. Modified
docker-compose.yml
Outdated
REST_PASSWORD: mirror_api_pass | ||
ROSETTA_PASSWORD: mirror_rosetta_pass | ||
networks: | ||
- mirror-node-bridge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure your intent for the mirror-node-bridge
network, but right now it encompasses the uploaders, minio and all mirror node components. I think we should separate that more and have a mirror-node
network that contains db
, importer
, grpc
, rest
and web3
. Then importer only could also be on a network that is common with minio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two networks are added since network-node-potgres
and db
to not interfere with each other as both are on same port.
@steven-sheehy Do you mean to add third mirror-node
network for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Neeharika-Sompalli Steven is suggesting adding a third network (eg: uploader-bridge
) that includes minio, the uploaders and the mirror node importer. The mirror node importer would wind up being a member of two networks so it could access the PostgreSQL database.
Therefore, the importer would have a network section that looks something like this:
networks:
- mirror-node-bridge
- uploader-bridge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Nathan said, although disagree upon the naming:
networks:
- mirror-node
- cloud-storage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks @steven-sheehy @nathanklick
@@ -0,0 +1 @@ | |||
{"version":"1","format":"fs","id":"b43d434a-ae8b-4ed4-a7a6-0d80eda86ee8","fs":{"version":"2"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to check in a logs or data folder? This seems like an anti-pattern and makes it easy to check in files we should not that might contain sensitive information. It should just be created by whichever component that needs it and gitignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minio-server/data
folder is added to create hedera-streams
bucket when the server starts. When tried using mb
to create bucket, faced few issues.
Do you think it should not be done this way ?
Agreed, will add this folder to gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should auto-create the bucket, but the network-logs folder doesn't need to be checked in to do this. I think minio will auto create buckets for any folder under /data
. So you just need to modify the entrypoint/command to create the dir if it doesn't exist. There's a number of solutions here. Something like this:
entrypoint: sh
command: -c 'mkdir -p /data/hedera-streams && /usr/bin/minio server /data'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as Steven suggested using the command
command: -c 'mkdir -p /data/hedera-streams && minio server /data --console-address ":9001"'
README.md
Outdated
@@ -1,15 +1,18 @@ | |||
# How to run a a mirror node with a local services code | |||
# How to run a LocalNode with a mirror node and consensus node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# How to run a LocalNode with a mirror node and consensus node | |
# How to run a local node with a mirror node and consensus node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Signed-off-by: Neeharika-Sompalli <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice work!
Closes hashgraph/hedera-services#2893
docker-compose.yml
filecompose-network
folder to have all static files needed to start Local nodenetwork-logs
folder to have all the logs generated from the runThe following tests are run:
REST API
queries for http://localhost:5551/api/v1/accounts?order=desc, http://localhost:5551/api/v1/transactions, http://localhost:5551/api/v1/balances?order=descMINIO UI
shows the recordStreams and accountBalances athttp://localhost:9001/buckets/hedera-streams/
GRPC tested with
grpcurl -plaintext -d '{"file_id": {"fileNum": 102}, "limit": 0}' localhost:5600 com.hedera.mirror.api.proto.NetworkService/getNodes
and streaming live messages when subscribed for topicWeb3 tested with
newman run hedera-mirror-web3/postman.json --env-var baseUrl=http://localhost:8545
and all tests passed