// apply a new masternode candidatefunctionpropose(address_candidate) externalpayable;// Deposit to stake/vote for a candidatefunctionvote(address_candidate) externalpayable;// Unstake/unvote for a candidatefunctionunvote(address_candidate,uint256_cap) public;// Resign a candidatefunctionresign(address_candidate) public;// Withdraw after unvote, resignfunctionwithdraw(uint256_blockNumber,uint_index) public;functiongetCandidates() publicviewreturns(address[]);functiongetCandidateCap(address_candidate) publicviewreturns(uint256);functiongetCandidateOwner(address_candidate) publicviewreturns(address);functiongetVoterCap(address_candidate,address_voter) publicviewreturns(uint256);functiongetVoters(address_candidate) publicviewreturns(address[]);functionisCandidate(address_candidate) publicviewreturns(bool);functiongetWithdrawBlockNumbers() publicviewreturns(uint256[]);functiongetWithdrawCap(uint256_blockNumber) publicviewreturns(uint256);
Viction provides RPC APIs that can be used with Web3 library to directly call the functions in the smart contract.
You can follow the steps below to interact with the smart contract by using Web3 library and NodeJS.
Init Web3 Provider
At the first step, you need init Web3 provider by connecting Viction Fullnode RPC endpoint.
Masternode owners need to have at least 50,000 VIC to apply to become a Masternode Candidate. Make sure to have > 50,000 VIC in the Masternode owner wallet in order to deposit it into the smart contract and pay the related transaction fee.
Apply to become a Masternode Candidate by calling propose function from the smart contract