Not getting access to "admin" and "personal" functions from web3 instance

krisbirkkrisbirk Posts: 1Member
Hi, I am having trouble with instantiating a web3 object.

Can I just add the "web3.js"-file to the html-file?

Is there some other way to import the web3-files (or maybe web3_extended) to an Etherum project?

Thanks,
Kristoffer

Comments

  • ZikileminiZikilemini Posts: 9Member
    This is very late to answer to your question but i will if someone search the answer.

    Web3 use your geth node to interract with your blockchain. Personal and admin are not given via RPC by default you must enable them manualy with the option

    --rpcapi="personal, admin"

    If you do this, you will be able to call web3.personal and web3.admin objects (after connection with your node of course)
  • o0ragman0oo0ragman0o Posts: 1,199Member, Moderator mod


    --rpcapi="personal, admin"

    If you do this, you will be able to call web3.personal and web3.admin objects (after connection with your node of course)

    @Zikilemini ...and so will everyone else. There is a reason they aren't included by default and people have lost money doing this.

  • ZikileminiZikilemini Posts: 9Member


    --rpcapi="personal, admin"

    If you do this, you will be able to call web3.personal and web3.admin objects (after connection with your node of course)

    @Zikilemini ...and so will everyone else. There is a reason they aren't included by default and people have lost money doing this.

    Yes i should tell it too. By the way, do you know he safe way to send transaction in Dapp ? The only way i found to send transaction was to unlock account via web3.personal.unlockAccount

    How should i process ?
  • o0ragman0oo0ragman0o Posts: 1,199Member, Moderator mod
    @Zikilemini Just stick with IPC and a full chain.
  • ZikileminiZikilemini Posts: 9Member
    @o0ragman0o I see, i am currently testing my Dapp in my browser, how should i do to have access to ipc ? And why is it more secure ?

    I'm sorry to ask those questions but i didn't found much informations about it :/ Have you a link ?
  • o0ragman0oo0ragman0o Posts: 1,199Member, Moderator mod
    @Zikilemini
    IPC = Interprocess Communication. Is a protocol where applications on the same computer can message each other.
    RPC = Remote Procedure Call. Is an inter-computer protocol and is for instance how mining rigs talk to pools. The API's are visible to a selected network (e.g. 0.0.0.0 is all networks) This is why it's dangerous to export the Personal management API. If you do, attackers can simply spam your node with send requests which will cause ether to be sent from your account the moment you unlocked your wallet.

    DAPP front ends are reliant on the Web3.js library. You connect your browser to your node via
    var Web3 = require('web3');
    // create an instance of web3 using the HTTP provider.
    // NOTE in mist web3 is already available, so check first if its available before instantiating
    var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
  • ZikileminiZikilemini Posts: 9Member
    edited July 2016
    @o0ragman0o ok I though doing this connected you with rpc but if it connect to IPC it's fine. So unlocking account with ipc is safe ?
Sign In or Register to comment.