0

I was just beginning my blockchain development by following https://docs.web3j.io/getting_started.html , I saw some 0x<address>|<ensName>, what is the address and ensName consecutively in the following piece of code and how do I get them ? also how do I format these number, do I need to include the pipeline ? (ex : 0x921uiwojo|<ensName>)

Code :

YourSmartContract contract = YourSmartContract.load(
        "0x<address>|<ensName>", <web3j>, <credentials>, GAS_PRICE, GAS_LIMIT);
1

what is the address and ensName consecutively in the following piece of code and how do I get them ?

The address is the address that your contract - or the contract you want to interact with - has previously been deployed at in the blockchain. The ENS name is an alternative way to refer to a specific address, but it can only be used if it's been set up. Not all addresses have ENS names.

also how do I format these number,

The format of an address is 0x followed by 40 HEX characters (20 bytes). See How are ethereum addresses generated?

The format of ENS name is any alphanumeric string of seven characters or more. (Having said that, I think any characters are allowed, it's just there might be difficulties resolving them. See "What about foreign characters? What about upper case letters? Is any unicode character valid?" in the FAQ.) See the ENS documentation to understand what it's all about.

do I need to include the pipeline

It's not a pipe, it's an "or", in the documentation sense. "Either use a raw address or an ENS name."

Also note that the contents of < and > (including those two characters) should be replaced with actual values...

  • I see , so once we create a contract, we will automatically generate this contract address / ENS ? – thegexploit Feb 21 '18 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.