Already implemented the same solution in javascript(web3js) and c#(nethereum) and both of them allow to load smart contract with abi and deployed contract address. Right now I'm working in java environment(web3j) and to load smart contract I need to provide credentials. I just want to call some static methods from contract, that doesn't require credentials. Is there any workaround to load contract without it? That way I'm not able to show contract data to user without giving credentials.
MyContract contract = MyContract.load(
"0x32b0138BD1b9527E95f141319ECF9B2765e06C00",
web3,
credentials,
new BigInteger("22000000000"),
new BigInteger("510000")
);
Since the operations you want to do don't require any Eth to execute, it doesn't matter what credentials you're using to do this. So you can just generate a new keypair, and use this.
Credentials dummyCredentials = Credentials.create(Keys.createEcKeyPair());
MyContract contract = MyContract.load(
"0x32b0138BD1b9527E95f141319ECF9B2765e06C00",
web3,
dummyCredentials,
new BigInteger("22000000000"),
new BigInteger("510000")
);