Klaytn 문서 아카이브
시작하기스마트 컨트랙트노드 운영dApp 개발자
  • Klaytn 문서
  • -
    • Klaytn Overview
      • 왜 클레이튼일까요?
      • 클레이튼 디자인
        • 합의 메커니즘
        • 계정
        • 트랜잭션
          • 기본
          • 수수료 위임 트랜잭션
          • 수수료 부분 위임 트랜잭션
          • Ethereum
        • 연산
          • 클레이튼 스마트 컨트랙트
          • 실행 모델(Execution Model)
          • Computation Cost
            • 연산 비용 (구 버전 문서)
          • Klaytn 가상머신
            • 클레이튼 가상머신 (구 버전 문서)
        • 스토리지
        • 트랜잭션 비용
          • 트랜잭션 비용 (구 버전 문서)
        • 클레이튼의 네이티브 코인 - KLAY
        • 토큰 이코노미
        • 거버넌스
        • 다중 채널
        • KNI
      • 확장성 솔루션
    • Getting Started
      • Deploying Smart Contract Using Foundry
      • Deploying Smart Contract Using Hardhat
      • Deploying Smart Contract Using KEN
        • Launch an Endpoint Node
        • Top up your Account
        • Install Development Tools
        • Deploy a Smart Contract
        • Check the Deployment
        • Account Management
          • Creating Accounts
          • Managing Accounts
      • Development Environment
      • Getting KLAY
    • 스마트 컨트랙트
      • 솔리디티 - 스마트 컨트랙트 언어
      • 미리 컴파일된 컨트랙트
        • 미리 컴파일된 컨트랙트 (구 버전 문서)
      • IDE 및 도구
        • Truffle
      • 샘플 컨트랙트
        • KlaytnGreeter
        • ERC-20
          • 1. ERC-20 스마트 컨트랙트 작성
          • 2. 스마트 컨트랙트 배포
          • 3. 클레이튼 월렛에서 ERC-20 토큰 사용
        • ERC-721
          • 1. ERC-721 스마트 컨트랙트 작성
          • 2. Deploying Smart Contract
      • 테스트 가이드
      • 배포 가이드
      • 클레이튼 호환 토큰
      • 이더리움 컨트랙트 이식
    • Run a Node
      • 배포
        • Endpoint Node
          • 시스템 요구사항
          • 설치 가이드
            • 다운로드
            • Installation Guide
            • 환경설정
            • EN 실행하기
            • 설치 테스트하기
          • ken CLI 명령어
          • JSON-RPC API
        • 코어 셀
          • System Requirements
          • 네트워크 설정
          • Installation Guide
            • Download
            • 설치하기 전에
            • 컨센서스 노드 설정
              • Installation Guide
              • Configuration
              • CN 실행하기
            • 프록시 노드 설정
              • Installation Guide
              • Configuration
              • PN 실행하기
            • 코어 셀 테스트하기
          • 모니터링 설정
          • H/A 설정
        • Service Chain
          • Getting Started
            • 4개 노드 서비스 체인 설정하기
            • Connecting to Baobab
            • 크로스체인 토큰 전송
            • HA(High Availability) for ServiceChain
            • Nested ServiceChain
            • Value Transfer between Sibling ServiceChains
          • 참조 매뉴얼
            • System Requirements
            • Download
            • SCN User Guide
              • Installation
              • Configuration
              • SCN 실행 및 중지하기
              • 노드 상태 확인하기
              • kscn commands
              • homi commands
            • SPN/SEN User Guide
              • Installation
              • Configuration
              • 노드 실행 및 중지
              • Checking Node Status
            • Bridge Configuration
            • 앵커링
            • KAS 앵커링
            • 토큰 전송
            • Configuration Files
            • 로그 파일
            • Genesis JSON
            • 업그레이드 및 하드포크
          • How-To Guides
        • Download Node Packages
          • v1.11.1
          • v1.11.0
          • v1.10.2
          • v1.10.1
          • v1.10.0
          • v1.9.1
          • v1.9.0
          • v1.8.4
          • v1.8.3
          • v1.8.2
          • v1.8.1
          • v1.8.0
          • v1.7.3
          • v1.7.2
          • v1.7.1
          • v1.7.0
          • v1.6.4
          • v1.6.3
          • v1.6.2
          • v1.6.1
          • v1.6.0
          • v1.5.3
          • v1.5.2
          • v1.5.1
          • v1.5.0
          • v1.4.2
          • v1.4.1
          • v1.4.0
          • v1.3.0
          • v1.2.0
          • v1.1.1
          • v1.0.0
          • v0.9.6
          • v0.8.2
    • 운영 가이드
      • Configuration
      • 노드 로그
      • Log operation
      • 에러 및 문제 해결
      • Klaytn Command
      • Chaindata Change
      • Chaindata Migration
    • dApp Developers
      • JSON-RPC APIs
        • API references
          • eth
            • Caution
            • Account
            • Block
            • Transaction
            • Config
            • Filter
            • Gas
            • Miscellaneous
          • klay
            • Account
            • Block
            • Transaction
              • Working with Klaytn Transaction Types
            • Configuration
            • Filter
            • Gas
            • Miscellaneous
          • net
          • debug
            • Logging
            • Profiling
            • Runtime Tracing
            • Runtime Debugging
            • VM Tracing
            • VM Standard Tracing
            • Blockchain Inspection
          • admin
          • personal
          • txpool
          • governance
        • Service Chain API references
          • mainbridge
          • subbridge
        • Transaction Error Codes
      • RPC Service Providers
        • Public Endpoints
      • SDK & Libraries for interacting with Klaytn Node
        • caver-js
          • Getting Started
          • Sending a sample transaction
          • API references
            • caver.account
            • caver.wallet
              • caver.wallet.keyring
            • caver.transaction
              • Basic
              • Fee Delegation
              • Partial Fee Delegation
            • caver.rpc
              • caver.rpc.klay
              • caver.rpc.net
              • caver.rpc.governance
            • caver.contract
            • caver.abi
            • caver.kct
              • caver.kct.kip7
              • caver.kct.kip17
              • caver.kct.kip37
            • caver.validator
            • caver.utils
            • caver.ipfs
          • caver-js ~v1.4.1
            • Getting Started (~v1.4.1)
            • API references
              • caver.klay
                • Account
                • Block
                • Transaction
                  • Legacy
                  • Value Transfer
                  • Value Transfer Memo
                  • Account Update
                  • Smart Contract Deploy
                  • Smart Contract Execution
                  • Cancel
                • Configuration
                • Filter
                • Miscellaneous
              • caver.klay.net
              • caver.klay.accounts
              • caver.klay.Contract
              • caver.klay.KIP7
              • caver.klay.KIP17
              • caver.klay.abi
              • caver.utils (~v1.4.1)
            • Porting from web3.js
        • caver-java
          • Getting Started
          • API references
          • caver-java ~v1.4.0
            • Getting Started (~v1.4.0)
            • Porting from web3j
        • ethers.js
        • web3.js
      • Tutorials
        • Klaytn Online Toolkit
        • Fee Delegation Example
        • Count DApp
          • 1. Environment Setup
          • 2. Clone Count DApp
          • 3. Directory Structure
          • 4. Write Smart Contract
          • 5. Frontend Code Overview
            • 5-1. Blocknumber Component
            • 5-2. Auth Component
            • 5-3. Count Component
          • 6. Deploy Contract
          • 7. Run App
        • Klaystagram
          • 1. Environment Setup
          • 2. Clone Klaystagram DApp
          • 3. Directory Structure
          • 4. Write Klaystagram Smart Contract
          • 5. Deploy Contract
          • 6. Frontend Code Overview
          • 7. FeedPage
            • 7-1. Connect Contract to Frontend
            • 7-2. UploadPhoto Component
            • 7-3. Feed Component
            • 7-4. TransferOwnership Component
          • 8. Run App
        • Building a Buy Me a Coffee dApp
          • 1. Project Setup
          • 2. Creating a BMC Smart Contract
          • 3. Testing the contract using scripts
          • 4. Deploying BMC Smart contract
          • 5. Building the BMC Frontend with React and Web3Onboard
          • 6. Deploying Frontend code on IPFS using Fleek
          • 7. Conclusion
        • Migrating Ethereum App to Klaytn
        • Connecting MetaMask
        • Connecting Remix
        • Verifying Smart Contracts Using Block Explorers
      • Developer Tools
        • Wallets
          • Kaikas
          • Klaytn Wallet
          • Klaytn Safe
            • Klaytn Safe Design
            • Create a Safe
            • Add assets
            • Send assets
            • Contract Interaction
            • Transaction Builder
            • Points to Note
            • Frequently Asked Questions
          • Wallet Libraries
            • Web3Auth
            • Web3Modal
            • Web3-Onboard
        • Oracles
          • Orakl Network
          • Witnet
          • SupraOracles
        • Block Explorers
          • Klaytnscope
          • Klaytnfinder
        • Klaytn Contracts Wizard
    • Glossary
  • ---
    • Klaytn 하드포크
    • 클레이튼 2.0
      • 메타버스 패키지
      • 완결성과 개선 사항들
      • 이더리움 호환성
      • 거버넌스 탈중앙화
      • 대규모 에코 펀드
    • FAQ
    • 오픈 소스
    • 이용약관
    • 지원 언어
  • ℹ️최신 Klaytn 문서
Powered by GitBook
On this page
  • caver.rpc.governance.vote
  • caver.rpc.governance.showTally
  • caver.rpc.governance.getTotalVotingPower
  • caver.rpc.governance.getMyVotingPower
  • caver.rpc.governance.getMyVotes
  • caver.rpc.governance.getChainConfig
  • caver.rpc.governance.getNodeAddress
  • caver.rpc.governance.getItemsAt
  • caver.rpc.governance.getPendingChanges
  • caver.rpc.governance.getIdxCache
  • caver.rpc.governance.getIdxCacheFromDb
  • caver.rpc.governance.getItemCacheFromDb
  • caver.rpc.governance.getVotes
  • caver.rpc.governance.getStakingInfo

Was this helpful?

  1. -
  2. dApp Developers
  3. SDK & Libraries for interacting with Klaytn Node
  4. caver-js
  5. API references
  6. caver.rpc

caver.rpc.governance

Previouscaver.rpc.netNextcaver.contract

Last updated 2 years ago

Was this helpful?

caver.rpc.governance는 governance 네임 스페이스를 가진 JSON-RPC API를 제공합니다.

caver.rpc.governance.vote

caver.rpc.governance.vote(key, value [, callback])

새로 투표합니다. 거버넌스 모드에 의거하여 노드가 의결권을 가지면 투표할 수 있습니다. 그렇지 않으면 오류 메시지가 반환되고 투표 행위가 무시됩니다.

Parameters

Name
Type
Description

key

string

Key : 변경하고자 하는 환경설정의 이름입니다. 키는 domain.field의 형식으로 되어 있습니다.

value

string | number | boolean

각 키에 대한 값의 타입들입니다.

callback

function

(선택 사항) 선택적 콜백(callback)은 오류 객체를 첫 번째 파라미터로, 결과를 두 번째 파라미터로 반환합니다.

caver.rpc.governance.vote의 key나 value에 대한 자세한 내용은 를 참고해주세요.

Return Value

Promise returns string

Type
Description

string

투표 제출 결과입니다.

Example

> caver.rpc.governance.vote('governance.governancemode', 'ballot').then(console.log)
Your vote was successfully placed.

caver.rpc.governance.showTally

caver.rpc.governance.showTally([callback])

현재 거버넌스 표 합계를 제공합니다. 집계된 찬성률을 백분율로 나타냅니다. 찬성률이 50%인 경우 변경이 통과됩니다.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise는 array를 반환합니다.

Type
Description

Array

표의 값과 찬성률을 포함한 배열입니다.

Example

> caver.rpc.governance.showTally().then(console.log)
[
  {
    Key: 'governance.unitprice',
    Value: 25000000000,
    ApprovalPercentage: 33.33333333333333
  }
]

caver.rpc.governance.getTotalVotingPower

caver.rpc.governance.getTotalVotingPower([callback])

CN이 지닌 의결권의 합을 제공합니다. Each CN has 1.0 ~ 2.0 voting power. "none", "single" 거버넌스 모드에서는 totalVotingPower 속성을 통해 제공하는 정보가 없습니다.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns number

Type
Description

number

의결권의 총합입니다.

Example

> caver.rpc.governance.getTotalVotingPower().then(console.log)
3

caver.rpc.governance.getMyVotingPower

caver.rpc.governance.getMyVotingPower([callback])

노드의 의결권을 반환합니다. 의결권의 값은 1.0 ~ 2.0입니다. "none", "single" 거버넌스 모드에서는 totalVotingPower 속성을 통해 제공하는 정보가 없습니다.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns number

Type
Description

number

노드의 의결권입니다.

Example

> caver.rpc.governance.getMyVotingPower().then(console.log)
1

caver.rpc.governance.getMyVotes

caver.rpc.governance.getMyVotes([callback])

투표 주기 내 투표 정보를 반환합니다. Each vote is stored in a block when the user's node generates a new block. After current epoch ends, this information is cleared.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns Array

Type
Description

Array

투표 주기 내 노드의 투표 상태입니다.

Example

> caver.rpc.governance.getMyVotes().then(console.log)
[
  {
    Key: 'governance.unitprice',
    Value: 25000000000,
    Casted: true,
    BlockNum: 76899
  }
]

caver.rpc.governance.getChainConfig

caver.rpc.governance.getChainConfig([callback])

최초 체인 환경설정을 제공합니다. 이 속성은 초기 환경설정만 저장하기 때문에 투표에 의해 거버넌스에 변경 사항이 있다면 chainConfig의 결과는 현재 상태와 달라질 것입니다. 현재 정보를 확인하려면 itemsAt을 사용하세요.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise는 object를 반환합니다.

Type
Description

object

체인의 최초 환경설정입니다.

Example

> caver.rpc.governance.getChainConfig().then(console.log)
{
  chainId: 10000,
  istanbul: { epoch: 30, policy: 2, sub: 22 },
  unitPrice: 25000000000,
  deriveShaImpl: 2,
  governance: {
    governingNode: '0xbeafcca672100a88a953fcf5e882cb763f9e3de9',
    governanceMode: 'single',
    reward: {
      mintingAmount: 6400000000000000000,
      ratio: '50/40/10',
      useGiniCoeff: true,
      deferredTxFee: true,
      stakingUpdateInterval: 60,
      proposerUpdateInterval: 30,
      minimumStake: 5000000
    },
    kip71: {
      lowerboundbasefee: 25000000000,
      upperboundbasefee: 750000000000,
      gastarget: 30000000,
      maxblockgasusedforbasefee: 60000000,
      basefeedenominator: 20
    }
  }
}

caver.rpc.governance.getNodeAddress

caver.rpc.governance.getNodeAddress([callback])

사용자의 노드 주소를 제공합니다. It is derived from the nodekey and used to sign consensus messages. 그리고 "governingnode"의 값은 검증자의 노드 중 하나의 주소가 되어야 합니다.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns string

Type
Description

string

노드의 주소입니다.

Example

> caver.rpc.governance.getNodeAddress().then(console.log)
0xbeafcca672100a88a953fcf5e882cb763f9e3de9

caver.rpc.governance.getItemsAt

caver.rpc.governance.getItemsAt([blockNumberOrTag] [, callback])

특정 블록에서의 거버넌스 항목을 반환합니다. It is the result of previous voting of the block and used as configuration for chain at the given block number.

Parameters

Name
Type
Description

blockNumberOrTag

number | string

(선택 사항) 블록 넘버, 또는 latest, earliest, pending 문자열 중 하나입니다. 이 값을 생략하면 latest가 기본값으로 사용됩니다.

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns object

Type
Description

object

거버넌스 항목들입니다.

Example

> caver.rpc.governance.getItemsAt().then(console.log)
{
  'governance.governancemode': 'ballot',
  'governance.governingnode': '0xbeafcca672100a88a953fcf5e882cb763f9e3de9',
  'governance.unitprice': 25000000000,
  'istanbul.committeesize': 22,
  'istanbul.epoch': 30,
  'istanbul.policy': 2,
  'kip71.basefeedenominator': 20,
  'kip71.gastarget': 30000000,
  'kip71.lowerboundbasefee': 25000000000,
  'kip71.maxblockgasusedforbasefee': 60000000,
  'kip71.upperboundbasefee': 750000000000,
  'reward.deferredtxfee': true,
  'reward.minimumstake': '5000000',
  'reward.mintingamount': '6400000000000000000',
  'reward.proposerupdateinterval': 30,
  'reward.ratio': '50/40/10',
  'reward.stakingupdateinterval': 60,
  'reward.useginicoeff': true
}

> caver.rpc.governance.getItemsAt('latest').then(console.log)

caver.rpc.governance.getPendingChanges

caver.rpc.governance.getPendingChanges([callback])

pendingChanges은 충분한 표를 받았지만, 아직 확정되지 않은 항목들의 목록을 반환합니다. At the end of the current epoch, these changes will be finalized and the result will be in effect from the epoch after next epoch.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns object

Type
Description

object

현재 보류 중인 변경 항목들의 키-밸류 쌍입니다.

Example

> caver.rpc.governance.getPendingChanges().then(console.log)
{ 'governance.governancemode': 'single' }

caver.rpc.governance.getIdxCache

caver.rpc.governance.getIdxCache([callback])

메모리 캐시 내 현재 idxCache 배열을 반환합니다. idxCache contains the block numbers where governance change happened. The cache can have up to 1000 block numbers in memory by default.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns object

Type
Description

Array

거버넌스 내용이 변경되었던 블록의 번호입니다.

Example

> caver.rpc.governance.getIdxCache().then(console.log)
[ 0, 60, 321180 ]

caver.rpc.governance.getIdxCacheFromDb

caver.rpc.governance.getIdxCacheFromDb([callback])

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns object

Type
Description

Array

Block numbers where governance change happened.

Example

> caver.rpc.governance.getIdxCacheFromDb().then(console.log)
[ 0, 60, 321180 ]

caver.rpc.governance.getItemCacheFromDb

caver.rpc.governance.getItemCacheFromDb([callback])

특정 블록에 저장된 거버넌스 정보를 반환합니다. 해당 블록에 변경 사항이 저장되어 있지 않다면 함수는 null을 반환합니다.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Parameters

Name
Type
Description

blockNumber

number | string

거버넌스 내용 변경이 이루어졌는지 확인할 블록의 번호, 16진수 문자열입니다.

Return Value

Promise returns object

Type
Description

object

특정 블록에 저장된 거버넌스 정보입니다.

Example

> caver.rpc.governance.getItemCacheFromDb(540).then(console.log)
{
  'governance.governancemode': 'single',
  'governance.governingnode': '0xbeafcca672100a88a953fcf5e882cb763f9e3de9',
  'governance.unitprice': 25000000000,
  'istanbul.committeesize': 22,
  'istanbul.epoch': 30,
  'istanbul.policy': 2,
  'kip71.basefeedenominator': 30,
  'kip71.gastarget': 30000000,
  'kip71.lowerboundbasefee': 25000000000,
  'kip71.maxblockgasusedforbasefee': 60000000,
  'kip71.upperboundbasefee': 750000000000,
  'reward.deferredtxfee': true,
  'reward.minimumstake': '5000000',
  'reward.mintingamount': '6400000000000000000',
  'reward.proposerupdateinterval': 30,
  'reward.ratio': '50/40/10',
  'reward.stakingupdateinterval': 60,
  'reward.useginicoeff': true
}

> caver.rpc.governance.getItemCacheFromDb(1).then(console.log)
null

caver.rpc.governance.getVotes

caver.rpc.governance.getVotes([callback])

투표 주기 내 모든 노드의 투표 상태를 반환합니다. These votes are gathered from the header of each block.

Parameters

Name
Type
Description

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns object

Type
Description

Array

키, 값, 노드 주소로 구성된 현재 투표 정보입니다.

Example

> caver.rpc.governance.getVotes().then(console.log)
[{
    key: 'reward.minimumstake',
    validator: '0xe733cb4d279da696f30d470f8c04decb54fcb0d2',
    value: '5000000'
}, {
    key: 'reward.useginicoeff',
    validator: '0xa5bccb4d279419abe2d470f8c04dec0789ac2d54',
    value: false
}]

caver.rpc.governance.getStakingInfo

caver.rpc.governance.getStakingInfo([blockNumberOrTag] [, callback])

특정 블록에서의 스테이킹 정보를 반환합니다.

Parameters

Name
Type
Description

blockNumberOrTag

number | string

(optional) A block number, or the string latest or earliest. If omitted, latest will be used.

callback

function

(optional) Optional callback, which returns an error object as the first parameter and the result as the second.

Return Value

Promise returns object

Type
Description

object

Example

> caver.rpc.governance.getStakingInfo().then(console.log)
{
  BlockNum: 321600,
  CouncilNodeAddrs: [],
  CouncilStakingAddrs: [],
  CouncilRewardAddrs: [],
  KIRAddr: '0x0000000000000000000000000000000000000000',
  PoCAddr: '0x0000000000000000000000000000000000000000',
  UseGini: false,
  Gini: -1,
  CouncilStakingAmounts: []
}

거버넌스에 변화가 한번이라도 있었던 블록의 번호를 포함하는 배열을 반환합니다. idxCacheFromDb의 결과의 길이는 와 같거나 더 깁니다.

스테이킹 정보입니다. 반환값의 대한 설명은 을 참고하세요.

idxCache
governance_vote
governance_getStakingInfo