Skip to content

Commit

Permalink
Release 0.1.0 (#79)
Browse files Browse the repository at this point in the history
* fix uuid

* Update clients and tests to get token from the server

* keylist endpoint

* Add tor connection to the rust client

* Add tor connection to the nodeJS client

* Add token command to standalone rust client

* add tor proxy

* fix config

* Fix clients/standalone-rust/Settings.toml

* Add first version of REact client

* Add wallet.db to gitignore

* Remove wallet.db

* Add conf file and Tor support to react client

* Organize better the REact client

* Centralize the Electrum client management, you simplifying the process of connecting to and disconnecting from the Electrum server

* Add broadcast backup function

* Add withdrawal function

* Add transfer-send function

* Add transfer-receive function

* Added automatic coin update function, but is not being used because asynchronous calls are not currently supported

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* Changing React application structure to handle concurrency

* add token server

* fixes

* Remove thunks

* Improve backup transactions database and view

* Improve GUI

* Fix some warnings

* Fix some warnings

* Improve update function

* Improve GUI

* Remove DB transaction to avoid race condition

* config

* config

* add token server

* Update tokens.md

* Update Token struct

* Add WASM packages

* Improve UI

* Change react-app config file

* chore: add changes to get locofy-ui working

* chore: add key to wizard

* chore: add deposit process ui

* chore: add token ui logic

* chore: huge locofy ai changes, remove old code as wasn't scalable, learned new locofy formats

* chore: fix up icons

* chore: hook token info card and deposit page

* chore: update token card UI

* chore: add more validation to deposit process, and modal windows

* chore: update deposit pages

* add expiry time

* fix

* fix

* chore: finish the tab ui logic

* chore: add changes to deposit, hook up live methods to the deposit process, add loading spinners and validation

* add key check

* fix serialisation

* chore: add token insertion into wallet object, various other changes, wasm error in deposit 2

* chore: fix wallet load code

* chore: add back in validation for wizard page 2, cleanup the main header panel ui

* chore: refactor, add a logged in wallet hook, add validation to wallet page 1

* chore: show seed key in wizard states

* chore: fix error if coins / activities is null

* Modify Token struct

* chore: fix error message ordering in wizard page

* chore: move order of destructure variable in main page

* chore: fix coin item, display some info to user about their statecoin

* chore: add changes to main header panel, add up btc values

* chore: fix deposit addresses

* chore: change to testnet server, add withdraw ui components

* chore: fix more withdrawal logic, fix  bug in deposit 3 page

* chore: do not show withdrawn coins

* chore: add send page and logic

* chore: fix receive page

* chore: fix activities table

* chore: fix some navigation errors and settings page errors

* Add Settings property to wallet

* chore: add password encrypted db wallets, add error message handling for it, remove certain coins from UI

* chore: add backup from file/load into db

* chore: add changes to main load wallet

* chore: get latest password

* chore: change settings page

* chore: remove manage transactions from settings page as will be in modal

* chore: add settings ui hooked with redux state and notifications

* chore: add the reloading of wallets within load wallet page

* chore: remove debugging, add check on wizard for encrypted wallets instead of live wallets

* chore: fix loading from backup file to include backup tx

* chore: add more responsive main bar page, and add modal ui

* chore: fix coin modal and help page

* chore: remove amount

* chore: downgrade sql

* chore: enable debug mode

* chore: replace icon of app

* chore: huge fix for resources in wallet

* chore: add build

* chore: add dev branch

* chore: fix clearnet config issues, start a build

* chore: change actions

* chore: remove mainnet

* chore: remove mainnet

* chore: change github actions

* chore: change app icon

* chore: change app icon

* chore: remove unused files

* version: update to 0.1.1

* DB file path

* Update atomic_transfer.md

* Update atomic_transfer.md

typo

* Update atomic_transfer.md

Fixed typo

* Update atomic_transfer.md

* Update protocol.md

* Update transfer_sender_sequence.md

* Update transfer_receiver_sequence.md

* Update transfer_sender_sequence.md

* Update transfer_receiver_sequence.md

* Update protocol.md

* Add ChaCha20-Poly1305 encryption scheme

This commit adds ChaCha20-Poly1305 algorithm to be used
to encrypt any enclave data instead of using the SGX built-in
functions.
This way, the data can be decrypted on another machine as long
the same encryption key be used.
SGX functions are still used to seal and unseal the encryption key.

* Add password to add-mnemonic call

* Add Dockerfiles to SGX SIM mode

* Add docker files to the server

* Update protocol.md

* Update README.md

* Update deposit_sequence.md

* Update transfer_sender_sequence.md

* Update transfer_receiver_sequence.md

* Add docker files to the enclave - HW mode

* Remove r2 and blind commitments

* Change HRP to 'ml' and 'tml'

* Add address validation and remove standalone rust client

* Update WASM and rename lib

* Update atomic_transfer.md

* Update atomic_transfer.md

* Add UniFFI

* Re-add nodejs client

* Add kotlin client

* Use TransferReceiverPostResponsePayload

* Add Atomic transfer

* Use statechain_info to verify transfers

* Add automatic seed generation and replication

* Update react-app package.json

* Increase the maximum amount of time to spend waiting for a connection to 30s

* Allow coin to be withdrawn if in IN_TRANSFER status

* Fix minor errors regarding IN_TRANSFER status

* Update Kotlin client

* fix: server config with env for mercury & token server

* feat: add docker build for github actions

* feat: add dev branch to yaml

* fix: token server port

* fix: expose port in dockerfile for token-server

* fix: move Rocket.toml from sub folder to parent folder

* fix: add tls feature to sqlx

* fix: route for endpoint /info

* feat: add explorer

* feat: add keylist cronjob

* fix: version for docker images in ci/cd

* fix: add dev2 branch to ci/cd

* fix: import error with token server

* fix: mercury server start cmd

* fix: start cmd for mercury server

* debug: mercury server dockerfile

* fix: config for mercury and token server

* fix: mercury server dockerfile

* fix: dockerfile for mercury server

* Fix the mainnet address conversion

* Add address reuse functionality

* Create rust client lib

* Create nodejs client lib

* Update ECIES package and restructure project folders

* Add a new test file that uses the nodejs lib

* Fix docker error preventing Mercury server from starting

* Move signature validation from rust client lib to Mercury lib

* Refactor `clients/libs/rust/src/transfer_receiver.rs`. No change in behavior

* Use `validateSignatureScheme` in `clients/libs/nodejs/transfer_receive.js`

* Use `validateSignatureScheme` in `clients/apps/kotlin/TransferReceive.kt`

* Add web client lib

* Add `max_fee_rate` setting to rust lib

* Add `max_fee_rate` setting to nodejs lib

* Create client_guide.md

* Add `max_fee_rate` setting to web lib

* Update client_guide.md

* Update client_guide.md

* Update client_guide.md

* Add `max_fee_rate` setting to Kotlin client

* Add multiple enclave support

* Remove outdated react-app

* Handle fee rate < 0 in broadcast command

* Feat/fee unit

* Add integration tests on regtest mode
-------
Co-authored-by: DhananjayPurohit <[email protected]>

* Add Lightning Latch atomic transfer

* Improve transfer message verification

* Add basic Rust integration tests

* Add `batchtimeout` to `/info/config`

* fix: directory for Rocket.toml

* feat: add tests for coin expiry

* fix: add test for transfer-sender that make coin expired by sending

* fix: assertion for broadcast tx

* fix: add dev3 for integration tests

* Add TB02 - Transfer Address Reuse

* Add TM01 - Sender Double Spends

* chore: remove dev3 branch from integration tests

* Add TA01 - 'signSecond not called' and return the pubnonce if the challenge is null

* Refactor transfer-receive to make it non-blocking

* Refactor transfer-receive in nodeJS library to make it non-blocking

* Adjust tests to the new transferReceive function

* Add web lib tests

* Fix minor error in nodeJS transfer-receive

* Add lightning latch functions to the nodeJS client

* Add Rust lightning latch test

* Add nodeJs lightning latch test

* Feat/tests for atomic swap (#72)

---------

Co-authored-by: S. Santos <[email protected]>

* Add lightning latch functions to web client

* Improve nodeJS API parameters

* Change fee rate to f64 instead of u64

* fix: ci build on main branch only (#78)

* Handle multiple deposit transactions

* Add multiple deposit support to the nodeJS client

* Update test_basic_workflow2 to support duplicated deposits

* Update web client to support multiple deposits

* Automate web client testing

* Add Vitest to web client tests

---------

Co-authored-by: Thomas Trevethan <[email protected]>
Co-authored-by: S. Santos <[email protected]>
Co-authored-by: rk16449 <[email protected]>
Co-authored-by: rk16449 <[email protected]>
Co-authored-by: Nicholas Gregory <[email protected]>
Co-authored-by: DhananjayPurohit <[email protected]>
Co-authored-by: S. Santos <[email protected]>
  • Loading branch information
8 people authored Aug 2, 2024
1 parent 861bee0 commit 1386b8b
Show file tree
Hide file tree
Showing 550 changed files with 208,537 additions and 211 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: ci

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: commerceblockx
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Get last commit hash
id: get_commit_hash
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
-
name: Build and push for mercury-server
uses: docker/build-push-action@v5
with:
context: .
file: ./server/Dockerfile
push: true
tags: commerceblockx/mercury-server:${{ env.COMMIT_HASH }}
-
name: Build and push for token-server
uses: docker/build-push-action@v5
with:
context: .
file: ./token-server/Dockerfile
push: true
tags: commerceblockx/token-server:${{ env.COMMIT_HASH }}
-
name: Build and push for mercury-explorer
uses: docker/build-push-action@v5
with:
context: .
file: ./explorer/Dockerfile
push: true
tags: commerceblockx/mercury-explorer:${{ env.COMMIT_HASH }}
-
name: Build and push for keylist-cronjob
uses: docker/build-push-action@v5
with:
context: .
file: ./keylistCron/Dockerfile
push: true
tags: commerceblockx/keylist-cronjob:${{ env.COMMIT_HASH }}
112 changes: 112 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Integration Tests

on:
push:
branches:
- dev
pull_request:
branches:
- dev

jobs:
test:
runs-on: ubuntu-latest

services:
docker:
image: docker:19.03.12
options: --privileged
ports:
- 5432:5432
- 18443:18443
- 50002:50002
- 50001:50001
- 8000:8000
- 18080:18080
volumes:
- /var/run/docker.sock:/var/run/docker.sock

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Compose
run: |
docker-compose -f docker-compose-test.yml up --build -d
- name: Wait for services to be ready
run: |
sleep 80 # Adjust time as necessary for services to initialize
- name: Verify Bitcoin daemon Service with Curl
run: |
container_id=$(docker ps -qf "name=mercurylayer_bitcoind_1")
echo "Container ID: $container_id"
docker logs $container_id
wallet_name="new_wallet"
docker exec $container_id bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet $wallet_name
address=$(docker exec $container_id bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass getnewaddress $wallet_name)
echo "New Wallet Address: $address"
docker exec $container_id bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass generatetoaddress 101 "$address"
docker exec $container_id bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass sendtoaddress bcrt1pcngfxjdkf4r2h26k52dh5nunxg8m68uf4lkfhmfjvjj6agfkm5jqmftw4e 0.0001
- name: Verify ElectrumX Service with Curl
run: |
container_id=$(docker ps -qf "name=mercurylayer_electrs_1")
echo "Container ID: $container_id"
docker logs $container_id
- name: Verify Enclave Service with Curl
run: |
container_id=$(docker ps -qf "name=mercurylayer_enclave-sgx_1")
echo "Container ID: $container_id"
docker logs $container_id
- name: Verify Mercury Service with Curl
run: |
container_id=$(docker ps -qf "name=mercurylayer_mercury_1")
echo "Container ID: $container_id"
docker logs $container_id
docker exec $container_id \
curl http://0.0.0.0:8000/info/config
- name: Get Public Key
run: |
docker exec $(docker ps -qf "name=enclave") \
curl -X POST http://0.0.0.0:18080/get_public_key \
-H "Content-Type: application/json" \
-d '{"statechain_id":"550e8400e29b41d4a716446655440000"}'
docker logs $(docker ps -qf "name=enclave")
- name: Check connectivity between containers
run: |
# Get container IDs
enclave_container=$(docker ps -qf "name=mercurylayer_enclave-sgx_1")
mercury_container=$(docker ps -qf "name=mercurylayer_mercury_1")
# Check if mercurylayer_mercury_1 can reach mercurylayer_enclave-sgx_1
docker exec $mercury_container curl -v http://mercurylayer_enclave-sgx_1:18080/get_public_key \
-H "Content-Type: application/json" \
-d '{"statechain_id":"550e8400e29b41d4a716446655440000"}'
# Alternatively, using IP address if service name resolution fails
enclave_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $enclave_container)
docker exec $mercury_container curl -v http://$enclave_ip:18080/get_public_key \
-H "Content-Type: application/json" \
-d '{"statechain_id":"550e8400e29b41d4a716446655440000"}'
docker inspect mercurylayer_mercury_1
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20.12.2'

- name: Install Node.js dependencies for client
run: |
cd clients/apps/nodejs
npm install
- name: Install Node.js dependencies for lib
run: |
cd clients/libs/nodejs
npm install
- name: Run Client-Side Tests
run: |
cd clients/apps/nodejs
node test_basic_workflow2.js
node test_atomic_swap.js
- name: Tear Down
run: |
docker-compose -f docker-compose-test.yml down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target
.vscode
/server/.env
/token-server/.env
Loading

0 comments on commit 1386b8b

Please sign in to comment.