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

Integrate chain simulator into xSuite #94

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7e21487
Add xsuite chain simulator package and integrate it into xSuite.
raress96 Feb 12, 2024
8a6f53e
Add temp project to test xsuite chain simulator integration.
raress96 Feb 12, 2024
78256ec
Rename chain simulator package.
raress96 Feb 13, 2024
062f63b
Start working on xSuite chain simulator tests.
raress96 Feb 13, 2024
1bc7607
Update chain simulator and fix majority of tests.
raress96 Feb 29, 2024
3dcaae7
Fix all tests for chain simulator.
raress96 Feb 29, 2024
03e5ece
Add github action for xsuite chain simulator.
raress96 Feb 29, 2024
5d7050b
Add example for async call promise with gas.
raress96 Feb 29, 2024
b5bc917
Update chain simulator to working version.
raress96 Mar 1, 2024
bdcec40
Merge branch 'dev' into chain-simulator
raress96 Mar 1, 2024
bd3e696
FIx tests.
raress96 Mar 1, 2024
c3b99e1
Implement sendTx for world and hatom concurrency test.
raress96 Mar 7, 2024
c6d49f9
Add hatom gas consumption test.
raress96 Mar 7, 2024
a4d3620
Save hatom mainnet state to file.
raress96 Mar 28, 2024
feff100
Update chain simulator binary and add test for getInitialWallets.
raress96 Mar 8, 2024
a5cd50c
Updates for new chain simulator version.
raress96 Mar 21, 2024
282a911
Introduce type tests
lcswillems Mar 9, 2024
7bc134b
Improve encoding and decoding
lcswillems Mar 9, 2024
523fb43
Release xsuite@0.0.51
lcswillems Mar 9, 2024
bac5f1a
Partially fix Hatom tests after chain simulator update.
raress96 Mar 28, 2024
ba74250
Merge branch 'dev' into chain-simulator
raress96 Mar 28, 2024
82a3bca
Merge branch 'dev' into chain-simulator
raress96 Apr 15, 2024
b279014
Update chain simulator, remove temp project and some code review fixes.
raress96 Apr 15, 2024
9aa7072
Refactor chain simulator process handling.
raress96 Apr 15, 2024
ba5ae85
Refactoring for chainsimulator to csproxy and add new endpoint.
raress96 Apr 15, 2024
98379a6
Fix lint.
raress96 Apr 15, 2024
6990e65
Try and fix pipeline.
raress96 Apr 15, 2024
3754a0a
Small code review fixes for chain simulator.
raress96 Apr 18, 2024
5c98c8e
Update chain simulator to v1.7.5 and fixes for integrating with it.
raress96 Apr 18, 2024
e6d1769
Fixed chain simulator setting incorrect state.
raress96 Apr 19, 2024
c9817c3
Temporary re-add hatom tests.
raress96 Apr 19, 2024
3361ae4
Small fixes.
raress96 Apr 22, 2024
bef136b
Update chain simulator, add get account endpoints with shard.
raress96 Apr 26, 2024
027952d
Update chain simulator again and code review fixes.
raress96 Apr 26, 2024
0d00c39
Merge branch 'dev' into chain-simulator
raress96 Apr 26, 2024
bc41d9f
Lint fixes.
raress96 Apr 26, 2024
b901ad2
Add tests spec
lcswillems May 5, 2024
99cc1d9
Rename folder
lcswillems May 5, 2024
eb33ff0
Rename tests
lcswillems May 5, 2024
b2e678d
Improvements to temp tests
lcswillems May 5, 2024
eabecbb
Improve chain simulator build command and small fixes.
raress96 May 9, 2024
8c31342
Fix hatom test.
raress96 May 9, 2024
e5dde64
Update node and pnpm version in pipeline.
raress96 May 9, 2024
87c47fa
Merge remote-tracking branch 'origin/dev' into chain-simulator
lcswillems May 11, 2024
b15f8c0
Merge branch 'dev' into chain-simulator
lcswillems May 15, 2024
e1500c0
A lot of changes but not finished and WIP
lcswillems May 19, 2024
26adf03
Bringing back changes in dev branch
lcswillems May 19, 2024
a897511
Bring improvements from dev branch
lcswillems May 19, 2024
32bf5ba
Continue to bring back improvements from dev
lcswillems May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
- name: Build xsuite-simulnet
run: pnpm build-xsuite-simulnet

- name: Build xsuite-chainsimulator
run: pnpm build-xsuite-chainsimulator

- name: Build xsuite
run: pnpm build-xsuite

Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/release-xsuite-chainsimulator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Release xsuite-chainsimulator

on:
workflow_dispatch:

jobs:
build:
strategy:
matrix:
os: [macos-12, ubuntu-20.04]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js & pnpm
uses: ./.github/actions/node-pnpm
with:
node-version: 18
pnpm-version: 8

- name: Use Golang
uses: actions/setup-go@v4
with:
go-version: 1.20
cache-dependency-path: xsuite-chainsimulator/mx-chain-simulator-go/go.sum

- name: Build xsuite-chainsimulator
run: pnpm build-xsuite-chainsimulator

- name: Upload package
uses: actions/upload-artifact@v3
with:
name: package
path: xsuite-chainsimulator/bin

test:
needs: build

strategy:
matrix:
os: [macos-12, ubuntu-20.04]
include:
- os: ubuntu-20.04
binary: csproxy-linux-amd64
- os: macos-12
binary: csproxy-darwin-amd64

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download package
uses: actions/download-artifact@v3
with:
name: package
path: xsuite-chainsimulator/bin

- name: Add execute permissions
run: chmod +x xsuite-chainsimulator/bin/csproxy-*

- name: Test
run: |
./xsuite-chainsimulator/bin/${{ matrix.binary }} --config xsuite-chainsimulator/config/config.toml --node-override-config xsuite-chainsimulator/config/nodeOverride.toml --node-configs xsuite-chainsimulator/config/node/config --proxy-configs xsuite-chainsimulator/config/proxy/config &
SERVER_PID=$!
sleep 2
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Chainsimulator succeeded to start."
kill $SERVER_PID
wait $SERVER_PID || [ $? -eq 143 ]
else
echo "Chainsimulator failed to start."
exit 1
fi

publish:
needs: test

runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download package
uses: actions/download-artifact@v3
with:
name: package
path: xsuite-chainsimulator/bin

- name: Add execute permissions
run: chmod +x xsuite-chainsimulator/bin/csproxy-*

- name: Use Node.js & pnpm
uses: ./.github/actions/node-pnpm
with:
node-version: 18
node-registry-url: "https://registry.npmjs.org"
pnpm-version: 8
skip-install: true

- name: Publish xsuite-chainsimulator to NPM
run: git config core.fileMode false && cd xsuite-chainsimulator && pnpm publish --publish-branch dev --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"scripts": {
"lint": "eslint .",
"build-xsuite-chainsimulator": "cd xsuite-chainsimulator && pnpm build",
"build-xsuite-simulnet": "cd xsuite-simulnet && pnpm build",
"build-xsuite": "cd xsuite && pnpm build",
"test-xsuite": "cd xsuite && pnpm test",
Expand Down
57 changes: 30 additions & 27 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ packages:
- "docs"
- "xsuite"
- "xsuite-simulnet"
- "xsuite-chainsimulator"
- "contracts/*"
- "xsuite-chain-simulator-temp"
lcswillems marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions xsuite-chain-simulator-temp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/

**/output/*
**/target/*
Loading
Loading