Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Failed to subscribe to init.sh #835

Closed
sdelvalle57 opened this issue Mar 8, 2021 · 4 comments · Fixed by #845
Closed

Failed to subscribe to init.sh #835

sdelvalle57 opened this issue Mar 8, 2021 · 4 comments · Fixed by #845

Comments

@sdelvalle57
Copy link

System info: Linux Ubuntu 20.04

Steps to reproduce:

  1. Cloned repo git clone https://github.com/cosmos/ethermint.git
  2. Run ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key mykey --chain-id ethermint-982 --trace

__Expected behavior:Attach to node
__Actual behavior:

panic: failed to subscribe pending txs: client is not running. Use .Start() method to start

goroutine 32 [running]:
github.com/cosmos/ethermint/rpc/namespaces/eth/filters.(*EventSystem).eventLoop(0xc0000d3900)
        /home/santiago/projects/ethermint/rpc/namespaces/eth/filters/filter_system.go:297 +0xe65
created by github.com/cosmos/ethermint/rpc/namespaces/eth/filters.NewEventSystem
        /home/santiago/projects/ethermint/rpc/namespaces/eth/filters/filter_system.go:88 +0x24d
@Khaos-Labs
Copy link

The same mistake happened 。

@araskachoi
Copy link
Contributor

Hello, I am unable to reproduce this error. do you think you can update the ticket with some additional information regarding your environment and reproduction steps please? thank you

@Khaos-Labs
Copy link

Issue resolved:
ethermintcli rest-server --laddr "tcp://localhost:8545" --node "tcp://127.0.0.1:26657" --unlock-key mykey --chain-id 1 --trace --rpc-api "web3,eth,net"

maybe :(dev branch code)
rpc/apis.go : selectedApis []string can‘t empty。
func GetAPIs(clientCtx context.CLIContext, selectedApis []string, keys ...ethsecp256k1.PrivKey) []rpc.API {
nonceLock := new(rpctypes.AddrLocker)
backend := backend.New(clientCtx)
ethAPI := eth.NewAPI(clientCtx, backend, nonceLock, keys...)

var apis []rpc.API

for _, api := range selectedApis {
	switch api {
	case Web3Namespace:
		apis = append(apis,
			rpc.API{
				Namespace: Web3Namespace,
				Version:   apiVersion,
				Service:   web3.NewAPI(),
				Public:    true,
			},
		)
	case EthNamespace:
		apis = append(apis,
			rpc.API{
				Namespace: EthNamespace,
				Version:   apiVersion,
				Service:   ethAPI,
				Public:    true,
			},
		)
		apis = append(apis,
			rpc.API{
				Namespace: EthNamespace,
				Version:   apiVersion,
				Service:   filters.NewAPI(clientCtx, backend),
				Public:    true,
			},
		)
	case PersonalNamespace:
		apis = append(apis,
			rpc.API{
				Namespace: PersonalNamespace,
				Version:   apiVersion,
				Service:   personal.NewAPI(ethAPI),
				Public:    false,
			},
		)
	case NetNamespace:
		apis = append(apis,
			rpc.API{
				Namespace: NetNamespace,
				Version:   apiVersion,
				Service:   net.NewAPI(clientCtx),
				Public:    true,
			},
		)
	}
}

return apis

}

@araskachoi
Copy link
Contributor

thank you for your response! taking a closer look, I have identified the error! a PR has been created to address this issue

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

Successfully merging a pull request may close this issue.

4 participants
@sdelvalle57 @araskachoi @Khaos-Labs and others