Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"unknown node type 0" when calling RPC method 'Filecoin.Version' on Localnet #792

Open
rkalis opened this issue Mar 5, 2021 · 3 comments

Comments

@rkalis
Copy link

rkalis commented Mar 5, 2021

I'm not sure whether this issue belongs on this repository or with Lotus, but since I'm using the Localnet setup from this repo I'll open it here. Let me know if I should move it to Lotus.

With the latest master of this repo (a2048ee8d580d16b17698358d0ade3f1285150ee) I am getting the following error when calling RPC method 'Filecoin.Version':

{"jsonrpc":"2.0","id":1,"error":{"code":1,"message":"unknown node type 0"}}

Steps to reproduce

cd docker
make localnet

Wait until started. Then in a separate terminal:

curl -X POST \
    -H "Content-Type: application/json" \
    --data '{ "jsonrpc": "2.0", "method": "Filecoin.Version", "params": [], "id": 1 }' \
    'http://127.0.0.1:7777/rpc/v0'

Environment

Operating System: macOS Big Sur 11.1
Docker Version: Docker Desktop 3.1.0

@jsign
Copy link
Contributor

jsign commented Mar 5, 2021

Thanks for the report :)

I think it's related to the bootstrap process of the kind of API exposed by the miner.

Some Lotus related code from where the error comes:

  const (                                                                                                                                                                                                                                                                                 
          NodeUnknown NodeType = iota                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                          
          NodeFull                                                                                                                                                                                                                                                                        
          NodeMiner                                                                                                                                                                                                                                                                       
          NodeWorker                                                                                                                                                                                                                                                                      
  )                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                          
  var RunningNodeType NodeType                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                          
  func VersionForType(nodeType NodeType) (Version, error) {                                                                                                                                                                                                                               
          switch nodeType {                                                                                                                                                                                                                                                               
          case NodeFull:                                                                                                                                                                                                                                                                  
                  return FullAPIVersion, nil                                                                                                                                                                                                                                              
          case NodeMiner:                                                                                                                                                                                                                                                                 
                  return MinerAPIVersion, nil                                                                                                                                                                                                                                             
          case NodeWorker:                                                                                                                                                                                                                                                                
                  return WorkerAPIVersion, nil                                                                                                                                                                                                                                            
          default:                                                                                                                                                                                                                                                                        
                  return Version(0), xerrors.Errorf("unknown node type %d", nodeType)                                                                                                                                                                                                     
          }                                                                                                                                                                                                                                                                               
  }  

I'd say might be relevant to this repo. This should only affect calling this Version API.
Whenever I have some time gap I can take a look.

@stanbar
Copy link

stanbar commented Nov 21, 2022

I'm getting the same error when I try to execute any command using lotus client binary connected to powergate's textile/lotus-devnet. Is textile/lotus-devnet just a mock? without any Filecoin normal functionality?

@stanbar
Copy link

stanbar commented Nov 22, 2022

I solved the issue by using old Lotus of version 1.10.0
First download old binaries wget https://github.com/filecoin-project/lotus/releases/download/v1.10.0/Lotus-v1.10.0-x86_64.AppImage
Then

FULLNODE_API_INFO=/ip4/127.0.0.1/tcp/7777/http ./Lotus-v1.10.0-x86_64.AppImage client retrieve QmWX5VPrE899oH6q8i3fkoQzyqo5VtLmY9r634Ln3axrQC output

2022-11-22T13:19:22.288+0100	WARN	cliutil	util/apiinfo.go:81	API Token not set and requested, capabilities might be limited.
> Recv: 0 B, Paid 0 FIL, ClientEventOpen (DealStatusNew)
> Recv: 0 B, Paid 0 FIL, ClientEventDealProposed (DealStatusWaitForAcceptance)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventBlocksReceived (DealStatusWaitForAcceptance)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventAllBlocksReceived (DealStatusWaitForAcceptance)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventDealAccepted (DealStatusAccepted)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventLastPaymentRequested (DealStatusAccepted)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventPaymentChannelAddingFunds (DealStatusPaymentChannelAddingInitialFunds)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventPaymentChannelReady (DealStatusPaymentChannelAllocatingLane)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventLaneAllocated (DealStatusOngoing)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventLastPaymentRequested (DealStatusFundsNeededLastPayment)
> Recv: 94.63 KiB, Paid 0 FIL, ClientEventSendFunds (DealStatusSendFundsLastPayment)
> Recv: 94.63 KiB, Paid 0.000000000000193794 FIL, ClientEventPaymentSent (DealStatusFinalizing)
> Recv: 94.63 KiB, Paid 0.000000000000193794 FIL, ClientEventComplete (DealStatusCompleted)
Success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants