JSON RPC API - fsn-rpc-api
Last updated
Was this helpful?
Last updated
Was this helpful?
FUSION RPC is compatible with Ethereum's and API. In addition, FUSION's extended API include: Ticket, Asset, Timelock, USAN, Swap, Staking, etc.
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.
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.
Online RPC service:
Testnet:
Mainnet:
Default JSON-RPC endpoints:
Client
URL
Go
You can start the HTTP JSON-RPC with the --rpc
flag
change the default port (9000) and listing address (localhost) with:
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:
The JSON RPC can also be started from the efsn console using the admin.startRPC(addr, port)
command.
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
Find more details .