fuseio / fuse-network

Fuse network engine; Contains instructions to connect as a node
MIT License
86 stars 44 forks source link

initWalletProvider - Cannot read property '0' of undefined #140

Open MysticRyuujin opened 1 year ago

MysticRyuujin commented 1 year ago

I just tried to upgrade running the quickstart.sh script and now I see this:

/fuse-validator # docker logs fuseapp 
[2022-12-09 14:39:28.843 +0000] INFO  (1 on 45a5aee389fe): runMain
[2022-12-09 14:39:28.845 +0000] INFO  (1 on 45a5aee389fe): initWalletProvider
[2022-12-09 14:39:28.856 +0000] ERROR (1 on 45a5aee389fe): Cannot read property '0' of undefined
    TypeError: Cannot read property '0' of undefined
        at initWalletProvider (/index.js:35:39)
        at runMain (/index.js:143:7)
        at Object.<anonymous> (/index.js:168:1)
        at Module._compile (internal/modules/cjs/loader.js:778:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
        at Module.load (internal/modules/cjs/loader.js:653:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        at Function.Module._load (internal/modules/cjs/loader.js:585:3)
        at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
        at startup (internal/bootstrap/node.js:283:19)

I assume this is somehow related to the wallet/keystore. The only thing I change in the quickstart.sh file is the BASE_DIR (BASE_DIR=/data/volumes/fusenet)

.env:

VALIDATOR_KEYSTORE_DIR=/data/volumes/fusenet/config/keys/FuseNetwork

Directory content:

# ls /data/volumes/fusenet/config/keys/FuseNetwork
address_book.json  UTC--2021-05-07T20-07-46Z--22ef1982-1e70-4a6c-7046-e25b40ecdd9f

Not sure where to go next.

leonprou commented 1 year ago

Hi @MysticRyuujin, The issue was fixed, please download the v2.0.1 of the valudator-app.

Are you a validator of Fuse btw?

MysticRyuujin commented 1 year ago

Are you a validator of Fuse btw?

Yes.

Hmmm now I'm getting this:

[2022-12-12 19:39:25.565 +0000] INFO  (1 on 952a69287ec7): runMain
[2022-12-12 19:39:25.568 +0000] INFO  (1 on 952a69287ec7): initWalletProvider
[2022-12-12 19:39:25.579 +0000] INFO  (1 on 952a69287ec7): account: <redacted>
[2022-12-12 19:39:25.581 +0000] INFO  (1 on 952a69287ec7): initConsensusContract 0x3014ca10b91cb3D0AD85fEf7A3Cb95BCAc9c0f79
[2022-12-12 19:39:25.595 +0000] INFO  (1 on 952a69287ec7): initBlockRewardContract 0x63D4efeD2e3dA070247bea3073BCaB896dFF6C9B
[2022-12-12 19:39:45.833 +0000] ERROR (1 on 952a69287ec7):
    code: -32603
    message: "ESOCKETTIMEDOUT"
    data: {
      "originalError": {
        "code": "ESOCKETTIMEDOUT",
        "connect": false
      }
    }

Unclear to me what it's trying to connect to here :confused:

The fusenet container is up and running and importing blocks

MysticRyuujin commented 1 year ago

Hmm ok I set this in my env file and it started working for a few seconds

HOME_RPC_URL=https://rpc.fuse.io

Then I got:

[2022-12-12 20:52:37.903 +0000] ERROR (1 on f0ab54391c73):
    code: -32603
    message: "Unknown Error: <html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"
    data: {
      "originalError": {}
    }

:thinking:

MysticRyuujin commented 1 year ago

Fixed:

HOME_RPC_URL=http://fusenet:8545

Probably need to either make that the default or put it in the docs, cuz it's not part of the example env file:

https://raw.githubusercontent.com/fuseio/fuse-network/master/scripts/examples/.env.validator.example

Edit: Hmmm not fixed... still getting 502 errors occasionally which seems odd... I have no idea where this nginx error is coming from