Plian Javascript Console
To open the console for the main chain, execute:
~/pchain/bin/pchain attach ~/pchain/.pchain/pchain/pchain.ipc
To open the console for the subchain, execute:
~/pchain/bin/pchain attach ~/pchain/.pchain/child_0/pchain.ipc
If you don't want to have to remember the command to open the console, you can create a simple bash script to open it. First, open a document called
openconsole.sh
nano openconsole.sh
That will open a text editor. In the text editor, copy and paste the below:
#!/bin/bash
~/pchain/bin/pchain attach ~/pchain/.pchain/pchain/pchain.ipc
Then type
ctrl-x
then y
to save and exit. To make it executable:chmod u+x openconsole.sh
The console can now be opened by executing the command
./openconsole.sh
The same can be done for creating an executable to attach to the subchain. To do that, open a document called
openconsolecc.sh
nano openconsolecc.sh
That will open a text editor. In the text editor, copy and paste the below:
#!/bin/bash
~/pchain/bin/pchain attach ~/pchain/.pchain/pchain/pchain.ipc
Then type
ctrl-x
then y
to save and exit. To make it executable:chmod u+x openconsolecc.sh
The console can now be opened by executing the command
./openconsolecc.sh
Once the console opens, you will see something like this:
Welcome to the Pchain JavaScript console!
instance: pchain/linux-amd64/go1.12.5
coinbase: 0x00000017f6f17ce18faa53d7010fa66acd0e1fb9
at block: 20346346 (Sun, 07 Feb 2021 05:59:12 UTC)
datadir: /root/.pchain/pchain
modules: admin:1.0 chain:1.0 debug:1.0 del:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 pi:1.0 rpc:1.0 tdm:1.0 txpool:1.0 web3:1.0
>
Don't worry if you don't have a
coinbase
line as that only shows when you have generated/imported a key.