Closed yosriady closed 4 years ago
- Running a Bitcoin and Ethereum node as the maker, using the SDK (?)
Hi @yosriady, just to be sure we are on the same page. We prefer that you tell us (or you open PRs) to update the SDK so it's usable than not using the SDK 🙂
@D4nte
Are developers supposed to use comit-scripts
to manage their production nodes? Since it was part of create-comit-app
and not comit-sdk
, I thought it was more for running a development environment to run the examples.
For a production-ready setup, wouldn't developers need to run their own nodes? Maybe I'm missing something here. I don't see how you can run a Bitcoin and Ethereum node using the SDK. 🤔
Really good question: comit-script
should just help to spin up a developer environment and the comit-sdk
does not concern the environment at all.
For a production-ready setup a developer would need to provide their own nodes.
The Node.js backend API is responsible for making BTC-DAI offers for the user and proceed with the swap if someone takes the offer from the desktop client.
This task implements:
I'm not yet clear of which of the functionality is already implemented by the SDK and which needs to be implemented.
Definition of Done
Phase 1
**TODOs** - [x] Evaluate browser wallet integration / walletconnect - [ ] ~~Grok `EthereumWallet` SDK interface under the hood to evaluate integration with Ledger / other wallets~~ Halting wallet integration - [ ] ~~Research injecting providers for ledger support https://github.com/MetaMask/web3-provider-engine~~ Extracted to issue - [x] Go through https://comit.network/docs/getting-started/create-comit-app/ - [ ] Set up infra for maker backend - [ ] ~~Run Bitcoin and Ethereum nodes for the service (locally)~~ Halting node setup - [ ] Go through https://github.com/comit-network/create-comit-app/tree/master/scripts to run nodes locally (separate pairs) for maker backend and for desktop app - [x] Set up https://en.bitcoin.it/wiki/Bitcoind - [x] https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md - `./src/bitcoind` / `./src/bitcoin-cli stop` - [x] Grok `InMemoryBitcoinWallet` config parameters https://github.com/bcoin-org/bcoin/blob/master/docs/README.md - [x] https://medium.com/@bitstein/setting-up-a-bitcoin-lightning-network-test-environment-ab967167594a - [x] Clarify about 'regtest` network and what it affects - [ ] Grok https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf - rpc settings - [x] Create bitcoin.conf with the following config https://github.com/comit-network/create-comit-app/blob/master/scripts/src/docker/bitcoin.rs#L52-L62 - [ ] Set up Ganache locally for Ethereum (URI, private key, erc20 contract address) - [ ] Set up `cnd` locally - [ ] configure `.env` in its proper directory under `maker/` - [ ] ~~Evaluate hosted services for nodes e.g. https://alchemyapi.io/infrastructure~~ Extracted to issue - [ ] Config environment variables - ~~`~/.create-comit-app/env` is bad DX, is there a way to configure where the env should live? Right now, developers cannot use `comit-scripts` for anything other than running the example.~~ Not meant for actual use - [ ] ~~Once Bitcoin and Ethereum infra is set up,~~ Proceeding with local nodes from `comit-scripts`, see below specTODOs Phase 2
GET /
(root) to display maker info e.g.peerId
,addresshint
for Frontend Taker to use tocreateSwap
GET /swaps
to returnmaker.comitClient.getNewSwaps()
taker.comitClient.sendSwap
to be confirmed, andmakerSwapHandle.accept(...)
takerSwapHandle.fund(...)
to be confirmed, andmakerSwapHandle.fund(...)
takerSwapHandle.redeem(...)
to be confirmed, and call:makerSwapHandle.redeem
SwapForm
submit shouldcreateSwap
and,(Optional) Implement a confirmation modalsendSwap
SwapList
component forHomePage
SwapDetailsPage
to display status and info of a single swap and perform next stepsuseEffect
? Or manual / user-initiated?makerSwapHandle.accept(...)
to be confirmed, and call:takerSwapHandle.deploy(...)
takerSwapHandle.fund(...)
makerSwapHandle.fund(...)
to be confirmed, and call:takerSwapHandle.redeem
makerSwapHandle.redeem(...)
to be confirmed, and:Debug bitcoin balances not displaying correctlySplit into separate issuemaster
Taker: Refactor MAKER_URL to application-level .envDeferred to separate issueRefactor taker & maker state machines into its own class with data + functionsDeferred to separate issuerunTakerNextStep
andparseTakerSwapStatus
Open Questions
Should the desktop app also have its own backend instead of having the app call the COMIT SDK?Monitoring maker & taker confirmationsSwap.fetchDetails returns status for: swap, alpha & beta ledgers, communicationImplement or use a third-party service e.g. AlchemyAPISDK may need to return transaction ID on functions that perform a transaction, for async monitoring purposesAvailable inSwap
object