-
Notifications
You must be signed in to change notification settings - Fork 463
[solved] fail to perform transaction with eosjs@13.0.0 on testnet jungle4.2 #131
Comments
after explore the closed issue, Step
Codeimport * as ecc from "eosjs-ecc";
import * as eosjs from "eosjs";
async function main() {
const sk = '5Jp4KE9xfjjUT33xdziisRh95UDz3GH6m7bXByUqKRendX6ho8V'
const pk = await ecc.privateToPublic(sk)
const accountName = 'yaleconab'
const client = eosjs.Testnet({
httpEndpoint: 'http://ayeaye.cypherglass.com:8888',
keyProvider: [sk],
broadcast: false,
sign: true,
debug: false,
expireInSeconds: 60,
chainID: 'a628a5a6123d6ed60242560f23354c557f4a02826e223bb38aad79ddeb9afbca',
})
const tx = await client.transaction(tr => {
tr.delegatebw({
from: 'yaleconab',
receiver: 'yaleconab',
stake_net_quantity: '10.0 EOS',
stake_cpu_quantity: '10.0 EOS',
transfer: 0,
})
})
}
main().catch(console.error) ConclusionI think eosjs shoud detect the correct chain_id by itself. |
The user needs to accept the chain ID for security reasons.. The chainId is the hash of the genesis state which includes all initial accounts and balances. A man in the middle attack would still be complicated by TaPOS, however, a known valid chainID is still done to help ensure the transactions belong to the intended chain. https://github.com/EOSIO/eos/search?q=compute_chain_id&unscoped_q=compute_chain_id |
I'm running into the same issue but I'm still not able to get it working by following the instructions above. @YaleZheng After you push a transaction are you able to verify it worked besides it not throwing any errors? When I set broadcast to false it appears to work but eosjs never actually calls push_transaction. When I set broadcast to true I get these errors.
|
I'm trying to create an account but it just hangs saying "Processing..." |
@randytorres can u list the environment you depended,and paste you relaitve code here? i have try to delegatebw with boardcast and it work fine too. Codeimport * as eosjs from "eosjs";
import * as ecc from "eosjs-ecc";
async function main() {
const sk = '5Jp4KE9xfjjUT33xdziisRh95UDz3GH6m7bXByUqKRendX6ho8V'
const pk = await ecc.privateToPublic(sk)
const accountName = 'yaleconab'
const client = eosjs.Testnet({
httpEndpoint: 'http://ayeaye.cypherglass.com:8888',
keyProvider: [sk],
sign: true,
debug: false,
expireInSeconds: 60,
chainId: 'a628a5a6123d6ed60242560f23354c557f4a02826e223bb38aad79ddeb9afbca',
})
const tx_signed = await client.transaction(tr => {
tr.delegatebw({
from: 'yaleconab',
receiver: 'yaleconab',
stake_net_quantity: '10.0 EOS',
stake_cpu_quantity: '10.0 EOS',
transfer: 0,
})
}, { broadcast: true })
console.log(JSON.stringify(tx_signed, null, 4))
}
main() |
@jcalfee ,I have try to create account again. Everything work fine. May be there r some network issues at that time. After filled your info, and click the create button,u should able to see something like below |
thanks @YaleZheng and @jcalfee I was able to figure it out and it wasnt related to eosjs. |
I apologize @YaleZheng, I closed too soon .. I'll wait for you to confirm. |
it's ok i just see many people create issue like this |
I have a similar issue here #248 |
Environment
lib_version: eosjs@13.0.0
testnet_site: http://dev.cryptolions.io/
Brief
it seem fail to perform transaction with eosjs@13.0.0
anytime i perform transaction,eosjs will throw error complain "provided keys, permissions, and delays do not satisfy declared authorizations"
but i can do the same transaction with cleos without any error
Code
Cleos
Error
The text was updated successfully, but these errors were encountered: