Update README.md#23
Update README.md#23jeremybeal11 wants to merge 3 commits intopokt-network:masterfrom jeremybeal11:master
Conversation
First draft to Android Readme
| try { | ||
| Wallet wallet = this.pocketAion.createWallet("32", null); | ||
| } catch (CreateWalletException cwe) { | ||
| throw cwe; |
| Currently there are 2 supported namespaces in Pocket Node for AION: `net` and `eth`. | ||
| In the examples below, you will see how to query the supported RPC calls in both | ||
| namespaces. | ||
| Currently there are 2 supported namespaces in PocketAION: `net` and `eth` that contains prebuild `RPC_Methods` to call when executing each namespace. In the examples below, you will see how we get the balance of a wallet using both namespaces. |
There was a problem hiding this comment.
net doesn't let you get balance from the blockchain, only the eth namespace have the getBalance. replace with In the examples below, you will see how you can use both namespaces.
| BigInteger nrg = new BigInteger("50000"); | ||
| BigInteger nrgPrice = new BigInteger("10000000000"); | ||
| BigInteger nonce = new BigInteger("1"); | ||
| BigInteger value = new BigInteger("0"); |
There was a problem hiding this comment.
the value should be new BigInteger("1"); , using 0 will add nothing to the state of the contract.
| ## Creating and sending a Query | ||
| Follow the example below to create a `Transaction` object for writing to the given AION network with the parameters below and `subnetwork`. | ||
| Throws `CreateQueryException` in case of errors. | ||
| ### Calling an AionContract function |
There was a problem hiding this comment.
should be Reading from a Smart Contract
| e.printStackTrace(); | ||
| // Prepare parameters | ||
| List<Object> functionParams = new ArrayList<>(); | ||
| functionParams.add(new BigInteger("2")); |
There was a problem hiding this comment.
Let's remove the functions params, nrg, nrgPrice and from. Just as in the iOS readme, both tutorials are doing the same just he language changes. send null instead of the fromAddress, nrg, nrgPrice and value.
| BigInteger nrgPrice = new BigInteger("10000000000"); | ||
| BigInteger value = new BigInteger("0"); | ||
| // Execute function and assert on response | ||
| contract.executeConstantFunction("multiply", fromAddress, functionParams, nrg, nrgPrice, value, new RPCCallback<Object>() { |
There was a problem hiding this comment.
change the function name to pocketTestState
There was a problem hiding this comment.
pocketTest.executeConstantFunction("pocketTestState", null, new ArrayList<Object>(), null, null, null, new RPCCallback<Object>() {
@Override
public void onResult(Object result, Exception exception) {
// Result is an Object we can cast to String
// Exception, if any, will contain the error sent from the Pocket Node
}
});
made Pabels requests
| BigInteger nrg = new BigInteger("50000"); | ||
| BigInteger nrgPrice = new BigInteger("10000000000"); | ||
| BigInteger value = new BigInteger("0"); | ||
| BigInteger value = new BigInteger("1"); |
There was a problem hiding this comment.
remove this line, no function params are being sent
First draft to Android Readme