Connecting to mainnet

What endpoint do i use to connect to mainnet? I have tried the following but get connection failed or refused…

config()
.put(‘accessNode.api’, ‘https://access-mainnet.onflow.org’);

config()
.put(‘accessNode.api’, ‘https://access.onflow.org’);

config()
.put(‘accessNode.api’, ‘access.mainnet.nodes.onflow.org:9000’);

The endpoint should be access.mainnet.nodes.onflow.org:9000

Does that not work for you?

I have the same problem. This code snipped

sdk
  .send(sdk.build([sdk.getLatestBlock(true)]), {
    node: "access.mainnet.nodes.onflow.org:9000",
  })
  .then((data: any) => console.log(data));

causes this error:

UnhandledPromiseRejectionWarning: Error: Response closed without headers

but works fine with https://access-testnet.onflow.org
sdk version: 0.0.44

EDIT: i just i can use the go sdk to connect to mainnet, just the js sdk doesnt work

@akrahl @guitarcrazy44 please make sure you are connecting to https://access-mainnet-beta.onflow.org/ as it is the only endpoint that supports requests coming from fcl library.

I’m currently connected to access-mainnet-beta.onflow.org, but I’m not seeing any TopShot transactions pass through via the script property of the transaction. Can you enlighten me?

I’m now seeing them. Not exactly sure what changed, but they’re appearing now.