-
Notifications
You must be signed in to change notification settings - Fork 43
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
web3_clientVersion not supported in the TruffleProvider #23
Comments
web3_clientVersion is actually an RPC method of the blockchain. We need support from rpc side or we need to understand when and where it will be called and wrap the method with custom result |
I didn't quite understand... can you elaborate it a little? What do you mean by the second sentence? |
Just like Loom did it for their truffleProvider. We need to do the same. There is no such method in RPCs of Harmony‘s blockchain. We have to manually add the expected return to the TruffleProvider. |
I went through this... https://forum.openzeppelin.com/t/loom-support/1239 |
Let me do some modification on my side to the sdk, and i'll make a branch later these days, and you can clone and try to see if it works on your side. maybe there are more rpc methods needed like getStorageAt, I'll try to understand what loom did to workaround. |
@asmitadhungana would you try this branch and see if it works for you https://github.com/harmony-one/sdk/tree/truffle_provider but you have to build the sdk manually, please follow this manual: https://github.com/harmony-one/sdk#bootstrap-and-build and do reply if it works or not, then we can discuss how to work around it. |
Sure! Thanks! |
Hey @neeboo, it is not actually working... idk why! My project's versions are set-up as per this package.json file in the documentation https://docs.harmony.one/home/developers/smart-contracts/sample-files#package-json ... but in the github documentation that you share, it says we need to use Node 10.0.0+... can you clarify it to me? What are the standard versions for dependencies for developing a truffle project for Harmony? I think i'm going wrong in there... |
The build was checked by one of my seniors and it seems to be working individually... it is not however, working with the project |
10.0+ is by default, personally i use v12.16.1 I think you would like to test on your local machine first follow this steps.
yarn bootstrap && yarn dist
const {
Harmony,
TruffleProvider,
} = require('../dev/harmony-js/packages/harmony-core')
// do the truffle thing
Please do tell me whether it works or not, then we can pr to the team, and make a release |
Can you post up your truffle-config.js here and the error log? @asmitadhungana And I'm not quite familiar with OZ cli, would you like to make an example or guide me to some working example ,maybe for ethereum network, which i can debug for harmony? |
for OpenZeppelin Cli, it's an interactive cli tool that I've used to make our smart-contract upgradeable... since I'd initialzed openeppelin in a truffle folder, and configured the migrations accordingly, you can use this reference for a quick understanding: https://github.com/OpenZeppelin/docs.openzeppelin.com/pull/67/files/46c54a3f21136dddc055dbcb9a2854e36f607e5f you can use the example in this guide to get to know it easily and deploy it in harmony testnets: |
i realized that the inability to find "stable-fork" was due to dry-run simulation while migrating... $npx truffle migrate --network testnet --skip-dry-run --reset Compiling your contracts...
Starting migrations...
1_initial_migration.jsReplacing 'Migrations'
2_deploy_contracts.jsError: Dice deployment failed with error: Returned error: The method web3_clientVersion does not exist/is not available |
This is my truffle-config now only with two networks: require('dotenv').config() //const {TruffleProvider} = require('@harmony-js/core'); const testnet_mnemonic = process.env.TESTNET_MNEMONIC //GAS - Currently using same GAS accross all environments const HDWalletProvider = require("@truffle/hdwallet-provider"); module.exports = { networks: {
}, |
@asmitadhungana would you git pull my branch and try again? |
sure, thanks! |
Hey @neebo, I'm getting the following error while building your updated branch.... asmee@asmee:/media/asmee/H/fix-test/harmony-js$ yarn dist |
I searched for this error and here's the link I got: codesandbox/codesandbox-client#4281 |
It however, got built in my partner's system... Idk why none of the builds are working for mine.... |
Better cleanup your local project and try again. |
Now what is the error you got? |
✖ Upgrading instance at 0xB9CE4120F4e2683E2025723C6fa40EE53d90b086 and calling 'initialize' with no arguments |
That i dont know how to solve. Maybe its the gas problem. You may dig something useful here. https://forum.openzeppelin.com/t/error-gas-required-exceeds-allowance-8000000-or-always-failing-transaction/1856/12 |
I've already contacted the forum... Might be, I'm the active commentator in there at the moment... They asked me to know the EVM version that Harmony is using... Can you let me know? And I'll close this issue since the main problem's been solved. Thank you for all he help @neebo! Much appreciated! |
It seems that it is related to ‘EVM‘ gas Limit. Since Harmony use EVM as its smart contract runtime however I am not sure it has the same gas setting to Ethereum. I will dig a bit and let you know |
Sure @neeboo , thanks a lot! |
@neeboo any asnwer yet? |
I've been working on a team project over harmony. For setting up the contract to be upgradeable, we used OpenZeppelin CLI along with @openzeppelin-upgrades library...
It works fine when deployed in Ganache. However, an error is thrown when trying to deploy in the testnet for Harmony blockchain…
Below is the error i get when deploying on stable net using oz create:
oz create
Nothing to compile, all contracts are up to date.
? Pick a contract to instantiate Ball
? Pick a network stable
✓ Added contract Ball
Returned error: The method web3_clientVersion does not exist/is not available
The dependencies are as follows:
Truffle v5.0.38 (core: 5.0.38)
Solidity - 0.5.7 (solc-js)
Node v8.10.0
Web3.js v1.2.1
@openzeppelin-cli and @openzeppelin-upgrades version 2.5.1
I contacted with the Openzeppelin team and they said that:
"It sounds like Harmony SDK doesn’t currently support web3_clientVersion in their TruffleProvider. (https://github.com/harmony-one/sdk/blob/master/packages/harmony-core/src/truffleProvider.ts)
This appears similar to an issue connecting to Loom network: OpenZeppelin/openzeppelin-sdk#405 (comment)"
Please do solve this, without this, we'll have to forbid using truffle altogether for our development and do it manually! Thank you!
The text was updated successfully, but these errors were encountered: