NAV Navbar
Logo
curl json

Introduction

Welcome to the Factom APIs documentation. Here you’ll find intructions for factomd and factom-walletd JSON-RPC APIs. The API call examples are in curl, but the json structures are also provided for programming solutions. If using GoLang, there is a factom library solution created here: https://github.com/FactomProject/factom

factomd API

This is the API reference for the factomd process. The API is designed for outside application to process transactions and interact with the Factom federated servers. It’s listening port can be configured and runs on 8088 by default.

All these APIs use JSON-RPC, which is a remote procedure call protocol encoded in JSON. It is a very simple protocol (and very similar to XML-RPC), defining only a handful of data types and commands.

They can be invoked in your terminal as

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "METHOD_HERE", "params": {"PARAM_1":"PARAM_DATA_1"}}' -H 'content-type:text/plain;' http://localhost:8088/v2

The output will also be JSON.

The right panel will contain the curl commands to be run in your terminal, as well as the json structures of the request and reponse. The json structs detail the required parameters for each call.

directory-block

Example Request

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "directory-block",
  "params": {
    "keymr": "36c360817761e0d92af464f7c2e94a7495104d6b0a6051218cc53e52d3d519b6"
  }
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": 
"directory-block", "params": {"KeyMR":"7ed5d5b240973676c4a8a71c08c0cedb9e0ea335eaef22995911bcdc0fe9b26b"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "header":{  
         "prevblockkeymr":"7d15d82e70201e960655ce3e7cf475c9da593dfb82c6dca6377349bd148bf001",
         "sequencenumber":72497,
         "timestamp":1484858820
      },
      "entryblocklist":[  
         {  
            "chainid":"000000000000000000000000000000000000000000000000000000000000000a",
            "keymr":"3faa880a97ef6ce1feca643cffa015dd6be6a597b3f9260e408c5ac9351d1f8d"
         },
         {  
            "chainid":"000000000000000000000000000000000000000000000000000000000000000c",
            "keymr":"5f8c98930a1874a46b47b65b9376a02fbff65b760f6866519799d69e2bc019ee"
         },
         {  
            "chainid":"000000000000000000000000000000000000000000000000000000000000000f",
            "keymr":"8c6fed0f41317cc45201b5b170a9ac5bc045029e39a90b6061211be2c0678718"
         }
      ]
   }
}

Every directory block has a KeyMR (Key Merkle Root), which can be used to retrieve it. The reponse will contain information that can be used to naviagate through all transactions (entry and factoid) within that block. The header of the directory block will contain information regarding the previous directory block’s keyMR, directory block height, and the timestamp.

directory-block-head

Example Request

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "directory-block-head"
}
curl -X POST --data-binary \
'{"jsonrpc": "2.0", "id": 0, "method": "directory-block-head"}' \
-H 'content-type:text/plain;' http://localhost:8088/v2

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "keymr":"7ed5d5b240973676c4a8a71c08c0cedb9e0ea335eaef22995911bcdc0fe9b26b"
   }
}

The directory block head is the last known directory block by factom, or in other words, the most recently recorded block. This can be used to grab the latest block and the information required to traverse the entire blockchain.

heights

Example Request

curl -X POST --data-binary \
'{"jsonrpc": "2.0", "id": 0, "method": "heights"}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "heights"
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "directoryblockheight":72498,
      "leaderheight":72498,
      "entryblockheight":72498,
      "entryheight":72498,
      "missingentrycount":0,
      "entryblockdbheightprocessing":72498,
      "entryblockdbheightcomplete":72498
   }
}

Returns various heights that allows you to view the state of the blockchain. The heights returned provide a lot of information regarding the state of factomd, but not all are neede by most applications. The heights also indicate the most recent block, which could not be complete, and still being built. The heights mean as follows:

A fully synced node should show the same number for all but ‘missingentrycount’

raw-data

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": 
"raw-data", "params":{"hash":"0ae2ab2cf543eed52a13a5a405bded712444cc8f8b6724a00602e1c8550a4ec2"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "raw-data",
  "params": {
    "hash": "1f2931558c0ef6ef9d40450fa3a49dc3a29d18c30ced91c791bbe6060d405e39"
  }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "data":"00f9164cd66af9d5773b4523a510b5eefb9a5e626480feeb6671ef2d17510ca30000900040e5a5fa49cf19015475fb1b5c8e4269b4586f04ec98e0bb60dd32c214e201c9cf97febe09afca45549db35a9f61ca930855ce6d753853fb270490bcafb65e43020015466163746f6d20496e63204261736520436861696e0014466163746f6d697a652045766572797468696e67000c42656c6c2041766572616765001142656c6c204176657261676520446174617b22736f75726365223a227777772e62656c6c617665726167652e636f6d222c2271756f74655f64617465223a22323031372d30312d31392031373a33333a3031222c2264617461223a5b7b22474f4c44223a22313231332e3134227d2c7b2253494c564552223a2231372e3139227d5d7d"
   }
}

Retrieve an entry or transaction in raw format, the data is a hex encoded string.

dblock-by-height

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": 
"dblock-by-height", "params":{"height":14460}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "dblock-by-height",
  "params": {
    "height": 1
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "dblock": {
      "header": {
        "version": 0,
        "networkid": 4203931043,
        "bodymr": "7716df6083612597d4ef18a8076c40676cd8e0df8110825c07942ca5d30073b4",
        "prevkeymr": "fa7e6e2d37b012d71111bc4e649f1cb9d6f0321964717d35636e4637699d8da2",
        "prevfullhash": "469c7fdce467d222363d55ac234901d8acc61fd4045ae26dd54dac17c556ef86",
        "timestamp": 24671414,
        "dbheight": 14460,
        "blockcount": 3,
        "chainid": "000000000000000000000000000000000000000000000000000000000000000d"
      },
      "dbentries": [
        {
          "chainid": "000000000000000000000000000000000000000000000000000000000000000a",
          "keymr": "574e7d6178e04c92879601f0cb84a619f984eb2617ff9e76ee830a9f614cc9a0"
        },
        {
          "chainid": "000000000000000000000000000000000000000000000000000000000000000c",
          "keymr": "2a10f1678b9736f213ef3ac76e4f8aa910e5fed66733aa30dafdc91245157b3b"
        },
        {
          "chainid": "000000000000000000000000000000000000000000000000000000000000000f",
          "keymr": "cbadd7e280377ad8360a4b309df9d14f56552582c05100145ca3367e50adc497"
        }
      ],
      "dbhash": "aa7d881d23aad83425c3f10996999d31c76b51b14946f7aca204c150e81bc6d6",
      "keymr": "18509c431ee852edbe1029d676217a0d9cb4fcc11ef8e9aef27fd6075167120c"
    },
    "rawdata": "00fa92e5a37716df6083612597d4ef18a8076c40676cd8e0df8110825c07942ca5d30073b4fa7e6e2d37b012d71111bc4e649f1cb9d6f0321964717d35636e4637699d8da2469c7fdce467d222363d55ac234901d8acc61fd4045ae26dd54dac17c556ef86017874b60000387c00000003000000000000000000000000000000000000000000000000000000000000000a574e7d6178e04c92879601f0cb84a619f984eb2617ff9e76ee830a9f614cc9a0000000000000000000000000000000000000000000000000000000000000000c2a10f1678b9736f213ef3ac76e4f8aa910e5fed66733aa30dafdc91245157b3b000000000000000000000000000000000000000000000000000000000000000fcbadd7e280377ad8360a4b309df9d14f56552582c05100145ca3367e50adc497"
  }
}

Retrieve a directory block given only its height.

ablock-by-height

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
"ablock-by-height", "params": {"height":1}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "ablock-by-height",
  "params": {
    "height": 14460
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "ablock": {
      "header": {
        "prevbackrefhash": "77e4fb398e228ec9710c20988647a01e2259a40ab77e27c005baf7f2deae3415",
        "dbheight": 14460,
        "headerexpansionsize": 0,
        "headerexpansionarea": "",
        "messagecount": 4,
        "bodysize": 516,
        "adminchainid": "000000000000000000000000000000000000000000000000000000000000000a",
        "chainid": "000000000000000000000000000000000000000000000000000000000000000a"
      },
      "abentries": [
        {
          "identityadminchainid": "888888e238492b2d723d81f7122d4304e5405b18bd9c7cb22ca6bcbc1aab8493",
          "prevdbsig": {
            "pub": "0186ad82617edf3565d944aa104590eb6adb338e92ee6fcd750c2ab2b2707e25",
            "sig": "5796cd49835088ea0d6b8e4a75611ebc674fb791d6e9ebc7f6e5bb1a5e86fc25a8a7742e8f60870e2cb8523fd122ef54bb95ac94b3676b81e07c921ed2196508"
          }
        },
        {
          "identityadminchainid": "888888fc37fa418395eeccb95ab0a4c64d528b2aeefa0d1632c8a116a0e4f5b1",
          "prevdbsig": {
            "pub": "c845f47df202a649e2262d3da0e35556aab62e361425ad7d2e7813a215c8f277",
            "sig": "a5c976c4d18814916fc893f7b4dee78120d20e0deab2b04df2e3b67c2ea1123224db28559ca6d022822388a5ce41128bf5a09ccbbd02b1c5b17a4152183a3d06"
          }
        },
        {
          "identityadminchainid": "88888815ac8a1ab6b8f57cee67ba15aad23ab7d8e70ffdca064200738c201f74",
          "prevdbsig": {
            "pub": "f18512813300d8c1d11e78216d0640ddcc35156a20b53d5ced351a7d5ad90010",
            "sig": "1051c165d7ad33e1f764bb96e5e661053da381ebd708c8ac137da2a1b6847eac07e83472d4fa6096768c7904760c821e45b5ebe23a691cc5bad1b61937f9e303"
          }
        },
        {
          "identityadminchainid": "888888271203752870ae5e6fa0cf96f93cf14bd052455ad476ab26de1ad2c077",
          "prevdbsig": {
            "pub": "4f2d34f0417297e2e985e0cc6e4cf3d0814416d09f37af7375517ea236786ed3",
            "sig": "01206ff2963af7df29bb6749a4c29bc1eb65a48bd7b3ec6590c723e11c3a3c5342e72f9b079a58d77a2562c25289d799fadfc5205f1e99c4f1d5c3ce85432906"
          }
        }
      ],
      "backreferencehash": "1786de6a72311dd4b60c6608d60c2b9367642fb1ee6b867b2c9f4c57c87b8cba",
      "lookuphash": "574e7d6178e04c92879601f0cb84a619f984eb2617ff9e76ee830a9f614cc9a0"
    },
    "rawdata": "000000000000000000000000000000000000000000000000000000000000000a77e4fb398e228ec9710c20988647a01e2259a40ab77e27c005baf7f2deae34150000387c00000000040000020401888888e238492b2d723d81f7122d4304e5405b18bd9c7cb22ca6bcbc1aab84930186ad82617edf3565d944aa104590eb6adb338e92ee6fcd750c2ab2b2707e255796cd49835088ea0d6b8e4a75611ebc674fb791d6e9ebc7f6e5bb1a5e86fc25a8a7742e8f60870e2cb8523fd122ef54bb95ac94b3676b81e07c921ed219650801888888fc37fa418395eeccb95ab0a4c64d528b2aeefa0d1632c8a116a0e4f5b1c845f47df202a649e2262d3da0e35556aab62e361425ad7d2e7813a215c8f277a5c976c4d18814916fc893f7b4dee78120d20e0deab2b04df2e3b67c2ea1123224db28559ca6d022822388a5ce41128bf5a09ccbbd02b1c5b17a4152183a3d060188888815ac8a1ab6b8f57cee67ba15aad23ab7d8e70ffdca064200738c201f74f18512813300d8c1d11e78216d0640ddcc35156a20b53d5ced351a7d5ad900101051c165d7ad33e1f764bb96e5e661053da381ebd708c8ac137da2a1b6847eac07e83472d4fa6096768c7904760c821e45b5ebe23a691cc5bad1b61937f9e30301888888271203752870ae5e6fa0cf96f93cf14bd052455ad476ab26de1ad2c0774f2d34f0417297e2e985e0cc6e4cf3d0814416d09f37af7375517ea236786ed301206ff2963af7df29bb6749a4c29bc1eb65a48bd7b3ec6590c723e11c3a3c5342e72f9b079a58d77a2562c25289d799fadfc5205f1e99c4f1d5c3ce85432906"
  }
}

Retrieve administrative blocks for any given height.

The admin block contains data related to the identities within the factom system and the decisions the system makes as it builds the block chain. The 'abentries’ (admin block entries) in the json response can be of various types, the most common is a directory block signature (DBSig). A majority of the federated servers sign every directory block, meaning every block after m5 will contain 5 DBSigs in each admin block.

The ABEntries are detailed here: Github Link

ecblock-by-height

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
"ecblock-by-height", "params": {"height":1}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "ecblock-by-height",
  "params": {
    "height": 14460
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "ecblock": {
      "header": {
        "bodyhash": "ef7a85d4bf868e34aff4edce479f6ee412161e1faa3596a112cd5ef75e96f59c",
        "prevheaderhash": "add44ed20133c7b8c9500ab5819d3aee665fffcce7acb6baa098fa8210b43a8b",
        "prevfullhash": "2f1dd9e5f1ab34102f65dea55c1598e2344568d68c0511640b7f436295615746",
        "dbheight": 14460,
        "headerexpansionarea": "",
        "objectcount": 10,
        "bodysize": 20,
        "chainid": "000000000000000000000000000000000000000000000000000000000000000c",
        "ecchainid": "000000000000000000000000000000000000000000000000000000000000000c"
      },
      "body": {
        "entries": [
          {
            "number": 1
          },
          {
            "number": 2
          },
          {
            "number": 3
          },
          {
            "number": 4
          },
          {
            "number": 5
          },
          {
            "number": 6
          },
          {
            "number": 7
          },
          {
            "number": 8
          },
          {
            "number": 9
          },
          {
            "number": 10
          }
        ]
      }
    },
    "rawdata": "000000000000000000000000000000000000000000000000000000000000000cef7a85d4bf868e34aff4edce479f6ee412161e1faa3596a112cd5ef75e96f59cadd44ed20133c7b8c9500ab5819d3aee665fffcce7acb6baa098fa8210b43a8b2f1dd9e5f1ab34102f65dea55c1598e2344568d68c0511640b7f4362956157460000387c00000000000000000a0000000000000014010101020103010401050106010701080109010a"
  }
}

Retrieve the entry credit block for any given height. These blocks contain entry credit transaction information.

fblock-by-height

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
 "fblock-by-height", "params": {"height":1}}' \
 -H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "fblock-by-height",
  "params": {
    "height": 14460
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "fblock": {
      "bodymr": "e12db6a1945d513f066cab66c94dc5cca1b8f90997b95a47b46e70b1656f764a",
      "prevkeymr": "98f3a6bcd978080fb612359f131fdb73c6119dea1f45c977a3fa30dfd507ebf5",
      "prevledgerkeymr": "fe7734478375e16f92f9e5513dbc3f2e830dd2bb263801ba816129242ce83cfe",
      "exchrate": 95369,
      "dbheight": 14460,
      "transactions": [
        {
          "millitimestamp": 1480284840637,
          "inputs": [],
          "outputs": [],
          "outecs": [],
          "rcds": [],
          "sigblocks": [],
          "blockheight": 0
        },
        {
          "millitimestamp": 1480284848556,
          "inputs": [
            {
              "amount": 201144428,
              "address": "dfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8f",
              "useraddress": ""
            }
          ],
          "outputs": [
            {
              "amount": 200000000,
              "address": "031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f",
              "useraddress": ""
            }
          ],
          "outecs": [],
          "rcds": [
            "3f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac"
          ],
          "sigblocks": [
            {
              "signatures": [
                "68fd6905eeb276739b2541398db3b1b06d73f99a50803bac83eafabc24be656e26278af6fe8070c85e861e21c39a56a5a422dd2d58dd65a7eeff849f6d02de04"
              ]
            }
          ],
          "blockheight": 0
        },
        {
          "millitimestamp": 1480284956754,
          "inputs": [
            {
              "amount": 401144428,
              "address": "dfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8f",
              "useraddress": ""
            }
          ],
          "outputs": [
            {
              "amount": 400000000,
              "address": "031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f",
              "useraddress": ""
            }
          ],
          "outecs": [],
          "rcds": [
            "3f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac"
          ],
          "sigblocks": [
            {
              "signatures": [
                "363c20508bddf5a9d4762e2496a861a1f03ec0dc50389b836dec898a3b37c33a6f831edf057f48a961b2d336231a78137e7402a0ca3a1d5c186ce2bb79e44907"
              ]
            }
          ],
          "blockheight": 0
        }
      ],
      "chainid": "000000000000000000000000000000000000000000000000000000000000000f",
      "keymr": "cbadd7e280377ad8360a4b309df9d14f56552582c05100145ca3367e50adc497",
      "ledgerkeymr": "886747480a30f833a27a819fe4b92fbd617cda028329fd2e4b87c7721ff65dea"
    },
    "rawdata": "000000000000000000000000000000000000000000000000000000000000000fe12db6a1945d513f066cab66c94dc5cca1b8f90997b95a47b46e70b1656f764a98f3a6bcd978080fb612359f131fdb73c6119dea1f45c977a3fa30dfd507ebf5fe7734478375e16f92f9e5513dbc3f2e830dd2bb263801ba816129242ce83cfe00000000000174890000387c000000000b0000071c020158a7da22bd000000020158a7da41ac010100dff4f06cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8fdfaf8400031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac68fd6905eeb276739b2541398db3b1b06d73f99a50803bac83eafabc24be656e26278af6fe8070c85e861e21c39a56a5a422dd2d58dd65a7eeff849f6d02de04020158a7da70a5010100b09dae6cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8fafd7c200031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac7e503a078b7f5bac25333c54a724530b97d25b8c2a83f82fdde249987b8bf4a4ba3da41643b7723102c3506bae86f6347ae94b72e8ca4c14617d8d3ca57df70500020158a7da9f9f010100818fccb26cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8f818f86c600031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971aced5c095795dc3a2fdcf7689718d10f32be9c656049f169900eac51a34b3f1cb2a0d35ba0a9440892219be15927a4702f062e29ac35238ece375bda4dea9a2a0500020158a7dace9101010083ddb1806c031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f83dceb9400dfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8f013b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29fdb846a8f9abcb8a1eda9556a8d5f8ef959d1649fddb5ba1ccd3a66b6bc919d8ed225b1273e671685812725a10a7bbac95f0ed9f128bcb3547b068fe3137e50500020158a7dafd8201010081bfa3f46cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8f81bede8800031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac66080fa6968bd4b104f1f7a2b5f5bd30b05b066bca956ef28ae94a17f1e18fd102de60f7612811707fda09df69802f5fe4438c1b7b750b57fcc4684c9235520100020158a7db2c7b010100dff4f06cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8fdfaf8400031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac40316508538da5dda6d029e6d8b7eca7b9a5074def82a1d78a0f04ac82fe1efbe14f01b01a6778d648ee47c3acf6f9ab2c9f044087703d55f9901403b991780500020158a7db5b75010100dff4f06cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8fdfaf8400031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac4f050366992fe0a8fb8939825e1286f096f8f1e3528d23e737a499ba73ac1c041501c77f8baf780b3cb915f630a07ac2c0cb312bfb8c89b27ab550fef070a30500020158a7db8a6e010100b09dae6cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8fafd7c200031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971aca6d367d754fd45454c04fd090a68ba4b02ad0316362a7fcd16f164f56d335e8ebd83a3f6e9f5dc1cae9a3ad4eb48a675b8c8b984a1989d359f2bcad368c9c60900020158a7dbb96001010083ddb1806c031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f83dceb9400dfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8f013b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29c59178bafe8aca410070ba26fd2d4eb607360f52a1b74b60f55a66a3c65bfc5c9ce9b03f6dd4880246723d8542c93fc935f988bc77cc3b9f3d616b414005730300020158a7dbe85201010081bfa3f46cdfda7feae639018161018676f141c5744397278c9021e1e9d36e89656c7abe8f81bede8800031cce24bcc43b596af105167de2c03603c20ada3314a7cfb47befcad4883e6f013f8f50d848f1973751c5776e2f34ab9acf42f72da96d74acd64d2935d75971ac363c20508bddf5a9d4762e2496a861a1f03ec0dc50389b836dec898a3b37c33a6f831edf057f48a961b2d336231a78137e7402a0ca3a1d5c186ce2bb79e449070000"
  }
}

Retrieve the factoid block for any given height. These blocks contain factoid transaction information.

receipt

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": 
"receipt", "params":{"hash":"0ae2ab2cf543eed52a13a5a405bded712444cc8f8b6724a00602e1c8550a4ec2"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "receipt",
  "params": {
    "Hash": "0ae2ab2cf543eed52a13a5a405bded712444cc8f8b6724a00602e1c8550a4ec2"
  }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "receipt":{  
         "entry":{  
            "entryhash":"0ae2ab2cf543eed52a13a5a405bded712444cc8f8b6724a00602e1c8550a4ec2"
         },
         "merklebranch":[  
            {  
               "left":"0ae2ab2cf543eed52a13a5a405bded712444cc8f8b6724a00602e1c8550a4ec2",
               "right":"0000000000000000000000000000000000000000000000000000000000000003",
               "top":"d2f3554d8394dc59932383de36dd742449d1c25ef1d21cdab07c4b9f044356af"
            },
            {  
               "left":"6adbc7ba1758f2850c92e4a09dea8ba9c6d844cdd4d596db2421b0f843c3e530",
               "right":"d2f3554d8394dc59932383de36dd742449d1c25ef1d21cdab07c4b9f044356af",
               "top":"041c3fed14469a3d0f1a022e3d5321583065e691edb9223605c86766ff881883"
            },
            {  
               "left":"0caff62ea5b5aa015c706add7b2463a5be07e1f0537617f553558090f23c7f56",
               "right":"041c3fed14469a3d0f1a022e3d5321583065e691edb9223605c86766ff881883",
               "top":"434ea8fc39fa1686035b4c993ef2c62ee67f67332fc59da1d373f33140d7c2b5"
            },
            {  
               "left":"434ea8fc39fa1686035b4c993ef2c62ee67f67332fc59da1d373f33140d7c2b5",
               "right":"1deef358d7e02adfe353f8137d1535e34f112d7a3b9fbf06b5c64dee5e4b2042",
               "top":"9482ce541c7198e21947c3043f12dddda6184bb4928f01ae2c3f885b2ed3d5bb"
            },
            {  
               "left":"9482ce541c7198e21947c3043f12dddda6184bb4928f01ae2c3f885b2ed3d5bb",
               "right":"3d93579d9f5b22387cb46c1ad280da9ba9e1fe753972ef08d9e9f1c938a765c0",
               "top":"6c83c08ee21925ce8c958a3b0b5da21bb04d66465f6f1366783f637bcdbb9d47"
            },
            {  
               "left":"9f5d7d533e66e920a68d9fd63d0cee1517fb6de713946968453cfd2cb3081dfd",
               "right":"6c83c08ee21925ce8c958a3b0b5da21bb04d66465f6f1366783f637bcdbb9d47",
               "top":"e1d971bedc93c03963d7808b570744d3853e8c521b21a5e3985f2651b85b5362"
            },
            {  
               "left":"e1d971bedc93c03963d7808b570744d3853e8c521b21a5e3985f2651b85b5362",
               "right":"f62391cfbdb158a4b20f301e2800f0b3933ba23417bf1aeb630ff968765ddb30",
               "top":"5858cdfc5418ed2d6d2f023f91786d6169e420d7ac3f5f3fc4d5121cd7848509"
            },
            {  
               "left":"3000e97b6045299a108c04b656a9965d2ac5e7a9ae76718afb6009c4098d320b",
               "right":"5858cdfc5418ed2d6d2f023f91786d6169e420d7ac3f5f3fc4d5121cd7848509",
               "top":"4358041d6773351dd0a42a8d16778c6544b1196a03c6c41645340cd076a29b6b"
            }
         ],
         "entryblockkeymr":"041c3fed14469a3d0f1a022e3d5321583065e691edb9223605c86766ff881883",
         "directoryblockkeymr":"4358041d6773351dd0a42a8d16778c6544b1196a03c6c41645340cd076a29b6b",
         "bitcointransactionhash":"469a96c847cf8bf1f325b6eec850f46488ed671930d62b54ed186a8031477a7d",
         "bitcoinblockhash":"000000000000000001edf3adf719dfc1263661d2c4b0ed779d004a2cbb7cca32"
      }
   }
}

Retrieve a reciept providing cryptographially verfiable proof that information was recorded in the factom blockchain and that this was subsequently anchored in the bitcoin blockchain.

entry-block

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":"entry-block", 
"params":{"KeyMR":"041c3fed14469a3d0f1a022e3d5321583065e691edb9223605c86766ff881883"}}'\
 -H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "entry-block",
  "params": {
    "KeyMR": "f65f67774139fa78344dcdd302631a0d646db0c2be4d58e3e48b2a188c1b856c"
  }
}

Example Response

{  
 "jsonrpc":"2.0",
 "id":0,
 "result":{  
  "header":{  
   "blocksequencenumber":4211,
   "chainid":"0caff62ea5b5aa015c706add7b2463a5be07e1f0537617f553558090f23c7f56",
   "prevkeymr":"f7588bc41f03220a5ba4128432dc58b2027c05f432c91d79e6213ecdd5c923b3",
   "timestamp":1450147800,
   "dbheight":15000
  },
  "entrylist":[  
   {  
    "entryhash":"0ae2ab2cf543eed52a13a5a405bded712444cc8f8b6724a00602e1c8550a4ec2",
    "timestamp":1450147980
   }
  ]
 }
}

Retrieve a specified entry block given its merkle root key. The entry block contains 0 to many entries

entry

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":"entry","params":
{"Hash":"24674e6bc3094eb773297de955ee095a05830e431da13a37382dcdc89d73c7d7"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "entry",
  "params": {
    "hash": "be5216cc7a5a3ad44b49245aec298f47cbdfca9862dee13b0093e5880012b771"
  }
}

Example Response

{  
 "jsonrpc":"2.0",
 "id":0,
 "result":{  
  "chainid":"df3ade9eec4b08d5379cc64270c30ea7315d8a8a1a69efe2b98a60ecdd69e604",
  "content":"...",
  "extids":[  
     "466163746f6d416e63686f72436861696e"
  ]
 }
}

Get an Entry from factomd specified by the Entry Hash.

pending-entries

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
"pending-entries", "params": {}}' -H 'content-type:text/plain;' http://localhost:8088/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"pending-entries",
   "params":{  

   }
}

Example Response

{  
 "jsonrpc":"2.0",
 "id":0,
 "result":[  
    {  
       "EntryHash":"dde3f69025780f58da583b6961cf17291004f733fb2fa1a69738e0a7768387e4",
       "ChainID":"5c7a44a37870ca729d03820339379955781a863bc461545a9df06bbc15110bdb",
       "Status":"AckStatusACK"
    },
    {  
       "EntryHash":"45da41a07c6157839a735147a555ba4b009b72a9a7fe126c0d418413743f1683",
       "ChainID":"f6df2b40bf16be03deddc169a6429804a67a761ed5f2d5499f7e56a7202f854b",
       "Status":"AckStatusACK"
    }
 ]
}

Returns an array of the entries that have been submitted but have not been recoreded into the blockchain.

transaction

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "transaction", "params":
{"hash":"64251aa63e011f803c883acf2342d784b405afa59e24d9c5506c84f6c91bf18b"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"transaction",
   "params":{  
      "hash":"64251aa63e011f803c883acf2342d784b405afa59e24d9c5506c84f6c91bf18b"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "factoidtransaction":{  
         "millitimestamp":1443537161594,
         "inputs":[  
            {  
               "amount":1000000000,
               "address":"ab87d1b89117aba0e6b131d1ee42f99c6e806b76ca68c0823fb65c80d694b125",
               "useraddress":""
            }
         ],
         "outputs":[  
            {  
               "amount":992000800,
               "address":"648f374d3de5d1541642c167a34d0f7b7d92fd2dab4d32f313776fa5a2b73a98",
               "useraddress":""
            }
         ],
         "outecs":[  
         ],
         "rcds":[  
            "10560cc304eb0a3b0540bc387930d2a7b2373270cfbd8448bc68a867cefb9f74"
         ],
         "sigblocks":[  
            {  
               "Signatures":[  
                  "d68d5ce3bee5e69f113d643df1f6ba0dd476ada40633751537d5b840e2be811d4734ef9f679966fa86b1777c8a387986b4e21987174f9df808c2081be2c04a08"
               ]
            }
         ],
         "blockheight":0
      },
      "includedintransactionblock":"786dd9b5d3c3b2d9c40c538fa99277fe10c16cda32b5642d63bd7f60804aa11d",
      "includedindirectoryblock":"d6b4b0988a3a777a88cebf4e6c34ccc16363f48560cd81c446da73461c4e965c",
      "includedindirectoryblockheight":3999
   }
}

Retrieve details of a factoid transaction using a transactions hash. Note that information regarding the directory block height, directory block keymr, and transaction block keymr are also included. The “blockheight” parameter in the reponse will always be 0 when using this call, refer to “includedindirectoryblockheight” if you need the height.

factoid-ack

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0,
"method":"factoid-ack", "params":{
"TxID":"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"factoid-ack",
   "params":{  
      "TxID":"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "txid":"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0",
      "transactiondate":1441138021975,
      "transactiondatestring":"2015-09-01 15:07:01",
      "blockdate":1441137600000,
      "blockdatestring":"2015-09-01 15:00:00",
      "status":"DBlockConfirmed"
   }
}

Factoid Acknowledgements will give the current status of a transaction. “DBlockConfirmed” is the highest level of confirmation you can obtain. This means the transaction has completed.

entry-ack

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, 
"method":"entry-ack", "params":{"TxID":
"9228b4b080b3cf94cceea866b74c48319f2093f56bd5a63465288e9a71437ee8"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"entry-ack",
   "params":{  
      "TxID":"9228b4b080b3cf94cceea866b74c48319f2093f56bd5a63465288e9a71437ee8"
   }
}

Example Reponse

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "committxid":"e5b5be39a41df43a3c46beaa238dc5e6f7bb11115a8da1a9b45cd694e257935a",
      "entryhash":"9228b4b080b3cf94cceea866b74c48319f2093f56bd5a63465288e9a71437ee8",
      "commitdata":{  
         "transactiondate":1449547801861,
         "transactiondatestring":"2015-12-07 22:10:01",
         "blockdate":1449547800000,
         "blockdatestring":"2015-12-07 22:10:00",
         "status":"DBlockConfirmed"
      },
      "entrydata":{  
         "blockdate":1449547800000,
         "blockdatestring":"2015-12-07 22:10:00",
         "status":"DBlockConfirmed"
      }
   }
}

Entry Acknowledgements will give the current status of a transaction. “DBlockConfirmed” is the highest level of confirmation you can obtain. This means the entry has made it into Factom.

pending-transactions

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "pending-transactions", "params":
{"Address":"EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwrcmgm2r"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"pending-transactions",
   "params":{  
      "Address":"EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwrcmgm2r"
   }
}

Example Response

{"jsonrpc":"2.0","id":0,"result":[{
    "TransactionID": "337a32712f14c5df0b57a64bd6c321a043081688ecd4f33fd8319470da2256b1",
    "Status": "AckStatusACK"
  }]}

Returns an array of factoid transactions that have not yet been recorded in the blockchain, but are known to the system.

chain-head

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
"chain-head", "params":{"ChainID":"5a77d1e9612d350b3734f6282259b7ff0a3f87d62cfef5f35e91a5604c0490a3"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "chain-head",
  "params": {
    "ChainID": "bb4e132bb2f8792c3174f5c1de108816c36cee86a383e1067926353e41f334bc"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "ChainHead": "f65f67774139fa78344dcdd302631a0d646db0c2be4d58e3e48b2a188c1b856c"
  }
}

Return the keymr of the head of the chain for a chain ID (the unique hash created when the chain was created).

entry-credit-balance

Example Request

curl -X POST --data-binary {"jsonrpc": "2.0", "id": 0, "method": 
"entry-credit-balance", "params":
{"address":"EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwrcmgm2r"}} \
-H content-type:text/plain; http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "entry-credit-balance",
  "params": {
    "address": "EC3MAHiZyfuEb5fZP2fSp2gXMv8WemhQEUFXyQ2f2HjSkYx7xY1S"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "balance": 2000
  }
}

Return its current balance for a specific entry credit address.

factoid-balance

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": 
"factoid-balance", "params":{"address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "factoid-balance",
  "params": {
    "address": "FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "balance": 966582271
  }
}

This call returns the number of Factoshis (Factoids *10^-8) that are currently available at the address specified.

entry-credit-rate

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, 
"method": "entry-credit-rate"}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "entry-credit-rate"
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "rate": 95369
  }
}

Returns the number of Factoshis (Factoids *10^-8) that purchase a single Entry Credit. The minimum factoid fees are also determined by this rate, along with how complex the factoid transaction is.

properties

Example Request

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "properties"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": 
"properties"}' -H 'content-type:text/plain;' http://localhost:8088/v2

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "factomdversion": "0.4.0.0",
    "factomdapiversion": "2.0"
  }
}

Retrieve current properties of the Factom system, including the software and the API versions.

factoid-submit

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "factoid-submit", "params":
{"transaction":"0201565d109233010100b0a0e100646f3e8750c550e4582eca5047546ffef89c13a175985e320232bacac81cc428afd7c200ce7b98bfdae90f942bc1fe88c3dd44d8f4c81f4eeb88a5602da05abc82ffdb5301718b5edd2914acc2e4677f336c1a32736e5e9bde13663e6413894f57ec272e28dc1908f98b79df30005a99df3c5caf362722e56eb0e394d20d61d34ff66c079afad1d09eee21dcd4ddaafbb65aacea4d5c1afcd086377d77172f15b3aa32250a"}}' \
 -H 'content-type:text/plain;' http://localhost:8088/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"factoid-submit",
   "params":{  
      "transaction":"0201565d109233010100b0a0e100646f3e8750c550e4582eca5047546ffef89c13a175985e320232bacac81cc428afd7c200ce7b98bfdae90f942bc1fe88c3dd44d8f4c81f4eeb88a5602da05abc82ffdb5301718b5edd2914acc2e4677f336c1a32736e5e9bde13663e6413894f57ec272e28dc1908f98b79df30005a99df3c5caf362722e56eb0e394d20d61d34ff66c079afad1d09eee21dcd4ddaafbb65aacea4d5c1afcd086377d77172f15b3aa32250a"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "message":"Successfully submitted the transaction",
      "txid":"aa8bac391e744340140ea0d95c7b37f9cc8a58601961bd751f5adb042af6f33b"
   }
}

Submit a factoid transaction. The transaction hex encoded string is documented here: Github Documentation

The factoid-submit api takes a specficically formated message encoded in hex that includes signatures. If you have a factom-walletd instance running, you can construct this factoid-submit api call with compose-transaction which takes easier to construct arguments.

commit-chain

Example Request

curl -X POST --data '{"jsonrpc": "2.0", "id": 0, "method": "commit-chain", "params":
{"message":
"00015507b2f70bd0165d9fa19a28cfaafb6bc82f538955a98c7b7e60d79fbf92655c1bff1c76466cb3bc3f3cc68d8b2c111f4f24c88d9c031b4124395c940e5e2c5ea496e8aaa2f5c956749fc3eba4acc60fd485fb100e601070a44fcce54ff358d606698547340b3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da2946c901273e616bdbb166c535b26d0d446bc69b22c887c534297c7d01b2ac120237086112b5ef34fc6474e5e941d60aa054b465d4d770d7f850169170ef39150b"}}' \ 
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "commit-chain",
  "params": {
    "message": "00015507b2f70bd0165d9fa19a28cfaafb6bc82f538955a98c7b7e60d79fbf92655c1bff1c76466cb3bc3f3cc68d8b2c111f4f24c88d9c031b4124395c940e5e2c5ea496e8aaa2f5c956749fc3eba4acc60fd485fb100e601070a44fcce54ff358d606698547340b3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da2946c901273e616bdbb166c535b26d0d446bc69b22c887c534297c7d01b2ac120237086112b5ef34fc6474e5e941d60aa054b465d4d770d7f850169170ef39150b"
  }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "message":"Chain Commit Success",
      "txid":"76e123d133a841fe3e08c5e3f3d392f8431f2d7668890c03f003f541efa8fc61"
   }
}

Send a Chain Commit Message to factomd to create a new Chain. The commit chain hex encoded string is documented here: Github Documentation

The commit-chain api takes a specficically formated message encoded in hex that includes signatures. If you have a factom-walletd instance running, you can construct this commit-chain api call with compose-chain which takes easier to construct arguments.

The compose-chain api call has two api calls in it’s response: commit-chain and reveal-chain. To successfully create a chain, the reveal-chain must be called after the commit-chain.

reveal-chain

Example Request

curl -X POST --data '{"jsonrpc": "2.0", "id": 0, "method": "reveal-chain", "params":
{"entry":
"007E18CCC911F057FB111C7570778F6FDC51E189F35A6E6DA683EC2A264443531F000E0005746573745A0005746573745A48656C6C6F20466163746F6D21"}}' \
 -H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "reveal-chain",
  "params": {
    "entry": "007E18CCC911F057FB111C7570778F6FDC51E189F35A6E6DA683EC2A264443531F000E0005746573745A0005746573745A48656C6C6F20466163746F6D21"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "message": "Entry Reveal Success",
    "entryhash": "f5c956749fc3eba4acc60fd485fb100e601070a44fcce54ff358d60669854734"
  }
}

Reveal the First Entry in a Chain to factomd after the Commit to compleate the Chain creation. The reveal chain hex encoded string is documented here: Github Documentation

The reveal-chain api takes a specficically formated message encoded in hex that includes signatures. If you have a factom-walletd instance running, you can construct this reveal-chain api call with compose-chain which takes easier to construct arguments.

The compose-chain api call has two api calls in it’s response: commit-chain and reveal-chain. To successfully create a chain, the reveal-chain must be called after the commit-chain.

commit-entry

Example Request

curl -X POST --data '{"jsonrpc": "2.0", "id": 0, "method": "commit-entry", "params":
{"message":"00015507C1024BF5C956749FC3EBA4ACC60FD485FB100E601070A44FCCE54FF358D60669854734013B6A27BCCEB6A42D62A3A8D02A6F0D73653215771DE243A63AC048A18B59DA29F4CBD953E6EBE684D693FDCA270CE231783E8ECC62D630F983CD59E559C6253F84D1F54C8E8D8665D493F7B4A4C1864751E3CDEC885A64C2144E0938BF648A00"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "commit-entry",
  "params": {
    "message": "00015507C1024BF5C956749FC3EBA4ACC60FD485FB100E601070A44FCCE54FF358D60669854734013B6A27BCCEB6A42D62A3A8D02A6F0D73653215771DE243A63AC048A18B59DA29F4CBD953E6EBE684D693FDCA270CE231783E8ECC62D630F983CD59E559C6253F84D1F54C8E8D8665D493F7B4A4C1864751E3CDEC885A64C2144E0938BF648A00"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "message": "Entry Commit Success",
    "txid": "bf12150038699f678ac2314e9fa2d4786dc8984d9b8c67dab8cd7c2f2e83372c"
  }
}

Send an Entry Commit Message to factom to create a new Entry. The entry commit hex encoded string is documented here: Github Documentation

The commit-entry api takes a specficically formated message encoded in hex that includes signatures. If you have a factom-walletd instance running, you can construct this commit-entry api call with compose-entry which takes easier to construct arguments.

The compose-entry api call has two api calls in it’s response: commit-entry and reveal-entry. To successfully create an entry, the reveal-entry must be called after the commit-entry.

reveal-entry

Example Request

curl -X POST --data '{"jsonrpc": "2.0", "id": 0, "method": "reveal-entry", "params":
{"entry":"007E18CCC911F057FB111C7570778F6FDC51E189F35A6E6DA683EC2A264443531F000E0005746573745A0005746573745A48656C6C6F20466163746F6D21"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "reveal-entry",
  "params": {
    "entry": "007E18CCC911F057FB111C7570778F6FDC51E189F35A6E6DA683EC2A264443531F000E0005746573745A0005746573745A48656C6C6F20466163746F6D21"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "message": "Entry Reveal Success",
    "entryhash": "f5c956749fc3eba4acc60fd485fb100e601070a44fcce54ff358d60669854734"
  }
}

Reveal an Entry to factomd after the Commit to compleate the Entry creation. The reveal entry hex encoded string is documented here: Github Documentation

The reveal-entry api takes a specficically formated message encoded in hex that includes signatures. If you have a factom-walletd instance running, you can construct this reveal-entry api call with compose-entry which takes easier to construct arguments.

The compose-entry api call has two api calls in it’s response: commit-entry and reveal-entry. To successfully create an entry, the reveal-entry must be called after the commit-entry.

send-raw-message

Send a raw hex encoded binary message to the Factom network. This is mostly just for debugging and testing.

Commit Chain Example

Example Request

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "send-raw-message",
  "params": {
    "message": "0401554b9c15b100015507b2f70bd0165d9fa19a28cfaafb6bc82f538955a98c7b7e60d79fbf92655c1bff1c76466cb3bc3f3cc68d8b2c111f4f24c88d9c031b4124395c940e5e2c5ea496e8aaa2f5c956749fc3eba4acc60fd485fb100e601070a44fcce54ff358d606698547340b3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da2946c901273e616bdbb166c535b26d0d446bc69b22c887c534297c7d01b2ac120237086112b5ef34fc6474e5e941d60aa054b465d4d770d7f850169170ef39150b"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "message": "Successfully sent the message"
  }
}

curl -X POST --data '{"jsonrpc": "2.0", "id": 0, "method": "send-raw-message", "params": {"message":"0401554b9c15b100015507b2f70bd0165d9fa19a28cfaafb6bc82f538955a98c7b7e60d79fbf92655c1bff1c76466cb3bc3f3cc68d8b2c1 11f4f24c88d9c031b4124395c940e5e2c5ea496e8aaa2f5c956749fc3eba4acc60fd485fb100e601070a44fcce54ff358d606698547340b3b6a27bcce b6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da2946c901273e616bdbb166c535b26d0d446bc69b22c887c534297c7d01b2ac12 0237086112b5ef34fc6474e5e941d60aa054b465d4d770d7f850169170ef39150b"}}' -H 'content-type:text/plain;' htt p://localhost:8088/v2

Reveal Chain Example

Example Request

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "send-raw-message",
  "params": {
    "message": "0c01554b8e5881007e18ccc911f057fb111c7570778f6fdc51e189f35a6e6da683ec2a264443531f000e0005746573745a0005746573745a48656c6c6f20466163746f6d21"
  }
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "message": "Successfully sent the message"
  }
}

curl -X POST --data '{"jsonrpc": "2.0", "id": 0, "method": "send-raw-message", "params": {"message":"0c01554b8e5881007e18ccc911f057fb111c7570778f6fdc51e189f35a6e6da683ec2a264443531f000e0005746573745a0005746573 745a48656c6c6f20466163746f6d21"}}' -H 'content-type:text/plain;' http://localhost:8088/v2

To Check: ChainID : 7e18ccc911f057fb111c7570778f6fdc51e189f35a6e6da683ec2a264443531f Entry Hash : f5c956749fc3eba4acc60fd485fb100e601070a44fcce54ff358d60669854734

errors

Example Request

curl -X POST --data '{"jsonrpc": "2.0", "id": 0, "method": "junk"}' -H 'content-type:text/plain;' http://localhost:8088/v2

Example Response

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "junk"
}
{
  "jsonrpc": "2.0",
  "id": 0,
  "error": {
    "code": -32601,
    "message": "Method not found"
  }
}

factom-walletd API

API reference documentation for factom-walletd. factom-walletd serves the wallet api on port :8089.

All these APIs use JSON-RPC, which is a remote procedure call protocol encoded in JSON. It is a very simple protocol (and very similar to XML-RPC), defining only a handful of data types and commands.

They can be invoked as:

curl -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "METHOD_NAME", "params":{"PARAM_1":"DATA_1"}}' -H 'content-type:text/plain;' http://localhost:8089/v2

The output will also be JSON.

An example of a request and a response are given in the right panel for each of the RPC Methods.

errors

Example Request

curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "bad"}'  \
-H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "bad"
}

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "error": {
        "code": -32601,
        "message": "Method not found"
    }
}

Example of an invalid method

address

Example Request

{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "address",
    "params": {
        "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q"
    }
}
curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
"address", "params":{"address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q"}}' \ 
-H 'content-type:text/plain;' http://localhost:8089/v2

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "public": "FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
        "secret": "Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK"
    }
}

Retrieve the public and private parts of a Factoid or Entry Credit address stored in the wallet.

all-addresses

Example Request

{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "all-addresses"
}
curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "all-addresses"}' \
-H 'content-type:text/plain;' http://localhost:8089/v2

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "addresses": [
            {
                "public": "FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
                "secret": "Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK"
            },
            {
                "public": "EC3MAHiZyfuEb5fZP2fSp2gXMv8WemhQEUFXyQ2f2HjSkYx7xY1S",
                "secret": "Es3ETdf64QnorrJzosZuCbcdSVPTu1NZVezUXTjjTTSzNb12JtES"
            }
        ]
    }
}

Retrieve all of the Factoid and Entry Credit addresses stored in the wallet.

generate-ec-address

Example Request

{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "generate-ec-address"
}
curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "generate-ec-address"}' \ 
-H 'content-type:text/plain;' http://localhost:8089/v2

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "public": "EC2LV5w7pMD9fwtoAnv2wiCSGm2WzYpxjCMz84reWmBsxLuCPoBp",
        "secret": "Es3tXbGBVKZDhUWzDKzQtg4rcpmmHPXAY9vxSM2JddwJSD5td3f8"
    }
}

Create a new Entry Credit Address and store it in the wallet.

generate-factoid-address

Example Request

curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "generate-ec-address"}' \ 
-H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "generate-factoid-address"
}

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "public": "FA2uGBEmmW5VUy3obcT12DWkW91cVVRV9yppifhkGANBQCzd3pNi",
        "secret": "Fs2G4Hs9YxqBZ8TkfyWwNKmJbwet3Zg1JNXt8MrQReCEph6rGt9v"
    }
}

Create a new Entry Credit Address and store it in the wallet.

get-height

Example Request

curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "get-height"}' \ 
-H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "get-height"
}

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "height": 1030
    }
}

Get the current hight of blocks that have been cached by the wallet while syncing.

import-addresses

Example Request

curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "import-addresses", "params":{"addresses":[{"secret":"Fs2G4Hs9YxqBZ8TkfyWwNKmJbwet3Zg1JNXt8MrQReCEph6rGt9v"},{"secret":"Es3tXbGBVKZDhUWzDKzQtg4rcpmmHPXAY9vxSM2JddwJSD5td3f8"}]}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "import-addresses",
    "params": {
        "addresses": [
            {
                "secret": "Fs2G4Hs9YxqBZ8TkfyWwNKmJbwet3Zg1JNXt8MrQReCEph6rGt9v"
            },
            {
                "secret": "Es3tXbGBVKZDhUWzDKzQtg4rcpmmHPXAY9vxSM2JddwJSD5td3f8"
            }
        ]
    }
}

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "addresses": [
            {
                "public": "FA2uGBEmmW5VUy3obcT12DWkW91cVVRV9yppifhkGANBQCzd3pNi",
                "secret": "Fs2G4Hs9YxqBZ8TkfyWwNKmJbwet3Zg1JNXt8MrQReCEph6rGt9v"
            },
            {
                "public": "EC2LV5w7pMD9fwtoAnv2wiCSGm2WzYpxjCMz84reWmBsxLuCPoBp",
                "secret": "Es3tXbGBVKZDhUWzDKzQtg4rcpmmHPXAY9vxSM2JddwJSD5td3f8"
            }
        ]
    }
}

Import Factoid and/or Entry Credit address secret keys into the wallet.

import-koinify

Example Request

curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "import-koinify", "params":
{"words":"yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow"}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "import-koinify",
    "params": {
        "words": "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow"
    }
}

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "public": "FA3cih2o2tjEUsnnFR4jX1tQXPpSXFwsp3rhVp6odL5PNCHWvZV1",
        "secret": "Fs1Nifx4n5BCsS277ozuWpHqX4vRo54eYNvT3cv3wLdFbfSMMjyx"
    }
}

Import a Koinify crowd sale address into the wallet. In our examples we used the word “yellow” twelve times, note that in your case the master passphrase will be different.

wallet-backup

Example Request

{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "wallet-backup"
}
curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "wallet-backup"}' \
-H 'content-type:text/plain;' http://localhost:8089/v2

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "wallet-seed": "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow",
        "addresses": [
            {
                "public": "FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
                "secret": "Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK"
            },
            {
                "public": "FA3cih2o2tjEUsnnFR4jX1tQXPpSXFwsp3rhVp6odL5PNCHWvZV1",
                "secret": "Fs1Nifx4n5BCsS277ozuWpHqX4vRo54eYNvT3cv3wLdFbfSMMjyx"
            },
            {
                "public": "EC1r4PvxinJgUVXA1j5RhvHZSWuCHtxtH3KsA5jqKAVsxY53F3tU",
                "secret": "Es3XpT2AZaG6vWGWYEjru17mS5rP4rzKUmLfwjEiez9R3fSuy5pB"
            },
            {
                "public": "EC2LV5w7pMD9fwtoAnv2wiCSGm2WzYpxjCMz84reWmBsxLuCPoBp",
                "secret": "Es3tXbGBVKZDhUWzDKzQtg4rcpmmHPXAY9vxSM2JddwJSD5td3f8"
            },
        ]
    }
}

Return the wallet seed and all addresses in the wallet for backup and offline storage.

transactions (Retrieving)

There are a few ways to search for a transaction

Using a Range

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"transactions",
   "params":{  
      "range":{  
         "start":1,
         "end":2
      }
   }
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method"
:"transactions", "params":{"range":{"start":1,"end":2}}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2

Example Reponse

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "transactions":[  
         {  
            "blockheight":2,
            "feespaid":7999200,
            "signed":true,
            "timestamp":1441138236,
            "totalecoutputs":100000000,
            "totalinputs":107999200,
            "totaloutputs":0,
            "inputs":[  
               {  
                  "address":"FA21zXEUHMPiRtzBgiMY15cGrSpgXCsZqrDPxPv4oUZsR5f2AcjP",
                  "amount":107999200
               }
            ],
            "outputs":null,
            "ecoutputs":[  
               {  
                  "address":"EC2LQ673tP3bRPgzuY6iyNVNvzHxVtzAcG5yw6KyBJpftGWsdS2t",
                  "amount":100000000
               }
            ],
            "txid":"82bd7f0461cfc915b539075faac07488e911ea6dcf1512ca913a876e020ff251"
         },
         {  
            "blockheight":1,
            "feespaid":7999200,
            "signed":true,
            "timestamp":1441138021,
            "totalecoutputs":200000000,
            "totalinputs":207999200,
            "totaloutputs":0,
            "inputs":[  
               {  
                  "address":"FA2vGRwutdPdTHQa7kkpX3LkSgqKQ1MS2nur4UqbxqP5MGHcziWa",
                  "amount":207999200
               }
            ],
            "outputs":null,
            "ecoutputs":[  
               {  
                  "address":"EC1whAxbYYsfQoAFLuzHCsz4Qz29WePBcrrGj5MqMQ1PR43wjiBH",
                  "amount":200000000
               }
            ],
            "txid":"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0"
         }
      ]
   }
}

This will retrieve all transactions within a given block height range.

By TxID

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"transactions",
   "params":{  
      "txid":"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0"
   }
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
"transactions", "params":{"txid":
"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0"}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2

Example Reponse

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "transactions":[  
         {  
            "feespaid":7999200,
            "signed":true,
            "timestamp":8,
            "totalecoutputs":200000000,
            "totalinputs":207999200,
            "totaloutputs":0,
            "inputs":[  
               {  
                  "address":"FA2vGRwutdPdTHQa7kkpX3LkSgqKQ1MS2nur4UqbxqP5MGHcziWa",
                  "amount":207999200
               }
            ],
            "outputs":null,
            "ecoutputs":[  
               {  
                  "address":"EC1whAxbYYsfQoAFLuzHCsz4Qz29WePBcrrGj5MqMQ1PR43wjiBH",
                  "amount":200000000
               }
            ],
            "txid":"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0"
         }
      ]
   }
}

This will retrieve a transaction by the given TxID. This call is the fastest way to retrieve a transaction, but it will not display the height of the transaction. If a height is in the response, it will be 0. To retrieve the height of a transaction, use the ‘By Address’ method

This call in the backend really pushes the request to factomd. For a more informative reponse, it is advised to use the factomd transaction method

By Address

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0,
"method":"transactions", "params":
{"address":"FA2vGRwutdPdTHQa7kkpX3LkSgqKQ1MS2nur4UqbxqP5MGHcziWa"}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"transactions",
   "params":{  
      "address":"FA2vGRwutdPdTHQa7kkpX3LkSgqKQ1MS2nur4UqbxqP5MGHcziWa"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "transactions":[  
         {  
            "blockheight":1,
            "feespaid":7999200,
            "signed":true,
            "timestamp":1441138021,
            "totalecoutputs":200000000,
            "totalinputs":207999200,
            "totaloutputs":0,
            "inputs":[  
               {  
                  "address":"FA2vGRwutdPdTHQa7kkpX3LkSgqKQ1MS2nur4UqbxqP5MGHcziWa",
                  "amount":207999200
               }
            ],
            "outputs":null,
            "ecoutputs":[  
               {  
                  "address":"EC1whAxbYYsfQoAFLuzHCsz4Qz29WePBcrrGj5MqMQ1PR43wjiBH",
                  "amount":200000000
               }
            ],
            "txid":"f1d9919829fa71ce18caf1bd8659cce8a06c0026d3f3fffc61054ebb25ebeaa0"
         },
         {  
            "feespaid":1673832600,
            "signed":true,
            "timestamp":1441137600,
            "totalecoutputs":0,
            "totalinputs":178826890364500,
            "totaloutputs":178825216531900,
            "inputs":[  
               {  
                  "address":"FA2L6Vng4jBMbbDZtYLsxKQbAAin4Rxg2CgvnyzXrwENSK1t2QUx",
                  "amount":178826890364500
               }
            ],
            "outputs":[  
               {  
                  "address":"FA2vGRwutdPdTHQa7kkpX3LkSgqKQ1MS2nur4UqbxqP5MGHcziWa",
                  "amount":224108800
               }
            ],
            "ecoutputs":null,
            "txid":"18b13f36b22d6cc23cab2a42fc277ecb0033a0281e646f14e0339e1fbc2ee464"
         }
      ]
   }
}

Retrieves all transactions that an address is apart of.

All Transactions

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, 
"method":"transactions"}' -H 'content-type:text/plain;' \
http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"transactions"
}

The developers were so preoccupied with whether or not they could, they didn’t stop to think if they should.

The amount of data returned by this is so large, I couldn’t get you a sample output as it froze my terminal window. It is strongly reccomended to use other techniques to retrieve transactions, it is rarely the case to require EVERY transaction in the blockchain. If you are still determined to retrieve EVERY transaction in the blockchain, use other techniques such as using the 'range’ method and specifically requesting for transactions between blocks X and Y, then incrementing your X’s and Y’s until you reach the latest block. This is much more manageable.

tmp-transactions

Example Request

curl  -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, 
"method":"tmp-transactions"}' -H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc": "2.0",
    "id": 0,
    "method":"tmp-transactions"
}

Example Response

{
    "jsonrpc":"2.0",
    "id":0,
    "result":{
        "transactions":[
            {
                "tx-name":"TX_NAME",
                "txid":"e387d89510f16e69ca979bde111caf97d2fc1cf273fe82bf41e241980df76dba",
                "totalinputs":0,
                "totaloutputs":0,
                "totalecoutputs":0
            }
        ]
    }
}

Lists all the current working transactions in the wallet. These are transactions that are not yet sent.

delete-transaction

Example Request

{
    "jsonrpc":"2.0",
    "id":0,"method":"delete-transaction",
    "params":{
        "tx-name":"a"
    }
}
curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, 
"method":"delete-transaction", "params":{"tx-name":"TX_NAME"}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "signed":false,
      "name":"TX_NAME",
      "timestamp":-62135596800,
      "totalecoutputs":0,
      "totalinputs":0,
      "totaloutputs":0,
      "inputs":null,
      "outputs":null,
      "ecoutputs":null
   }
}

Deletes a working transaction in the wallet. The full transaction will be returned, and then deleted.

new-transaction

Example Request

curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method":"new-transaction", 
"params":{"tx-name":"TX_NAME"}}' -H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc":"2.0",
    "id":0,"method":"new-transaction",
    "params":{
        "tx-name":"TX_NAME"
    }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "feesrequired":1000,
      "signed":false,
      "name":"TX_NAME",
      "timestamp":1484933437,
      "totalecoutputs":0,
      "totalinputs":0,
      "totaloutputs":0,
      "inputs":null,
      "outputs":null,
      "ecoutputs":null,
      "txid":"4ab170433f9384f3e77a25a5d21a58f794bef19b9a363bcd88048203d73cf3ba"
   }
}

This will create a new transaction. The txid is in flux until the final transaction is signed. Until then, it should not be used or recorded.

When dealing with transactions all factoids are represented in factoshis. 1 factoid is 1e8 factoshis, meanining you can never send anything less than 0 to a transaction (0.5).

add-input

Example Request

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method":"add-input","params":
{"tx-name":"TX_NAME","address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q","amount":2000000000}}' \
 -H 'content-type:text/plain;' http://localhost:8089/v2 
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"add-input",
   "params":{  
      "tx-name":"TX_NAME",
      "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
      "amount":2000000000
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "feespaid":2000000000,
      "feesrequired":2000,
      "signed":false,
      "name":"TX_NAME",
      "timestamp":1484934602,
      "totalecoutputs":0,
      "totalinputs":2000000000,
      "totaloutputs":0,
      "inputs":[  
         {  
            "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
            "amount":2000000000
         }
      ],
      "outputs":null,
      "ecoutputs":null,
      "txid":"e713c13c4b3868cc884d1baa68f77cacbe74a2a248f38d4ac5883550fce0c961"
   }
}

Adds an input to the transaction from the given address. The public address is given, and the wallet must have the private key associated with the address in order to succusfully sign the transaction.

The input is measured in factoshis, so to send 10 factoids, you must input 1,000,000,000 factoshis (without commas in json)

add-output

Example Request

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method":"add-output",
"params":{"tx-name":"TX_NAME","address":
"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P","amount":1000000000}}'  \
-H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"add-output",
   "params":{  
      "tx-name":"TX_NAME",
      "address":"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P",
      "amount":1000000000
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "feespaid":1000000000,
      "feesrequired":12000,
      "signed":false,
      "name":"TX_NAME",
      "timestamp":1484934602,
      "totalecoutputs":0,
      "totalinputs":2000000000,
      "totaloutputs":1000000000,
      "inputs":[  
         {  
            "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
            "amount":2000000000
         }
      ],
      "outputs":[  
         {  
            "address":"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P",
            "amount":1000000000
         }
      ],
      "ecoutputs":null,
      "txid":"e713d93303077cb87634489c9fd335b394925bf3ae167e5f226b523fa882dd71"
   }
}

Adds a factoid address output to the transaction. Keep in mind the output is done in factoshis. 1 factoid is 1,000,000,000 factoshis.

So to send 10 factoids, you must send 1,000,000,000 factoshis (no commas in json).

add-ec-output

Example Request

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method":"add-ec-output"
,"params":{"tx-name":"TX_NAME","address":
"EC22MrL8CT4iTfRhxPvAStm9v4XEn5cJPvUpY39GLgU9GPnKMffn","amount":10000}}' \
 -H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"add-ec-output",
   "params":{  
      "tx-name":"TX_NAME",
      "address":"EC22MrL8CT4iTfRhxPvAStm9v4XEn5cJPvUpY39GLgU9GPnKMffn",
      "amount":10000
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "feesrequired":22000,
      "signed":false,
      "name":"TX_NAME",
      "timestamp":1484934602,
      "totalecoutputs":10,
      "totalinputs":2000000000,
      "totaloutputs":1000000000,
      "inputs":[  
         {  
            "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
            "amount":2000000000
         }
      ],
      "outputs":[  
         {  
            "address":"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P",
            "amount":1000000000
         }
      ],
      "ecoutputs":[  
         {  
            "address":"EC22MrL8CT4iTfRhxPvAStm9v4XEn5cJPvUpY39GLgU9GPnKMffn",
            "amount":10000
         }
      ],
      "txid":"65ec0f3990c49bd18ec4e9c10c6f1d0fa91572dd7cdbf61e5b47b67ab0f011f6"
   }
}

When adding entry credit outputs, the amount given is in factoshis, not entry credtis. This means math is required to determine the correct amount of factoshis to pay to get X EC.

(ECRate * ECTotalOutput)

In our case the rate is 1000, meaning 1000 entry credits per factoid. We added 10 entry credits, so we need 1,000 * 10 = 10,000 factoshis

To get the ECRate search in the search bar above for “entry-credit-rate”

add-fee

Example Request

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method":"add-fee","params":
{"tx-name":"TX_NAME","address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q"}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"add-fee",
   "params":{  
      "tx-name":"TX_NAME",
      "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "feespaid":22000,
      "feesrequired":22000,
      "signed":false,
      "name":"TX_NAME",
      "timestamp":1484934602,
      "totalecoutputs":10000,
      "totalinputs":1000032000,
      "totaloutputs":1000000000,
      "inputs":[  
         {  
            "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
            "amount":1000032000
         }
      ],
      "outputs":[  
         {  
            "address":"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P",
            "amount":1000000000
         }
      ],
      "ecoutputs":[  
         {  
            "address":"EC22MrL8CT4iTfRhxPvAStm9v4XEn5cJPvUpY39GLgU9GPnKMffn",
            "amount":10000
         }
      ],
      "txid":"0afa940a04f2423135fef1c62c6785dc105850079583c2b1881b6b23017266b3"
   }
}

Addfee is a shortcut and safeguard for adding the required additonal factoshis to covert the fee. The fee is displayed in the returned transaction after each step, but this be used instead of manually adding the additional input. It is a safeguard as it prevents overpaying.

Addfee will complain if your inputs and outputs do not match up. For example, in the steps above we added the inputs first, this was intentional to show a case of overpaying. Obviously no one wants to overpay for a transaction, so addfee has returned an error and this message: 'Inputs and outputs don’t add up’ . This is because we have 2,000,000,000 factoshis as input and only 1,000,000,000 + 10,000 as output. Lets correct the input by doing 'add-input’, and putting 1000010000 as the amount for the address. It will overwrite the previous input.

Curl to do that:

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method":"add-input","params": {"tx-name":"TX_NAME","address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q","amount":1000010000}}' \ -H 'content-type:text/plain;' http://localhost:8089/v2

Run the addfee again and the feepaid and feerequired will match up

sub-fee

Example Request

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method"
:"sub-fee","params": {"tx-name":"TX_NAME","address":
"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P"}}' \
-H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"sub-fee",
   "params":{  
      "tx-name":"TX_NAME",
      "address":"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "feespaid":22000,
      "feesrequired":22000,
      "signed":false,
      "name":"TX_NAME",
      "timestamp":1484934602,
      "totalecoutputs":10000,
      "totalinputs":1000010000,
      "totaloutputs":999978000,
      "inputs":[  
         {  
            "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
            "amount":1000010000
         }
      ],
      "outputs":[  
         {  
            "address":"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P",
            "amount":999978000
         }
      ],
      "ecoutputs":[  
         {  
            "address":"EC22MrL8CT4iTfRhxPvAStm9v4XEn5cJPvUpY39GLgU9GPnKMffn",
            "amount":10000
         }
      ],
      "txid":"32fbdc624fb31927f60a1cd52a836b1c65cc49ddc98b41d4d7adb50780ebf305"
   }
}

When paying from a transaction, you can also make the recieving transaction pay for it. Using sub fee, you can use the recieiving address in the parameters, and the fee will be deducted from their output amount.

This allows a wallet to send all it’s factoids, by making the input and output the remaining balance, then using sub fee on the output address.

sign-transaction

Example Request

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method":"sign-transaction","params":{"tx-name":"TX_NAME"}}' \
 -H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"sign-transaction",
   "params":{  
      "tx-name":"TX_NAME"
   }
}

Example Reponse

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "feespaid":22000,
      "feesrequired":22000,
      "signed":true,
      "name":"TX_NAME",
      "timestamp":1484934602,
      "totalecoutputs":10000,
      "totalinputs":1000010000,
      "totaloutputs":999978000,
      "inputs":[  
         {  
            "address":"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q",
            "amount":1000010000
         }
      ],
      "outputs":[  
         {  
            "address":"FA2H7gecy8Nr7cxF7ngtByW23PxvrysuzYMAiAhbRTddCWZTLs4P",
            "amount":999978000
         }
      ],
      "ecoutputs":[  
         {  
            "address":"EC22MrL8CT4iTfRhxPvAStm9v4XEn5cJPvUpY39GLgU9GPnKMffn",
            "amount":10000
         }
      ],
      "txid":"32fbdc624fb31927f60a1cd52a836b1c65cc49ddc98b41d4d7adb50780ebf305"
   }
}

Signs the transaction. It is now ready to be signed

compose-transaction

Example Request

curl -X POST --data-binary '{"jsonrpc":"2.0","id":0,"method":"compose-transaction",
"params":{"tx-name":"TX_NAME"}}' -H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"compose-transaction",
   "params":{  
      "tx-name":"TX_NAME"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "jsonrpc":"2.0",
      "id":3,
      "params":{  
         "transaction":"020159bcffde4d01010183dcebe210646f3e8750c550e4582eca5047546ffef89c13a175985e320232bacac81cc42883dce9e81028f458993c24c1cee28b34f77fc633c92603f36e1c1cd1f21350753f00eccdefce1022883c5223b3344e0a0e0a9a5a23856890507d4451a5ee2de0ca6c6d699d4cdf01718b5edd2914acc2e4677f336c1a32736e5e9bde13663e6413894f57ec272e28a30347ad7a0b4d449a0e644e5b4bd53eda240677a450b6f19482b63558031c027ae7ca84d713a4eac48a3e9f57603fe270318fc8144eb107fa10c6cf349c9006"
      },
      "method":"factoid-submit"
   }
}

Compose transaction marshals the transaction into a hex encoded string. The string can be inputted into the factomd API factoid-submit to be sent to the network.

compose-chain

Example Request

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
 "compose-chain", "params": {"chain": {"firstentry":
 {"extids":["abcd", "1234"], "content":"1234abcd"}},
  "ecpub":"EC2DKSYyRcNWf7RS963VFYgMExo1824HVeCfQ9PGPmNzwrcmgm2r"}}'\
-H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"compose-chain",
   "params":{  
      "chain":{  
         "firstentry":{  
            "extids":[  
               "abcd",
               "1234"
            ],
            "content":"1234abcd"
         }
      },
      "ecpub":"EC2DKSYyRcNWf7RS963VFYgMExo1824HVeCfQ9PGPmNzwrcmgm2r"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "commit":{  
         "jsonrpc":"2.0",
         "id":2885,
         "params":{  
            "message":"00015a9177f43d5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456abc6ea48b1287d0e5f2cf64798647221842e46b37e920cfaea62723c15195c320a9c707c2dfe35d43a21255c51012dae80cefbb14cf6571b6e195f5365bac7d30b3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29e84f101bcf1d3a8ca45ad5c1a0ab3cf8ab935a2ad4f75914a0fb08e267facd9540cefe6833f3ea0295c3c2035bcd42a94e26477f096474b05e67538a34945a09"
         },
         "method":"commit-chain"
      },
      "reveal":{  
         "jsonrpc":"2.0",
         "id":2886,
         "params":{  
            "entry":"00e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b85500080002abcd000212341234abcd"
         },
         "method":"reveal-chain"
      }
   }
}

This method, compose-chain, will return the appropriate api calls to create a chain in factom. You must first call the commit-chain, then the reveal-chain api calls. To be safe, wait a few seconds after calling commit.

compose-entry

Example Request

curl -X POST --data-binary '{ "jsonrpc": "2.0", "id": 0, "method":
 "compose-entry", "params": { "entry": 
 {"chainid":"48e0c94d00bf14d89ab10044075a370e1f55bcb28b2ff16206d865e192827645", 
 "extids":["cd90", "90cd"], "content":"abcdef"}, "ecpub":"EC2DKSYyRcNWf7RS963VFYgMExo1824HVeCfQ9PGPmNzwrcmgm2r"}}'\
-H 'content-type:text/plain;' http://localhost:8089/v2
{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"compose-entry",
   "params":{  
      "entry":{  
         "chainid":"48e0c94d00bf14d89ab10044075a370e1f55bcb28b2ff16206d865e192827645",
         "extids":[  
            "cd90",
            "90cd"
         ],
         "content":"abcdef"
      },
      "ecpub":"EC2DKSYyRcNWf7RS963VFYgMExo1824HVeCfQ9PGPmNzwrcmgm2r"
   }
}

Example Response

{  
   "jsonrpc":"2.0",
   "id":0,
   "result":{  
      "commit":{  
         "jsonrpc":"2.0",
         "id":2889,
         "params":{  
            "message":"00015a91804aa917606c4f9717f13e157e0b80c6f482888a62bd20440c7eb49f90393c9c279457013b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29e95f7957b0555b7cb80e93c6923b43e98e9a308503197af70af607fc30abc1b36d52b3388d0507460caf4d30a1be8fba80c5416f34bf6c0394e26a9a9814070a"
         },
         "method":"commit-entry"
      },
      "reveal":{  
         "jsonrpc":"2.0",
         "id":2890,
         "params":{  
            "entry":"0048e0c94d00bf14d89ab10044075a370e1f55bcb28b2ff16206d865e19282764500080002cd90000290cdabcdef"
         },
         "method":"reveal-entry"
      }
   }
}

This method, compose-entry, will return the appropriate api calls to create a entry in factom. You must first call the commit-entry, then the reveal-entry api calls. To be safe, wait a few seconds after calling commit.

properties

Example Request

curl  -X GET --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "properties"}'  \
-H 'content-type:text/plain;' http://localhost:8089/v2
{
    "jsonrpc": "2.0",
    "id": 0,
    "method": "properties"
}

Example Response

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "walletversion": "0.2.0.0",
        "walletapiversion": "2.0"
    }
}

Retrieve current properties of factom-walletd, including the wallet and wallet API versions.

Debug API

These API calls were originally created for Factom internal use to help them develop better tools and quickly monitor processes, nodes and servers. These API calls are primarily for debugging information and purposes.

An example of a request and a response are given in the right panel for each of the RPC Methods.

holding-queue

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"holding-queue"
}
 curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "holding-queue"}' \
 -H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":{
    "Messages":null
    }
}

Show current holding messages in queue.

network-info

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"network-info"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "network-info"}' \ 
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":{
    "NetworkNumber":1,
    "NetworkName":"MAIN",
    "NetworkID":4203931043
    }
}

Get information on the current network factomd is connected to (TEST, MAIN, etc).

predictive-fer

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"predictive-fer"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "predictive-fer"}' \ 
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":{
    "PredictiveFER":666600
    }
}

Get the predicted future entry credit rate.

audit-servers

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"audit-servers"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "audit-servers"}' \ 
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":{
    "AuditServers":[]
    }
}

Get a list of the current network audit servers along with their information.

federated-servers

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"federated-servers"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "federated-servers"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":{
    "FederatedServers":[
        {
        "ChainID":"0000000000000000000000000000000000000000000000000000000000000000",
        "Name":"",
        "Online":true,
        "Replace":null
        }
    ]
    }
}

Get a list of the current network federated servers along with their information.

configuration

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"configuration"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "configuration"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":
    {
    "App":
        {
        "PortNumber":8088,
        "HomeDir":"/home/.factom/m2/",
        "ControlPanelPort":8090,
        "ControlPanelFilesPath":"/home/.factom/m2/",
        "ControlPanelSetting":"readonly",
        "DBType":"LDB",
        "LdbPath":"/home/.factom/m2/test-database/ldb",
        "BoltDBPath":"/home/.factom/m2/test-database/bolt",
        "DataStorePath":"/home/.factom/m2/test-data/export",
        "DirectoryBlockInSeconds":6,
        "ExportData":false,
        "ExportDataSubpath":"/home/.factom/m2/test-database/export/",
        "NodeMode":"FULL","IdentityChainID":"",
        "LocalServerPrivKey":"4c38c72fc5cdad68f13b74674d3ffb1f3d63a112710868c9b08946553448d26d",
        "LocalServerPublicKey":"cc1985cdfae4e32b5a454dfda8ce5e1361558482684f3367649c3ad852c8e31a",
        "ExchangeRate":0,
        "ExchangeRateChainId":"111111118d918a8be684e0dac725493a75862ef96d2d3f43f84b26969329bf03",
        "ExchangeRateAuthorityPublicKey":"daf5815c2de603dbfa3e1e64f88a5cf06083307cf40da4a9b539c41832135b4a",
        "ExchangeRateAuthorityPublicKeyMainNet":"daf5815c2de603dbfa3e1e64f88a5cf06083307cf40da4a9b539c41832135b4a",
        "ExchangeRateAuthorityPublicKeyTestNet":"1d75de249c2fc0384fb6701b30dc86b39dc72e5a47ba4f79ef250d39e21e7a4f",
        "ExchangeRateAuthorityPublicKeyLocalNet":"3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29",
        "Network":"MAIN",
        "MainNetworkPort":"8108",
        "PeersFile":"/home/.factom/m2/test-peers.json",
        "MainSeedURL":"https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/mainseed.txt",
        "MainSpecialPeers":"",
        "TestNetworkPort":"8109",
        "TestSeedURL":"https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/testseed.txt",
        "TestSpecialPeers":"",
        "LocalNetworkPort":"8110",
        "LocalSeedURL":"https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/localseed.txt",
        "LocalSpecialPeers":"",
        "CustomBootstrapIdentity":"38bab1455b7bd7e5efd15c53c777c79d0c988e9210f1da49a99d95b3a6417be9",
        "CustomBootstrapKey":"cc1985cdfae4e32b5a454dfda8ce5e1361558482684f3367649c3ad852c8e31a",
        "FactomdTlsEnabled":false,
        "FactomdTlsPrivateKey":"/full/path/to/factomdAPIpriv.key",
        "FactomdTlsPublicCert":"/full/path/to/factomdAPIpub.cert",
        "FactomdRpcUser":"",
        "FactomdRpcPass":"",
        "ChangeAcksHeight":0
        },
    "Peer":
        {
        "AddPeers":null,
        "ConnectPeers":null,
        "Listeners":null,
        "MaxPeers":0,
        "BanDuration":0,
        "TestNet":false,
        "SimNet":false
        },
    "Log":
        {
        "LogPath":"/home/mjb/.factom/m2/test-database/Log",
        "LogLevel":"error",
        "ConsoleLogLevel":"standard"
        },
    "Wallet":
        {
        "Address":"",
        "Port":0,
        "DataFile":"",
        "RefreshInSeconds":"",
        "BoltDBPath":"",
        "FactomdAddress":"",
        "FactomdPort":0
        },
    "Walletd":
        {
        "WalletRpcUser":"",
        "WalletRpcPass":"",
        "WalletTlsEnabled":false,
        "WalletTlsPrivateKey":"/full/path/to/walletAPIpriv.key",
        "WalletTlsPublicCert":"/full/path/to/walletAPIpub.cert",
        "FactomdLocation":"localhost:8088",
        "WalletdLocation":"localhost:8089"
        }
    }
}

Get the current configuration state from factomd.

process-list

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"process-list"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "process-list"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

authorities

List of authority servers in the management chain.

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"authorities"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "authorities"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":
    {
    "Authorities"[
        {
        "AuthorityChainID":"0000000000000000000000000000000000000000000000000000000000000000",
        "ManagementChainID":"0000000000000000000000000000000000000000000000000000000000000000",
        "MatryoshkaHash":"0000000000000000000000000000000000000000000000000000000000000000",
        "SigningKey":"49b6edd274e7d07c94d4831eca2f073c207248bde1bf989d2183a8cebca227b7",
        "Status":1,
        "AnchorKeys":null,
        "KeyHistory":null
        }
    ]
    }
}

Get the process list known to the current factomd instance.

reload-configuration

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"reload-configuration"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "reload-configuration"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":{
    "App":{
        "PortNumber":8088,
        "HomeDir":"/home/.factom/m2/",
        "ControlPanelPort":8090,
        "ControlPanelFilesPath":"/home/.factom/m2/",
        "ControlPanelSetting":"readonly",
        "DBType":"LDB","LdbPath":"/home/.factom/m2/test-database/ldb",
        "BoltDBPath":"/home/.factom/m2/test-database/bolt",
        "DataStorePath":"/home/.factom/m2/test-data/export",
        "DirectoryBlockInSeconds":6,"ExportData":false,
        "ExportDataSubpath":"/home/.factom/m2/test-database/export/",
        "NodeMode":"FULL",
        "IdentityChainID":"",
        "LocalServerPrivKey":"4c38c72fc5cdad68f13b74674d3ffb1f3d63a112710868c9b08946553448d26d",
        "LocalServerPublicKey":"cc1985cdfae4e32b5a454dfda8ce5e1361558482684f3367649c3ad852c8e31a",
        "ExchangeRate":0,
        "ExchangeRateChainId":"111111118d918a8be684e0dac725493a75862ef96d2d3f43f84b26969329bf03",
        "ExchangeRateAuthorityPublicKey":"daf5815c2de603dbfa3e1e64f88a5cf06083307cf40da4a9b539c41832135b4a",
        "ExchangeRateAuthorityPublicKeyMainNet":"daf5815c2de603dbfa3e1e64f88a5cf06083307cf40da4a9b539c41832135b4a",
        "ExchangeRateAuthorityPublicKeyTestNet":"1d75de249c2fc0384fb6701b30dc86b39dc72e5a47ba4f79ef250d39e21e7a4f",
        "ExchangeRateAuthorityPublicKeyLocalNet":"3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29",
        "Network":"MAIN",
        "MainNetworkPort":"8108","PeersFile":"/home/.factom/m2/test-peers.json",
        "MainSeedURL":"https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/mainseed.txt",
        "MainSpecialPeers":"",
        "TestNetworkPort":"8109",
        "TestSeedURL":"https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/testseed.txt",
        "TestSpecialPeers":"",
        "LocalNetworkPort":"8110",
        "LocalSeedURL":"https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/localseed.txt",
        "LocalSpecialPeers":"",
        "CustomBootstrapIdentity":"38bab1455b7bd7e5efd15c53c777c79d0c988e9210f1da49a99d95b3a6417be9",
        "CustomBootstrapKey":"cc1985cdfae4e32b5a454dfda8ce5e1361558482684f3367649c3ad852c8e31a",
        "FactomdTlsEnabled":false,
        "FactomdTlsPrivateKey":"/full/path/to/factomdAPIpriv.key",
        "FactomdTlsPublicCert":"/full/path/to/factomdAPIpub.cert",
        "FactomdRpcUser":"",
        "FactomdRpcPass":"",
        "ChangeAcksHeight":0
    },
    "Peer":{
        "AddPeers":null,
        "ConnectPeers":null,
        "Listeners":null,
        "MaxPeers":0,
        "BanDuration":0,
        "TestNet":false,
        "SimNet":false
    },
    "Log":{
        "LogPath":"/home/.factom/m2/test-database/Log",
        "LogLevel":"error",
        "ConsoleLogLevel":"standard"
    },
    "Wallet":{
        "Address":"",
        "Port":0,
        "DataFile":"",
        "RefreshInSeconds":"",
        "BoltDBPath":"",
        "FactomdAddress":"",
        "FactomdPort":0
    },
    "Walletd":{
        "WalletRpcUser":"",
        "WalletRpcPass":"",
        "WalletTlsEnabled":false,
        "WalletTlsPrivateKey":"/full/path/to/walletAPIpriv.key",
        "WalletTlsPublicCert":"/full/path/to/walletAPIpub.cert",
        "FactomdLocation":"localhost:8088",
        "WalletdLocation":"localhost:8089"
    }
}
}

Causes factomd to re-read the configuration from the config file. Note:This may cause consensus problems and could be impractical even in testing.

drop-rate

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"drop-rate"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "drop-rate"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
    "jsonrpc":"2.0",
    "id":0,
    "result":{
        "DropRate":0
    }
}

Get the current package drop rate for network testing.

set-drop-rate

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"set-drop-rate",
   "params":{  
      "DropRate":10
   }
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "set-drop-rate", "params":{"DropRate":10}}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
    "jsonrpc":"2.0",
    "id":0,
    "result":{
        "DropRate":10
    }
}

Change the network drop rate for testing.

current-minute

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"current-minute"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "current-minute"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
    "jsonrpc":"2.0",
    "id":0,
    "result":{
        "Minute":0
    }
}

Get the current minute number for the open entry block.

delay

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"delay"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "delay"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
    "jsonrpc":"2.0",
    "id":0,"result":{
        "Delay":0
    }
}

Get the current msg delay time for network testing.

set-delay

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"set-delay",
   "params":{  
      "Delay":10
   }
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "set-delay", "params":{"Delay":10}}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
    "jsonrpc":"2.0",
    "id":0,
    "result":{
        "Delay":10
    }
}

summary

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"summary"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "summary"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
    "jsonrpc":"2.0",
    "id":0,
    "result":{
        "Summary":"    FNode0[b1455b]
        L___vm00  0/ 0  0.0%  0.000  2832[1aac21] 2830/2833/2834   1/ 1        
        0/0/0/0                    0/0/0/0      0     0        0/0/0          
        0/0/0   0.00/0.00 0/0 -"
    }
}

Get the nodes summary string.

messages

Example Request

{  
   "jsonrpc":"2.0",
   "id":0,
   "method":"messages"
}
curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "messages"}' \
-H 'content-type:text/plain;' http://localhost:8088/debug

Example Response

{
"jsonrpc":"2.0",
"id":0,
"result":{
    "Messages":[
        "... Messages ..."
    ]}
}

Get a list of messages from the message journal (must run factomd with -journaling=true).

Security

Encrypted Connections

When factomd is run with TLS enabled, the calling program needs to specify the certificate file generated by factomd. This is how to use curl with TLS.

Example Request

`curl -X POST --cacert ~/.factom/m2/factomdAPIpub.cert --data-binary '{"jsonrpc":"2.0","id":0,"method":"properties"}' \
-H 'content-type:text/plain;' https://localhost:8088/v2`

Password Protection

When factomd is run with a password, it uses HTTP Basic Authentication. It is recommended to encrypt the connection when using a password, because otherwise the password can be sniffed on the network. Here is how to run with just the password:

Example Request

`curl -X POST -u userHere:securePassHere --data-binary '{"jsonrpc":"2.0","id":0,"method":"properties"}' \
-H 'content-type:text/plain;' http://localhost:8088/v2`

Combined Password and Encryption

Example Request

`curl -X POST -u userHere:securePassHere --cacert ~/.factom/m2/factomdAPIpub.cert \
--data-binary '{"jsonrpc":"2.0","id":0,"method":"properties"}' \
-H 'content-type:text/plain;' https://localhost:8088/v2`

Creating Certificates

Normally, when started the program creates a new certificate if one is not found. The certificates are bound to a set of specific IP addresses.

Normally it finds the IP address by asking the OS. When using cloud services that use a different public IP than the server sees (AWS, Azure) the certificate needs to be told what the external IP address is manually. There are two options for this.

1 - Edit the config file to show the external IP address instead of localhost for FactomdLocation.

2 - Start factomd with the selfaddr flag and pass a comma separated list of authorized domains and IP addresses:

factomd -tls=true -selfaddr=domain.net,123.23.111.444