Receive via HTTP with ngrok using a CLI Wallet - mwcproject/docs GitHub Wiki
To receive payment via HTTP, you need to configure your HTTP(S) payment address. For it, you have 3 options listed below : HTTP(S) address with Ngrok (recommended for beginners), HTTP(S) address with NAT or HTTP(S) address with Double-NAT. That will allow every user to receive MWCs by HTTP(S) payment address. The most recommended and easiest way to configure the HTTP(S) address for new user is the Ngrok software. Moreover, by using Ngrok you will not reveal your ip to the sender, so the Double-Nat isn't needed anymore as long as you use the ngrok HTTP(S) address.
WARNING: Please note that ngrok is a third party service and you are trusting them. They will be able to see the amounts you are transferring and possibly even replace your slate file with thier own file. Alternatively you can use port forwarding if you don't want to use ngrok.
To follow this tutorial, you will need the following:
- Up-to-date MWC CLI-Wallet Software: https://github.com/mwcproject/mwc-wallet/releases
- Up-to-date mwc-node Software: https://github.com/mwcproject/mwc-node/releases
- ngrok : https://ngrok.com/download
First let's lay out the overall procedure, more detailed instructions with screenshots are below:
- Start your Node and wait for it to Sync
- Start NGrok
- Start your Wallet in Listen Mode
- Request the Payment
- Keep the Wallet and Node open until the payment was received
-
Download Ngrok with no account on all plateforms with the link below :
In our example, we'll take Ngrok on windows.
https://ngrok.com/download
-
Extract the zip file, and double-click on ngrok.exe.
-
Then click on
run
to launch Ngrok.
-
Ngrok have been welly launched as we can see below.
-
Type
ngrok http 3415
in the ngrok console to expose your local web server and so receive MWC via HTTP(S) payment with your Ngrok address.-
On Windows 7-10 :
ngrok http 3415
-
On Mac OSX & Linux :
./ngrok http 3415
-
-
Now, you are online and as we can see: the link expire in 7 hours and 59 minutes. The arrow points your HTTPS address which is needed to withdraw (typical ngrok address for your withdrawal :
https://xxxxxx.ngrok.io
), HTTP & HTTP(S) ngrok address are usable to receive MWC. By the way, we highly recommend every user to use the HTTPS link.In the example below, Ngrok HTTP(S) payment address are :
Ngrok HTTP address : http://f7e57b8c.ngrok.io
Ngrok HTTPS address : https://f7e57b8c.ngrok.io
You have a demonstation with image on how to receive MWC with HTTP(S) ngrok address just here !
Your Ngrok link expires after being online 8 hours in a row. You will need to close and launch back the Ngrok sotware to have a new session and as well a new usable link. By the way, make sure to type
ngrok http 3415
in the Ngrok terminal to enable the HTTP(S) port 3415 tunnel. Moreover, you need to let the Ngrok Terminal open to be online when you receive your MWC withdrawal. To close Ngrok, you just need to close the Terminal manually or typeCTRL + C
. Make sure that QT Wallet recipient wallet is listening and the Ngrok HTTP(S) tunnel port is online and running !
- Extract
mwc.exe
andmwc-wallet.exe
.
- Create a folder named
mwc_base
and move the file namedmwc.exe
,mwc-wallet.exe
,ngrok.exe
andcmd.bat
into the new folder created.
- Double click on
mwc.exe
to start the node.
Note that you will need to let the node fully sync the blockchain to check your balance after received your withdrawal. Also let this terminal open and running during the whole withdrawal process
- Double click on
ngrok.exe
to expose your local web server and type in newly opened ngrok terminal:
Let this terminal open and running during the whole withdrawal process
ngrok http 3415
- Double click on the
cmd.bat
and type in the new opened terminal :
Let this terminal open and running during the whole withdrawal process
mwc-wallet -e listen
Note if you didn't have the mwc-wallet before, you need to recover wallet (
mwc-wallet init -r
) or create new wallet (mwc-wallet init
)
- Once you have the
node
,mwc-wallet
andngrok
running, you can make your withdrawal with the ngrok address that you can find on the ngrok terminal as we can see below.
Note that a typical ngrok address for withdrawal is :
https://xxxxxx.ngrok.io
-
Once the payement is sent, you will see 2 request on ngrok terminal, that mean you received the payement but the transaction still
UNCONFIRMED
and it's inAWAITING FINALIZATION
as you will see by double-clicking on thecmd.bat
and typing in the new opened terminal :mwc-wallet info
The recipient needs to wait at least 2 minutes to see the transactions status switches to
AWAITING CONFIRMATION
.
- Once the transaction is confirmed and so received, the recipient needs to wait enough confirmations (set to 10 blocks by default) to spend the fund received recently.
- Once 10 confirmations (10 minutes) are reached, the recipient received his fund and can spend it directly after.