by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:34
    RobertoArtiles commented #1206
  • 13:34
    RobertoArtiles commented #1206
  • 11:07
  • 10:51
    RobertoArtiles commented #1206
  • 10:51
    RobertoArtiles commented #1206
  • 09:24
    alanwuha starred web3j/web3j
  • 02:08
    ruirui1128 commented #917
  • 02:08
    ruirui1128 commented #917
  • 02:03
  • Aug 10 13:57
    RobertoArtiles commented #1206
  • Aug 10 13:57
    RobertoArtiles commented #1206
  • Aug 10 13:18
    zjxjwxk starred web3j/web3j
  • Aug 09 17:25
    dportabella labeled #1248
  • Aug 09 17:25
    dportabella opened #1248
  • Aug 09 17:25
    dportabella labeled #1248
  • Aug 09 17:25
    dportabella opened #1248
  • Aug 09 16:51
    dportabella labeled #1247
  • Aug 09 16:51
    dportabella opened #1247
  • Aug 09 16:51
    dportabella labeled #1247
  • Aug 09 16:51
    dportabella opened #1247
ruchita
@ruchita.ladha_gitlab
@iikirilov : thank you!
Soumyadip Chowdhury
@soumyadip007

Credentials credentials =
WalletUtils.loadCredentials(
"12341234",
"/path/to/wallet");
log.info("Credentials loaded");

Can anyone please tell me what will be the path?

How to generate this?

Error:
01:27:50.610 [main] INFO org.web3j.sample.Application - Connected to Ethereum client version: Geth/v1.9.8-omnibus-f14759fb-20191127/linux-amd64/go1.13.4
Exception in thread "main" java.io.FileNotFoundException: \path\to\wallet (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)

Ivaylo Kirilov
@iikirilov
@soumyadip007 the path is to a wallet file like - UTC--2020-06-25T07-44-09.754000000Z--417584778fff87b92cc1b669d4741eb4e677d39f.json
Soumyadip Chowdhury
@soumyadip007
image.png
@iikirilov , could you please tell me that how can I locate the Rinkeby wallet path, I've setup one rinkeby network, should I put this path?
Soumyadip Chowdhury
@soumyadip007

If I try to create a local private wallet web3J Wallet then getting this error.

Soumyadip@DESKTOP-INVVN9F MINGW64 ~/Desktop/BlockChain Total
$ web3j wallet create
Exception in thread "main" java.lang.NullPointerException
at org.web3j.console.ConsoleDevice.readPassword(ConsoleDevice.java:24)
at org.web3j.console.WalletManager.getPassword(WalletManager.java:35)
at org.web3j.console.WalletCreator.run(WalletCreator.java:34)
at org.web3j.console.WalletCreator.main(WalletCreator.java:26)
at org.web3j.console.WalletRunner.main(WalletRunner.java:23)
at org.web3j.console.WalletRunner.run(WalletRunner.java:14)
at org.web3j.console.Runner.main(Runner.java:35)

Ivaylo Kirilov
@iikirilov
@soumyadip007 metamask is a browser wallet - you will have to export your wallet to a file and load it with web3j
Soumyadip Chowdhury
@soumyadip007
@iikirilov Thanks
Nick Ivanov
@nick-ivanov
Hello everyone. What would be the right way to put together a bunch of values of different types for signing, so that it could match abi.encodePacked in Solidity?
Specifically, I have a tuple (address, address, uint256, uint32). I have exhausted all possible ways to concatenate them. I do use the Ethereum prefix, but the signatures still don't match.
In web3js, this does the trick:

var hash = web3.utils.soliditySha3(
{t: 'address', v: client}, {t: 'address', v: hotspot}, {t: 'uint256', v: amount}, {t: 'uint32', v: timestamp}
);

return signature_json = web3.eth.accounts.sign(
hash,
'<private key here>'
);

Do you know how to do the same in Web3j? Thank you in advance!
Evan Saulpaugh
@esaulpaugh
@nick-ivanov my java library does packed encoding like TupleType.parse("(address,address,uint256,uint32)").encodePacked(new Tuple(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, 1L)) --> 00000000000000000000000000000000000000010000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000001; would that help? https://github.com/esaulpaugh/headlong/blob/master/src/main/java/com/esaulpaugh/headlong/abi/TupleType.java actually I think I forgot to add this feature to the command line interface. I should add it
Evan Saulpaugh
@esaulpaugh
headlong-cli will now do packed encoding. java -jar headlong-cli-0.4-SNAPSHOT-interface.jar -ep "(uint16,uint24)" "('01','ff')" --> 00010000ff i will see about implementing the decoder as well
pringinacio
@pringinacio
I would like to add a feature to WalletUtils (org.web3j.crypto), so that when generating a wallet does not necessarily create a file. It can, for example, return only the Json content of WalletFile (objectMapper.writeValueAsString(walletFile);)
Ivaylo Kirilov
@iikirilov
@nick-ivanov web3j does not have a easy way to do packed encoding for you - everything get poadded to 32 bytes by default
sofaki000
@sofaki000
Hello guys!im using a gradle web3j plugin to compile smart contracts and generate wrapper java classes to interact with them.however this happens at build time.i want it to happen at runtime.do you have any idea how to compile smart contracts at runtime without using cmd tools?thanks a lot!
Ivaylo Kirilov
@iikirilov
@sofaki000 yes it is possible you can pass the relevant arguments to SolidityFunctionWrapperGenerator from web3j:codegen
make sure you load the generated wrappers in the classpath to use it :)
Pylyp Radionov
@rad-p

hi all, I got simple contract greeter

pragma solidity 0.6.6;

contract Greeter {

    string word;

    constructor() public {
        word = "Hello from constructor";
    }

    function getWord() public view returns(string memory) {
        return word;
    }
}

and after using web3j wrapper, the getWord functions returns RemoteFunctionCall

 public RemoteFunctionCall<TransactionReceipt> getWord() {
        final Function function = new Function(
                FUNC_GETWORD, 
                Arrays.<Type>asList(), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

but according to docs, it should return type, as its not a transaction, but rather a eth_call
docs.web3j.io/smart_contracts/#calling-constant-methods

Vince BCD
@BCDiploma_gitlab
Hi guys, we face this kind of error on ropsten for a few hours :
Failure extracting data from Ethereum transaction receipt 0x877....
Any idea?
mhadhbi oumaima
@MHADHBIoumaima_gitlab
I want to pass this as input for a function call with web3j [["0x207e2346c77ab01529aa39dbf9bbc93ee85bd3bf6ad583f53d1ed5ac1fd85837", "0x0178e5a86eca5347e62ad37356e4c36b2d4e5cb043da93f922fb9a497f958247"], [["0x1ac6921597c999911bc8064722875bdfd2157f3d6278a1a12e1f4a27a063d173", "0x24db42163adfb1d6212fff6b8a4e414aec35d239b54a7443df40d5226289fbf7"], ["0x1a2b44db88cd4d0dd069a0220ef39b6b540598d1f1849636cd266f15260f22d7", "0x03f8bafc4b085bcb99779b6004836a047a496c5c2e0ae0bdc0e03f0552eefe07"]], ["0x23c40fd5d4564017ef81905c3bff16dfc4ccae06520d2457b4a351b1d8f315da","0x02055f9ef9f510ed3966e55046487421db1d831c416825af8b58d943532ac65e"] ], any ideas ?
Conor Svensson
@conor10
For all you Web3j users - we’ve just released our first Web3j survey, it would be great to get feedback from any users here! https://forms.gle/G4PNL7jMGAMpuYxo6
www.dobeho.com
@dobesthosting_twitter
while transffering erc20 token if i send 200 means it transfer 0.0000000000000002 i dont know why its happened please guide any one data: my code error @ contract.methods.transfer(account2, web3.utils.fromWei(web3.utils.toBN(200), 'ether')).encodeABI()
daniellucas01
@daniellucas01
Hi guys
Sorry to disturb you guys
But i am new to web3j
And when deploying the code to the rinkeby test net using web3j and infura
The transaction always timed out for my android application
To be specific i am using web3j 4.2.0 for android , web3j cli version 4.2.0 and solc compiler version 0.4.25+commit.59dbf8f1.Windows.msvc to generate the abi and bin files
But no matter what i do whether its contract deployment or contract loading it always does not work for me
For contract deployment its always transaction forever pending (even when i alter the gas price and limit often) or contract deployed by remix cannot be loaded by web3j
Can someone help me ?
Craig Williams
@craigwilliams84

Hey Web3j team! Craig here, formerly of Kauri/ConsenSys...I work for Argent now.

Is the Epirus cli jar available in a public maven repository at all? We used to pull the web3j-console jar and execute org.web3j.console.Runner from within our build.gradle to generate the smart contract wrappers, but we have to now upgrade to the latest web3j for abiv2 support which means we'll have to change to the Epirus cli.

Craig Williams
@craigwilliams84
Figured out I could just use the codegen package and bypass the cli...all good!
Hope you're all doing well anyway!
Evan Saulpaugh
@esaulpaugh
@craigwilliams84 depending on your use case, https://github.com/esaulpaugh/headlong may be simpler
ligi
@ligi
which module includes WebSocketService? It does not seem to be in core
and I think it should go to the documentation as it is referenced here: https://docs.web3j.io/getting_started/ but the module import there does not import it
or was it renamed?
maybe @kunalbarchha knows as it is for his issue here: ethereum/go-ethereum#21386
Rok Povšič
@rok-povsic_gitlab
hello, when calling smart contract wrapper's method, how do I pass in funds? the method I want to call requires a msg.value field, i.e. the funds, but I can't find any reference on how to pass this in when calling the wrapper's method (i.e. I do contract.method(...).send() and the msg.value sent is 0)
Rok Povšič
@rok-povsic_gitlab
looks like this isn't possible looking at the wrapper source code. what I've done is inherited the wrapper class and simply copy-pasted the method I'm using, but replaced the executeRemoteCallTransaction to use the second parameter - which is the WEI value
Ivaylo Kirilov
@iikirilov
@ligi WebSocketService is in fact in the core module
@craigwilliams84 you probably should be using the web3j-gradle-plugin to generate the smart-contract wrappers https://github.com/web3j/web3j-gradle-plugin
@rok-povsic_gitlab can you provide the abi for that function
ligi
@ligi
@iikirilov ah thanks - I was on an old version 3.x - that was the reason - thanks for the pointer
Ivaylo Kirilov
@iikirilov
@dobesthosting_twitter the denomination is in wei - check out https://www.investopedia.com/terms/g/gwei-ethereum.asp