Commit Graph

22 Commits

Author SHA1 Message Date
Dmitry Holodov
2143df291b makefile targets for release binaries (#454) 2023-05-03 13:26:51 -05:00
Dmitry Holodov
df97eebcae feat: dockerized bootnode (#405)
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2023-04-23 14:01:08 -04:00
noot
ea8bae1416 feat: add dockerfile (#387)
Co-authored-by: Dmitry Holodov <dimalinux@protonmail.com>
2023-04-21 15:37:10 -05:00
Dmitry Holodov
c5dacd1b59 fixes mock generation and attempts to fix TestDaemon_PersistOffers (#303)
* fixes mock generation
* ensures mock generation is working in CI for future PRs
* attempts to fix TestDaemon_PersistOffers failures deleting its temporary data directory
* updates some library dependencies
2023-02-09 07:53:14 -06:00
Dmitry Holodov
cae623b0ad cache monero download (#296) 2023-02-01 21:06:26 -05:00
noot
6cdffdbebf add go-dleq; remove all rust dependencies (#242) 2022-11-28 19:31:41 -05:00
Dmitry Holodov
ec89cd684a misc fixes (#232)
* Relayer now runs as a dedicated binary in integration tests
* Binaries are now in `bin/` folder
* Removed warnings in our github actions
* Libp2p libs updated
* Signal handling improvements
* xmrmaker instance locking fix added
2022-11-18 16:47:16 -06:00
noot
7e44d6e7b9 add FakeDLEq; add pure go + darwin build commands (#225) 2022-11-14 16:14:10 -05:00
Dmitry Holodov
ec325f2cf7 add linting and formatting support for solidity (#217)
* Added new `format-solidity` and `lint-solidity` Makefile targets
* Updated documentation on how to install the new tools dependencies
* Formatted the solidity code, updated expected byte code and deployed stagenet contract
* Updated go.mod to go 1.19
* Updated Github actions for go 1.19 and we now use all formatters/linters in the actions checks
2022-11-01 23:01:59 -05:00
Dmitry Holodov
6fcd1b8e26 match folders to exec names (#189) 2022-09-12 20:27:56 -04:00
Dmitry Holodov
476bc69b82 CLI cleanups (#185)
* Switches to current v2 version of urfave CLI
* Fixes incorrect port values in the help
* Provides defaults directly to urfave for clear `--help` messaging
* `--base-path` flag renamed to `--data-dir`. This matches `monerod`'s' `--data-dir` and almost matches the `geth` flag `--datadir`
* Bootnodes and contract address are provided for stagenet testing
* Bootnodes can be provided individually by repeating the `--bootnodes`/`--bn` flag, or as a comma separated block (original behavior), or even a combination of both. (Makes adding/removing bootnodes a lot easier.)
* More precise error messaging when XMR maker/taker values are off
* Fixes bug in the peer finder where XMR was hardcoded as the provides coin
* `cleanup-test-processes.sh` displays which processes are being killed
2022-09-07 19:45:01 -05:00
Dmitry Holodov
007162b929 New bash library, and well as bash linting and formatting (#170)
* Allows unit and integration tests to share the same bash code via a utility library named testlib.sh.
* Linting and formatting of bash scripts was added to the Makefile targets lint and format.
* Updated the docker image and Go used by git actions
2022-08-25 13:24:13 -05:00
Dmitry Holodov
49a4ff12f3 Full API Monero RPC client (#154)
Switches from our partial Monero RPC client implementation to a full-API client to help with testing, reliability, debugging and future features. Other changes:
* GenerateBlocks written for better results when called by multiple parties simultaneously
* monero.Client interface renamed to monero.WalletClient to be orthogonal with monero.DaemonClient interface
* monero.NewClient(...) renamed to monero.NewWalletClient(...) to be orthogonal with monero.NewDaemonClient(...)
* monero.CreateMoneroWallet(...) simplified to monero.CreateWallet(...) (package prefix already states wallet type)
* monero/clent.go, monero/daemon.go renamed to monero/wallet_client.go, monero/daemon_client.go
* monero/rpc.go removed with code consolidated into monero/wallet_client.go and monero/daemon_client.go
2022-08-18 23:58:14 -05:00
Dmitry Holodov
36bfb03831 Update go ethereum (#149)
* Updated go-ethereum dep to 1.10.21
* Code now installs/uses an abigen that automatically matches the version of our go-ethereum in the go.mod
* solc was updated to 0.8.16 (in the docs, we don't install it, but anyone wanting to generate identical output needs it).
* Minimum go version is now 1.18
* golangci-lint updated to v1.48.0 (was needed to play nicely with go 1.18 and the new generated code)
* dleq/cgo-dleq submodule updated to latest version
2022-08-11 13:52:47 -05:00
Dmitry Holodov
b729588dd5 update to current version of ganache (#138)
Updates the repo to install the latest version of ganache (ganache-cli is obsolete). 

One of the things that changed in the newer version of Ganache, is gas fee estimation uses the timestamp from the last mined block instead of the local computer's current timestamp. This mirrors what Geth does, so the Ganache change is helpful, but it caused a few problems that this PR fixes.

If we want to do dynamic fee estimation for a transaction that can not happen before time T0 or T1, we need to wait until there is one mined block after T0 or T1 to create our transaction. Otherwise the transaction will be reverted during fee estimation, returning an error when creating the transaction, and we'll never send the transaction out to the network.

Ganache, by default, only mines blocks when you create a transaction. In order to have a mined block after T0 or T1 to calculate transaction fees, we stopped using instamine, and now mine a block every second. This PR chose the minimum block interval for speedier tests.

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2022-08-06 22:30:45 -05:00
noot
1d0482a7fc update dleq library (#142) 2022-08-01 21:54:32 -04:00
Dmitry Holodov
adfb0fa602 Test cleanup (#135)
* version independent monerod path with localhost-only binding

* fixed lint target and install script

* created 3rd ETH key constant to avoid race condition in tests

* updated run-integration-tests.sh with the same changes made to run-unit-tests.sh

* new design for paritioning out 2 unique keys to test packages

* restored accidentally deleted tests/alice.key

* removed websocket connection leaks from tests

* made file paths unique between tests with better file cleanup

* fix for the websocket connection leak commit

* reverted increase of GenerateBlocks (didn't mean to commit that)

* fixed maker/taker key that I had reversed

* fixed incorrect zero-balance check

* fixed comment on ClaimOrRefund

* added back sample script for installing go in /usr/local/go

* etchclient creation cleanup using t.Cleanup()

* minor cleanup to ganache_test_keys code

* initial dynamic monero-wallet-rpc implementation for tests

* converted monero tests to use dynamic monero-wallet-rpc services

* unit tests all using dynamic monero-wallet-rpc services

* fixed 2 tests that failed after moving to dynamic monero-wallet-rpc services

* fixed low balance issues in TestSwapState_NotifyClaimed

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2022-06-29 13:36:03 -04:00
noot
cca0b6c771 allow for multiple ongoing swaps (#128) 2022-06-13 20:50:10 -04:00
noot
5384d707a5 add joining stagenet and recovery module documentation (#117) 2022-05-24 20:37:27 -04:00
noot
39e6cc0bcd integrate DLEq into protocol (#67)
* update contract to use secp256k1 curve verification

* update go contract bindings script and bindings

* cleanup rust code, move to its own folder

* remove commented out stuff

* go fmt

* add go wrapper around farcaster-dleq

* add unit tests for farcaster-dleq wrapper

* add dleq unit test for keys

* add swap.go claim test, worksgit status

* add swap.go refund tests

* lint

* update SendKeysMessage to include DLEqProof, update alice/bob generateKeys

* add dleq proof verification to alice/bob handlers

* move alice and bob to protocol package

* add common protocol funcs for generating/verifying dleq proof

* lint

* update alice to store secp256k1 pubkey commitments in contract, update alice/bob to use dleq secret when calling contract

* update alice unit tests

* fix bob unit tests

* update network msg size

* add build-dleq makefile step

* cleanup

* attempt to fix test

* skip inconsistent test on CI
2022-01-15 13:41:27 -05:00
noot
d9bd457465 ci: split integration tests and unit tests (#57)
* split integration tests and unit tests

* add script
2021-12-06 21:40:27 -05:00
noot
e72f7648e6 update ci to run on master, fix unit-tests job (#13) 2021-10-29 10:43:55 -04:00