latest contributor to this doc

Last Edit:

@gcharang

Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman

Why Postman: Postman allows easy sending of RPC requests to an Komodo DeFi Framework instance launched by the Komodo Wallet Desktop application through a friendly GUI.

Prerequisites: Download and install the latest versions of Komodo Wallet Desktop and Postman on your computer.

On Komodo Wallet Desktop:

  1. Start the application and login to your wallet

  2. Click the settings button on the bottom left part of the application

Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Under the Security section, click "Show" on the line that says "View seed and private keys"
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Input your password and click View in the dialog box that pops out
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Click the copy button beside "RPC Password" to copy it. This "RPC Password" is also referred to as "userpass". It is reset every time the Komodo Wallet Desktop application is restarted
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Save the "userpass" value to a text file for later usage and leave the Komodo Wallet Desktop application running

On Postman:

  1. Launch the application. If it is your first time launching it, you will see a screen similar to the following. Click the "Skip and go to the app" link to skip account creation/login
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Click the “Eye icon” in the top right part of the screen to create a new Environment
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. In the popout dialog menu, Click the "Add" button in the Environment section
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. In the new tab that opens, change the Environment's name to KomodoWallet and add variables as shown in the next step
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Add a variable with the name "userpass" and for its value, paste the "RPC password" value copied and saved from Komodo Wallet Desktop. Then, add another variable with the name "url" and set its value as "localhost:7783" and save as shown in the picture below
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Change environment to KomodoWallet by clicking on the dropdown that says "No Environment" beside the eye icon and selecting "KomodoWallet"
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Click "New" to start creating a new RPC request
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. In the popout menu, select "HTTP Request"
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Select "Post" as the request type
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Input "{{url}}" in the input bar beside POST
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. Next select "Body" → "raw" → "JSON" as shown in the picture below
Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman
  1. In the text area available, you can input the data part of any of the RPC requests from the docs. Example: version | Komodo Documentation

The RPC call looks like:

curl --url "http://127.0.0.1:7783" --data "{
  \"method\":\"version\",
  \"userpass\":\"$userpass\"
}"

the --data part is:

"{
  \"method\":\"version\",
  \"userpass\":\"$userpass\"
}"

remove the quotes outside the brackets, replace escaped quotes: " with regular quotes: " and "$userpass" with "{{userpass}}"

you will get:

{
  "method":"version",
  "userpass":"{{userpass}}"
}

input it in the text area and click the Send button to receive output from the Komodo DeFi Framework instance launched by the Komodo Wallet Desktop application

Send Commands to an MM2 Instance Being Run by Komodo Wallet Desktop Using Postman

The same method can be used to execute any other RPC command from the docs at Note About Rational Number Type | Komodo Documentation

Note: Every time the Komodo Wallet Desktop application is restarted, the "RPC password/userpass" is also reset. So copy it and update the value of the "userpass" variable in the environment named "KomodoWallet" in Postman