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

import_contract not possible with large contract state #352

Open
Tarnadas opened this issue Feb 16, 2024 · 1 comment
Open

import_contract not possible with large contract state #352

Tarnadas opened this issue Feb 16, 2024 · 1 comment

Comments

@Tarnadas
Copy link

Hey,

I've been trying to use import_contract for a contract where RPC refuses to download the state, because it is too large.
I know that the beta RPC doesn't have this limitation, so I tried enabling unstable feature to set up custom worker:

    let custom_worker = near_workspaces::custom("https://beta.rpc.mainnet.near.org").await?;
    let contract = worker
        .import_contract(&"app.chess-game.near".parse()?, &custom_worker)
        .dest_account_id(contract.id())
        .with_data()
        .transact()
        .await?;
    let states = custom_worker
        .view_state(&"app.chess-game.near".parse()?)
        .await?;

However I get an error for both import_contract or view_state:

Error: Failed to connect to RPC service https://beta.rpc.mainnet.near.org within 10 seconds

Caused by:
    error while parsing method call result: [missing field `version`]

So I am wondering is there any other way to use import_contract with large contract state?

@Tarnadas
Copy link
Author

oh also if I use beta RPC via Near CLI I can successfully download contract state

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

No branches or pull requests

1 participant