Run mvn spring-boot:run in your terminal
Type http://localhost:8080/swagger-ui.html in your browser
I've included a testing wallet with Testnet funds to allow people to try out-of-the-box.
To utilize them, use PUT /wallet/unlock to load them into the in-memory map.
Mind it is a testing account in a Test network, i.e.: there is no point in stealing those funds :P
- Use GET /wallet/mnemonic to get a new Mnemonic seed, try to save those, as they will help you to recover the wallet in case of need.
- Use POST /wallet to register a new Wallet (It requires the mnemonics from previous step)
- Use PUT /wallet/{walletId}/transaction/send to create and send a new Transaction.
- Check the logs to see if the transaction is confirmed by a block, or just do polling on GET /transaction/{transactionId} until it contains blockHash and blockNumber attributes
An alternative to the previous way of creating transactions is via GET /wallet/{walletId}/transaction/create that will return a valid transaction, in case the user wants to verify the Fee cost.
Once it has been validated, the transaction can be send with PUT /wallet/{walletId}/transaction/broadcast
Unfortunately, BitcoinJ won't accept this transaction directly, only the outputs of it, so as much you can use Broadcast with the outputs of the transaction and, finger-crossed, the inputs will be the same :X
- Use GET /wallet/mnemonic to obtain a list of mnemonic words.
- Use POST /wallet to create a Wallet using the mnemonic words.
- Use GET /wallet/{walletId} to get details of a wallet.
-
Use PUT /wallet/unlock/{walletId} to unlock an existing Wallet.
Unlock allows you to load an existing wallet file from the file system, could be any wallet created by this tool or created by any other tool using BitcoinJ.
-
Use GET /wallet/{walletId} to get details of a wallet.
- Use GET /wallet/mnemonic to obtain a list of mnemonic words.
- Use POST /wallet to register a new Wallet
- Use GET /wallet/{walletId}/balance to see the wallet's balance in ETHER
This tool includes a self-contained (Client and Server present) example of how to use Payment-Protocol.
-
Use GET /wallet/mnemonic to obtain a list of mnemonic words.
-
Use POST /wallet/mnemonic to create a Wallet using the mnemonic words.
Or, alternatively, unlock an existing wallet with PUT /wallet/unlock/{walletId}
-
Fetch a payment request from your wallet using POST /payment-client/payment-request
Hint: Use http://localhost:8080/payment-server/ to get a payment request meant for your wallet. You can set the amount to pay by adding the query parameter: ?amount=; mind that amount is expected in Bitcoin, not in Satoshis
-
Once Payment-Request has been fetched, use POST /payment-client/payment/{walletId} with the data coming from the previous endpoint.
Mind that from the Transaction data you only need to set the Output part, not the entire transaction, I plan to improve this if I have time to do so...
Payment Protocol is meant for you to pay your providers in a safe way (PaymentClient*) and/or to allow your users to use the platform in a safe way (PaymentServer*)