Skip to content

get 'ECONNREFUSED' when running 'npm run start -- generateProofs' #30

Open
@barrybecker4

Description

@barrybecker4

Describe the bug
I get 'ECONNREFUSED' when running 'npm run start -- generateProofs'

To Reproduce

I am trying to follow the instructions to run the examples in the README. My .env file looks like this (with some values sanitized). I put my metamask wallet key for the WALLET_KEY value, but maybe I should have set it as the THIRD_PARTY_WALLET_KEY.

RHS_URL="https://rhs-staging.polygonid.me" 
CONTRACT_ADDRESS="0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
CIRCUITS_PATH="./circuits" 
# My metamask wallet key in hex format with matic balance
WALLET_KEY="c8**************************************************8c" 
# MongoDB connection string, uses in memory Mongo server if not specified
MONGO_DB_CONNECTION=""
# Our Alchemy url to polygon amoy network rpc node
THIRD_PARTY_RPC_URL="https://polygon-amoy.g.alchemy.com/v2/**********" 
# third party contract address in the linea test network
THIRD_PARTY_CONTRACT_ADDRESS=""
# third party key in hex format with matic balance
THIRD_PARTY_WALLET_KEY="" 

I get the following error when I run $ npm run start -- generateProofs

> [email protected] prestart
> npm run build

> [email protected] build
> tsc

> [email protected] start
> ts-node index.ts generateProofs

=============== generate proofs ===============
=============== user did ===============
did:polygonid:polygon:amoy:2**************************P
================= generate Iden3SparseMerkleTreeProof =======================
================= push states to rhs ===================
================= publish to blockchain ===================
AggregateError
    at internalConnectMultiple (node:net:1118:18)
    at afterConnectMultiple (node:net:1685:7) {
  code: 'ECONNREFUSED',
  [errors]: [
    Error: connect ECONNREFUSED ::1:8545
        at createConnectionError (node:net:1648:14)
        at afterConnectMultiple (node:net:1678:16) {
      errno: -4078,
      code: 'ECONNREFUSED',
      syscall: 'connect',
      address: '::1',
      port: 8545
    },
    Error: connect ECONNREFUSED 127.0.0.1:8545
        at createConnectionError (node:net:1648:14)
        at afterConnectMultiple (node:net:1678:16) {
      errno: -4078,
      code: 'ECONNREFUSED',
      syscall: 'connect',
      address: '127.0.0.1',
      port: 8545
    }
  ]
}

Expected behavior
The test should run successfully.

** Environment info (please complete the following information):**

  • Windows 10
  • Node version: 20.17.0
  • Browser : N/A
  • Package version [e.g. 1.0.0]

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions