Skip to content
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

Expose genesis_config and genesis_records RPC API #271

Closed
frol opened this issue Mar 25, 2020 · 2 comments
Closed

Expose genesis_config and genesis_records RPC API #271

frol opened this issue Mar 25, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers P3 Nice to have. (Realistically we're not going to do this...)

Comments

@frol
Copy link
Collaborator

frol commented Mar 25, 2020

We have recently added (near/nearcore#2109) new RPC API methods: genesis_config and genesis_records (with EXPERIMENTAL_ prefix).

The API documentation is currently defined in the PR description mentioned above.

@frol frol added enhancement New feature or request good first issue Good for newcomers P3 Nice to have. (Realistically we're not going to do this...) labels Mar 25, 2020
@Rishabhraghwendra18
Copy link
Contributor

Hi @frol . Is this issue still open ?

@frol
Copy link
Collaborator Author

frol commented Nov 23, 2021

Nope, these methods are already implemented:

/**
* @deprecated
* Gets the genesis config from RPC
* @see {@link https://docs.near.org/docs/develop/front-end/rpc#genesis-config}
*/
async experimental_genesisConfig(): Promise<NearProtocolConfig> {
const deprecate = depd('JsonRpcProvider.experimental_protocolConfig()');
deprecate('use `experimental_protocolConfig({ sync_checkpoint: \'genesis\' })` to fetch the up-to-date or genesis protocol config explicitly');
return await this.sendJsonRpc('EXPERIMENTAL_protocol_config', { sync_checkpoint: 'genesis' });
}
/**
* Gets the protocol config at a block from RPC
* @see {@link }
*
* @param blockReference specifies the block to get the protocol config for
*/
async experimental_protocolConfig(blockReference: BlockReference | { sync_checkpoint: 'genesis' }): Promise<NearProtocolConfig> {
return await this.sendJsonRpc('EXPERIMENTAL_protocol_config', blockReference);
}

(well, genesis_records endpoint was removed from the JSON RPC implementation on nearcore side)

@frol frol closed this as completed Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers P3 Nice to have. (Realistically we're not going to do this...)
Projects
None yet
Development

No branches or pull requests

2 participants