Integrating to Partisia Platform
We have collected articles that help you integrate your application with the rest of Partisia Platform in this section.
Connecting your application with your private deployment is possible by interacting the REST server, that reader nodes runs, while getting the updates from the block producer nodes.
The following sections explains some of the endpoints you can use to get info about the transactions and events that is executed on your private deployment. You can also get the current state of your deployed smart contracts and MPC smart contracts.
Rest endpoint examples and libraries
You can get information about blocks, transactions, contract state and more through the REST API. The REST API is also be used for sending signed transactions to the blockchain.
The REST API is available on any block producing node, you can also spin up a reader node, to minimize the load on your block producing nodes.
We also publish a number of libraries that help create transactions and using the REST API.
REST API endpoints
Below is a collection of commonly used rest endpoints.
In our rest server source repo, you can find all the different endpoints and all returned data types.
Transaction Information
-
Get the 10 latest transactions:
-
Get a specified transaction from the transaction hash:
- http://docker:9432/blockchain/transaction/{{transactionHash}}
- Insert the Hash of the transaction instead of
{{transactionHash}}
, e.g. for the transaction with the hash95c72be12a002a4ee0f492ac10bf0da9cd32dbce396f32611b31290e80240979
the request would behttp://docker:9432/blockchain/transaction/95c72be12a002a4ee0f492ac10bf0da9cd32dbce396f32611b31290e80240979
- Insert the Hash of the transaction instead of
- http://docker:9432/blockchain/transaction/{{transactionHash}}
Event Information
- Get a specified event from the event hash:
- http://localhost/blockchain/event/{{eventIdentifier}}
- Insert the Hash of the event instead of
{{eventIdentifier}}
, e.g. for the event with the hash7e3b8b053d5078af01de73f0c474fda1f9f01d97f9d850fcce0682a1431d2da2
the request would behttp://docker:9432/blockchain/transaction/7e3b8b053d5078af01de73f0c474fda1f9f01d97f9d850fcce0682a1431d2da2
- Insert the Hash of the event instead of
- http://localhost/blockchain/event/{{eventIdentifier}}
Block Information
-
Get the block with blocknumber 1:
-
Get the latest block number:
-
Get the latest block:
Smart Contract Information
- Get the state of a contract.
- http://docker:9432/blockchain/contracts/04a2020bb33ef9e0323c7a3210d5cb7fd492aa0d65
04a2020bb33ef9e0323c7a3210d5cb7fd492aa0d65
is the smart contract address of the MPC registry.
- http://docker:9432/blockchain/contracts/04a2020bb33ef9e0323c7a3210d5cb7fd492aa0d65
Account Information
- Get the info for a specified account:
- http://docker:9432/chain/accounts/00803c974202d4dd8db22bd3833b8d123f89ea199b
00803c974202d4dd8db22bd3833b8d123f89ea199b
is the address of the account.
- http://docker:9432/chain/accounts/00803c974202d4dd8db22bd3833b8d123f89ea199b
Blockchain Chain Id
- Get the id of the chain, which is used when creating transactions.