EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

cant execute ping contract request #85

Closed alzozov closed 6 years ago

alzozov commented 6 years ago

eos : DAWN-2018-04-27-ALPHA eosjs : 10.0.0

//contract action:

   // @abi action
    void printaction( account_name sender, string status ){
        //require_auth(sender);            
        eosio::print("Pong");
    }

// nodejs code
var EOS = require('eosjs') 
var EOS_CONFIG = {
  contractName: "basics", // Contract name
  contractSender: "basics", // User executing the contract (should be paired with private key)
  clientConfig: {
    keyProvider: ['5KQEtQ7bgfUg6Va5Vnei75MoX22GMXeMW3VXb6GCTJcqCyMUDga', '5KfrF8tPdZWsvHwoZZ4K5AZdKZtpzowHgLpjHzKNmUDGcy2PTJ9'], // Your private key
    httpEndpoint: 'http://pulssoft.com:8888' // EOS http endpoint
  }
}

var eosClient = EOS.Localnet(EOS_CONFIG.clientConfig)
eosClient.contract('basics').then(contract => contract.printaction('basics', 'param2')) //.... etc

This returns error: [TypeError: binary is not a function]

and everything works in cleos ! server to replicate error: http://pulssoft.com:8888

alzozov commented 6 years ago

it was a problem with nodejs