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

[FEATURE] Verify fcl-js works with gRPC endpoint on archive node #1632

Open
bthaile opened this issue Apr 18, 2023 · 4 comments
Open

[FEATURE] Verify fcl-js works with gRPC endpoint on archive node #1632

bthaile opened this issue Apr 18, 2023 · 4 comments
Assignees
Labels

Comments

@bthaile
Copy link
Contributor

bthaile commented Apr 18, 2023

Issue to be solved

API endpoints to check

  • execute script at block,
  • execute script at height
  • get account at height

test against block older than 100 back. HTTP/REST supports going back 100 blocks. Need to very going further back.

Suggest A Solution

Add integration test that can be manually executed when archive node is available. This will also give reference to community

What are you currently working on that this is blocking?

Community node.js script fails.

const fcl = require("@onflow/fcl");
const { send: transportGRPC } = require("@onflow/transport-grpc");

fcl.config({
  "accessNode.api": "archive.mainnet.nodes.onflow.org:9000",
  "sdk.transport": transportGRPC
})

async function test() {
  const result = await fcl.send([
    fcl.script`
      pub fun main(): PublicAccount{
        return getAccount(0x8f3e345219de6fed)
      }
    `,
    fcl.atBlockHeight(99452067)
  ]).then(fcl.decode);
  console.log(result);
}

test()
@bluesign
Copy link

"accessNode.api": "archive.mainnet.nodes.onflow.org:9000",

it needs grpcWeb proxy in front ( and probably archive.onflow.org endpoint )

@JeffreyDoyle
Copy link
Member

Hey @bthaile - the solution here is as @bluesign mentioned, that the archive nodes require a grpcWeb proxy in front of them such that web clients using FCL can communicate with them.

@peterargue - is this something we could add for the archive node(s)?

@JeffreyDoyle
Copy link
Member

@peterargue Actually, we're planning to deprecate GRPC support in FCL in FCL 2.0 (see: #1650). It would be best to instead plan to add REST/HTTP support to the archive node(s) instead, as that will be what is supported by FCL.

@peterargue
Copy link

I don't expect archive nodes will get their own REST server, but there is some work underway to add support for proxying requests from an AN to an RN (instead of an EN). This would expose the archive node's data and script execution from AN APIs. Longer term, I expect the archive node functionality to be folded directly into ANs and ONs.

I can look into how much work it would be to setup the grpc-web transcoder for the current archive nodes as a short term solution.

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

No branches or pull requests

5 participants