Developer Resources
Block ExplorerGitHubRun a NodeMigration GuideETN Testnet Faucet
  • Overview
  • Foundational topics
    • Intro to the Electroneum Smart Chain
    • Intro to ETN
    • Intro to dapps
    • Web2 vs Web3
    • Accounts
    • Transactions
    • Blocks
    • Electroneum Virtual Machine (EVM)
      • Opcodes
    • Gas and Fees
    • Nodes and clients
    • Networks
    • Consensus mechanisms
      • IBFT
  • Electroneum Stack
    • Intro to the stack
    • Smart contracts
    • Development networks
    • Development frameworks
    • Electroneum client APIs
      • JavaScript APIs
      • JSON-RPC
    • Storage
    • Integrated Development Environments (IDEs)
    • Metamask
  • Advanced
    • Bridges
    • Standards
      • Token standards
        • ERC-20 Fungible Tokens
        • ERC-721 NFTs
    • Oracles
    • Networking layer
      • Network addresses
    • Data structures and encoding
      • Patricia Merkle Trie
      • Recursive-length prefix (RLP)
      • Web3 secret storage definition
  • Design fundamentals
    • Intro to design and UX
  • ETN-SC Client
    • Getting started
      • Introduction
      • Hardware requirements
      • Instaling ETN-SC
    • Fundamentals
      • Command-line options
      • Security
      • Sync-modes
      • Account management
      • Databases
      • Backup & restore
      • Logs
      • Connecting to peers
      • Pruning
      • Private networks
      • Config files
      • Light client
    • Interacting with ETN-SC
      • JSON-RPC Server
        • Batch requests
        • Real-time events
      • JSON-RPC Namespaces
        • admin
        • clique
        • debug
        • eth
        • istanbul
        • les
        • miner
        • net
        • personal
        • txpool
      • JS Console
      • JS Console 2: Contracts
      • GraphQL Server
    • Developers
      • Introduction
      • Dapp developers
        • Dev mode
        • Go API
        • Go Account Management
        • Go Contract Bindings
      • EVM tracing
        • Introduction
        • Basic traces
        • Built-in tracers
        • Custom EVM tracer
        • Tutorial for JavaScript tracing
      • ETN-SC developer
        • Developer guide
        • Disclosures
        • DNS discovery setup guide
        • Code review guidelines
      • Contributing
    • Monitoring
      • Creating Dashboards
      • Understanding Dashboards
      • Ethstats
      • Metrics
    • Tools
      • Clef
        • Introduction
        • APIs
        • Rules
        • Setup
        • Datatypes
        • Tutorial
        • Clique-signing
      • abigen
      • devp2p
    • FAQs
  • Migration to Smart Chain
    • Overview
    • How to Migrate
      • ETN Online Wallets
      • Paper Wallets
      • CLI Wallet Users
      • Exchange Holders
      • Exchanges
    • Bridge Smart Contract
  • Misc. Guides
    • Set up Ledger + Metamask
  • MY.ELECTRONEUM.COM
    • Vendor API
Powered by GitBook
On this page
  • clique_getSnapshot
  • clique_getSnapshotAtHash
  • clique_getSigner
  • clique_getSigners
  • clique_getSignersAtHash
  • clique_proposals
  • clique_propose
  • clique_discard
  • clique_status

Was this helpful?

  1. ETN-SC Client
  2. Interacting with ETN-SC
  3. JSON-RPC Namespaces

clique

The clique API provides access to the state of the clique consensus engine. This API can be used to manage signer votes and to check the health of a private network.

clique_getSnapshot

Retrieves a snapshot of all clique state at a given block.

CLIENT
METHOD INVOCATION

Console

clique.getSnapshot(blockNumber)

RPC

{"method": "clique_getSnapshot", "params": [blockNumber]}

Example:

> clique.getSnapshot(5463755)
{
  hash: "0x018194fc50ca62d973e2f85cffef1e6811278ffd2040a4460537f8dbec3d5efc",
  number: 5463755,
  recents: {
    5463752: "0x42eb768f2244c8811c63729a21a3569731535f06",
    5463753: "0x6635f83421bf059cd8111f180f0727128685bae4",
    5463754: "0x7ffc57839b00206d1ad20c69a1981b489f772031",
    5463755: "0xb279182d99e65703f0076e4812653aab85fca0f0"
  },
  signers: {
    0x42eb768f2244c8811c63729a21a3569731535f06: {},
    0x6635f83421bf059cd8111f180f0727128685bae4: {},
    0x7ffc57839b00206d1ad20c69a1981b489f772031: {},
    0xb279182d99e65703f0076e4812653aab85fca0f0: {},
    0xd6ae8250b8348c94847280928c79fb3b63ca453e: {},
    0xda35dee8eddeaa556e4c26268463e26fb91ff74f: {},
    0xfc18cbc391de84dbd87db83b20935d3e89f5dd91: {}
  },
  tally: {},
  votes: []
}

clique_getSnapshotAtHash

Retrieves the state snapshot at a given block.

CLIENT
METHOD INVOCATION

Console

clique.getSnapshotAtHash(blockHash)

RPC

{"method": "clique_getSnapshotAtHash", "params": [blockHash]}

clique_getSigner

Returns the signer for a specific clique block. Can be called with either a blocknumber, blockhash or an rlp encoded blob. The RLP encoded blob can either be a block or a header.

CLIENT
METHOD INVOCATION

Console

clique.getSigner(blockNrOrHashOrRlp)

RPC

{"method": "clique_getSigner", "params": [string]}

clique_getSigners

Retrieves the list of authorized signers at the specified block number.

CLIENT
METHOD INVOCATION

Console

clique.getSigners(blockNumber)

RPC

{"method": "clique_getSigners", "params": [blockNumber]}

clique_getSignersAtHash

Retrieves the list of authorized signers at the specified block hash.

CLIENT
METHOD INVOCATION

Console

clique.getSignersAtHash(blockHash)

RPC

{"method": "clique_getSignersAtHash", "params": [string]}

clique_proposals

Returns the current proposals the node is voting on.

CLIENT
METHOD INVOCATION

Console

clique.proposals()

RPC

{"method": "clique_proposals", "params": []}

clique_propose

Adds a new authorization proposal that the signer will attempt to push through. If the auth parameter is true, the local signer votes for the given address to be included in the set of authorized signers. With auth set to false, the vote is against the address.

CLIENT
METHOD INVOCATION

Console

clique.propose(address, auth)

RPC

{"method": "clique_propose", "params": [address, auth]}

clique_discard

This method drops a currently running proposal. The signer will not cast further votes (either for or against) the address.

CLIENT
METHOD INVOCATION

Console

clique.discard(address)

RPC

{"method": "clique_discard", "params": [address]}

clique_status

This is a debugging method which returns statistics about signer activity for the last 64 blocks. The returned object contains the following fields:

  • inturnPercent: percentage of blocks signed in-turn

  • sealerActivity: object containing signer addresses and the number of blocks signed by them

  • numBlocks: number of blocks analyzed

CLIENT
METHOD INVOCATION

Console

clique.status()

RPC

{"method": "clique_status", "params": []}

Example:

> clique.status()
{
  inturnPercent: 100,
  numBlocks: 64,
  sealerActivity: {
    0x42eb768f2244c8811c63729a21a3569731535f06: 9,
    0x6635f83421bf059cd8111f180f0727128685bae4: 9,
    0x7ffc57839b00206d1ad20c69a1981b489f772031: 9,
    0xb279182d99e65703f0076e4812653aab85fca0f0: 10,
    0xd6ae8250b8348c94847280928c79fb3b63ca453e: 9,
    0xda35dee8eddeaa556e4c26268463e26fb91ff74f: 9,
    0xfc18cbc391de84dbd87db83b20935d3e89f5dd91: 9
  }
}
PreviousadminNextdebug

Last updated 1 year ago

Was this helpful?