Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:37
    GlacierBo starred web3j/web3j
  • 06:01
  • 06:01
    JhetoX starred web3j/web3j
  • 03:53
    jtomtan labeled #1121
  • 03:53
    jtomtan labeled #1121
  • 03:53
    jtomtan opened #1121
  • 03:53
    jtomtan opened #1121
  • Dec 05 17:24

    cfelde on master

    Removed URLClassLoader usage. Replaced 'replaceAll' with 'rep… Merge pull request #1120 from A… (compare)

  • Dec 05 17:24

    cfelde on master

    Removed URLClassLoader usage. Replaced 'replaceAll' with 'rep… Merge pull request #1120 from A… (compare)

  • Dec 05 17:24
    cfelde closed #1120
  • Dec 05 17:24
    cfelde closed #1120
  • Dec 05 17:19
    AlexandrouR synchronize #1120
  • Dec 05 17:19
    AlexandrouR synchronize #1120
  • Dec 05 14:57
  • Dec 05 13:59

    iikirilov on master

    Abstracts getCode to transactio… (compare)

  • Dec 05 13:59

    iikirilov on master

    Abstracts getCode to transactio… (compare)

  • Dec 05 13:59
    iikirilov closed #1118
  • Dec 05 13:59
    iikirilov closed #1118
  • Dec 05 13:57
    AlexandrouR review_requested #1120
  • Dec 05 13:57
    AlexandrouR review_requested #1120
Camilo Henao
@camilo5972
Hello everyone, I'm using web3j with Besu protocol (https://github.com/web3j/web3j/blob/master/besu/src/main/java/org/web3j/protocol/besu/Besu.java). I can make a private transaction but I can't get the result of a call in the contract. I'm using this to load the contract: "contract.load(address ..., Besu ..., BesuPrivateTransactionManager ..., BesuPrivacyGasProvider ...)" and for call "contract.myfunction(param).send()" but nothing returns.
or if someone has examples of how to use web3j-besu for interaction with smart contracts it would be very helpful. In a context of private transactions.
David Roon
@adridadou
@iikirilov I understand the function better. I was actually talking about blockFlowable I didn’t understand why a function that was suppose to be a push was polling. But debugging the function I understand it better now, the polling is just to check if there is any change in the filter
Ivaylo Kirilov
@iikirilov
the push is websockets @adridadou
@camilo5972 the examples are in the besu integration test
Camilo Henao
@camilo5972
Thanks @iikirilov, I already solved my problem. Apparently it was something in my node configuration. Now I can write and read private transactions using web3j.
Camilo Henao
@camilo5972
Anyone know how I can read the events emitted by a private contract with Web3J or directly with JSON-RPC?
Ivaylo Kirilov
@iikirilov
@camilo5972 the events are in the private transaction receipt - I am not sure if the flowables will work. You should be able to use the smart contract wrappers
web3j.privGetPirvateTransactionReceipt(myContract.myMethod().send().getTransactionHash()).send().getPrivateTransactionReceipt().getEvents() <--- should be something like this
Camilo Henao
@camilo5972
@iikirilov Thank you very much!..It worked
the-icarus
@the-icarus

Hi all,
I use web3j version 4.5.0 and get following error after transaction (in this case contract deployment):
org.web3j.protocol.exceptions.TransactionException: Transaction has failed with status: 0x0. Gas used: ... . (not-enough gas?))
I use parity version: v2.5.0 and configured following params;

    "eip140Transition": "0x0",
    "eip211Transition": "0x0",
    "eip214Transition": "0x0",
    "eip658Transition": "0x0"

May be the problem is related to that since the return code matches 0x0.
Strang thing: If using remix and connect to the same node with MetaMask the deployment works.
Gas setting is much more than necessary
Any ideas?

Last Pharaon
@Manasse228

Hello
who here already uses Metamask + Angular ?
i have a problem

I cann't fetch the default account on metamask

the-icarus
@the-icarus
You can simply use getAccounts on web3. There is a web3 provider injected when MetaMask is installed and enabled
@Manasse228
Last Pharaon
@Manasse228
it doesn't work
the-icarus
@the-icarus
@Manasse228 Just found out, that the new version of MetaMask works different. I remember they added phishing protection. If you have the latest version of metamask you need to first connect. Use window.ethereum.enable() which will return a promise. The result of the promise resolve function will be the Account Address
More details on development can be found here: https://metamask.github.io/metamask-docs/Main_Concepts/Getting_Started
Last Pharaon
@Manasse228
thanks
the-icarus
@the-icarus
you're welcome
Last Pharaon
@Manasse228
you don't have any example doing with Angular ?
the-icarus
@the-icarus
You can take a look at the truffle box for the initial setup
Last Pharaon
@Manasse228
@Manasse228
Hello
i use Metamask provider like this on Angular
await window['ethereum'].send('eth_sendTransaction', params)
.then(function (result) {
// The result varies by method, per the JSON RPC API.
// For example, this method will return a transaction hash on success.
console.log('err, result ', result)
})
.catch(function (error) {
// Like a typical promise, returns an error on rejection.
})
but i have these errors
Error: Uncaught (in promise): TypeError: Cannot read property 'then' of undefined
RPC Error: The method undefined does not exist/is not available
Ivaylo Kirilov
@iikirilov
@the-icarus I thin kthe gas is too high - maybe you do not have enough ether to pay for the maximum possible gas used so the node rejects it.
Edward Grech
@dwardu
Hi. I made a change in the codegen module in the web3j project, and rebuilt the module. I would like to get web3j solidity generate command to generate code using my modification. I can see in ~/.web3j/web3j-4.5.6/bin/web3j that the web3j cli is finding ~/.web3j/web3j-4.5.6/lib/codegen-4.5.6.jar on the classpath, so I think the simplest shortcut would be to build this codegen module JAR from my local modified web3j project, and place it on the classpath (or replace ~/.web3j/web3j-4.5.6/lib/codegen-4.5.6.jar) At which point does this JAR get built please? I am building the web3j project in IntelliJ successfully, but cannot locate the JAR. Thanks!
Edward Grech
@dwardu
Update: Got it to work by simply running jar uf ~/.web3j/web3j-4.5.6/lib/codegen-4.5.6.jar -C ./codegen/build/classes/java/main . inside web3j project, but it would still be interesting to understand at which point the “official” codegen-4.5.6.jar is generated.
MONISHA68
@MONISHA68
Hi everyone!Which web3j version suits for connecting with quorum/ethereum network.It shows transaction failed due to gas exceeded.Suggests me the stable version of web3j to overcome this issue.
Antony Denyer
@antonydenyer
@MONISHA68 use 4.5.7
Philip Peinsold
@ppeinsold
Hey guys! I have a question regarding events and filter. I have a .sol contract which fires an event like this:
"event myEvent(address indexed userAddress, string indexed userId);"
I indexed the parameters so I can filter the events afterwards.
Then I created the .java file of the contract with "web3j solidity generate ..."
The strange thing now is, that since I indexed the parameters the event returns the userId not as normal string anymore, but as wired chars. In my .java file which I generated from solidity code it seems like it casts it to a byte array:
"typedResponse.userId = (byte[]) eventValues.getIndexedValues().get(1).getValue();"
Why? And how do I get the correct string again?
Thanks for your help! I searched already some time, but was not able to find an answer...
Philip Peinsold
@ppeinsold
Or maybe a simpler question -> the event from above description returns a byte array. How can I get the original String from that again? new String(returnValue) did not work and gives me a wired string...
Edward Grech
@dwardu

@ppeinsold I have not tried to reproduce your issue with web3j, but I don’t think your issue is web3j-related. From the Solidity docs:

If you use arrays (including string and bytes) as indexed arguments, its Keccak-256 hash is stored as a topic instead, this is because a topic can only hold a single word (32 bytes).

So I don’t think it’s possible to recuperate the string if it is indexed. And that would also explain why it’s being mapped to byte[]. I would say, if you need it indexed, and you also need to recuperate the string value, include the string in the event twice: once as an indexed parameter so that you can search/filter events by its value (by the hash of its value really), and the other unindexed to be able to read it back.

Philip Peinsold
@ppeinsold
@dwardu nice idea, thank you. I'll try that!
Ivaylo Kirilov
@iikirilov
@ppeinsold @dwardu is right - all dynamic indexed parameters have their value hashed.
Dean Zhao
@RealDeanZhao
Hi I tried to call the contract method and it took about 15 seconds to get the transaction receipt even I set the pollingInterval to 2 seconds. Can anyone help me on this?
Dean Zhao
@RealDeanZhao

Hi I tried to call the contract method and it took about 15 seconds to get the transaction receipt even I set the pollingInterval to 2 seconds. Can anyone help me on this?

I find the solution now, I need a custom transaction manager with shorter sleep time. final TransactionManager txManager = new RawTransactionManager(this.web3j,
this.credentials, -1L, 10, 1000L);

Antony Denyer
@antonydenyer
That's a bit confusing, the TransactionManager should probably default to what is specified in Web3j.build
Dean Zhao
@RealDeanZhao
@antonydenyer yes, it's confusing. I will have another try tomorrow. Maybe it was because I incorrectly set the polling interval to 2L instead of 2000L.
Dean Zhao
@RealDeanZhao
@antonydenyer I tried to set the polling interval to 2000L, it still took abount 15s to finished the contract call. I used the generated contract class instead of using web3j to send the transaction directly. Please check if there is any issue with the generated code.
Antony Denyer
@antonydenyer
@RealDeanZhao Can you raise an issue so it doesn't get lost
Dean Zhao
@RealDeanZhao
@antonydenyer web3j/web3j#1113
Antony Denyer
@antonydenyer
👍
Jeevan
@lpfloyd
Hi guys, I am currently working on web3j/web3j#1103 . Wondering who do I refer to for feedback related to this issue. Related dev please do PM me so I can get the job done faster.
Ivaylo Kirilov
@iikirilov
Hey @lpfloyd I am the person to refer to for feedback.
Dean Zhao
@RealDeanZhao
Is it possbile to get the state at specific block number using the abi generated contract class? I can only find the one sends the eth_call with DefaultBlockParameterName.LATEST.
Ivaylo Kirilov
@iikirilov
@RealDeanZhao no - but you can do it using web3j - I think something like web3j.ethGetStorageAt(<contract_Address>)
Dean Zhao
@RealDeanZhao
Hi guys, i have a question that how to decode a Function? I can only find the FunctionEncoder and FunctionReturnDecoder.
Dean Zhao
@RealDeanZhao
I just tried FunctionReturnDecoder.decode(encodedFunction.substring(8), typeReferences), it seems works.
Gaurav
@buddies2705
anyone building(or already built) something cool using Web3..(Ping me please)
Rohit Sethi
@rohitsethii

Hi,

signing a raw transaction using web3j org.web3j:core:4.2.0-android and submitting it using web3.js version: 1.2.4 inside an API. It works sometimes very well but fails even using the same signing method.

Also, everything is working fine with web3.js signing and submission.

Please let me know if I am missing anything.