-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOC] Document new changes
RPC API
#173
Comments
What errors are possible / how they will be returned? |
In this particular case it also would make sense to accept UTF-8 strings. |
Also it really looks like this should have been REST API:
If we make API easy to use directly we won't have to maintain special wrapper library for every language. |
Good point! I have created the tracking issue for this: near/nearcore#2034
The keys are not required to be UTF-8 as far as I know, and given base64 is a string, it will be confusing.
What is the point of introducing REST over RPC? I am, actually, redesigning the API (started with |
@amgando I had updated the description to reflect the recent API redesign. Just for the reference:
|
I had updated the issue to reflect the upcoming changes in near/nearcore#2264. |
UPDATE: I completely rewrote this description!
As of near/nearcore#2148 we have a brand new API for the
changes
endpoint. We expose new APIs with a prefixEXPERIMENTAL_
, so currently one can run a local node and useEXPERIMENTAL_changes
endpoint to get the changes that are happening on the network on a per-block basis.UPDATE 2020/03/16: There is an upcoming update near/nearcore#2264, which will replace
account_id
in the request withaccount_ids
expecting a list ofaccount_id
(I chose to make it a breaking change while we are at the experimental stage).NOTE: There is an extended
EXPERIMENTAL_changes_in_block
API: #267API
EXPERIMENTAL_changes
RPC endpoint accepts the following types of requests:the extra fields based on
changes_type
are the following:"account_changes"
:account_ids
as list ofaccount_id
"single_access_key_changes"
:keys
as list of objects:account_id
public_key
"all_access_key_changes"
:account_ids
as list ofaccount_id
"contract_code_changes
:account_ids
as list ofaccount_id
"data_changes"
:account_ids
as list ofaccount_id
key_prefix_base64
(base64-encoded string of the key-prefix data saved from a smart contract)Example of Account changes
When an account gets modified (created, updated, removed), we can query the block which contains the receipts for the transaction:
we observe the following:
If the account was deleted:
Example of Data changes
When some key gets modified (created, updated, removed), we can query the block which contains the receipts for the transaction:
we observe the following (assume the key was modified twice in a single block, and then removed):
Notes
changes
RPC API near-api-js#196The text was updated successfully, but these errors were encountered: