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

add local test scripts #113

Merged
merged 99 commits into from
Jul 24, 2024
Merged

add local test scripts #113

merged 99 commits into from
Jul 24, 2024

Conversation

paul-ahn-wm
Copy link

@paul-ahn-wm paul-ahn-wm commented Jul 3, 2024

Simple Wemix node launching script in a local environment with docker.

Usage:

// with local files
./local-docker-env/local-docker.sh -a <account_num>  -v <ubuntu_version>(optional)


// with remote repository files
./local-docker-env/local-docker-git.sh -a <account_num> -b <branch> -r <repo> -v <ubuntu_version>(optional)

@paul-ahn-wm paul-ahn-wm self-assigned this Jul 3, 2024
@paul-ahn-wm paul-ahn-wm added the enhancement New feature or request label Jul 3, 2024
Copy link
Collaborator

@egonspace egonspace left a comment

Choose a reason for hiding this comment

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

LGTM

@kai-yu-wm
Copy link

kai-yu-wm commented Jul 4, 2024

How to do it with just a script.
Sample :

(cat <<EOF
services:
ubuntu:
image: ubuntu:22.04
hostname: ubuntu
tty: true
container_name: ubuntu
EOF
) | docker compose -f /dev/stdin up -d

@jed-wemade
Copy link

jed-wemade commented Jul 4, 2024

Local Dockerfiles use two canonical images: golang:1.19 and ubuntu:latest.
Currently, golang:1.19 based on debian image uses glibc 2.36 and ubuntu:latest uses glibc 2.39.
Using different glibc library may occurs wrong symbol linking so I suggest specifiying ubuntu version too.
Note that supported ubuntu versions wemix doc stated are 22.04 LTS, 20.04.4 and 18.04.6 LTS. (22.04 LTS is used in Dockerfile.wemix)

@paul-ahn-wm
Copy link
Author

paul-ahn-wm commented Jul 4, 2024

@kai-yu-wm

How to do it with just a script. Sample :

(cat <<EOF
services:
ubuntu:
image: ubuntu:22.04
hostname: ubuntu
tty: true
container_name: ubuntu
EOF
) | docker compose -f /dev/stdin up -d

Initially, I implemented codes like your suggestion to print the output, but I removed it because it made reviewing the terminal log difficult.

@paul-ahn-wm
Copy link
Author

paul-ahn-wm commented Jul 5, 2024

@jed-wemade

Local Dockerfiles use two canonical images: golang:1.19 and ubuntu:latest. Currently, golang:1.19 based on debian image uses glibc 2.36 and ubuntu:latest uses glibc 2.39. Using different glibc library may occurs wrong symbol linking so I suggest specifiying ubuntu version too. Note that supported ubuntu versions wemix doc stated are 22.04 LTS, 20.04.4 and 18.04.6 LTS. (22.04 LTS is used in Dockerfile.wemix)

I initially implemented the local test script with the Ubuntu version intentionally set to the latest, as it was developed for testing purposes. However, after considering your suggestion, I thought it would be better to make the Ubuntu version optional. Therefore, I have modified the script to incorporate this improvement.

@paul-ahn-wm paul-ahn-wm merged commit ff492c7 into dev Jul 24, 2024
4 checks passed
@paul-ahn-wm paul-ahn-wm deleted the feat/local-test branch July 24, 2024 01:03
jennwiederholen added a commit that referenced this pull request Sep 12, 2024
* Add release ci (#102)

* Create release.yml

* fix: typo

* fix: remove sha

* fix: specify ubuntu version in ci files

* fix: setup packages in ci files to match dependency

* fix: integrate file name rule to keep consistency between ci files

* fix: use gwemix version instead of ref name

* feat: update snapshot pending state

* Migrate governance-contracts (#89)

* migrate : governance-contract

* panic: core.GenerateChain

* fix: test panic

* fix : FakeMode, escape futureBlock

* fix : panic bad block

* refact : mv wemix_backends -> wemix package

* refact : remove common/bn

* refact : GovContracts

* fix : remove unused

* fix : rename confusing variable

* fix : unhandled error

* fix : code style

* refact: migrate openzeppelin contract:v4.6.0, contracts-upgrade:v4.7.0

* feat : update governancedeploy use wemix/bind

* fix : remove unused

* fix : default init envstorage values

* fix : gwemix.sh

* fix : compare fixed bytes

* fix : compare fixed bytes

* fix : typo

* fix : Flag type

* feat : update genesisConfig

* fix : remove unused code

* fix : deploy log

* feat : wemix simulated OptionFn

* feat : install solc

* fix : typo

* fix : typo

* fix : error verifyBlockSig

* fix : remove unused file

* fix : gwemix.sh

* fix: go.mod

* refact : using bind structs

* docs : gwemix.sh comment

* refact : submodule openzeppelin

* feat : using NCPExit

* wip : dev-ci

* fix : unuse generic

* fix : TestWemixBackends$

* feat : using generic, remove lint_test go@1.17

* fix: go:generate

* fix : clean code

* fix : remove comment

* fix : clean code

* feat : (governance abigen) compare data before writing to the file

* refact : using compiledTy

* feat : include sigs wemix/bind contracts

* refacet : move compiled, remove simulated-backend

* fix : clean code

* fix : clean code

* fix : detailed tick processing

* feat : [init-gov] add option password

* fix : gwemix.sh init-gov params

* fix : [init-gov] add option password

* refact : use const

* fix : use constant

* fix : loadGenesisConfig

* fix : check bootnodeExists

---------

Co-authored-by: egonspace <egonspace@gmail.com>

* fix : call staker address (#114)

fix : get contracts address StakingReward domain

* Feat: add local test scripts (#113)

* migrate : governance-contract

* panic: core.GenerateChain

* fix: test panic

* fix : FakeMode, escape futureBlock

* fix : panic bad block

* refact : mv wemix_backends -> wemix package

* refact : remove common/bn

* refact : GovContracts

* fix : remove unused

* fix : rename confusing variable

* fix : unhandled error

* fix : code style

* refact: migrate openzeppelin contract:v4.6.0, contracts-upgrade:v4.7.0

* feat : update governancedeploy use wemix/bind

* fix : remove unused

* fix : default init envstorage values

* fix : gwemix.sh

* fix : compare fixed bytes

* fix : compare fixed bytes

* fix : typo

* fix : Flag type

* feat : update genesisConfig

* fix : remove unused code

* fix : deploy log

* feat : wemix simulated OptionFn

* feat : install solc

* fix : typo

* fix : typo

* fix : error verifyBlockSig

* fix : remove unused file

* fix : gwemix.sh

* fix: go.mod

* refact : using bind structs

* docs : gwemix.sh comment

* refact : submodule openzeppelin

* feat : using NCPExit

* wip : dev-ci

* fix : unuse generic

* fix : TestWemixBackends$

* feat : using generic, remove lint_test go@1.17

* fix: go:generate

* fix : clean code

* fix : remove comment

* fix : clean code

* feat : (governance abigen) compare data before writing to the file

* refact : using compiledTy

* feat : include sigs wemix/bind contracts

* refacet : move compiled, remove simulated-backend

* fix : clean code

* fix : clean code

* fix : detailed tick processing

* Feat: add local test scripts

* Fix: minor fix

* feat : [init-gov] add option password

* fix : gwemix.sh init-gov params

* Chore: typo fix

* fix : [init-gov] add option password

* Fix: fix set-nodekey.sh

* Chore: push for test

* refact : use const

* Feat: add init-boot.sh

* Fix: minor fix

* chore: minor typo

* chore: add waiting message for port to open in init-boot.sh

* Chore: minor test

* chore: improve waiting message for port to open in init-boot.sh

* feat: add executable permission to gwemix.sh in init-boot.sh

* chore: improve gwemix start confirmation in init-boot.sh

* chore: update log file path and success message in init-boot.sh

* chore: Update init-boot.sh to improve gwemix start confirmation

* chore: Add pcscd service to Dockerfile.local.boot and start it in init-boot.sh

* chore: Update init-boot.sh to start gwemix service and improve start confirmation

* chore: Update Dockerfile and gen-docker-compose.sh for wemix node configuration

* chore: Refactor key generation and configuration scripts

* chore: Clean up unnecessary files and improve entrypoint in Dockerfile.local.boot and Dockerfile.local.node

* chore: Update init-boot.sh to start gwemix service and improve start confirmation

* chore: Update init-boot.sh to improve gwemix start confirmation

* chore: Update Makefile and Dockerfile.local.boot to include init-node.sh in build process

* chore: Update init-node.sh to check if the boot node has started before executing commands

* chore: Update init-node.sh to include datadir for wemix

* chore: Improve gwemix start confirmation and add etcd initialization

* chore: Update init-boot.sh to use console command for etcd initialization

* chore: Add curl and netcat-traditional to Dockerfile

* chore: Refactor local-docker-env scripts for key generation and configuration

* chore: Update Makefile-local-env to include wemix configuration files in build process

* Feat: Refactor local-docker-env scripts for key generation and configuration

* Chore: revert makefile

* chore: Update local-docker-env scripts for key generation and configuration

* chore: Update Dockerfile to include missing command for updating CA certificates

* chore: change local test readme to english

* chore: Refactor local-docker-env scripts for key generation and configuration

* chore: Update Dockerfile to use specified Ubuntu version in the Docker image

---------

Co-authored-by: felix-shin-wt <znzno700@wemade.com>
Co-authored-by: egonspace <egonspace@gmail.com>
Co-authored-by: felix-shin-wt <65204854+felix-shin-wt@users.noreply.github.com>

* add .prettierrc [solidity formatter] (#115)

* feat : add prettierrc

* fix : remove unuseful comment

* [add proposal type] governance general purpose (#116)

* feat : add execute

* fix : upgrade issue

* test : execute

* feat : append gap

* fix : gap size

* fix : [execute fail] return value

* fix : typo

* fix : typo

* feat : test code

* feat : gov abigen

* fix: update rocksdb to v6.28.2 (#120)

fix: update rocksdb v6.27.3 -> v6.28.2

* fix : remove memsize (#122)

* Feat: remove mem-size to support go1.23

* Fix: remove memsize from mobile/geth

* feat: add eth 68 protocol (#117)

* fix: eth 68 protocol

* fix: test failure

* fix: test failure

* fix: protocol name for eth68

* fix: support eth protocol name

* fix: lint error

* fix: use  protocol name when handshaking

* fix: protocol name

* fix: protocol match bug

* fix: not load NCPExit contract

* fix: apply comment

* Feat: version patch to 9 (#126)

:Feat: version patch to 9

---------

Co-authored-by: jed-wemade <127728629+jed-wemade@users.noreply.github.com>
Co-authored-by: egonspace <egon@wemade.com>
Co-authored-by: felix-shin-wt <65204854+felix-shin-wt@users.noreply.github.com>
Co-authored-by: egonspace <egonspace@gmail.com>
Co-authored-by: paul ahn <paulahn2022@wemade.com>
Co-authored-by: felix-shin-wt <znzno700@wemade.com>
This was referenced Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants