Skip to content

Commit

Permalink
Merge pull request #530 from multiversx/main
Browse files Browse the repository at this point in the history
Main in feat/next
  • Loading branch information
andreibancioiu authored Nov 12, 2024
2 parents 90b0f7d + 9de1d6a commit 670a1b0
Show file tree
Hide file tree
Showing 175 changed files with 24,666 additions and 897 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ jobs:
- run: npm run lint
- run: npm run compile
- run: npm install esmify && npm run compile-browser
- run: npm test
- run: npm run tests-unit
- run: npm run tests-devnet
65 changes: 65 additions & 0 deletions .github/workflows/test-localnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: MultiversX Integration Tests

on:
push:
branches:
- main
pull_request:

jobs:
integration_tests:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Python environment
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'

# Step 3: Install pipx (to manage Python tools)
- name: Install pipx
run: |
python3 -m pip install --user pipx
python3 -m pipx ensurepath
# Add the pipx binary location to PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash

# Step 4: Install mxpy (MultiversX Python SDK)
- name: Install mxpy (MultiversX SDK)
run: |
pipx install multiversx-sdk-cli --force
# Step 5: Set up MultiversX localnet using mxpy
- name: Set up MultiversX localnet
run: |
# Start the local testnet with mxpy
mkdir -p ~/localnet && cd ~/localnet
mxpy localnet setup --configfile=${GITHUB_WORKSPACE}/localnet.toml
nohup mxpy localnet start --configfile=${GITHUB_WORKSPACE}/localnet.toml > localnet.log 2>&1 & echo $! > localnet.pid
sleep 120 # Allow time for the testnet to fully start
# Step 6: Install Node.js and dependencies
- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Install Node.js dependencies
run: npm install

# Step 7: Run integration tests
- name: Run integration tests
run: |
npm run tests-localnet
# Step 8: Stop the testnet using the stored PID
- name: Stop MultiversX local testnet
if: success() || failure()
run: |
kill $(cat localnet.pid) || echo "Testnet already stopped"
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
src/testdata/**
src/testutils/**
localnet.toml
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"prettier.printWidth": 120
}
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,33 @@ Feel free to skip this section if you are not a contributor.

```
npm install --global browserify
npm install esmify
npm install esmify --no-save
```

## Optional Dependencies

### axios

This package can make HTTP requests using `axios`, which is not bundled by default. If you plan to use the API network provider or Proxy network provider, make sure to install `axios`:

```bash
npm install axios
```

### @multiversx/sdk-bls-wasm

This package requires `@multiversx/sdk-bls-wasm` for BLS (Boneh-Lynn-Shacham) cryptographic functions, which is not bundled by default. If you plan to use BLS functionality, make sure to install this optional dependency:

```bash
npm install @multiversx/sdk-bls-wasm
```

### bip39

This package provides mnemonic and seed generation functionality using `bip39`, but it is not bundled by default. If you plan to use mnemonic-related features, make sure to install this optional dependency:

```bash
npm install bip39
```

### Building the library
Expand Down
2 changes: 1 addition & 1 deletion browser-tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="/node_modules/mocha/mocha.js"></script>

<script>mocha.setup('bdd')</script>
Expand Down
41 changes: 41 additions & 0 deletions localnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[general]
log_level = "*:DEBUG"
genesis_delay_seconds = 10
rounds_per_epoch = 50
round_duration_milliseconds = 6000

[metashard]
consensus_size = 1
num_observers = 0
num_validators = 1

[shards]
num_shards = 3
consensus_size = 1
num_observers_per_shard = 0
num_validators_per_shard = 1

[networking]
host = "127.0.0.1"
port_seednode = 9999
port_seednode_rest_api = 10000
p2p_id_seednode = "16Uiu2HAkx4QqgXXDdHdUWbLu5kxhd3Uo2hqB2FfCxmxH5Sd7bZFk"
port_proxy = 7950
port_first_observer = 21100
port_first_observer_rest_api = 10100
port_first_validator = 21500
port_first_validator_rest_api = 10200

[software.mx_chain_go]
resolution = "remote"
archive_url = "https://github.com/multiversx/mx-chain-go/archive/refs/heads/master.zip"
archive_download_folder = "~/multiversx-sdk/localnet_software_remote/downloaded/mx-chain-go"
archive_extraction_folder = "~/multiversx-sdk/localnet_software_remote/extracted/mx-chain-go"
local_path = "~/multiversx-sdk/localnet_software_local/mx-chain-go"

[software.mx_chain_proxy_go]
resolution = "remote"
archive_url = "https://github.com/multiversx/mx-chain-proxy-go/archive/refs/heads/master.zip"
archive_download_folder = "~/multiversx-sdk/localnet_software_remote/downloaded/mx-chain-proxy-go"
archive_extraction_folder = "~/multiversx-sdk/localnet_software_remote/extracted/mx-chain-proxy-go"
local_path = "~/multiversx-sdk/localnet_software_local/mx-chain-proxy-go"
Loading

0 comments on commit 670a1b0

Please sign in to comment.