-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
Description
First, start the local node:
cargo run --package neard --bin neard -- --home=/tmp/testdir init --chain-id= --test-seed=alice.near --account-id=test.near --fast
cargo run --package neard --bin neard -- --home=/tmp/testdir init --chain-id= --test-seed=alice.near --account-id=test.near --fast Then create a local project:
npx create-near-app --vanilla myproject
cd myproject
mkdir neardev/default
cp /tmp/tesdir/validator_key.json neardev/default/test.near.jsonAlso change in src/config.js the following entry:
case 'testnet':
return {
networkId: 'local',
nodeUrl: 'http://localhost:3030',
contractName: CONTRACT_NAME,
walletUrl: 'https://wallet.testnet.near.org',
helperUrl: 'https://helper.testnet.near.org',
};Then run:
near create_account bob.test.near --masterAccount test.near
near send test.near bob.test.near 1 --masterAccount test.near Observe the transaction hash in the output.
Go to http://localhost:3030/status and copy the most recent block hash.
Then execute the following rpc request:
http post http://localhost:3030 jsonrpc=2.0 id=dontcare method=EXPERIMENTAL_light_client_proof \
params:='{
"type": "transaction", "transaction_hash": "<observed_tx_hash>", "sender_id": "test.near", "light_client_head": "<observed_block_hash>"
}'Observe the output:
HTTP/1.1 200 OK
content-length: 159
content-type: application/json
date: Tue, 16 Jun 2020 01:04:39 GMT
{
"error": {
"code": -32000,
"data": "2e7woi7vPBcmPzMWFtJLaVyQPbVCwPZoujJd4H7bbBrK has not been confirmed",
"message": "Server error"
},
"id": "dontcare",
"jsonrpc": "2.0"
}
But transaction was clearly confirmed (you can check the account balance before and after).