Fusion
  • Learn and build with Fusion
  • Learn
    • Learn about Fusion
      • About Fusion
      • Fusion's vision
      • Key problems to be solved
      • How does Fusion (and AnySwap) compare?
      • Journey to Interoperability
      • Whitepaper
    • The features of Fusion
      • DCRM
        • DCRM journey
        • DCRM nodes
        • DCRM Yellow paper
      • Time lock feature
        • Infinity
        • Lock-In and Lock-Out (LILO)
        • Use-Case — Lending
        • Use-Case — Banker’s Acceptance
      • Smart contacts
        • Use cases
          • Mortgage smart contract
          • Risk-free Token Loan
          • Risk free contract market
      • Cross-chain Tokens
      • Quantum swap
      • Secure and Distributed Secret Key Sharding
      • Fusion assets and tokens
      • Ticketed Proof of Stake (TPoS)
    • Fusion blockchain
      • Short Address Notation - SAN
      • Chain data
      • FSN token
        • Uses of FSN token
        • Tokenomics
      • Gas
  • Dapps
    • Chainge finance
    • Anyswap
  • Build
    • Quick links
    • JavaScript API - web3-fusion-extend
    • JSON RPC API - fsn-rpc-api
    • Python Web3 library - web3fsnpy
    • DCRM SDK
    • Create your own FRC20
    • Github repositories
    • Developers community
  • Tutorials
    • My Fusion wallet
      • Creating a new PSN wallet
      • Generating a Short Account Number (SAN)
      • Send tokens and assets using a send function
      • Create assets
      • Quantum swaps
      • Lock-in and Lock-out feature
    • How to setup a node
    • Staking options
    • How To Setup and Use Anyswap with Metamask wallet
    • How to use MultiSwap
    • Set up DCRM Windows guide
  • Credits
Powered by GitBook
On this page
  • FUSION JSON RPC API
  • JSON RPC
  • JavaScript API
  • JSON-RPC Endpoint
  • Curl Examples Explained
  • Read more

Was this helpful?

  1. Build

JSON RPC API - fsn-rpc-api

PreviousJavaScript API - web3-fusion-extendNextPython Web3 library - web3fsnpy

Last updated 4 years ago

Was this helpful?

FUSION JSON RPC API

FUSION RPC is compatible with Ethereum's and API. In addition, FUSION's extended API include: Ticket, Asset, Timelock, USAN, Swap, Staking, etc.

JSON RPC

is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value pairs.

is a stateless, light-weight remote procedure call (RPC) protocol. Primarily this specification defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON () as data format.

JavaScript API

To talk to an fusion node from inside a JavaScript application use the library, which gives a convenient interface for the RPC methods. FUSION's extended JavaScript API, See the for more.

JSON-RPC Endpoint

Online RPC service:

Testnet:

Mainnet:

Default JSON-RPC endpoints:

Client

URL

Go

You can start the HTTP JSON-RPC with the --rpc flag

efsn --rpc

change the default port (9000) and listing address (localhost) with:

efsn --rpc --rpcaddr <ip> --rpcport <portnumber>

If accessing the RPC from a browser, CORS will need to be enabled with the appropriate domain set. Otherwise, JavaScript calls are limit by the same-origin policy and requests will fail:

efsn --rpc --rpccorsdomain "http://localhost:9000"

The JSON RPC can also be started from the efsn console using the admin.startRPC(addr, port) command.

Curl Examples Explained

The curl options below might return a response where the node complains about the content type, this is because the --data option sets the content type to application/x-www-form-urlencoded . If your node does complain, manually set the header by placing -H "Content-Type: application/json" at the start of the call.

The examples also do not include the URL/IP & port combination which must be the last argument given to curl e.x. 127.0.0.1:9000

Read more

Find more details .

JSON-RPC
web3.js
JSON
JSON-RPC
RFC 4627
web3.js
JavaScript API
https://testnet.fsn.dev/api
https://fsn.dev/api
here
http://localhost:9000