Private SCN을 구동하여 컨트랙트를 배포하고 caver-java를 이용하여 컨트랙트를 실행하려 하는데
TransactionReceipt가 null이면 어떤 경우인가요?
private SCN 노드 하나로 컨트랙트 배포 및 트랜잭션 처리 모두 가능한가요?
-
현재 SCN 노드만 구동중 입니다.
-
계정이 보유한 Klay는 확인했습니다.
-
컨트랙트의 배포 주소를 확인하고 컨트랙트의 view 함수의 기능은 확인했습니다.
-
caver-java 1.3.1
-
Baobob 테스트넷에 배포 후 정상 동작은 확인했습니다.
Caver caver = Caver.build("http://54.180.118.248:7551"); // SCN URL KlayCredentials credentials = KlayWalletUtils.loadCredentials(keyFilePw, keyFileDirPath+"/UTC--2020-03-04T08-01-27.821042500Z--82466b3d5f53c6adb0eaedf8c44fa6fad1057302.json"); Rena contract = Rena.load( "0x1fd06cc5c36c976664b73e4f98bbb081ebca9729", caver, credentials, 9999, new DefaultGasProvider() ); /* Test Point */ BigInteger testPoint = contract.getTestPoint().send(); System.out.println("[Test Point]:"+testPoint); KlayTransactionReceipt.TransactionReceipt transactionReceipt = contract.addTestPoint().send(); // Receipt가 NULL if(transactionReceipt != null) { System.out.println("[TX HASH]:"+transactionReceipt.getTransactionHash()); }
Contract
pragma solidity >=0.4.21 <0.7.0;
pragma experimental ABIEncoderV2;
contract Rena {
uint256 public testPoint = 100;
/* Function */
function getTestPoint() public view returns (uint256) {
return testPoint;
}
function addTestPoint() public returns (bool) {
testPoint = testPoint + 10;
return true;
}
}
SCN Config
Configuration file for the kscnd
SCSIGNER=
SCSIGNER_PASSWD_FILE= # Need to right password file for the keystore file of the scsigner address
NETWORK_ID=9999
PORT=22323 # if EN(main-bridge) and SCN(sub-bridge) on same instance, use different port with EN.(EN: 32323, SCN:22323)
SERVER_TYPE="fasthttp"
SYNCMODE="full"
VERBOSITY=5
# txpool options setting
TXPOOL_EXEC_SLOTS_ALL=16384
TXPOOL_NONEXEC_SLOTS_ALL=16384
TXPOOL_EXEC_SLOTS_ACCOUNT=16384
TXPOOL_NONEXEC_SLOTS_ACCOUNT=16384
TXPOOL_LIFE_TIME="5m"
# rpc options setting
RPC_ENABLE=1 # if this is set, the following options will be used
RPC_API="mainbridge, subbridge, txpool,net,klay,subbridge,rpc,admin,personal" # available apis: admin,debug,klay,miner,net,personal,rpc,txpool,web3,mainbridge,subbridge
RPC_PORT=7551 # if main-bridge and sub-bridge on same instance, use different port with main-bridge.(main: 8551, sub:7551)
RPC_ADDR="0.0.0.0"
RPC_CORSDOMAIN="*"
RPC_VHOSTS="*"
# ws options setting
WS_ENABLE=1 # if this is set, the following options will be used
WS_API="klay"
WS_ADDR="0.0.0.0"
WS_PORT=7552 # if main-bridge and sub-bridge on same instance, use different port with main-bridge.(main: 8552, sub:7552)
WS_ORIGINS="*"
# service chain options setting
#SC_MAIN_BRIDGE=0 # if this is set, the following options will be used.
#SC_MAIN_BRIDGE_PORT=50505
#SC_MAIN_BRIDGE_INDEXING=0
#SC_SUB_BRIDGE=0
#SC_SUB_BRIDGE_PORT=50506 # if main-bridge and sub-bridge on same instance, use different port with main-bridge.(main: 50505, sub:50506)
#SC_PARENT_CHAIN_ID=8217
#SC_ANCHORING=0
#SC_ANCHORING_PERIOD=1
#SC_TX_LIMIT=1000
# Setting 1 is to enable options, otherwise disabled.
METRICS=1
PROMETHEUS=1
NO_DISCOVER=1
DB_NO_PARALLEL_WRITE=0
MULTICHANNEL=1
SUBPORT=$((PORT + 1)) # used for multi channel option
VTRECOVERY=1 # value transfer recovery
# Raw options e.g) "--txpool.nolocals"
ADDITIONAL=""
DATA_DIR=/home/ec2-user/data
LOG_DIR=$DATA_DIR/logs