Issue when setup a Function X node

Dear,
I’m following this document to setup a Function X. And got a issue. Hope someone can help/give advices!

  • Installation F(x) core : Passed
  • Full node with Binaries: Stuck at start node

    “ignoring input and redirecting stderr to stdout”

Here is fxcore.log when I run tail -f fxcore.log

> INF service stop impl={"Data":{},"Logger":{}} module=p2p msg={} peer={"id":"c5877d9d243af1a504caf5b7f7a9c915b3ae94ae","ip":"myIP","port":26656} server=node
> 3:52AM INF service stop impl={"Data":{},"Logger":{}} module=p2p msg={} peer={"id":"b289311ece065c813287e3a25835bb6378999aa5","ip":"myIP","port":26656} server=node
> 3:52AM INF Dialing peer address={"id":"c5877d9d243af1a504caf5b7f7a9c915b3ae94ae","ip":"myIP","port":26656} module=p2p server=node
> 3:52AM INF service start impl="Peer{MConn{myIP:26656} c5877d9d243af1a504caf5b7f7a9c915b3ae94ae out}" module=p2p msg={} peer={"id":"c5877d9d243af1a504caf5b7f7a9c915b3ae94ae","ip":"myIP","port":26656} server=node
> 3:52AM INF service start impl=MConn{myIP:26656} module=p2p msg={} peer={"id":"c5877d9d243af1a504caf5b7f7a9c915b3ae94ae","ip":"myIP","port":26656} server=node
> 3:52AM INF Added peer module=p2p peer={"Data":{},"Logger":{}} server=node
> 3:52AM INF Connection is closed @ recvRoutine (likely by the other side) conn={"Logger":{}} module=p2p peer={"id":"c5877d9d243af1a504caf5b7f7a9c915b3ae94ae","ip":"myIP","port":26656} server=node
> 3:52AM INF service stop impl={"Logger":{}} module=p2p msg={} peer={"id":"c5877d9d243af1a504caf5b7f7a9c915b3ae94ae","ip":"myIP","port":26656} server=node
> 3:52AM ERR Stopping peer for error err=EOF module=p2p peer={"Data":{},"Logger":{}} server=node
3:52AM INF service stop impl={"Data":{},"Logger":{}} module=p2p msg={} peer={"id":"c5877d9d243af1a504caf5b7f7a9c915b3ae94ae","ip":"myIP","port":26656} server=node
3:52AM ERR Connection failed @ sendRoutine conn={"Logger":{}} err="pong timeout" module=p2p peer={"id":"969b8e2aae989416e4f1b07b7067765c0a8b714e","ip":"myIP","port":26656} server=node

Here is status of FX core:

root@instance-2:/home/fx-core/fx-core# fxcored status
Error: RPC error -32603 - Internal error: open /root/.fxcore/data/blockstore.db/000898.sst: no such file or directory
1 Like

Hello i make the setup like this

sudo apt update
sudo apt upgrade
sudo apt install -y make gcc git tree 
wget https://go.dev/dl/go1.20.3.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.3.linux-amd64.tar.gz

export PATH=$PATH:/usr/local/go/bin
go version
mkdir -p $HOME/go/bin
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
echo "export PATH=$PATH:$(go env GOPATH)/bin" >> ~/.profile
source ~/.profile
git clone --branch release/v3.1.x https://github.com/functionx/fx-core.git
cd fx-core
make go.sum
make install
fxcored version
cd
wget -c https://fx-mainnet.s3.amazonaws.com/fxcore-snapshot-mainnet-2023-04-17.tar.gz
tar -xzvf fxcore-snapshot-mainnet-2023-04-17.tar.gz -C ~/.fxcore/
ls -l ~/.fxcore/data/
wget https://raw.githubusercontent.com/FunctionX/fx-core/release/v3.1.x/public/mainnet/genesis.json -O ~/.fxcore/config/genesis.json
wget https://raw.githubusercontent.com/FunctionX/fx-core/release/v3.1.x/public/mainnet/config.toml -O ~/.fxcore/config/config.toml
wget https://raw.githubusercontent.com/FunctionX/fx-core/release/v3.1.x/public/mainnet/app.toml -O ~/.fxcore/config/app.toml
cat > /etc/systemd/system/fxcored.service

[Unit]
Description=f(x)Core Node
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/root/go/bin/fxcored start --home /root/.fxcore
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl enable fxcored

sudo systemctl start fxcored
sudo systemctl status fxcored
journalctl -u fxcored

please check if you did the setup like this

Best Regards Sylvia

1 Like

I has followed exact steps on DOCS.
So, I have just tried your code you give.


Could you give some advices?
Thank so much!

Hello,

It said no such file and I see that you are in /fx-core/fx-core twice.

Could you check whether u extract the snapshot to the correct folder /root/.fxcore/data ?

Did you ensure proper extraction of snapshot before starting the node?

And which date of snapshot did you use? full or pruned?

Did you checksum the snapshot to ensure for file integrity?

You could also setup a daemon the run the service for more stability

fxcored version to check the version

1 Like

Thanks for your supporting!
I’ll check right now

Thank so much @ByteXSylvia and @lancelai !
Change to older version of snapshot and now it’s running fine

1 Like

Great News :smiling_face_with_three_hearts:

1 Like

Sorry for disturbing. I’m a newbie in this field.
I have successfully launched node . The node has synced to the current block.

I’m using web3.js and ethers.js libraries. How to connect node with these 2 libraries? I tried the following with no success

const Web3 = require('web3');
const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:26657'));
const test = web3.eth.getBlockNumber()
console.log(test)

Note that I’m running a light node (using Pruned-snapshot)

see if this helps

https://web3js.readthedocs.io/en/v1.2.11/web3.html

I’m using 2 rpc link : http://localhost:8545 and http://localhost:26657
But still got no result
image

Ports are listen

Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:26657         0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 :::26656                :::*                    LISTEN     
tcp6       0      0 :::8545                 :::*                    LISTEN

I’m using the public Fx RPC with no issue.

Each time that I reconnect my VM, node is still syncing but f(x)core seems not work.
image

How to restart it? @ByteXSylvia

Hello time to make a Demon

cat > /etc/systemd/system/fxcored.service

[Unit]
Description=f(x)Core Node
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/root/go/bin/fxcored start --home /root/.fxcore
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl enable fxcored

sudo systemctl start fxcored

I’ve did it before (used your yesterday given code).
Have just do it one more time and still not solve

sudo systemctl restart fxcored

1 Like

Hi, Could you instruct how to connect web3.js /ethers.js with local node?


rpc_address": "tcp://127.0.0.1:26657

I’m using this RPC address but seems not work

hello my node is not getting block it tucked in single block and the logs are showing like stopping peers.

Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM ERR Error in validation err="wrong Block.Header.AppHash. Expected 5BF01A16F1083A2ED0FE7B4919BFECDCE3E95AD5C46D7A90685AE2F6C07E1DF7, got 243B6FF2EB54C0D1432C3FC03502DB344372ADF8F3E781A68D32183C65D03376" module=blockchain Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM ERR Stopping peer for error err="blockchainReactor validation error: wrong Block.Header.AppHash. Expected 5BF01A16F1083A2ED0FE7B4919BFECDCE3E95AD5C46D7A90685AE2F6C07E1DF7, got 243B6FF2EB54C0D1432C3FC03502DB344372ADF8F3E781A68D32183C65D03376" module=p2p peer={"Data":{},"Logger":{}} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM INF service stop impl={"Logger":{}} module=p2p msg="Stopping MConnection service" peer={"id":"836ded83bac83a4ac8511826fa1ad4ca2238f960","ip":"35.172.96.99","port":26656} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM ERR Stopping peer for error err="read tcp 10.190.0.2:59430->35.172.96.99:26656: use of closed network connection" module=p2p peer={"Data":{},"Logger":{}} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM INF service stop impl={"Data":{},"Logger":{}} module=p2p msg="Stopping Peer service" peer={"id":"836ded83bac83a4ac8511826fa1ad4ca2238f960","ip":"35.172.96.99","port":26656} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM ERR error while stopping peer error="already stopped" module=p2p Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM ERR Stopping peer for error err="blockchainReactor validation error: wrong Block.Header.AppHash. Expected 5BF01A16F1083A2ED0FE7B4919BFECDCE3E95AD5C46D7A90685AE2F6C07E1DF7, got 243B6FF2EB54C0D1432C3FC03502DB344372ADF8F3E781A68D32183C65D03376" module=p2p peer={"Data":{},"Logger":{}} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM INF service stop impl={"Logger":{}} module=p2p msg="Stopping MConnection service" peer={"id":"7c7a260eeefda37eac896ae423e78cf345a2ef70","ip":"52.4.101.2","port":26656} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM ERR Stopping peer for error err="read tcp 10.190.0.2:50018->52.4.101.2:26656: use of closed network connection" module=p2p peer={"Data":{},"Logger":{}} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM INF service stop impl={"Data":{},"Logger":{}} module=p2p msg="Stopping Peer service" peer={"id":"7c7a260eeefda37eac896ae423e78cf345a2ef70","ip":"52.4.101.2","port":26656} Dec 14 06:45:42 functionx-testnet-1 fxcored[974358]: 06:45:42AM ERR error while stopping peer error="already stopped" module=p2p Dec 14 06:45:46 functionx-testnet-1 fxcored[974358]: 06:45:46AM INF Error reconnecting to peer. Trying again addr={"id":"a817685c010402703820be2b5a90d9e07bc5c2d3","ip":"54.83.49.110","port":26656} err="incompatible: peer is on a different network. Got dhobyghaut, expected fxcore" module=p2p tries=1 Dec 14 06:45:51 functionx-testnet-1 fxcored[974358]: 06:45:51AM INF Error reconnecting to peer. Trying again addr={"id":"e922b34e660976a64d6024bde495666752141992","ip":"54.80.190.189","port":26656} err="incompatible: peer is on a different network. Got dhobyghaut, expected fxcore" module=p2p tries=2

I see
:26656} err="incompatible: peer is on a different network. Got dhobyghaut, expected fxcore" module=p2p tries=2

Depending you are setting up a testnet or mainnet node

Check this out Full node with Binaries | Function X Docs

yes i used this docs only to setup testnet node, but i dont know what causing this issue?

i have re-setup the node but its not syncing and suddenly showed this error.
panic: runtime error: index out of range [7] with length 1