Local Node Mode

Before using the local node mode of PIWallet, make sure you have done the bellow:

  • Installed pchain

  • Sync to the latest height (you can check by Monitor)

  • Create Your Account

  • Pchain running RPC (run pchain with flag –rpc –rpcapi=eth,web3,admin,debug,tdm,miner,personal,chain,txpool,del –rpcaddr=0.0.0.0)

  • Opened RPC port to your local IP

  • Copied keystore file to your datadir (required to send transactions)

Pchain RPC’s default port is 6969, remember to open your port 6969 ONLY to your local IP and DO NOT keep your account unlocked for a long time.

First, set the RPC URL in the wallet. The RPC URL is http://yourserverip:rpcport/chainid, so suppose you are running pchain on a machine whose IP is 111.222.333.444, and you open RPC with pchain default RPC port, and you wanna interact with main chain, the RPC URL should be http://111.222.333.444:6969/pchain. If you want to interact with subchain which chain id is child_0, the RPC URL should be http://111.222.333.444:6969/child_0.

After this, PIWallet will read the chain state to the wallet.

If you are having issues sending transactions in local node mode, make sure the keystore on your connected node is in the correct place. Your datadir looks like the below:

datadir/
        -chaininfo.db/
        -config.toml
        -nodekey
        -nodes/
        -tx3cache/
        -pchain/
                -data/
                -geth/
                -pchain.ipc
                -priv_validator.json
                -keystore/   //you should put your keystore file under here
        -child_0/
                -data/
                -geth/
                -pchain.ipc
                -priv_validator.json
                -keystore/       //you should put your keystore file under here

最后更新于