Could it be possible to submit and extrinsic using JSON-RPC methods.
- Say submit a
balance_transfer
along with its parameters using curl or postman as a JSON-RPC
Substrate and Polkadot Stack Exchange is a question and answer site for developers building blockchains with the Substrate SDK. It only takes a minute to sign up.
Sign up to join this communityYes, with the RPC request author_submitExtrinsic
https://polkadot.js.org/docs/substrate/rpc/#submitextrinsicextrinsic-extrinsic-hash
You have to get the balance_transfer extrinsic signed and you can submit it using the RPC author_submitExtrinsic like this:
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_submitExtrinsic", "params": ["0xbd0284007e56c7cbacdc5c990244cbf948bf75bd7826b381ba27cb13992f1dbc1d89a905011e7fc91d60f775573b34458da2c1f70d1853b396398e37c446660e7bd2b13a646f37f0a69e4b7aed97e3f7bec342f622d3997ad49acc4ba9c72edd7c2c312988c5012c001e000004d611d9bfe81218fbb6a46c8220c110878ae2c51b98147a8f6ec3134bc76f32000400007e56c7cbacdc5c990244cbf948bf75bd7826b381ba27cb13992f1dbc1d89a90528]}' http://localhost:9933/
You can get the signed extrinsic with PolkadotJS UI.
Go to Developer-> Extrinsic -> balance -> transfer(). Unselect the Sign and Submit option and you will be able to see the signed transaction you will have to use in the RPC.
or with the @polkadot/apps library:
const transferBalance = api.tx.balances.transfer(BOB, 10);
const signedExtrinsic = await transferBalance.signAsync(alice).toJSON();