Crate snarkos_rpc[−][src]
Expand description
On Aleo, full nodes run a JSON-RPC server to enable API calls for fetching data and interacting with peers connected to the network.
RPC Port
snarkos --rpc-port 3030
The default RPC port is 3030
. A custom RPC port may be specified using the --rpc-port
flag when starting a node.
Authentication for Private RPC Endpoints
snarkos --rpc-username {USERNAME} --rpc-password {PASSWORD}
The RPC server exposes protected RPC endpoints for account specific operations, such as creating an account, creating a transaction, and fetching record commitments. RPC requests to protected RPC endpoints can be optionally guarded with an authentication header.
To enable this authentication layer, provide the authentication credentials to
the --rpc-username
and --rpc-password
flags when booting up a full node.
Modules
Logic for instantiating the RPC server.
Implementation of public RPC endpoints.
Implementation of private RPC endpoints that require authentication.
Definition of the public and private RPC endpoints.
Structures for RPC endpoint requests and responses.
Structs
Returned value for the getblock
rpc call
Returned value for the getblocktemplate
rpc call
Output for the createrawtransaction
rpc call
Input for the decryptrecord
rpc call
A connection in the graph of the known network.
RPC metadata for encoding authentication
The crawled known network and measurements.
Returned value for the getnodeinfo
rpc call
Returned value for the getpeerinfo
rpc call
Record payload data
Returned value for the decoderawrecord
rpc call
Output for the createaccount
rpc call
Defines the authentication format for accessing private endpoints on the RPC server
Implements JSON-RPC HTTP endpoint functions for a node. The constructor is given Arc::clone() copies of all needed node components.
Returned value for the gettransaction
rpc call
Input for the createrawtransaction
rpc call
Additional metadata included with a transaction response
Recipient of a transaction
Metadata and measurements pertaining to a node in the graph of the known network.
Traits
Definition of private RPC endpoints that require authentication.
Definition of public RPC endpoints.