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

Terra localnet #405

Closed

Conversation

expertdicer
Copy link
Collaborator

@expertdicer expertdicer commented Jan 14, 2024

Summary of changes

Localrelayer is a local testing environment composed of three LocalTerra instances connected by a relayer. Localrelayer comes preconfigured with opinionated, sensible defaults for a standard testing environment.

Presequite

Ensure you have docker and docker-compose installed:

# Docker
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt install docker.io -y

# Docker compose
sudo apt install docker-compose -y

Deploy

Build a local docker image with current changes

make build

Start the testing environment:

make start

If you don't want the logs, you can start in detached mode with the following command:

make startd

Check that everything is running:

docker ps

Expected output:

❯ docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED              STATUS         PORTS                                                                                   NAMES
318c89d3015f   informalsystems/hermes:1.1.0   "/home/hermes/setup.…"   About a minute ago   Up 2 seconds   0.0.0.0:3000->3000/tcp                                                                  localrelayer-hermes-1
d90ec29c7a6f   local:terra                  "/terra/setup.sh"      About a minute ago   Up 3 seconds   26656/tcp, 0.0.0.0:41317->1317/tcp, 0.0.0.0:49090->9090/tcp, 0.0.0.0:46657->26657/tcp   localrelayer-localterra-c-1
d90ec29c7a6f   local:terra                  "/terra/setup.sh"      About a minute ago   Up 3 seconds   26656/tcp, 0.0.0.0:31317->1317/tcp, 0.0.0.0:39090->9090/tcp, 0.0.0.0:36657->26657/tcp   localrelayer-localterra-b-1
e36cead49a07   local:terra                  "/terra/setup.sh"      About a minute ago   Up 3 seconds   0.0.0.0:1317->1317/tcp, 0.0.0.0:9090->9090/tcp, 0.0.0.0:26657->26657/tcp, 26656/tcp     localrelayer-localterra-a-1

Testing

Run IBC-Hooks test:

sh ./tests/ibc-hooks/test_hooks.sh

Run Packet Forward Middleware test:

sh ./tests/ibc-hooks/test_pfm.sh

Report of required housekeeping

  • Github issue OR spec proposal link
  • Wrote tests
  • Updated API documentation (client/lcd/swagger-ui/swagger.yaml)
  • Added a relevant changelog entry: clog add [section] [stanza] [message]

(FOR ADMIN) Before merging

  • Added appropriate labels to PR
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)
  • Confirm added tests are consistent with the intended behavior of changes
  • Ensure all tests pass

@nghuyenthevinh2000
Copy link
Contributor

can we break down this pull request into multiple smaller items, reviewing 4000+ lines of code is not manageable

@expertdicer
Copy link
Collaborator Author

can we break down this pull request into multiple smaller items, reviewing 4000+ lines of code is not manageable

I have reduced to 2000+

@expertdicer expertdicer marked this pull request as ready for review January 15, 2024 07:02
@expertdicer
Copy link
Collaborator Author

1000+ now

@nghuyenthevinh2000
Copy link
Contributor

Thank you for your pull request. Given the current ambivalence within the community regarding PPJ, we will temporarily suspend the reviewing process until a well-defined plan for PPJ, which includes the reviewing process and delineates the shares of responsibility, is approved through governance.

done

install_prerequisites () {
wget -qO /usr/local/bin/dasel https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64
Copy link
Collaborator

Choose a reason for hiding this comment

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

You might want to check if the download actually succeeded.

CONFIG_FOLDER=$TERRA_HOME/config

install_prerequisites () {
wget -qO /usr/local/bin/dasel https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64
Copy link
Collaborator

Choose a reason for hiding this comment

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

You might want to check if the download actually succeeded

count=$(chainA query wasm contract-state smart "$CONTRACT_ADDRESS" "$QUERY" -o json | jq -r '.data')

echo "funds: $funds, count: $count"
echo "denom: $denom, old balance: $balance, new balance: $new_balance"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although this is only a bash script, I would suggest to add the expected values, too.

new_balance=$(chainC query bank balances "$RECEIVER" -o json | jq -r '.balances[0].amount')
# export ADDR_IN_CHAIN_A=$(chainC q ibchooks wasm-sender channel-0 "$VALIDATOR")

echo "denom: $denom, old balance: $balance, new balance: $new_balance"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although this is only a bash script, I would suggest to add the expected values, too.

@nghuyenthevinh2000 nghuyenthevinh2000 mentioned this pull request Feb 4, 2024
@classic-terra classic-terra deleted a comment from StrathCole May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants