Package org.aion4j.avm.helper.local
Class LocalAvmNode
- java.lang.Object
-
- org.aion4j.avm.helper.local.LocalAvmNode
-
public class LocalAvmNode extends Object
-
-
Constructor Summary
Constructors Constructor Description LocalAvmNode(String storagePath, String senderAddress)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CallResponsecall(String contract, String sender, String method, String argsString, BigInteger value)static byte[]compileJarBytes(byte[] jarBytes)Called mainly from maven goal to compile a Jar content with ABICompiler, mainly to process annotations.booleancreateAccountWithBalance(String address, BigInteger balance)org.aion.vm.api.interfaces.TransactionContextcreateCallTransaction(org.aion.types.Address contract, org.aion.types.Address sender, String method, Object[] args, BigInteger value, long energyLimit, long energyPrice)static ObjectdecodeResult(String hex)DeployResponsedeploy(String jarFilePath)DeployResponsedeploy(String jarFilePath, String deployArgs, String deployer)static byte[]encodeDeployArgsString(String deployArgs)static StringencodeMethodCall(String method, Object[] args)static StringencodeMethodCallWithArgsString(String method, String methodArgs)voidexplore(String dappAddress, PrintStream printStream)BigIntegergetBalance(String address)static StringgetBytesForDeploy(String dappJarPath, String deployArgsStr)voidinit(String storagePath)static byte[]optimizeJarBytes(byte[] jarBytes, boolean debugMode)voidsetForceAbiCompile(boolean flag)Enforce abiCompile during deployvoidshutdown()
-
-
-
Method Detail
-
init
public void init(String storagePath)
-
deploy
public DeployResponse deploy(String jarFilePath) throws DeploymentFailedException
- Throws:
DeploymentFailedException
-
deploy
public DeployResponse deploy(String jarFilePath, String deployArgs, String deployer) throws DeploymentFailedException
- Throws:
DeploymentFailedException
-
call
public CallResponse call(String contract, String sender, String method, String argsString, BigInteger value) throws CallFailedException
- Throws:
CallFailedException
-
createCallTransaction
public org.aion.vm.api.interfaces.TransactionContext createCallTransaction(org.aion.types.Address contract, org.aion.types.Address sender, String method, Object[] args, BigInteger value, long energyLimit, long energyPrice)
-
createAccountWithBalance
public boolean createAccountWithBalance(String address, BigInteger balance)
-
getBalance
public BigInteger getBalance(String address)
-
explore
public void explore(String dappAddress, PrintStream printStream) throws Exception
- Throws:
Exception
-
setForceAbiCompile
public void setForceAbiCompile(boolean flag)
Enforce abiCompile during deploy- Parameters:
flag-
-
encodeDeployArgsString
public static byte[] encodeDeployArgsString(String deployArgs) throws CallFailedException
- Throws:
CallFailedException
-
getBytesForDeploy
public static String getBytesForDeploy(String dappJarPath, String deployArgsStr) throws CallFailedException
- Throws:
CallFailedException
-
encodeMethodCallWithArgsString
public static String encodeMethodCallWithArgsString(String method, String methodArgs) throws CallFailedException
- Throws:
CallFailedException
-
compileJarBytes
public static byte[] compileJarBytes(byte[] jarBytes)
Called mainly from maven goal to compile a Jar content with ABICompiler, mainly to process annotations.- Parameters:
jarBytes-- Returns:
-
optimizeJarBytes
public static byte[] optimizeJarBytes(byte[] jarBytes, boolean debugMode)
-
shutdown
public void shutdown()
-
-