I am trying this tutorial to connect to a local testnet on virtualbox from my host using eosjs https://steemit.com/eos/@eos-asia/deploying-your-first-production-eos-dapp
this is the code:
EOS = require('eosjs')
eos = EOS.Localnet({
keyProvider: ['MY_PRIVATE_KEY_HERE'],
httpEndpoint: 'http://192.168.56.101:8888'
})
eos.contract('ping.ctr').then((contract) => {
contract.ping("tester", { authorization: ['tester'] }).then((res) => {
console.log(res)
})
})
This is the reply that I get
> node test.js
api error => { message: 'transaction declares authority \'{"actor":"tester","permission":"active"}\', but does not have signatures for it under a provided delay of 0 ms',
file: 'authorization_manager.cpp',
line_number: 405,
method: 'check_authorization' } http://192.168.56.101:8888/v1/chain/push_transaction {"compression":"none","transaction":{"expiration":"2018-06-22T10:50:50","region":0,"ref_block_num":1320,"ref_block_prefix":2298898006,"max_net_usage_words":0,"max_kcpu_usage":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"ping.ctr","name":"ping","authorization":[{"actor":"tester","permission":"active"}],"data":"000000005c95b1ca"}]},"signatures":["SIG_K1_KZ8ZUhBugRRtW8uDvA4Ry3UJdMTsX8X6fXfUzRyVgY9jkHFVh5M8LYLYjZxYqbXYJ7m2UY3QkAUGPZeXEgXUV2j7eCqoXa"]}
{ Error: {"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{\"actor\":\"tester\",\"permission\":\"active\"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}}
On the VM I am able to get the desired PONG:
~/eos/build/contracts/ping$ cleos push action ping.ctr ping '["tester"]' -p tester
executed transaction: f1bd8aa658a29c83cdadc73bd59a86974d14c51ea63cd68e45632224c426bc06 104 bytes 3451 us
# ping.ctr <= ping.ctr::ping {"receiver":"tester"}
>> Pong
Any idea how to make it work or how to debug it?