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

feat: Use docker-compose for local transaction replication #1238

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ajnavarro
Copy link
Contributor

@ajnavarro ajnavarro commented Oct 11, 2023

How to run it: docker compose up --build . Still solving some problems, like the bind address is localhost by default, so the gnoland node cannot be accessed from the host. Working on it.

It closes #1204

  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Oct 11, 2023
Dockerfile Outdated
WORKDIR /opt/gno/src/gno.land/
COPY --from=build /opt/build/build/gnoland /opt/gno/bin/
RUN mkdir config
#TODO: RUN echo '[rpc]\nladdr = "tcp://0.0.0.0:26657"' > config/config.toml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having problems with the config file, really difficult to use. I had to go through the code to exactly know the needed filesystem structure. After that, I only got nil pointer exceptions. It looks like we are expecting to have a complete config file instead of patching some of the specified values on top of the ones provided by flags or defaults...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is a suggested method to simplify this using #731.

Meanwhile, I recommend checking out these existing docker-compose examples that demonstrate different ways of working with a config file:

Copy link
Member

@zivkovicmilos zivkovicmilos Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajnavarro
I'll open up a PR for resolving this config file nonsense so we are unblocked

EDIT: #1240

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moul thanks for pointing that out. Everything is working correctly inside the docker containers and all of the containers can reach other containers. The main problem is when you want to access the API from the host. To make that possible we have to change the binding address. I think that is something we hadn't to do in the examples you mentioned.

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (89428c5) 47.84% compared to head (c37c7a2) 47.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1238      +/-   ##
==========================================
- Coverage   47.84%   47.83%   -0.01%     
==========================================
  Files         369      369              
  Lines       62764    62757       -7     
==========================================
- Hits        30028    30019       -9     
- Misses      30308    30310       +2     
  Partials     2428     2428              
Files Coverage Δ
gno.land/cmd/gnoland/start.go 89.95% <ø> (-0.32%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Make everything work porperly adding a toml config gile

Signed-off-by: Antonio Navarro <[email protected]>
@ajnavarro ajnavarro force-pushed the feat/local-feedback-loop branch from c5c8db2 to c37c7a2 Compare October 18, 2023 16:28
@ajnavarro ajnavarro marked this pull request as ready for review October 18, 2023 18:00
@ajnavarro ajnavarro requested a review from a team as a code owner October 18, 2023 18:00
moul pushed a commit that referenced this pull request Nov 12, 2023
## Description

This PR introduces a bash script and simple Makefile to control local
development.
It starts a node instance, along with the appropriate backup / restore
processes.

Parent task: #1131 

Docker equivalent: #1238

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: Guilhem Fanton <[email protected]>
moul pushed a commit to moul/gno that referenced this pull request Nov 14, 2023
## Description

This PR introduces a bash script and simple Makefile to control local
development.
It starts a node instance, along with the appropriate backup / restore
processes.

Parent task: gnolang#1131 

Docker equivalent: gnolang#1238

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: Guilhem Fanton <[email protected]>
misc/docker-compose/default-config.toml Show resolved Hide resolved
misc/docker-compose/docker-compose.yml Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
misc/docker-compose/docker-compose.yml Show resolved Hide resolved
@thehowl
Copy link
Member

thehowl commented Nov 30, 2023

also, since #1240 is merged, might want to update how you get the config (also because I have a hunch that the one you specified may not be the correct location, but I may be wrong)

@ajnavarro
Copy link
Contributor Author

ajnavarro commented Jan 12, 2024

Sorry, I worked on this before the holidays but forgot to update. The full file is still needed, #1240 is not fixing that problem. Not sure if that functionality is still needed tho. Maybe we should close this PR @zivkovicmilos ?

thehowl pushed a commit that referenced this pull request Jan 23, 2024
…1544)

## Description

This PR fixes the flow of loading Gno configuration files. 
Previously, configuration files were loaded without applying default
values, causing to funky behavior.

Additionally, this PR drops the config TOML template, instead relying on
the TOML package itself to marshal.

Issue spotted in #1238 

Note:
I've tried to keep the original functionality of
`LoadOrMakeConfigWithOptions`, because if this is changed or broken up
in its current state, things start breaking across dimensions.

Funky behavior that's fixed:
The `EventStore` fields were not being saved in the original config
(since we utilized a template for it, and this was not present in the
template). Now, config files should properly save on disk the event
store configuration.

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
leohhhn pushed a commit to leohhhn/gno that referenced this pull request Jan 31, 2024
…nolang#1544)

## Description

This PR fixes the flow of loading Gno configuration files. 
Previously, configuration files were loaded without applying default
values, causing to funky behavior.

Additionally, this PR drops the config TOML template, instead relying on
the TOML package itself to marshal.

Issue spotted in gnolang#1238 

Note:
I've tried to keep the original functionality of
`LoadOrMakeConfigWithOptions`, because if this is changed or broken up
in its current state, things start breaking across dimensions.

Funky behavior that's fixed:
The `EventStore` fields were not being saved in the original config
(since we utilized a template for it, and this was not present in the
template). Now, config files should properly save on disk the event
store configuration.

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: 🌟 Wanted for Launch
Status: In Progress
Status: No status
Status: In Review
Development

Successfully merging this pull request may close these issues.

[Portal Loop] Docker support for local dev environment
4 participants