Accumulate
  • Getting Started
    • Introduction
    • Support
    • Glossary
    • Fees
    • Networks
    • Open source and contribution
    • Frequently Asked Questions
    • Converting FCT to ACME
  • Setup
    • Local DevNet Setup
    • Follower node setup with AccMan
    • Validator node setup with AccMan
    • Retaining validator keys when wiping node data
  • CLI
    • CLI setup
    • CLI reference
      • Flags
    • Import a Factom wallet
  • Nodes
    • Operator onboarding guide
    • Debugging node issues
  • Developer Resources
    • API Reference
    • Factom API support
  • Staking
    • What is staking
    • How to stake your tokens
    • FAQ
  • Tools
    • Explorer
    • Javascript SDK
    • Java SDK
  • Deep Dive
    • Lite accounts
    • Accumulate digital identifiers (ADIs)
    • Key management
    • Identity hierarchies
    • Synthetic transactions
    • Signatures and authorities
  • Integration
    • Ledger Integration
      • How to use the Ledger with the Accumulate CLI
      • CLI Reference
    • Tendermint
  • Tutorials
    • Accumulate Bridge Guides
      • How to convert ACME to WACME
      • How to convert WACME to ACME
      • How to setup a bridge node
    • How to create a Lite Account and Keys on Mainnet / Testnet
    • Sending Tokens from a Lite Token Account via CLI
    • How to create an ADI via CLI
    • How to create a Custom Token/Token Issuer using CLI
    • Querying Accumulate token account with Json RPC API
  • Release Note
    • Release notes
      • Release Note 2.0 RC2
      • Release Note 1.0 RC1
      • Release Note 0.6
      • Release Note 0.5.1
      • Release Note 0.5
  • Blog
  • Hackathon
    • Accumulate web3athon guide
Powered by GitBook
On this page
  • Introduction
  • Factom API
  • Factom API to Accumulate API mappings
  • Factom Wallet API

Was this helpful?

  1. Developer Resources

Factom API support

Easing the transition from Factom to Accumulate

PreviousDebugging node issuesNextWhat is staking

Last updated 2 years ago

Was this helpful?

Introduction

Factom was originally deployed in 2015. Its API has been used on many projects and by many exchanges. This paper looks at the API as it exists and details what we can do to make the Accumulate API match to the extent possible. This paper outlines what we could do to bridge Factom to Accumulate. This will not be fully implemented by Activation, and we may not ever entirely implement the calls described in this document.

Factom API

The API is designed for outside applications to process transactions and interact with the Factom federated servers. The listening port can be configured and runs on 8088 by default. All these APIs use JSON-RPC, 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.

We will go through the Factom API as it exists today and detail what we believe we can provide on Accumulate.

Factom API to Accumulate API mappings

-- Not supported

-- Only requires the transaction hash, however.

Returns Jason for entry and factoid transactions.

Accumulate has no commit transactions, so ack cannot return them Accumulate does have entries, so ack can return the entry reveals Requires a transaction date and a block date for factoid transactions

-- Not supported

-- Returns the first entry of a given data account

Commit-entry creates the signature for signing an entry and puts it in the wallet database keyed by the entry hash. Nothing is submitted to Accumulate at this time.

Reveal-entry creates the entry transaction and combines the entry transaction with the signature provided by commit-entry. The transaction is then submitted to Accumulate.

Returns

  • Leaderheight -- DVN height /600 (10 minute cadence)

  • DirectoryBlockHeight -- DVN height /600 (10 minute cadence)

  • Minute -- (DVN height / 60) % 10 (minutes within a 10 minute cadence)

  • Currentblockstarttime -- Timestamp of the first DVN minor block in a 10 minute cadence

  • Currentminutestarttime -- First DVN minor block of the current minute in a 10 minute cadence

  • Directoryblockinseconds -- 600

  • Stalldetected -- returns true if Accumulate detects a stall of the node

  • Faulttimeout -- returns 0

  • Roundtimeout -- returns 0

Note that minute times are approximate. Even in Factom, minute times could stretch or compress depending upon how the various leaders synced, or if a leader had to be replaced.

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

Reveal-chain is implemented as a Reveal-entry but creates a new Lite Data Account as well. This may be difficult to implement without a new call to create the Lite Data Account

Commit-entry creates the signature for signing an entry and puts it in the wallet database keyed by the entry hash. Nothing is submitted to Accumulate at this time. Reveal-entry creates the entry transaction and combines the entry transaction with the signature provided by commit-entry. The transaction is then submitted to Accumulate.

Sending a raw transaction allows transactions to be created off-line in secure environments and submitted to the network on a “hot” platform. Also useful for testing and debugging. Any transaction created for the Accumulate protocol should be available in raw form for disconnected construction.

Caveats include:

  • No transaction block,

  • directory block can be reported Directoryblockheight will be reported as the DNV minor block height / 600

Factom Wallet API

--

-- Not supported

-- Not supported

-- Not supported

-- Not supported

-- Given an entry hash, return the entry in JSON form

-- Deprecated; not supported

-- Not supported

-- The address specified must be a url to a key page. Returns the credit balance

-- Not supported.

-- Returns the price of credit in ACME (fixed point)

-- Deprecated; not supported

-- Returns the number of ACME at a given Lite Data Account (which can be specified with the FA address). If a URL is provided instead of an address, factoid-balance can return the number of ACME at an ADI Token Account.

-- Not Supported

-- Submit a binary transaction as long as it is properly encoded and signed to Accumulate.

Not Supported

-- Returns the last confirmed Directory Validator Block for all heights

-- all addresses must be key page urls. The call is broken up into individual calls for each key page url. Currentheight and lastsavedheight are both the current height of the DVN

-- all addresses must be token account urls. The call is broken up into individual calls for each token account. Currentheight and lastsavedheight are both the current height of the DVN

-- returns 0. Accumulate does not have the commit/reveal exchange with applications and users, so writes do not pend like they do in Factom

-- return any pending transactions in the signature chain for a particular transaction account. No changes to the JSON format are required. The “fees” entry on each transaction will be 0. (This is because Accumulate does not require the inputs to be more than the outputs to pay fees but rather uses credits on the signing key page to pay fees.)

-- will return

-- Retrieve an entry or transaction in raw format. Data is a hex encoded string.

-- Retrieve a receipt for a transaction hash or entry hash. This will be in Accumulate format

-- Supported

-- Supported

-- Not supported

Noop: we do not charge fees in the same way Factom did)

Only allow the addition of one input

Supported

Creates a lite token account address

Returns all the key books and token accounts managed by the wallet

-- Not supported

-- Not supported

Marshals the current transaction into a hex encoded string. Compose-transaction fails if the current transaction is incomplete and/or has not been signed. Returns a hex string that can be inputted into the factomd API to be sent to the network.

Delete the current transaction under constructed

-- Not Supported

Create a lite token account address

-- Not supported

Import Factoid address secret keys into the wallet

Import a Koinify crowd sale address into the wallet.

Create a new transaction to be built using other calls

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

Signs the transaction under construction

Noop. it does nothing because we do not pay fees on Accumulate by a difference between inputs and outputs

Lists all current working transactions in the wallet. None of these transactions have been sent

Return transactions using a range, by TxID, by Address. All Transactions are not supported

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

Return balances of all addresses in the wallet

ablock-by-height
ack
admin-block
chain-head
commit-entry
current-minute
dblock-by-height
directory-block
directory-block-head
ecblock-by-height
Entry
Entry-ack
Entry-block
Entry-credit-balance
Entrycredit-block
Entry-credit-rate
Factoid-ack
Factoid-balance
Factoid-block
Factoid-submit
Fblock-by-height
Heights
Multiple-ec-balances
Multiple-fct-balances
Pending-entries
Pending-transactions
Properties
Raw-data
Receipt
Reveal-chain
Reveal-entry
Send-raw
Transaction
Add-ec-output
Add-fee
Add-input
Add-output
Address
All-addresses
Compose-chain
Compose-entry
Compose-transaction
factoid-submit
Delete-transaction
Generate-ec-address
Generate-factoid-address
Get-height
Import-addresses
Import-koinify
New-transaction
Properties
Sign-transaction
Sub-fee
Tmp-transactions
Transactions (Retrieving)
Wallet-backup
Wallet-balances