** Problem

As the creator of Solana, but when solutions are possible to resolve it.

error message

Opening JSON RPC URL at http: //127.0.0.1: 8899, the following error message is displayed:

`

The used HTTP method is not allowed. Needs notification or options

`

This warning indicates that the query does not correspond to the expected HTTP method to obtain a valid JSON-RPC call.

SOLANA JSON RPC Understanding **

Solana JSon-RPC API allows you to interact with your Test Validator unit using a specific version of the protocol. The latest version of the API, V1, uses Post inquiries to submit operations and other operations. This is different from the previous version, V0, which used Get or Head inquiries.

** Why is it going?

Browsod (Post) required for JSON-RPC calls in the latest versions of Solana API. Browser programs can only receive inquiries rather than records.

Solutions:

Solana: Problem opening solana-test-validator on browser

Browser:

  • -Did tool such as Flask, Django or Express.js to create an API end -point that accepts Test Validator entries in queries. Http.

  • 0.1: 8899) directly from your browser. HTTP method.

CODE EXAMPLE

To start with the following solutions, you can apply to the following examples:

server side solution (flask)

Create a new flask project in your desired text:

Python

The inquiries of the flask import flask,

program = flask (__ Name__)

@app.route ('/test-validator', methods = ['post'])

Def Handle_test_Validator ():

Data = request.get_json ()

Process the data and send it to the Solana Validator node

Return Test Validator Response

If __name__ == '__main__':

app.ruun (host = '0.0,0,0')

Browser Library Solution

Install JSON-RPC-Client in your project:

`Javascript

Import {client} from ‘json-rpc-client’;

CONST URL = ‘

Customer = New Customer ({{{{{{{

URL,

});

// Send the data to the Solana Validator node using Post inquiries

Customer.Post (‘/test-validator’, {

Method: Post,

Args: {},

Jsonrpc: ‘2.0’,

ID: Null,

})

`

Node and HTTP Methods Needing.

friendly cryptocurrency investors

Solana: Problem opening solana-test-validator on browser

Leave a Reply

Your email address will not be published. Required fields are marked *