Commit Graph

40 Commits (620ac569f7db4b19c3dc761619e7a4d0ab0841dd)

Author SHA1 Message Date
Daniel Karzel c0070f8fa7
Move files from `protocol` to appropriate module
Some network and application specific code does not belong in the protocol module and was moved.
Eventloop, recovery and the outside behaviour were moved to the respective application module because they are application specific.

The `swap_setup` was moved into the network module because upon change both sides will have to be changed and should thus stay close together.
3 years ago
Thomas Eizinger 8a30ef725c
Refactor transports to construct them specific for each application
Instead of splitting up the transports into capabilities, we compose
them directly for each application. This allows us to remove the
websocket transport for the CLI which is really only needed for the
ASB to allow retrieval of quotes via the browser.
3 years ago
rishflab 8805002f96 Remove redundant noun from tracing initialiser functions 3 years ago
rishflab 9745d150e7 Log at debug level to file
EnvFilter is applied globally. This means you cannot log at INFO level
to the terminal and at DEBUG level to log files. To get a around this
limitation I had to implement the layer trait on a new type and filter
in the on_event() trait method. Each swap has its own log file denoted
by its swap_id. The logger appends to the existing file when resuming a
swap.

Closes #278
3 years ago
Daniel Karzel 0091b6cdaf Remove CLI config file in favour of parameters
The CLI has sensible default values for all parameters,
thus a config file is not really an advantage but just
keeps getting in our way, so re remove it.
3 years ago
Franck Royer 7805a6d684
Move cli specific modules under cli folder
nectar will also have its own folder with a separate config.
3 years ago
Franck Royer 7d392c3086
This files contains `Command` and `Arguments` structs 3 years ago
Franck Royer 311ba74cd6
Remove sell-xmr from CLI 3 years ago
Daniel Karzel c930ad84a4 Add --force flag for cancel and refund 3 years ago
Daniel Karzel ad2aefc2a5 Refund Command 3 years ago
Daniel Karzel 0600a7048e Cancel command 3 years ago
Daniel Karzel 802dc61e7e Configuration for RPC urls and Bitcoin wallet name 3 years ago
Daniel Karzel 44c4b5dcea Remove newlines from import statements to avoid problems
Rust fmt automatically groups the imports (from top to bottom) as `pub use` `use crate` and `use`.
There is no need to introduce sections which cause annoyance when auto importing using the IDE.
3 years ago
bors[bot] ca6ba78862
Merge #123
123: Small fixes after testnet usage r=da-kami a=D4nte



Co-authored-by: Franck Royer <franck@coblox.tech>
3 years ago
Daniel Karzel 0a21040e08 Deterministic peer id from seed for alice
This includes the introduction of the --data-dir parameter instead of the --database.
Both the seed file and the database are stored in the data-dir, the database in sub-folder `database`.
3 years ago
Franck Royer 9d8f8b0a1f
P2p socket should be listening for external connections 3 years ago
rishflab e7c00d742e Re-export bitcoin and monero types 3 years ago
rishflab c900d12593 Merge xmr_btc crate
Created network, storage and protocol modules. Organised
files into the modules where the belong.

xmr_btc crate moved into isolated modulein swap crate.

Remove the xmr_btc module and integrate into swap crate.

Consolidate message related code

Reorganise imports

Remove unused parent Message enum

Remove unused parent State enum

Remove unused dependencies from Cargo.toml
3 years ago
Daniel Karzel 8a2128e93a Correct monero-wallet-rpc parameter name 3 years ago
Franck Royer 1fa812b727
Separate Buy/Sell for resume command
To avoid confusing the user on whether person should enter a listen addr
or a connect peer id and address
3 years ago
Daniel Karzel a692cf9299 Remove all short-codes because they don't add value at the moment 3 years ago
Franck Royer 1a4bd0e2b4
Bob refunds swap after restart that requires communication
As Bob is dialing Alice, we now ensure that we are connected to Alice
at each step that needs communication.
If we are not connected, we proceed with dialing.

In an attempt to improve libp2p usage, we also add known address of
Alice first and only use peer_id to dial.
This ensures that we use the expected peer id.
4 years ago
Daniel Karzel e9681b6e2b Work in review comments 4 years ago
Daniel Karzel 6d03d1bbff Resume command and global database cl-parameter 4 years ago
Franck Royer 5ba830f3bf
Replace swap `recover` terminology with `resume` 4 years ago
Franck Royer 4ce8695dfc
Align with origin/database 4 years ago
Daniel Karzel 03b8e5f52e Upgrade CLI for mainnet test 4 years ago
rishflab fcec465bdb Revert "No need to send Monero transfer proof from Alice to Bob" 4 years ago
rishflab 379aff50cf Fix rebase conflicts 4 years ago
Lucas Soriano del Pino 620216a596 Remove need to send Monero transfer proof from Alice to Bob 4 years ago
Lucas Soriano del Pino bea99185ed Use correct default values for monerod_url*
*`monerod_url` is an incorrect name as it's actually a
`monero_wallet_rpc_url`. This is fixed in another branch.
4 years ago
Lucas Soriano del Pino f0d90130ad Add recovery command 4 years ago
Lucas Soriano del Pino 09773dd15b Re-introduce history command 4 years ago
rishflab a44303f839 Add monerod to config
Fixed rebase issues
4 years ago
rishflab 7afd316210 Construct tor transport for Bob 4 years ago
rishflab 3b008c38a6 Remove redundant code and stale comments 4 years ago
rishflab 796d0b3439 Extract transport creation and remove tor conditional compile
The numerous tor conditional compile flags were removed by
extracting transport creation to the main statement. A tor
transport is created if Alice specifies a tor port using the CLI.
4 years ago
rishflab 0ca511bf8a Remove hardcoded configuration
The hardcoded configuration was replaced with CLI
configuration options. CLI based config was chosen
over a config file as it does not access and clutter
the user's file system. By CLI options depend on whether
the program is run in Alice or Bob mode.
4 years ago
Philipp Hoenisch 8811a0a205
Add Tor to main 4 years ago
Tobin C. Harding 05766d3146 Add swap/
Add a binary crate `swap` that implements two nodes (Alice and Bob). With this
applied we can start up a node for each role and do:

- Bob: Requests current amounts using BTC is input
- Alice: Responds with amounts
- Bob: (mock) get user input to Ok the amounts

... continue with swap (TODO)
4 years ago