Copy disabled (too large)
Download .txt
Showing preview only (14,945K chars total). Download the full file to get everything.
Repository: pactus-project/pactus
Branch: main
Commit: fa89e8025dc1
Files: 825
Total size: 14.1 MB
Directory structure:
gitextract_gyguei1v/
├── .dockerignore
├── .editorconfig
├── .entire/
│ └── .gitignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── windows-signing/
│ │ └── action.yml
│ ├── codecov.yml
│ ├── packager/
│ │ ├── js/
│ │ │ ├── grpc/
│ │ │ │ ├── README.md
│ │ │ │ └── package.json
│ │ │ └── jsonrpc/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── packager.sh
│ │ ├── python/
│ │ │ ├── grpc/
│ │ │ │ ├── README.md
│ │ │ │ ├── pactus_grpc/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── __init__.pyi
│ │ │ │ ├── pyproject.toml
│ │ │ │ └── setup.py
│ │ │ └── jsonrpc/
│ │ │ ├── README.md
│ │ │ ├── pactus_jsonrpc/
│ │ │ │ └── __init__.py
│ │ │ ├── pyproject.toml
│ │ │ └── setup.py
│ │ └── rust/
│ │ ├── grpc/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ └── jsonrpc/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ └── lib.rs
│ ├── releasers/
│ │ ├── linux/
│ │ │ └── pactus-gui.desktop
│ │ ├── macos/
│ │ │ ├── Info.plist
│ │ │ ├── gtk3-launcher.sh
│ │ │ ├── gui.bundle
│ │ │ ├── pactus.icns
│ │ │ └── run-install-name-tool-change.sh
│ │ ├── pactus_downloader.sh
│ │ ├── releaser_cli.sh
│ │ ├── releaser_gui_linux.sh
│ │ ├── releaser_gui_macos.sh
│ │ ├── releaser_gui_windows_build.sh
│ │ ├── releaser_gui_windows_installer.sh
│ │ └── windows/
│ │ ├── README.md
│ │ ├── gtk-win-bundler.py
│ │ ├── pactus-gui.manifest
│ │ └── rsrc_windows_amd64.syso
│ └── workflows/
│ ├── codeql.yml
│ ├── coverage.yml
│ ├── deadlock.yml
│ ├── docker.yml
│ ├── gui.yml
│ ├── linting.yml
│ ├── packager.yml
│ ├── releaser.yml
│ ├── semantic-pr.yml
│ └── testing.yml
├── .gitignore
├── .golangci.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── cmd/
│ ├── cmd.go
│ ├── cmd_test.go
│ ├── daemon/
│ │ ├── import.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── prune.go
│ │ ├── start.go
│ │ └── version.go
│ ├── gtk/
│ │ ├── app/
│ │ │ └── run.go
│ │ ├── assets/
│ │ │ ├── assets.go
│ │ │ ├── css/
│ │ │ │ └── style.css
│ │ │ ├── css.go
│ │ │ ├── dialogs.go
│ │ │ ├── icons.go
│ │ │ ├── images.go
│ │ │ ├── main_ui.go
│ │ │ └── ui/
│ │ │ ├── dialog_about.ui
│ │ │ ├── dialog_about_gtk.ui
│ │ │ ├── dialog_address_details.ui
│ │ │ ├── dialog_address_label.ui
│ │ │ ├── dialog_address_private_key.ui
│ │ │ ├── dialog_transaction_bond.ui
│ │ │ ├── dialog_transaction_transfer.ui
│ │ │ ├── dialog_transaction_unbond.ui
│ │ │ ├── dialog_transaction_withdraw.ui
│ │ │ ├── dialog_wallet_change_password.ui
│ │ │ ├── dialog_wallet_create_address.ui
│ │ │ ├── dialog_wallet_password.ui
│ │ │ ├── dialog_wallet_set_default_fee.ui
│ │ │ ├── dialog_wallet_show_seed.ui
│ │ │ ├── main_window.ui
│ │ │ ├── widget_committee.ui
│ │ │ ├── widget_network.ui
│ │ │ ├── widget_node.ui
│ │ │ ├── widget_validator.ui
│ │ │ └── widget_wallet.ui
│ │ ├── controller/
│ │ │ ├── address_details_dialog_controller.go
│ │ │ ├── address_label_dialog_controller.go
│ │ │ ├── address_private_key_dialog_controller.go
│ │ │ ├── committee_widget_controller.go
│ │ │ ├── controller.go
│ │ │ ├── main_window_controller.go
│ │ │ ├── navigator.go
│ │ │ ├── network_widget_controller.go
│ │ │ ├── node_widget_controller.go
│ │ │ ├── password_prompt.go
│ │ │ ├── tx_bond_dialog_controller.go
│ │ │ ├── tx_transfer_dialog_controller.go
│ │ │ ├── tx_unbond_dialog_controller.go
│ │ │ ├── tx_withdraw_dialog_controller.go
│ │ │ ├── validator_widget_controller.go
│ │ │ ├── wallet_change_password_dialog_controller.go
│ │ │ ├── wallet_create_address_dialog_controller.go
│ │ │ ├── wallet_default_fee_dialog_controller.go
│ │ │ ├── wallet_password_dialog_controller.go
│ │ │ ├── wallet_seed_dialog_controller.go
│ │ │ └── wallet_widget_controller.go
│ │ ├── gtkutil/
│ │ │ ├── format.go
│ │ │ ├── format_test.go
│ │ │ ├── gtkutil.go
│ │ │ └── gtkutil_test.go
│ │ ├── main.go
│ │ ├── model/
│ │ │ ├── committee_model.go
│ │ │ ├── network_model.go
│ │ │ ├── node_model.go
│ │ │ ├── validator_model.go
│ │ │ └── wallet_model.go
│ │ ├── startup_assistant.go
│ │ └── view/
│ │ ├── about_dialog_view.go
│ │ ├── about_gtk_dialog_view.go
│ │ ├── address_details_dialog_view.go
│ │ ├── address_label_dialog_view.go
│ │ ├── address_private_key_dialog_view.go
│ │ ├── committee_widget_view.go
│ │ ├── main_window_view.go
│ │ ├── network_widget_view.go
│ │ ├── node_widget_view.go
│ │ ├── splash_window_view.go
│ │ ├── tx_bond_dialog_view.go
│ │ ├── tx_transfer_dialog_view.go
│ │ ├── tx_unbond_dialog_view.go
│ │ ├── tx_withdraw_dialog_view.go
│ │ ├── validator_widget_view.go
│ │ ├── view_builder.go
│ │ ├── wallet_change_password_dialog_view.go
│ │ ├── wallet_create_address_dialog_view.go
│ │ ├── wallet_default_fee_dialog_view.go
│ │ ├── wallet_password_dialog_view.go
│ │ ├── wallet_seed_dialog_view.go
│ │ └── wallet_widget_view.go
│ ├── helper.go
│ ├── importer.go
│ ├── shell/
│ │ ├── main.go
│ │ └── main_test.go
│ └── wallet/
│ ├── address.go
│ ├── create.go
│ ├── fee.go
│ ├── info.go
│ ├── main.go
│ ├── neuter.go
│ ├── password.go
│ ├── recover.go
│ ├── send.go
│ └── transaction.go
├── committee/
│ ├── committee.go
│ ├── committee_test.go
│ └── interface.go
├── config/
│ ├── banned_addrs.json
│ ├── bootstrap.json
│ ├── config.go
│ ├── config_test.go
│ ├── errors.go
│ └── example_config.toml
├── consensus/
│ ├── commit.go
│ ├── config.go
│ ├── config_test.go
│ ├── consensus.go
│ ├── consensus_test.go
│ ├── cp.go
│ ├── cp_decide.go
│ ├── cp_mainvote.go
│ ├── cp_prevote.go
│ ├── cp_test.go
│ ├── errors.go
│ ├── height.go
│ ├── height_test.go
│ ├── interface.go
│ ├── log/
│ │ ├── log.go
│ │ ├── log_test.go
│ │ └── messages.go
│ ├── manager/
│ │ ├── interface.go
│ │ ├── manager.go
│ │ ├── manager_test.go
│ │ └── mock.go
│ ├── mediator.go
│ ├── mock.go
│ ├── precommit.go
│ ├── precommit_test.go
│ ├── prepare.go
│ ├── prepare_test.go
│ ├── propose.go
│ ├── propose_test.go
│ ├── spec/
│ │ ├── .gitignore
│ │ ├── Pactus.cfg
│ │ ├── Pactus.tla
│ │ └── README.md
│ ├── state.go
│ ├── ticker.go
│ └── voteset/
│ ├── binary_voteset.go
│ ├── block_voteset.go
│ ├── errors.go
│ ├── vote_box.go
│ ├── vote_box_test.go
│ ├── voteset.go
│ └── voteset_test.go
├── consensusv2/
│ ├── commit.go
│ ├── config.go
│ ├── config_test.go
│ ├── consensus.go
│ ├── consensus_test.go
│ ├── cp.go
│ ├── cp_decide.go
│ ├── cp_mainvote.go
│ ├── cp_prevote.go
│ ├── cp_test.go
│ ├── errors.go
│ ├── height.go
│ ├── height_test.go
│ ├── log/
│ │ ├── log.go
│ │ ├── log_test.go
│ │ └── messages.go
│ ├── mediator.go
│ ├── precommit.go
│ ├── precommit_test.go
│ ├── propose.go
│ ├── propose_test.go
│ ├── spec/
│ │ ├── .gitignore
│ │ ├── Pactus.cfg
│ │ ├── Pactus.tla
│ │ └── README.md
│ ├── state.go
│ ├── ticker.go
│ └── voteset/
│ ├── binary_voteset.go
│ ├── block_voteset.go
│ ├── errors.go
│ ├── vote_box.go
│ ├── vote_box_test.go
│ ├── voteset.go
│ └── voteset_test.go
├── crypto/
│ ├── address.go
│ ├── address_test.go
│ ├── address_type.go
│ ├── bls/
│ │ ├── bls.go
│ │ ├── bls_bench_test.go
│ │ ├── bls_test.go
│ │ ├── errors.go
│ │ ├── hdkeychain/
│ │ │ ├── errors.go
│ │ │ ├── extendedkey.go
│ │ │ └── extendedkey_test.go
│ │ ├── private_key.go
│ │ ├── private_key_test.go
│ │ ├── public_key.go
│ │ ├── public_key_test.go
│ │ ├── signature.go
│ │ ├── signature_test.go
│ │ ├── validator_key.go
│ │ └── validator_key_test.go
│ ├── crypto.go
│ ├── ed25519/
│ │ ├── ed25519.go
│ │ ├── ed25519_test.go
│ │ ├── errors.go
│ │ ├── hdkeychain/
│ │ │ ├── errors.go
│ │ │ ├── extendedkey.go
│ │ │ └── extendedkey_test.go
│ │ ├── private_key.go
│ │ ├── private_key_test.go
│ │ ├── public_key.go
│ │ ├── public_key_test.go
│ │ ├── signature.go
│ │ └── signature_test.go
│ ├── errors.go
│ ├── hash/
│ │ ├── errors.go
│ │ ├── hash.go
│ │ └── hash_test.go
│ ├── private_key.go
│ ├── public_key.go
│ └── signature.go
├── docs/
│ ├── bootstrap.md
│ ├── gtk-gui-development.md
│ ├── install.md
│ ├── metrics.md
│ ├── patching.md
│ ├── release-candidate.md
│ ├── releasing.md
│ └── update-dependencies.md
├── execution/
│ ├── errors.go
│ ├── execution.go
│ ├── execution_test.go
│ └── executor/
│ ├── batch_transfer.go
│ ├── batch_transfer_test.go
│ ├── bond.go
│ ├── bond_test.go
│ ├── errors.go
│ ├── executor.go
│ ├── executor_test.go
│ ├── sortition.go
│ ├── sortition_test.go
│ ├── transfer.go
│ ├── transfer_test.go
│ ├── unbond.go
│ ├── unbond_test.go
│ ├── withdraw.go
│ └── withdraw_test.go
├── genesis/
│ ├── genesis.go
│ ├── genesis_params.go
│ ├── genesis_test.go
│ ├── mainnet.go
│ ├── mainnet.json
│ ├── testnet.go
│ └── testnet.json
├── go.mod
├── go.sum
├── network/
│ ├── config.go
│ ├── config_test.go
│ ├── dht.go
│ ├── errors.go
│ ├── gater.go
│ ├── gater_test.go
│ ├── gossip.go
│ ├── gossip_test.go
│ ├── interface.go
│ ├── mdns.go
│ ├── mdns_test.go
│ ├── mock.go
│ ├── network.go
│ ├── network_test.go
│ ├── notifee.go
│ ├── peermgr.go
│ ├── peermgr_test.go
│ ├── stream.go
│ ├── stream_test.go
│ ├── utils.go
│ └── utils_test.go
├── node/
│ ├── node.go
│ └── node_test.go
├── sandbox/
│ ├── interface.go
│ ├── mock.go
│ ├── sandbox.go
│ └── sandbox_test.go
├── scripts/
│ └── snapshot.py
├── sortition/
│ ├── proof.go
│ ├── proof_test.go
│ ├── seed.go
│ ├── seed_test.go
│ ├── sortition.go
│ ├── sortition_test.go
│ ├── vrf.go
│ └── vrf_test.go
├── state/
│ ├── errors.go
│ ├── execution.go
│ ├── execution_test.go
│ ├── facade.go
│ ├── lastinfo/
│ │ ├── last_info.go
│ │ └── last_info_test.go
│ ├── mock.go
│ ├── param/
│ │ ├── foundation_mainnet.json
│ │ ├── foundation_testnet.json
│ │ └── param.go
│ ├── score/
│ │ ├── score.go
│ │ └── score_test.go
│ ├── state.go
│ ├── state_test.go
│ ├── validation.go
│ └── validation_test.go
├── store/
│ ├── account.go
│ ├── account_test.go
│ ├── block.go
│ ├── block_test.go
│ ├── config.go
│ ├── config_test.go
│ ├── errors.go
│ ├── interface.go
│ ├── mock.go
│ ├── store.go
│ ├── store_test.go
│ ├── tx.go
│ ├── validator.go
│ └── validator_test.go
├── sync/
│ ├── bundle/
│ │ ├── bundle.go
│ │ ├── bundle_test.go
│ │ └── message/
│ │ ├── block_announce.go
│ │ ├── block_announce_test.go
│ │ ├── blocks_request.go
│ │ ├── blocks_request_test.go
│ │ ├── blocks_response.go
│ │ ├── blocks_response_test.go
│ │ ├── errors.go
│ │ ├── hello.go
│ │ ├── hello_ack.go
│ │ ├── hello_ack_test.go
│ │ ├── hello_test.go
│ │ ├── message.go
│ │ ├── message_test.go
│ │ ├── proposal.go
│ │ ├── proposal_test.go
│ │ ├── query_proposal.go
│ │ ├── query_proposal_test.go
│ │ ├── query_votes.go
│ │ ├── query_votes_test.go
│ │ ├── transactions.go
│ │ ├── transactions_test.go
│ │ ├── vote.go
│ │ └── vote_test.go
│ ├── cache/
│ │ ├── cache.go
│ │ └── cache_test.go
│ ├── config.go
│ ├── config_test.go
│ ├── firewall/
│ │ ├── config.go
│ │ ├── errors.go
│ │ ├── firewall.go
│ │ └── firewall_test.go
│ ├── handler.go
│ ├── handler_block_announce.go
│ ├── handler_block_announce_test.go
│ ├── handler_blocks_request.go
│ ├── handler_blocks_request_test.go
│ ├── handler_blocks_response.go
│ ├── handler_blocks_response_test.go
│ ├── handler_hello.go
│ ├── handler_hello_ack.go
│ ├── handler_hello_ack_test.go
│ ├── handler_hello_test.go
│ ├── handler_proposal.go
│ ├── handler_proposal_test.go
│ ├── handler_query_proposal.go
│ ├── handler_query_proposal_test.go
│ ├── handler_query_votes.go
│ ├── handler_query_votes_test.go
│ ├── handler_transactions.go
│ ├── handler_transactions_test.go
│ ├── handler_vote.go
│ ├── handler_vote_test.go
│ ├── interface.go
│ ├── mock.go
│ ├── peerset/
│ │ ├── peer/
│ │ │ ├── metric/
│ │ │ │ ├── metric.go
│ │ │ │ └── metric_test.go
│ │ │ ├── peer.go
│ │ │ ├── peer_test.go
│ │ │ ├── service/
│ │ │ │ ├── services.go
│ │ │ │ └── services_test.go
│ │ │ └── status/
│ │ │ └── status.go
│ │ ├── peer_set.go
│ │ ├── peer_set_test.go
│ │ └── session/
│ │ ├── manager.go
│ │ ├── session.go
│ │ └── stats.go
│ ├── sync.go
│ └── sync_test.go
├── tests/
│ ├── account_test.go
│ ├── block_test.go
│ ├── main_test.go
│ ├── transaction_test.go
│ └── validator_test.go
├── txpool/
│ ├── config.go
│ ├── config_test.go
│ ├── errors.go
│ ├── interface.go
│ ├── pool.go
│ ├── txpool.go
│ ├── txpool_mock.go
│ └── txpool_test.go
├── types/
│ ├── account/
│ │ ├── account.go
│ │ └── account_test.go
│ ├── amount/
│ │ ├── amount.go
│ │ ├── amount_test.go
│ │ └── errors.go
│ ├── block/
│ │ ├── block.go
│ │ ├── block_test.go
│ │ ├── errors.go
│ │ ├── header.go
│ │ ├── txs.go
│ │ └── txs_test.go
│ ├── certificate/
│ │ ├── certificate.go
│ │ ├── certificate_test.go
│ │ ├── errors.go
│ │ ├── power.go
│ │ └── power_test.go
│ ├── height.go
│ ├── height_test.go
│ ├── proposal/
│ │ ├── errors.go
│ │ ├── proposal.go
│ │ └── proposal_test.go
│ ├── protocol/
│ │ ├── protocol.go
│ │ └── protocol_test.go
│ ├── round.go
│ ├── round_test.go
│ ├── tx/
│ │ ├── errors.go
│ │ ├── factory.go
│ │ ├── payload/
│ │ │ ├── batch_transfer.go
│ │ │ ├── batch_transfer_test.go
│ │ │ ├── bond.go
│ │ │ ├── bond_test.go
│ │ │ ├── errors.go
│ │ │ ├── payload.go
│ │ │ ├── sortition.go
│ │ │ ├── sortition_test.go
│ │ │ ├── transfer.go
│ │ │ ├── transfer_test.go
│ │ │ ├── unbond.go
│ │ │ ├── unbond_test.go
│ │ │ ├── withdraw.go
│ │ │ └── withdraw_test.go
│ │ ├── tx.go
│ │ └── tx_test.go
│ ├── validator/
│ │ ├── validator.go
│ │ └── validator_test.go
│ └── vote/
│ ├── cp_just.go
│ ├── cp_vote.go
│ ├── errors.go
│ ├── vote.go
│ ├── vote_test.go
│ └── vote_type.go
├── util/
│ ├── bech32m/
│ │ ├── bech32m.go
│ │ ├── bech32m_test.go
│ │ └── error.go
│ ├── bip39/
│ │ ├── README.md
│ │ ├── bip39.go
│ │ ├── bip39_test.go
│ │ ├── example_test.go
│ │ └── wordlists/
│ │ ├── chinese_simplified.go
│ │ ├── chinese_traditional.go
│ │ ├── czech.go
│ │ ├── english.go
│ │ ├── french.go
│ │ ├── italian.go
│ │ ├── japanese.go
│ │ ├── korean.go
│ │ └── spanish.go
│ ├── downloader/
│ │ ├── chunk.go
│ │ ├── chunk_test.go
│ │ ├── downloader.go
│ │ ├── downloader_test.go
│ │ ├── errors.go
│ │ └── options.go
│ ├── encoding/
│ │ ├── encoding.go
│ │ └── encoding_test.go
│ ├── htpasswd/
│ │ ├── htpasswd.go
│ │ └── htpasswd_test.go
│ ├── io.go
│ ├── io_test.go
│ ├── ipblocker/
│ │ ├── ipblocker.go
│ │ └── ipblocker_test.go
│ ├── linkedlist/
│ │ ├── linkedlist.go
│ │ └── linkedlist_test.go
│ ├── linkedmap/
│ │ ├── linkedmap.go
│ │ └── linkedmap_test.go
│ ├── logger/
│ │ ├── config.go
│ │ ├── logger.go
│ │ └── logger_test.go
│ ├── net.go
│ ├── ntp/
│ │ ├── ntp.go
│ │ ├── ntp_test.go
│ │ └── query.go
│ ├── number.go
│ ├── number_test.go
│ ├── pairslice/
│ │ ├── pairslice.go
│ │ └── pairslice_test.go
│ ├── persistentmerkle/
│ │ ├── merkle.go
│ │ └── merkle_test.go
│ ├── prompt/
│ │ └── prompt.go
│ ├── ratelimit/
│ │ ├── ratelimit.go
│ │ └── ratelimit_test.go
│ ├── shell/
│ │ ├── shell.go
│ │ └── shell_test.go
│ ├── simplemerkle/
│ │ ├── merkle.go
│ │ ├── merkle_test.go
│ │ └── printing.go
│ ├── slice.go
│ ├── slice_test.go
│ ├── terminal/
│ │ ├── terminal.go
│ │ └── terminal_test.go
│ ├── testsuite/
│ │ ├── logger.go
│ │ └── testsuite.go
│ ├── time.go
│ ├── time_test.go
│ ├── utils.go
│ └── utils_test.go
├── version/
│ ├── agent.go
│ ├── agent_test.go
│ ├── version.go
│ ├── version.json
│ └── version_test.go
├── wallet/
│ ├── addresses.go
│ ├── addresses_test.go
│ ├── addresspath/
│ │ ├── errors.go
│ │ ├── path.go
│ │ └── path_test.go
│ ├── encrypter/
│ │ ├── encrypter.go
│ │ ├── encrypter_test.go
│ │ ├── error.go
│ │ ├── params.go
│ │ └── params_test.go
│ ├── errors.go
│ ├── manager/
│ │ ├── config.go
│ │ ├── config_test.go
│ │ ├── errors.go
│ │ ├── interface.go
│ │ ├── manager.go
│ │ ├── manager_mock.go
│ │ └── manager_test.go
│ ├── provider/
│ │ ├── interface.go
│ │ ├── local/
│ │ │ └── local.go
│ │ ├── offline/
│ │ │ └── offline.go
│ │ ├── provider_mock.go
│ │ └── remote/
│ │ ├── errors.go
│ │ ├── remote.go
│ │ ├── servers.go
│ │ └── servers.json
│ ├── storage/
│ │ ├── errors.go
│ │ ├── interface.go
│ │ ├── jsonstorage/
│ │ │ ├── errors.go
│ │ │ ├── storage.go
│ │ │ ├── storage_test.go
│ │ │ ├── store.go
│ │ │ ├── testdata/
│ │ │ │ ├── neuter_wallet
│ │ │ │ ├── testnet_wallet
│ │ │ │ ├── unsupported_wallet
│ │ │ │ ├── wallet_version_1
│ │ │ │ ├── wallet_version_2
│ │ │ │ ├── wallet_version_3
│ │ │ │ ├── wallet_version_4
│ │ │ │ └── wallet_version_5
│ │ │ ├── upgrader.go
│ │ │ ├── upgrader_test.go
│ │ │ └── version.go
│ │ ├── sqlitestorage/
│ │ │ ├── options.go
│ │ │ ├── sql.go
│ │ │ ├── storage.go
│ │ │ ├── storage_test.go
│ │ │ └── version.go
│ │ └── storage_mock.go
│ ├── transactions.go
│ ├── transactions_test.go
│ ├── tx_builder.go
│ ├── types/
│ │ └── types.go
│ ├── vault/
│ │ ├── errors.go
│ │ ├── utils.go
│ │ ├── utils_test.go
│ │ ├── vault.go
│ │ └── vault_test.go
│ ├── wallet.go
│ └── wallet_test.go
└── www/
├── grpc/
│ ├── README.md
│ ├── basicauth/
│ │ ├── basicauth.go
│ │ └── basicauth_test.go
│ ├── blockchain.go
│ ├── blockchain_test.go
│ ├── buf/
│ │ ├── buf.gen.yaml
│ │ ├── buf.yaml
│ │ ├── grpc-gateway.config.yaml
│ │ ├── openapi.config.yaml
│ │ └── templates/
│ │ ├── components.tmpl
│ │ ├── grpc.md.tmpl
│ │ ├── json-rpc.md.tmpl
│ │ └── openrpc.tmpl
│ ├── config.go
│ ├── gen/
│ │ ├── dart/
│ │ │ ├── blockchain.pb.dart
│ │ │ ├── blockchain.pbenum.dart
│ │ │ ├── blockchain.pbjson.dart
│ │ │ ├── blockchain.pbserver.dart
│ │ │ ├── network.pb.dart
│ │ │ ├── network.pbenum.dart
│ │ │ ├── network.pbjson.dart
│ │ │ ├── network.pbserver.dart
│ │ │ ├── transaction.pb.dart
│ │ │ ├── transaction.pbenum.dart
│ │ │ ├── transaction.pbjson.dart
│ │ │ ├── transaction.pbserver.dart
│ │ │ ├── utils.pb.dart
│ │ │ ├── utils.pbenum.dart
│ │ │ ├── utils.pbjson.dart
│ │ │ ├── utils.pbserver.dart
│ │ │ ├── wallet.pb.dart
│ │ │ ├── wallet.pbenum.dart
│ │ │ ├── wallet.pbjson.dart
│ │ │ └── wallet.pbserver.dart
│ │ ├── docs/
│ │ │ ├── grpc.md
│ │ │ └── json-rpc.md
│ │ ├── go/
│ │ │ ├── blockchain.cobra.pb.go
│ │ │ ├── blockchain.pb.go
│ │ │ ├── blockchain.pb.gw.go
│ │ │ ├── blockchain_grpc.pb.go
│ │ │ ├── blockchain_jgw.pb.go
│ │ │ ├── network.cobra.pb.go
│ │ │ ├── network.pb.go
│ │ │ ├── network.pb.gw.go
│ │ │ ├── network_grpc.pb.go
│ │ │ ├── network_jgw.pb.go
│ │ │ ├── transaction.cobra.pb.go
│ │ │ ├── transaction.pb.go
│ │ │ ├── transaction.pb.gw.go
│ │ │ ├── transaction_grpc.pb.go
│ │ │ ├── transaction_jgw.pb.go
│ │ │ ├── utils.cobra.pb.go
│ │ │ ├── utils.pb.go
│ │ │ ├── utils.pb.gw.go
│ │ │ ├── utils_grpc.pb.go
│ │ │ ├── utils_jgw.pb.go
│ │ │ ├── wallet.cobra.pb.go
│ │ │ ├── wallet.pb.go
│ │ │ ├── wallet.pb.gw.go
│ │ │ ├── wallet_grpc.pb.go
│ │ │ └── wallet_jgw.pb.go
│ │ ├── java/
│ │ │ └── pactus/
│ │ │ ├── BlockchainGrpc.java
│ │ │ ├── BlockchainOuterClass.java
│ │ │ ├── NetworkGrpc.java
│ │ │ ├── NetworkOuterClass.java
│ │ │ ├── TransactionGrpc.java
│ │ │ ├── TransactionOuterClass.java
│ │ │ ├── UtilsGrpc.java
│ │ │ ├── UtilsOuterClass.java
│ │ │ ├── WalletGrpc.java
│ │ │ └── WalletOuterClass.java
│ │ ├── js/
│ │ │ ├── blockchain_grpc_pb.js
│ │ │ ├── blockchain_grpc_web_pb.js
│ │ │ ├── blockchain_pb.js
│ │ │ ├── network_grpc_pb.js
│ │ │ ├── network_grpc_web_pb.js
│ │ │ ├── network_pb.js
│ │ │ ├── transaction_grpc_pb.js
│ │ │ ├── transaction_grpc_web_pb.js
│ │ │ ├── transaction_pb.js
│ │ │ ├── utils_grpc_pb.js
│ │ │ ├── utils_grpc_web_pb.js
│ │ │ ├── utils_pb.js
│ │ │ ├── wallet_grpc_pb.js
│ │ │ ├── wallet_grpc_web_pb.js
│ │ │ └── wallet_pb.js
│ │ ├── open-rpc/
│ │ │ └── pactus-openrpc.json
│ │ ├── python/
│ │ │ ├── blockchain_pb2.py
│ │ │ ├── blockchain_pb2.pyi
│ │ │ ├── blockchain_pb2_grpc.py
│ │ │ ├── network_pb2.py
│ │ │ ├── network_pb2.pyi
│ │ │ ├── network_pb2_grpc.py
│ │ │ ├── transaction_pb2.py
│ │ │ ├── transaction_pb2.pyi
│ │ │ ├── transaction_pb2_grpc.py
│ │ │ ├── utils_pb2.py
│ │ │ ├── utils_pb2.pyi
│ │ │ ├── utils_pb2_grpc.py
│ │ │ ├── wallet_pb2.py
│ │ │ ├── wallet_pb2.pyi
│ │ │ └── wallet_pb2_grpc.py
│ │ └── rust/
│ │ ├── pactus.rs
│ │ ├── pactus.serde.rs
│ │ └── pactus.tonic.rs
│ ├── middleware.go
│ ├── middleware_test.go
│ ├── network.go
│ ├── network_test.go
│ ├── proto/
│ │ ├── .clang-format
│ │ ├── blockchain.proto
│ │ ├── network.proto
│ │ ├── transaction.proto
│ │ ├── utils.proto
│ │ └── wallet.proto
│ ├── server.go
│ ├── server_test.go
│ ├── transaction.go
│ ├── transaction_test.go
│ ├── utils.go
│ ├── utils_test.go
│ ├── wallet.go
│ └── wallet_test.go
├── html/
│ ├── README.md
│ ├── blockchain.go
│ ├── blockchain_test.go
│ ├── config.go
│ ├── html_test.go
│ ├── middleware.go
│ ├── middleware_test.go
│ ├── network.go
│ ├── network_test.go
│ ├── server.go
│ ├── transaction.go
│ └── transaction_test.go
├── http/
│ ├── config.go
│ ├── config_test.go
│ ├── server.go
│ ├── server_test.go
│ └── swagger-ui/
│ ├── LICENSE
│ ├── README.md
│ ├── index.css
│ ├── index.html
│ ├── oauth2-redirect.html
│ ├── pactus.swagger.json
│ ├── swagger-initializer.js
│ ├── swagger-ui-bundle.js
│ ├── swagger-ui-es-bundle-core.js
│ ├── swagger-ui-es-bundle.js
│ ├── swagger-ui-standalone-preset.js
│ ├── swagger-ui.css
│ └── swagger-ui.js
├── jsonrpc/
│ ├── config.go
│ └── server.go
└── zmq/
├── config.go
├── config_test.go
├── mock.go
├── publisher.go
├── publisher_block_info.go
├── publisher_block_info_test.go
├── publisher_raw_block.go
├── publisher_raw_block_test.go
├── publisher_raw_tx.go
├── publisher_raw_tx_test.go
├── publisher_test.go
├── publisher_tx_info.go
├── publisher_tx_info_test.go
├── server.go
├── server_test.go
├── topic.go
└── topic_test.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
.github
build
================================================
FILE: .editorconfig
================================================
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.go]
indent_size = 4
indent_style = tab
[Makefile]
indent_style = tab
================================================
FILE: .entire/.gitignore
================================================
tmp/
settings.local.json
metadata/
logs/
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: If you find an issue, please let us know.
title: '[BUG]: '
labels: '["bug"]'
type: 'Bug'
assignees: ''
---
<!--
Thank you in advance for helping us to improve Pactus!
Please read through the template below and answer all relevant questions.
Your additional work here is greatly appreciated and will help us respond as quickly as possible.
-->
## Description
> Provide a clear and concise description of the issue, including what you expected to happen.
### How To Reproduce
> Detail the steps taken to reproduce this error, and
> whether this issue can be reproduced consistently or if it is intermittent.
1. Step 1
2. Step 2
3. Step 3
### What Happened
> What actually happened including any error log or so
### Expected Behavior
> What were you expecting
### Extra
> Any extra information you think is relevant to issue
### Environment
- **Operation System:**
- **Pactus Version:**
- **Go Version:**
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Any new functionality for Pactus.
title: '[FEATURE]: '
labels: '["enhancement"]'
type: "Feature"
assignees: ''
---
<!--
Thank you in advance for helping us to improve Pactus!
Please read through the template below and answer all relevant questions.
Your additional work here is greatly appreciated and will help us respond as quickly as possible.
-->
## Describe the problem you'd like to have solved
> A clear and concise description of what the problem is.
### Describe the ideal solution
> A clear and concise description of what you want to happen.
### Alternatives and current work-around
> A clear and concise description of any alternatives you've considered or any work-around that are currently in place.
### Additional context
> Add any other context or screenshots about the feature request here.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Description
> A clear description of what the pull request does.
## Related Issue
Fixes # (issue)
================================================
FILE: .github/actions/windows-signing/action.yml
================================================
name: "Signing Windows Artifacts"
description: "Signing Windows Artifacts"
inputs:
signpath-api-token:
description: "SignPath API Token"
required: true
signpath-signing-policy-slug:
description: "SignPath Signing Policy Slug"
required: true
artifact-name:
description: "The name of artifact (.zip) file"
required: true
runs:
using: "composite"
steps:
- name: upload-unsigned-artifact
id: upload-unsigned-artifact
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.artifact-name }}
# Based on current SignPath configuration, we can only sign one file per request.
path: ./build/unsigned/${{ inputs.artifact-name }}.exe
- name: sign-artifact
id: sign-artifact
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: "${{ inputs.signpath-api-token }}"
organization-id: "208fe1b4-fd9d-41c8-be2e-8ebd037cd0db"
project-slug: "pactus"
signing-policy-slug: "${{ inputs.signpath-signing-policy-slug }}"
github-artifact-id: "${{ steps.upload-unsigned-artifact.outputs.artifact-id }}"
wait-for-completion: true
wait-for-completion-timeout-in-seconds: 3600
output-artifact-directory: ./build/signed/
================================================
FILE: .github/codecov.yml
================================================
comment:
layout: header, changes, diff, sunburst
coverage:
status:
patch:
default:
threshold: "10%"
only_pulls: true
project:
default:
target: auto
threshold: "10%"
ignore:
- "*/mock.go"
- "www/grpc/gen"
================================================
FILE: .github/packager/js/grpc/README.md
================================================
# pactus-grpc
JavaScript client for interacting with the [Pactus](https://pactus.org) blockchain via gRPC.
## Installation
```bash
npm install pactus-grpc
```
## Usage
```javascript
import grpc from '@grpc/grpc-js';
import blockchain_pb from "pactus-grpc/blockchain_pb.js";
import blockchain_grpc_pb from "pactus-grpc/blockchain_grpc_pb.js";
const client = new blockchain_grpc_pb.BlockchainClient(
"127.0.0.1:50051",
grpc.credentials.createInsecure()
);
const request = new blockchain_pb.GetBlockchainInfoRequest();
client.getBlockchainInfo(request, (err, response) => {
if (err) {
console.log(err);
} else {
console.log(response.toObject());
}
});
```
================================================
FILE: .github/packager/js/grpc/package.json
================================================
{
"name": "pactus-grpc",
"version": "{{ VERSION }}",
"description": "JavaScript client for interacting with the Pactus blockchain via gRPC",
"author": "Pactus Development Team",
"license": "MIT",
"homepage": "https://pactus.org",
"repository": {
"type": "git",
"url": "git+https://github.com/pactus-project/pactus.git"
},
"bugs": {
"url": "https://github.com/pactus-project/pactus/issues"
},
"keywords": [
"pactus",
"blockchain",
"grpc"
],
"dependencies": {
"@grpc/grpc-js": "^1.14.1",
"grpc-web": "^2.0.2",
"google-protobuf": "^4.0.1"
}
}
================================================
FILE: .github/packager/js/jsonrpc/README.md
================================================
# pactus-jsonrpc
JavaScript client for interacting with the [Pactus](https://pactus.org) blockchain via JSON-RPC.
## Installation
```bash
npm install pactus-jsonrpc
```
## Usage
```javascript
import PactusOpenRPC from "pactus-jsonrpc";
const jsonrpcClient = new PactusOpenRPC({
transport: {
type: "http",
host: "127.0.0.1",
port: 8545
},
});
const blockchainInfo = await jsonrpcClient.pactusBlockchainGetBlockchainInfo();
console.log(JSON.stringify(blockchainInfo, null, 2));
```
================================================
FILE: .github/packager/js/jsonrpc/package.json
================================================
{
"name": "pactus-jsonrpc",
"version": "{{ VERSION }}",
"description": "JavaScript client for interacting with the Pactus blockchain via JSON-RPC",
"author": "Pactus Development Team",
"license": "MIT",
"homepage": "https://pactus.org",
"main": "./index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/pactus-project/pactus.git"
},
"bugs": {
"url": "https://github.com/pactus-project/pactus/issues"
},
"keywords": [
"pactus",
"blockchain",
"json-rpc"
],
"dependencies": {
"@open-rpc/client-js": "1.8.1",
"@open-rpc/meta-schema": "1.14.9",
"@open-rpc/schema-utils-js": "2.1.2",
"lodash": "^4.17.15"
}
}
================================================
FILE: .github/packager/packager.sh
================================================
#!/bin/bash
# The 'set -e' command causes the script to immediately exit
# if any command returns a non-zero exit status (i.e., an error).
set -e
replace_in_place() {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "$1" "$2"
else
sed -i "$1" "$2"
fi
}
ROOT_DIR="$(pwd)"
PACKAGE_DIR="${ROOT_DIR}/packages"
PROTO_GEN_DIR="${ROOT_DIR}/www/grpc/gen"
if [[ -z "$VERSION" ]]; then
echo "❌ Error: Version tag not found."
exit 1
fi
# Remove 'v' prefix from version if present
VERSION=${VERSION#v}
echo "Packing Version:" ${VERSION}
rm -rf ${PACKAGE_DIR}
mkdir -p ${PACKAGE_DIR}
mkdir -p ${PACKAGE_DIR}/js/{pactus-grpc,pactus-jsonrpc}
mkdir -p ${PACKAGE_DIR}/python/{pactus-grpc,pactus-jsonrpc}
mkdir -p ${PACKAGE_DIR}/rust/{pactus-grpc,pactus-jsonrpc}
echo "== Building pactus-grpc package for JavaScript"
cp -R ${ROOT_DIR}/.github/packager/js/grpc/* ${PACKAGE_DIR}/js/pactus-grpc
cp -R ${PROTO_GEN_DIR}/js/* ${PACKAGE_DIR}/js/pactus-grpc
cp ${ROOT_DIR}/LICENSE ${PACKAGE_DIR}/js/pactus-grpc
replace_in_place "s/{{ VERSION }}/$VERSION/g" "${PACKAGE_DIR}/js/pactus-grpc/package.json"
echo "== Building pactus-jsonrpc package for JavaScript"
GENERATOR_DIR="${PACKAGE_DIR}/generator"
git clone https://github.com/pactus-project/generator.git "$GENERATOR_DIR" && cd "$GENERATOR_DIR"
npm install && npm run build
cd "$ROOT_DIR" && $GENERATOR_DIR/build/cli.js generate \
-t client \
-l typescript \
-n pactus-jsonrpc \
-d "${ROOT_DIR}/www/grpc/gen/open-rpc/pactus-openrpc.json" \
-o "$GENERATOR_DIR/js"
cd "$GENERATOR_DIR/js/client/typescript"
npm install && npx tsc
cp $GENERATOR_DIR/js/client/typescript/build/index.d.ts ${PACKAGE_DIR}/js/pactus-jsonrpc
cp $GENERATOR_DIR/js/client/typescript/build/index.js ${PACKAGE_DIR}/js/pactus-jsonrpc
cp $GENERATOR_DIR/js/client/typescript/build/index.js.map ${PACKAGE_DIR}/js/pactus-jsonrpc
cp -R ${ROOT_DIR}/.github/packager/js/jsonrpc/* ${PACKAGE_DIR}/js/pactus-jsonrpc
cp ${ROOT_DIR}/LICENSE ${PACKAGE_DIR}/js/pactus-jsonrpc
replace_in_place "s/{{ VERSION }}/$VERSION/g" "${PACKAGE_DIR}/js/pactus-jsonrpc/package.json"
echo "== Building pactus-grpc package for Python"
cp -R ${ROOT_DIR}/.github/packager/python/grpc/* ${PACKAGE_DIR}/python/pactus-grpc
cp ${PROTO_GEN_DIR}/python/* ${PACKAGE_DIR}/python/pactus-grpc/pactus_grpc
cp ${ROOT_DIR}/LICENSE ${PACKAGE_DIR}/python/pactus-grpc
replace_in_place "s/{{ VERSION }}/$VERSION/g" ${PACKAGE_DIR}/python/pactus-grpc/setup.py
echo "== Building pactus-jsonrpc package for Python"
pip install openrpcclientgenerator
ORPC_DIR="${PACKAGE_DIR}/orpc"
mkdir -p ${ORPC_DIR}
cp "${ROOT_DIR}/www/grpc/gen/open-rpc/pactus-openrpc.json" ${ORPC_DIR}/openrpc.json
cd ${ORPC_DIR}
orpc python example.com ./out
cp -R ${ROOT_DIR}/.github/packager/python/jsonrpc/* ${PACKAGE_DIR}/python/pactus-jsonrpc
cp ${ORPC_DIR}/out/python/pactus-open-rpc-http-client/pactus_open_rpc_http_client/client.py ${PACKAGE_DIR}/python/pactus-jsonrpc/pactus_jsonrpc/client.py
cp ${ORPC_DIR}/out/python/pactus-open-rpc-http-client/pactus_open_rpc_http_client/models.py ${PACKAGE_DIR}/python/pactus-jsonrpc/pactus_jsonrpc/models.py
cp ${ROOT_DIR}/LICENSE ${PACKAGE_DIR}/python/pactus-jsonrpc
replace_in_place "s/{{ VERSION }}/$VERSION/g" ${PACKAGE_DIR}/python/pactus-jsonrpc/setup.py
echo "== Building pactus-grpc package for Rust"
cp -R ${ROOT_DIR}/.github/packager/rust/grpc/* ${PACKAGE_DIR}/rust/pactus-grpc
cp -R ${PROTO_GEN_DIR}/rust/* ${PACKAGE_DIR}/rust/pactus-grpc/src
cp ${ROOT_DIR}/LICENSE ${PACKAGE_DIR}/rust/pactus-grpc
replace_in_place "s/{{ VERSION }}/$VERSION/g" ${PACKAGE_DIR}/rust/pactus-grpc/Cargo.toml
echo "== Building pactus-jsonrpc package for Rust"
cd "$ROOT_DIR" && $GENERATOR_DIR/build/cli.js generate \
-t client \
-l rust \
-n pactus-jsonrpc \
-d "${ROOT_DIR}/www/grpc/gen/open-rpc/pactus-openrpc.json" \
-o "$GENERATOR_DIR/rust"
cp -R ${ROOT_DIR}/.github/packager/rust/jsonrpc/* ${PACKAGE_DIR}/rust/pactus-jsonrpc
cp $GENERATOR_DIR/rust/client/rust/src/index.rs ${PACKAGE_DIR}/rust/pactus-jsonrpc/src/pactus.rs
cp ${ROOT_DIR}/LICENSE ${PACKAGE_DIR}/rust/pactus-jsonrpc
replace_in_place "s/{{ VERSION }}/$VERSION/g" "${PACKAGE_DIR}/rust/pactus-jsonrpc/Cargo.toml"
================================================
FILE: .github/packager/python/grpc/README.md
================================================
# pactus-grpc
Python client for interacting with the [Pactus](https://pactus.org) blockchain via gRPC.
## Installation
```bash
pip install pactus-grpc
```
## Usage
```python
import asyncio
import grpc
from pactus_grpc import blockchain_pb2_grpc, blockchain_pb2, network_pb2_grpc, network_pb2
async def main():
channel = grpc.aio.insecure_channel("127.0.0.1:50051")
blockchain_stub = blockchain_pb2_grpc.BlockchainStub(channel)
blockchain_request = blockchain_pb2.GetBlockchainInfoRequest()
blockchain_response = await blockchain_stub.GetBlockchainInfo(blockchain_request)
print(blockchain_response)
await channel.close()
if __name__ == "__main__":
asyncio.run(main())
```
================================================
FILE: .github/packager/python/grpc/pactus_grpc/__init__.py
================================================
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
================================================
FILE: .github/packager/python/grpc/pactus_grpc/__init__.pyi
================================================
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
================================================
FILE: .github/packager/python/grpc/pyproject.toml
================================================
[build-system]
requires = ["setuptools >= 42.0.0"]
build-backend = "setuptools.build_meta"
================================================
FILE: .github/packager/python/grpc/setup.py
================================================
from pathlib import Path
from setuptools import find_packages, setup
setup(
name="pactus-grpc",
version="{{ VERSION }}",
author="Pactus Development Team",
author_email="info@pactus.org",
url="https://pactus.org",
description="Python client for interacting with the Pactus blockchain via gRPC",
long_description=Path("README.md").read_text(encoding="utf-8"),
long_description_content_type="text/markdown",
license="MIT",
packages=find_packages(),
keywords=["pactus", "blockchain", "grpc"],
install_requires=[
"grpcio",
"protobuf",
],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
)
================================================
FILE: .github/packager/python/jsonrpc/README.md
================================================
# pactus-jsonrpc
Python client for interacting with the [Pactus](https://pactus.org) blockchain via JSON-RPC.
## Installation
```bash
pip install pactus-jsonrpc
```
## Usage
```python
import asyncio
from pactus_jsonrpc.client import PactusOpenRPCClient
async def main():
client = PactusOpenRPCClient(
headers={},
client_url="http://127.0.0.1:8545"
)
blockchain_info = await client.pactus.blockchain.get_blockchain_info()
print(blockchain_info)
if __name__ == "__main__":
asyncio.run(main())
```
================================================
FILE: .github/packager/python/jsonrpc/pactus_jsonrpc/__init__.py
================================================
================================================
FILE: .github/packager/python/jsonrpc/pyproject.toml
================================================
[build-system]
requires = ["setuptools >= 42.0.0"]
build-backend = "setuptools.build_meta"
================================================
FILE: .github/packager/python/jsonrpc/setup.py
================================================
from pathlib import Path
from setuptools import find_packages, setup
setup(
name="pactus-jsonrpc",
version="{{ VERSION }}",
author="Pactus Development Team",
author_email="info@pactus.org",
url="https://pactus.org",
description="Python client for interacting with the Pactus blockchain via JSON-RPC",
long_description=Path("README.md").read_text(encoding="utf-8"),
long_description_content_type="text/markdown",
packages=find_packages(),
license="MIT",
install_requires=[
"jsonrpc2-pyclient>=5.2.0",
"py-undefined>=0.1.5",
"pydantic>=2.5.3"
],
keywords=["pactus", "blockchain", "json-rpc"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
)
================================================
FILE: .github/packager/rust/grpc/Cargo.toml
================================================
[package]
name = "pactus-grpc"
version = "{{ VERSION }}"
edition = "2021"
description = "Rust client for interacting with the Pactus blockchain via gRPC"
authors = [ "Pactus Development Team <info@pactus.org>" ]
license = "MIT"
homepage = "https://pactus.org"
repository = "https://github.com/pactus-project/pactus"
keywords = [ "pactus", "blockchain", "grpc" ]
[dependencies]
tonic = { version = "0.14", default-features = false, features = ["transport", "codegen"] }
prost = { version = "0.14", default-features = false, features = ["derive", "std"] }
tonic-prost = { version = "0.14", default-features = false, features = [] }
serde = { version = "1.0", default-features = false, features = [] }
async-trait = { version = "0.1", default-features = false, features = [] }
pbjson = { version = "0.8", default-features = false, features = [] }
================================================
FILE: .github/packager/rust/grpc/README.md
================================================
# pactus-grpc
Rust client for interacting with the [Pactus](https://pactus.org) blockchain via gRPC.
## Installation
```bash
cargo add pactus-grpc
```
## Usage
```rust
use pactus_grpc::{blockchain_client::BlockchainClient, GetBlockchainInfoRequest};
use tonic::transport::Channel;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("http://127.0.0.1:50051")
.connect()
.await?;
let mut client = BlockchainClient::new(channel);
let request = tonic::Request::new(GetBlockchainInfoRequest {});
let response = client.get_blockchain_info(request).await?;
let info = response.into_inner();
println!("get_blockchain_info Response: {:?}", info);
Ok(())
}
```
================================================
FILE: .github/packager/rust/grpc/src/lib.rs
================================================
//! # Pactus gRPC Client
//!
//! A Rust client library for interacting with the Pactus blockchain via gRPC.
//!
//! ## Example
//!
//! ```rust
//! use pactus_grpc::{blockchain_client::BlockchainClient, GetBlockchainInfoRequest};
//! use tonic::transport::Channel;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let channel = Channel::from_static("http://127.0.0.1:50051")
//! .connect()
//! .await?;
//!
//! let mut client = BlockchainClient::new(channel);
//!
//! let request = tonic::Request::new(GetBlockchainInfoRequest {});
//! let response = client.get_blockchain_info(request).await?;
//! let info = response.into_inner();
//!
//! println!("get_blockchain_info Response: {:?}", info);
//!
//! Ok(())
//! }
//! ```
pub mod pactus;
// Re-export the main message types
pub use pactus::*;
================================================
FILE: .github/packager/rust/jsonrpc/Cargo.toml
================================================
[package]
name = "pactus-jsonrpc"
version = "{{ VERSION }}"
edition = "2021"
description = "Rust client for interacting with the Pactus blockchain via JSON-RPC"
authors = [ "Pactus Development Team <info@pactus.org>" ]
license = "MIT"
homepage = "https://pactus.org"
repository = "https://github.com/pactus-project/pactus"
keywords = [ "pactus", "blockchain", "json-rpc" ]
[dependencies]
jsonrpsee = { version = "0.26", default-features = false, features = ["http-client"] }
serde = { version = "1.0", default-features = false, features = ["derive", "std"] }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
derive_builder = { version = "0.20", default-features = false, features = ["std"] }
================================================
FILE: .github/packager/rust/jsonrpc/README.md
================================================
# pactus-jsonrpc
Rust client for interacting with the [Pactus](https://pactus.org) blockchain via JSON-RPC.
## Installation
```bash
cargo add pactus-jsonrpc
```
## Usage
```rust
use jsonrpsee::http_client::HttpClient;
use pactus_jsonrpc::pactus::PactusOpenRPC;
#[tokio::main]
async fn main() {
let client = HttpClient::builder().build("http://127.0.0.1:8545").unwrap();
let rpc: PactusOpenRPC<HttpClient> = PactusOpenRPC::new(client);
let info = rpc.pactus_blockchain_get_blockchain_info().await.unwrap();
println!("get_blockchain_info Response: {:?}", info);
}
```
================================================
FILE: .github/packager/rust/jsonrpc/src/lib.rs
================================================
//! # Pactus JSON-RPC Client
//!
//! A Rust client library for interacting with the Pactus blockchain via JSON-RPC.
//!
//! ## Example
//!
//! ```rust
//! use jsonrpsee::http_client::HttpClient;
//! use pactus_jsonrpc::pactus::PactusOpenRPC;
//!
//! #[tokio::main]
//! async fn main() {
//! let client = HttpClient::builder().build("http://127.0.0.1:8545").unwrap();
//! let rpc: PactusOpenRPC<HttpClient> = PactusOpenRPC::new(client);
//!
//! let info = rpc.pactus_blockchain_get_blockchain_info().await.unwrap();
//! println!("get_blockchain_info Response: {:?}", info);
//! }
//! ```
pub mod pactus;
================================================
FILE: .github/releasers/linux/pactus-gui.desktop
================================================
[Desktop Entry]
Name=pactus-gui
Comment=Pactus blockchain node
Exec=pactus-gui
Icon=pactus
Type=Application
Categories=Network;
================================================
FILE: .github/releasers/macos/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleIdentifier</key>
<string>com.github.pactus-project.pactus.pactus-gui</string>
<key>CFBundleExecutable</key>
<string>pactus-gui</string>
<key>CFBundleName</key>
<string>pactus-gui</string>
<key>CFBundleShortVersionString</key>
<string>%SHORTVERSION%</string>
<key>CFBundleVersion</key>
<string>%VERSION%</string>
<key>CFBundleIconFile</key>
<string>pactus.icns</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSHumanReadableCopyright</key>
<string>MIT License.</string>
<key>LSMinimumSystemVersion</key>
<string>10.15</string>
</dict>
</plist>
================================================
FILE: .github/releasers/macos/gtk3-launcher.sh
================================================
#!/bin/sh
if test "x$GTK_DEBUG_LAUNCHER" != x; then
set -x
fi
if test "x$GTK_DEBUG_GDB" != x; then
EXEC="gdb --args"
else
EXEC=exec
fi
name=`basename "$0"`
tmp="$0"
tmp=`dirname "$tmp"`
tmp=`dirname "$tmp"`
bundle=`dirname "$tmp"`
bundle_contents="$bundle"/Contents
bundle_res="$bundle_contents"/Resources
bundle_lib="$bundle_res"/lib
bundle_bin="$bundle_res"/bin
bundle_data="$bundle_res"/share
bundle_etc="$bundle_res"/etc
export DYLD_FALLBACK_LIBRARY_PATH="$bundle_lib"
export XDG_CONFIG_DIRS="$bundle_etc"/xdg
export XDG_DATA_DIRS="$bundle_data"
export GTK_DATA_PREFIX="$bundle_res"
export GTK_EXE_PREFIX="$bundle_res"
export GTK_PATH="$bundle_res"
# macOS-specific settings
if [ "$(uname)" = "Darwin" ]; then
# Changing the PANGOCAIRO_BACKEND is necessary on MacOS to render emoji
export PANGOCAIRO_BACKEND="fontconfig"
fi
export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
if [ `uname -r | cut -d . -f 1` -ge 10 ]; then
export GTK_IM_MODULE_FILE="$bundle_lib/gtk-3.0/3.0.0/immodules.cache"
fi
APP=$name
# Strip out the argument added by the OS.
if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
shift 1
fi
$EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
================================================
FILE: .github/releasers/macos/gui.bundle
================================================
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<app-bundle>
<meta>
<!-- Where to pick up the GTK+ installation, icon themes,
etc. Note that "${env:JHBUILD_PREFIX}" is evaluated to the
value of the environment variable JHBUILD_PREFIX. You can
define additional prefixes and refer to them in paths
throughout this file on the form "${prefix:name}". This is
useful for installing certain libraries or even the
application itself separately. Note that JHBUILD_PREFIX is
defined by jhbuild, so it you are not using jhbuild you can
either define your own or just hardcode the path here.
-->
<prefix name="default">${env:LIB_HOME}</prefix>
<prefix name="bundle">${env:GUI_BUNDLE}</prefix>
<!-- The project directory is the default location of the created
app. If you leave out the path, the current directory is
used. Note the usage of an environment variable here again.
-->
<destination overwrite="yes">${env:ROOT_DIR}</destination>
<image>
<!-- Not implemented yet (DMG image). -->
</image>
<!-- Comment this out to keep the install names in binaries -->
<run-install-name-tool/>
<!-- Optionally specify a launcher script to use. If the
application sets up everything needed itself, like
environment variable, linker paths, etc, a launcher script is
not needed. If the source path is left out, the default
script will be used.
-->
<launcher-script>${project}/gtk3-launcher.sh</launcher-script >
<!-- Not implemented: Optional runtime, could be python or mono
for example.
-->
<!-- runtime copy="yes">/usr/bin/python</runtime -->
<!-- Indicate the active gtk version to use. This is needed only
for gtk+-3.0 projects. -->
<gtk>gtk+-3.0</gtk>
</meta>
<!-- The special macro "${project}" refers to the directory where
this bundle file is located. The application name and bundle
identifier are taken from the plist file.
-->
<plist>${project}/Info.plist</plist>
<main-binary>${prefix:bundle}/pactus-gui</main-binary>
<!-- Copy in the input methods. Dunno if they actually work with
OSX. Note the ${gtkdir} macro, which expands to the correct
library subdirectory for the specified gtk version. -->
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so
</binary>
<!-- And the print backends -->
<!-- <binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
</binary> -->
<!-- Starting with 2.24, gdk-pixbuf installs into its own directory. -->
<binary>
${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so
</binary>
<binary>
${prefix}/lib/gio/modules/libgiognutls.so
</binary>
<!-- Translation filenames, one for each program or library that you
want to copy in to the bundle. The "dest" attribute is
optional, as usual. Bundler will find all translations of that
library/program under the indicated directory and copy them.-->
<!-- <translations name="gtk30">
${prefix}/share/locale
</translations> -->
<!-- Data to copy in, usually Glade/UI files, images, sounds files
etc. The destination inside the bundle can be specified if the
files should end up at a different location, by using the
"dest" property. The destination must then start with the macro
"${bundle}", which refers to the bundle root directory.
-->
<!-- data>
${prefix}/share/gtk3-demo
</data -->
<!-- Copy in the themes data. You may want to trim this to save space
in your bundle. -->
<data>
${prefix}/share/themes
</data>
<data>
${prefix}/share/icons
</data>
<!-- Copy icons. Note that the .icns file is an Apple format which
contains up to 4 sizes of icon. You can use
/Developer/Applications/Utilities/Icon Composer.app to import
artwork and create the file. -->
<data dest="${bundle}/Contents/Resources">
${prefix:bundle}/pactus.icns
</data>
</app-bundle>
================================================
FILE: .github/releasers/macos/run-install-name-tool-change.sh
================================================
#!/bin/sh
if [ $# -lt 3 ]; then
echo "Usage: $0 library old_prefix new_prefix action"
exit 1
fi
LIBRARY=$1
WRONG_PREFIX=$2
RIGHT_PREFIX="@executable_path/../$3"
ACTION=$4
chmod u+w $LIBRARY
if [ "x$ACTION" = "xchange" ]; then
libs="`otool -L $LIBRARY 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep $WRONG_PREFIX | sort | uniq`"
for lib in $libs; do
if ! echo $lib | grep --silent "@executable_path" ; then
if echo $lib | grep --silent "${LIB_HOME}/Cellar/"; then
fixed=`echo $lib | sed -e "s|${LIB_HOME}/Cellar/\([^/]*\)/[^/]*/|@executable_path/../Resources/opt/\1/|"`
else
fixed=`echo $lib | sed -e s,\${WRONG_PREFIX},\${RIGHT_PREFIX},`
fi
echo $lib $fixed $LIBRARY
install_name_tool -change $lib $fixed $LIBRARY
fi
done;
elif [ "x$ACTION" = "xid" ]; then
# echo "$LIBRARY $WRONG_PREFIX to $RIGHT_PREFIX"
lib=$(otool -D "$LIBRARY" 2>/dev/null | grep ^"$WRONG_PREFIX" | sed s,"$WRONG_PREFIX",,)
if [ -n "$lib" ]; then
# echo "Rewrite $lib"
install_name_tool -id "${RIGHT_PREFIX}/${lib}" $LIBRARY;
# else
# path=$(otool -D "$LIBRARY" 2>/dev/null | sed -n 2p)
# echo "Empty Result $path"
fi
fi
================================================
FILE: .github/releasers/pactus_downloader.sh
================================================
#!/bin/sh
# Function to check if a command is available
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Download function
download_file() {
file_name=$1
url=$2
echo "== Downloading ${file_name}..."
if ! curl --fail --proto '=https' --tlsv1.2 -# -L -o "${file_name}" "${url}" ; then
echo "Failed to download ${file_name}. Check the URL or your internet connection."
exit 1
fi
}
# Check if sha256sum is installed
if ! command_exists sha256sum; then
echo "sha256sum is not installed. Please install sha256sum and try again."
exit 1
fi
# Detect the operating system and CPU type
OS=$(uname -s)
ARCH=$(uname -m)
EXT=".tar.gz"
case $OS in
######################
Android)
OS="android"
case $ARCH in
aarch64 | arm64)
ARCH="arm64"
;;
*)
echo "Unrecognized CPU type: $ARCH"
exit 1
;;
esac
;;
######################
Linux)
OS="linux"
case $ARCH in
x86_64)
ARCH="amd64"
;;
aarch64 | arm64)
ARCH="arm64"
;;
*)
echo "Unrecognized CPU type: $ARCH"
exit 1
;;
esac
;;
######################
FreeBSD)
OS="freebsd"
case $ARCH in
amd64)
ARCH="amd64"
;;
*)
echo "Unrecognized CPU type: $ARCH"
exit 1
;;
esac
;;
######################
Darwin)
OS="darwin"
case $ARCH in
x86_64)
ARCH="amd64"
;;
arm64)
ARCH="arm64"
;;
*)
echo "Unrecognized CPU type: $ARCH"
exit 1
;;
esac
;;
######################
MINGW* | MSYS* | CYGWIN*)
if ! command_exists unzip; then
echo "unzip is not installed. Please install unzip and try again."
exit 1
fi
OS="windows"
EXT=".zip"
case $ARCH in
i686 | i386)
ARCH="386"
;;
x86_64)
ARCH="amd64"
;;
aarch64 | arm64)
ARCH="arm64"
;;
*)
echo "Unrecognized CPU type: $ARCH"
exit 1
;;
esac
;;
*)
echo "Unrecognized OS type: $OS"
exit 1
;;
esac
# Version number
VERSION="__VERSION__"
# Set the server URL where the binary and checksum files are hosted
SERVER_URL="https://github.com/pactus-project/pactus/releases/download/v${VERSION}"
# Set the filename of the binary and checksum
CHECKSUM_FILE="SHA256SUMS"
# Set the filename of the binary and checksum
FILE_NAME="pactus-cli_${VERSION}_${OS}_${ARCH}${EXT}"
# Destination directory that is the current directory
DEST_DIR="$(pwd)"
EXTRACTED_DIR="${DEST_DIR}/pactus-cli_${VERSION}"
# Create a temporary directory for downloads
DOWN_DIR="$(mktemp -d)"
# Check if extractopn folder exists and print an error if it does
if [ -e "${EXTRACTED_DIR}" ]; then
echo "Destination directory '${EXTRACTED_DIR}' already exists."
exit 1
fi
cd ${DOWN_DIR}
# Download the files using the download_file function
download_file "${FILE_NAME}" "${SERVER_URL}/${FILE_NAME}"
download_file "${CHECKSUM_FILE}" "${SERVER_URL}/${CHECKSUM_FILE}"
# Verify the checksum
echo "== Verify the checksum..."
sha256sum --ignore-missing -c "${CHECKSUM_FILE}"
if [ $? -ne 0 ]; then
echo "Checksum verification failed for ${FILE_NAME}!"
exit 1
fi
# Extracting
echo "== Extracting ${FILE_NAME}..."
if [ "${OS}" = "windows" ]; then
unzip -n "${FILE_NAME}" -d "${DEST_DIR}" || {
echo "Error: Extraction failed."
exit 1
}
else
tar -xzf "${FILE_NAME}" -C "${DEST_DIR}" || {
echo "Error: Extraction failed."
exit 1
}
fi
echo "Extracted at ${EXTRACTED_DIR}"
echo ""
echo "Installation completed."
================================================
FILE: .github/releasers/releaser_cli.sh
================================================
#!/bin/bash
# The 'set -e' command causes the script to immediately exit
# if any command returns a non-zero exit status (i.e., an error).
set -e
ROOT_DIR="$(pwd)"
VERSION="$(echo `git -C ${ROOT_DIR} describe --abbrev=0 --tags` | sed 's/^.//')" # "v1.2.3" -> "1.2.3"
PACKAGE_NAME="pactus-cli_${VERSION}"
# https://go.dev/doc/install/source#environment
for OS_ARCH in \
"linux amd64" "linux arm64" \
"android arm64" \
"freebsd amd64" "freebsd arm64" \
"darwin amd64" "darwin arm64" \
"windows 386" "windows amd64" "windows arm64"; do
PAIR=($OS_ARCH);
OS=${PAIR[0]};
ARCH=${PAIR[1]};
cd ${ROOT_DIR}
PACKAGE_NAME_OS=${PACKAGE_NAME}_${OS}_${ARCH}
BUILD_DIR=${ROOT_DIR}/build/${PACKAGE_NAME_OS}
if [ $OS = "windows" ]; then
EXE=".exe"
fi
echo "Building Pactus for ${OS}-${ARCH}..."
LD_FLAGS="-s -w"
if [[ ${OS} == "android" ]]; then
LD_FLAGS="${LD_FLAGS} -checklinkname=0"
fi
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags "${LD_FLAGS}" -trimpath -o ${BUILD_DIR}/${PACKAGE_NAME}/pactus-daemon${EXE} ./cmd/daemon
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags "${LD_FLAGS}" -trimpath -o ${BUILD_DIR}/${PACKAGE_NAME}/pactus-wallet${EXE} ./cmd/wallet
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags "${LD_FLAGS}" -trimpath -o ${BUILD_DIR}/${PACKAGE_NAME}/pactus-shell${EXE} ./cmd/shell
cd ${BUILD_DIR}
if [ $OS = "windows" ]; then
zip -r ${PACKAGE_NAME_OS}.zip ${PACKAGE_NAME}
mv ${PACKAGE_NAME_OS}.zip ${ROOT_DIR}
else
tar -czvf ${PACKAGE_NAME_OS}.tar.gz -p ${PACKAGE_NAME}
mv ${PACKAGE_NAME_OS}.tar.gz ${ROOT_DIR}
fi
done
================================================
FILE: .github/releasers/releaser_gui_linux.sh
================================================
#!/bin/bash
set -e
ROOT_DIR="$(pwd)"
VERSION="$(echo `git -C ${ROOT_DIR} describe --abbrev=0 --tags` | sed 's/^.//')" # "v1.2.3" -> "1.2.3"
BUILD_DIR="${ROOT_DIR}/build"
PACKAGE_NAME="pactus-gui_${VERSION}"
PACKAGE_DIR="${ROOT_DIR}/${PACKAGE_NAME}"
# Check the architecture
ARC="$(uname -m)"
if [ "${ARC}" = "x86_64" ]; then
FILE_NAME="${PACKAGE_NAME}_linux_amd64"
elif [ "${ARC}" = "aarch64" ]; then
FILE_NAME="${PACKAGE_NAME}_linux_arm64"
else
echo "Unsupported architecture: ${ARC}"
exit 1
fi
mkdir ${PACKAGE_DIR}
echo "Building the binaries for Linux ${ARC} architecture"
cd ${ROOT_DIR}
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/pactus-daemon ./cmd/daemon
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/pactus-wallet ./cmd/wallet
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/pactus-shell ./cmd/shell
CGO_ENABLED=1 go build -ldflags "-s -w" -trimpath -tags gtk -o ${BUILD_DIR}/pactus-gui ./cmd/gtk
# Moving binaries to package directory
echo "Moving binaries"
mv ${BUILD_DIR}/pactus-daemon ${PACKAGE_DIR}/pactus-daemon
mv ${BUILD_DIR}/pactus-wallet ${PACKAGE_DIR}/pactus-wallet
mv ${BUILD_DIR}/pactus-shell ${PACKAGE_DIR}/pactus-shell
mv ${BUILD_DIR}/pactus-gui ${PACKAGE_DIR}/pactus-gui
echo "Creating archive"
tar -czvf ${ROOT_DIR}/${FILE_NAME}.tar.gz -p ${PACKAGE_NAME}
# building AppImage
# https://github.com/linuxdeploy/linuxdeploy-plugin-gtk
cp ${ROOT_DIR}/.github/releasers/linux/* ${PACKAGE_DIR}
cd ${PACKAGE_DIR}
wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARC}.AppImage"
chmod +x linuxdeploy-${ARC}.AppImage linuxdeploy-plugin-gtk.sh
DEPLOY_GTK_VERSION=3 ./linuxdeploy-${ARC}.AppImage \
--executable ./pactus-gui \
--appdir AppDir \
--plugin gtk \
--output appimage \
--icon-file pactus.png \
--desktop-file ./pactus-gui.desktop
mv ./pactus-gui-${ARC}.AppImage ${ROOT_DIR}/${FILE_NAME}.AppImage
================================================
FILE: .github/releasers/releaser_gui_macos.sh
================================================
#!/bin/bash
set -e
ROOT_DIR="$(pwd)"
VERSION="$(echo `git -C ${ROOT_DIR} describe --abbrev=0 --tags` | sed 's/^.//')" # "v1.2.3" -> "1.2.3"
BUILD_DIR="${ROOT_DIR}/build"
PACKAGE_NAME="pactus-gui_${VERSION}"
PACKAGE_DIR="${ROOT_DIR}/${PACKAGE_NAME}"
# Ensure GTK prefix is provided for bundling assets
if [ -z "${LIB_HOME}" ]; then
echo "LIB_HOME is not set. Set it to your GTK prefix (e.g. /opt/homebrew or /usr/local)."
exit 1
fi
# Check the architecture
ARC="$(uname -m)"
if [ "${ARC}" = "x86_64" ]; then
FILE_NAME="${PACKAGE_NAME}_darwin_amd64"
elif [ "${ARC}" = "arm64" ]; then
FILE_NAME="${PACKAGE_NAME}_darwin_arm64"
else
echo "Unsupported architecture: ${ARC}"
exit 1
fi
mkdir -p ${PACKAGE_DIR}
echo "Building the binaries for macOS ${ARC} architecture"
cd ${ROOT_DIR}
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/pactus-daemon ./cmd/daemon
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/pactus-wallet ./cmd/wallet
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/pactus-shell ./cmd/shell
CGO_ENABLED=1 go build -ldflags "-s -w -extldflags -headerpad_max_install_names" -trimpath -tags gtk -o ${BUILD_DIR}/pactus-gui ./cmd/gtk
echo "Installing gtk-mac-bundler"
git clone https://gitlab.gnome.org/GNOME/gtk-mac-bundler.git
cd gtk-mac-bundler
# A workaround to make bundle without building GTK+ using jhbuild.
rm bundler/run-install-name-tool-change.sh
cp ${ROOT_DIR}/.github/releasers/macos/run-install-name-tool-change.sh bundler/run-install-name-tool-change.sh
chmod +x bundler/run-install-name-tool-change.sh
# make sure launcher is executable
chmod +x ${ROOT_DIR}/.github/releasers/macos/gtk3-launcher.sh
make install
export PATH=${PATH}:${HOME}/.bin:${HOME}/local/bin
BUNDLER=$(which gtk-mac-bundler)
echo "gtk-mac-bundler found at ${BUNDLER}"
cd -
echo "Bundling the GUI package"
GUI_BUNDLE=${ROOT_DIR}/gui-bundle
mkdir -p ${GUI_BUNDLE}
cp ${BUILD_DIR}/pactus-gui ${GUI_BUNDLE}
cp ${ROOT_DIR}/.github/releasers/macos/* ${GUI_BUNDLE}
# https://stackoverflow.com/questions/21242932/sed-i-may-not-be-used-with-stdin-on-mac-os-x
sed -i '' "s/%SHORTVERSION%/${VERSION}/" ${GUI_BUNDLE}/Info.plist
sed -i '' "s/%VERSION%/Version ${VERSION}/" ${GUI_BUNDLE}/Info.plist
export GUI_BUNDLE
export ROOT_DIR
${BUNDLER} ${GUI_BUNDLE}/gui.bundle
# Removing Cellar as workaround
rm -rf ${ROOT_DIR}/pactus-gui.app/Contents/Resources/Cellar
echo "Creating dmg"
# https://github.com/create-dmg/create-dmg
create-dmg --version
create-dmg --skip-jenkins \
--volname "Pactus GUI" \
"${FILE_NAME}.dmg" \
"${ROOT_DIR}/pactus-gui.app"
echo "Creating archive"
cp ${BUILD_DIR}/pactus-daemon ${PACKAGE_DIR}
cp ${BUILD_DIR}/pactus-wallet ${PACKAGE_DIR}
cp ${BUILD_DIR}/pactus-shell ${PACKAGE_DIR}
cp -R ${ROOT_DIR}/pactus-gui.app ${PACKAGE_DIR}
tar -czvf ${ROOT_DIR}/${FILE_NAME}.tar.gz -p ${PACKAGE_NAME}
================================================
FILE: .github/releasers/releaser_gui_windows_build.sh
================================================
#!/bin/bash
set -e
ROOT_DIR="$(pwd)"
BUILD_DIR="${ROOT_DIR}/build"
# Copy Windows resources file for application icon
cp ${ROOT_DIR}/.github/releasers/windows/rsrc_windows_amd64.syso ${ROOT_DIR}/cmd/gtk/rsrc_windows_amd64.syso
# This fixes a bug in pkgconfig: invalid flag in pkg-config --libs: -Wl,-luuid
sed -i -e 's/-Wl,-luuid/-luuid/g' /mingw64/lib/pkgconfig/gdk-3.0.pc
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/unsigned/pactus-daemon.exe ./cmd/daemon
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/unsigned/pactus-wallet.exe ./cmd/wallet
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ${BUILD_DIR}/unsigned/pactus-shell.exe ./cmd/shell
CGO_ENABLED=1 go build -ldflags "-s -w -H windowsgui" -trimpath -tags gtk -o ${BUILD_DIR}/unsigned/pactus-gui.exe ./cmd/gtk
================================================
FILE: .github/releasers/releaser_gui_windows_installer.sh
================================================
#!/bin/bash
set -e
ROOT_DIR="$(pwd)"
VERSION="$(echo `git -C ${ROOT_DIR} describe --abbrev=0 --tags` | sed 's/^.//')"
BUILD_DIR="${ROOT_DIR}/build"
PACKAGE_NAME="pactus-gui_${VERSION}"
PACKAGE_DIR="${ROOT_DIR}/${PACKAGE_NAME}"
FILE_NAME="${PACKAGE_NAME}_windows_amd64"
echo "🚀 Starting Pactus GUI Windows packaging..."
# Create package directory
mkdir -p "${PACKAGE_DIR}/pactus-gui"
# Bundle GTK application using Python bundler
python3 "${ROOT_DIR}/.github/releasers/windows/gtk-win-bundler.py" \
"${BUILD_DIR}/signed/pactus-gui.exe" \
"${PACKAGE_DIR}/pactus-gui"
# Move other binaries
cp ${BUILD_DIR}/signed/pactus-daemon.exe ${PACKAGE_DIR}/pactus-daemon.exe
cp ${BUILD_DIR}/signed/pactus-wallet.exe ${PACKAGE_DIR}/pactus-wallet.exe
cp ${BUILD_DIR}/signed/pactus-shell.exe ${PACKAGE_DIR}/pactus-shell.exe
cp ${BUILD_DIR}/signed/pactus-gui.exe ${PACKAGE_DIR}/pactus-gui/pactus-gui.exe
# Create archive
7z a ${ROOT_DIR}/${FILE_NAME}.zip ${PACKAGE_DIR}
# Create installer
cat << EOF > ${ROOT_DIR}/inno.iss
[Setup]
AppId=Pactus
AppName=Pactus
AppVersion=${VERSION}
AppPublisher=Pactus
AppPublisherURL=https://pactus.org/
DefaultDirName={autopf}/Pactus
DefaultGroupName=Pactus
SetupIconFile=.github/releasers/windows/pactus.ico
LicenseFile=LICENSE
Uninstallable=yes
[Files]
Source:"${PACKAGE_NAME}/*"; DestDir:"{app}"; Flags: recursesubdirs
[Icons]
Name:"{group}\\Pactus"; Filename:"{app}\\pactus-gui\\pactus-gui.exe"
Name:"{commondesktop}\\Pactus"; Filename:"{app}\\pactus-gui\\pactus-gui.exe"
[Run]
Filename:"{app}\\pactus-gui\\pactus-gui.exe"; Description:"Launch Pactus"; Flags: postinstall nowait
EOF
# Build installer
INNO_PATH="/c/Program Files (x86)/Inno Setup 6"
INNO_DIR=$(cygpath -w -s "${INNO_PATH}")
"${INNO_DIR}/ISCC.exe" "${ROOT_DIR}/inno.iss"
mv "Output/mysetup.exe" "${BUILD_DIR}/unsigned/${FILE_NAME}_installer.exe"
echo "🎉 Build complete! Package: ${BUILD_DIR}/unsigned/${FILE_NAME}_installer.exe"
================================================
FILE: .github/releasers/windows/README.md
================================================
# Generating the Windows resource (.syso)
1) Install the tool (once):
`go install github.com/akavel/rsrc@latest`
2) Generate the .syso in this folder:
`rsrc -manifest ./pactus-gui.manifest -ico ./pactus.ico`
================================================
FILE: .github/releasers/windows/gtk-win-bundler.py
================================================
#!/usr/bin/env python3
"""
GTK Bundle Helper for Windows
Automatically detects and bundles all GTK dependencies for Windows distribution.
"""
import os
import sys
import shutil
import subprocess
import json
from pathlib import Path
from typing import List, Set, Dict, Optional
class GTKBundler:
def __init__(self, mingw_prefix: str, target_dir: str):
self.mingw_prefix = Path(mingw_prefix)
self.target_dir = Path(target_dir)
def run_command(self, cmd: List[str]) -> str:
"""Run a command and return its output."""
try:
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
return result.stdout.strip()
except subprocess.CalledProcessError as e:
print(f"Error running command {' '.join(cmd)}: {e}")
sys.exit(1)
def get_dependencies(self, exe_path: Path, dependencies: List[Path]) -> None:
"""Get all DLL dependencies for an executable using ldd."""
# Use ldd to get dependencies
ldd_output = self.run_command(['ldd', str(exe_path)])
for line in ldd_output.split('\n'):
if '/mingw64' in line and '.dll' in line:
# Extract the DLL path
parts = line.split()
if len(parts) >= 3:
dll_path = parts[2].replace('/mingw64', str(self.mingw_prefix))
dll_path = Path(dll_path)
if dll_path not in dependencies:
dependencies.append(dll_path)
def copy_file(self, src: Path, dst: Path) -> None:
"""Copy a file if it hasn't been copied already."""
if dst.exists():
print(f" Already copied: {src.name}")
return
if not src.exists():
print(f"ERROR: Required file not found: {src}")
sys.exit(1)
try:
# Create parent directories if needed
dst.parent.mkdir(parents=True, exist_ok=True)
# Copy the file
shutil.copy2(src, dst)
print(f" Copied: {src.name}")
except Exception as e:
print(f"ERROR: Failed to copy file {src} to {dst}: {e}")
sys.exit(1)
def copy_dir(self, src_path: str, dst_path: str) -> None:
"""Copy a directory if it exists."""
if not Path(src_path).exists():
print(f"ERROR: Required directory not found: {src_path}")
sys.exit(1)
try:
Path(dst_path).parent.mkdir(parents=True, exist_ok=True)
shutil.copytree(src_path, dst_path, dirs_exist_ok=True)
print(f" Copied directory: {Path(src_path).name}")
except Exception as e:
print(f"ERROR: Failed to copy directory {src_path} to {dst_path}: {e}")
sys.exit(1)
def copy_gtk_dependencies(self, exe_path: Path, target_exe_dir: Path) -> None:
"""Copy all dependencies for the GTK executable."""
print(f"Analyzing dependencies for: {exe_path.name}")
# Get direct dependencies
dependencies = []
self.get_dependencies(exe_path, dependencies)
for dep in dependencies:
self.get_dependencies(dep, dependencies)
# Add dependencies for all pixbuf loader DLLs
pixbuf_dir = Path(f"{self.mingw_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders")
for loader_file in pixbuf_dir.glob("*.dll"):
print(f" Scanning pixbuf loader: {loader_file.name}")
self.get_dependencies(loader_file, dependencies)
for dep in dependencies:
self.copy_file(dep, target_exe_dir / dep.name)
# Copy GTK resources
# Based on this tutorial: https://www.gtk.org/docs/installations/windows#building-and-distributing-your-application
def copy_gtk_resources(self) -> None:
"""Copy GTK resources (themes, icons, schemas, etc.)."""
print("Copying GTK resources...")
# Copy GdkPixbuf loaders
print(" Copying GdkPixbuf loaders...")
self.copy_dir(
f"{self.mingw_prefix}/lib/gdk-pixbuf-2.0",
f"{self.target_dir}/lib/gdk-pixbuf-2.0"
)
# Copy icon themes
print(" Copying icon themes...")
self.copy_dir(
f"{self.mingw_prefix}/share/icons/Adwaita",
f"{self.target_dir}/share/icons/Adwaita"
)
self.copy_dir(
f"{self.mingw_prefix}/share/icons/hicolor",
f"{self.target_dir}/share/icons/hicolor"
)
# Copy GTK themes
print(" Copying GTK themes...")
self.copy_dir(
f"{self.mingw_prefix}/share/gtk-3.0",
f"{self.target_dir}/share/themes/Windows10/gtk-3.0"
)
# Copy GSettings schemas
print(" Copying GSettings schemas...")
self.copy_dir(
f"{self.mingw_prefix}/share/glib-2.0/schemas",
f"{self.target_dir}/share/glib-2.0/schemas"
)
# Create settings.ini
settings_file = f"{self.target_dir}/share/gtk-3.0/settings.ini"
Path(settings_file).parent.mkdir(parents=True, exist_ok=True)
with open(settings_file, 'w') as f:
f.write("[Settings]\n")
f.write("gtk-theme-name=Adwaita\n")
f.write("gtk-icon-theme-name=Adwaita\n")
f.write("gtk-font-name=Segoe UI 9\n")
f.write("gtk-application-prefer-dark-theme=true\n")
print(" Created settings.ini")
def copy_gtk_executables(self, target_exe_dir: Path) -> None:
"""Copy helper executables that might be needed."""
print("Copying helper executables...")
helper_exes = [
"gdbus.exe",
"gspawn-win64-helper.exe",
"gspawn-win64-helper-console.exe"
]
for exe in helper_exes:
exe_src = self.mingw_prefix / "bin" / exe
if exe_src.exists():
self.copy_file(exe_src, target_exe_dir / exe)
def bundle_application(self, exe_path: Path) -> None:
"""Main method to bundle the entire application."""
print(f"Bundling GTK application: {exe_path}")
# Create target directory structure
target_exe_dir = self.target_dir
target_exe_dir.mkdir(parents=True, exist_ok=True)
# Copy all dependencies
self.copy_gtk_dependencies(exe_path, target_exe_dir)
# Copy helper executables
self.copy_gtk_executables(target_exe_dir)
# Copy GTK resources
self.copy_gtk_resources()
def main():
if len(sys.argv) != 3:
print("Usage: python3 gtk-win-bundler.py <exe_path> <target_dir>")
sys.exit(1)
# Check for MINGW_PREFIX environment variable
mingw_prefix = os.environ.get('MINGW_PREFIX')
if not mingw_prefix:
print("Error: MINGW_PREFIX environment variable is not set")
sys.exit(1)
exe_path = Path(sys.argv[1])
target_dir = Path(sys.argv[2])
bundler = GTKBundler(mingw_prefix, target_dir)
bundler.bundle_application(exe_path)
if __name__ == "__main__":
main()
================================================
FILE: .github/releasers/windows/pactus-gui.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="amd64"
name="pactus"
type="win32"/>
<description>Pactus GUI</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
================================================
FILE: .github/workflows/codeql.yml
================================================
name: "CodeQL Advanced"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "23 3 * * 0"
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: "ubuntu-latest"
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#changing-the-languages-that-are-analyzed
include:
- language: actions
build-mode: none
- language: go
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
queries: security-extended, security-and-quality
- if: matrix.build-mode == 'manual'
shell: bash
run: make build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
================================================
FILE: .github/workflows/coverage.yml
================================================
name: Reporting Test Coverage
permissions:
contents: read
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Checkout code
uses: actions/checkout@v6
- name: Test with coverage
run: go test -gcflags=-l -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage report
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
================================================
FILE: .github/workflows/deadlock.yml
================================================
name: Deadlock and Data Race Detection
permissions:
contents: read
on:
pull_request:
branches: ["main"]
jobs:
data-race:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Checkout code
uses: actions/checkout@v6
- name: Test with data race detection
run: make test_race
- name: Replace sync.RWMutex with deadlock.RWMutex
run: find . -type f -name "*.go" -not -path '*/\.*' -exec sed -i -- 's/\t"sync"/\tsync "github.com\/sasha-s\/go-deadlock"/g' {} +
- name: Adding go-deadlock package
run: go get github.com/sasha-s/go-deadlock
- name: Test with deadlock detection
run: make test
================================================
FILE: .github/workflows/docker.yml
================================================
name: Building Docker and Push to DockerHub
permissions:
contents: read
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"] # Trigger on version tags (e.g., v1.0.0)
branches: ["main"]
env:
REGISTRY_IMAGE: pactus/pactus
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64
- linux/386
- linux/ppc64le
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Build and push platform-specific image
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v6
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v6
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
================================================
FILE: .github/workflows/gui.yml
================================================
name: Build and Test GUI
permissions:
contents: read
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-gui:
runs-on: ${{ matrix.name }}
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
matrix:
# Default values for `defaults.run.shell`
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell
include:
- name: ubuntu-latest
shell: "bash -e {0}"
- name: macos-latest
shell: "bash -e {0}"
- name: windows-latest
shell: "msys2 {0}"
steps:
- uses: actions/checkout@v6
- name: Setup Go for macOS and Linux
if: runner.os != 'Windows'
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y libgtk-3-dev libcairo2-dev libglib2.0-dev
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: brew install gtk+3
- name: Setup MSYS2 and Dependencies (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: >-
git
make
glib2-devel
mingw-w64-x86_64-go
mingw-w64-x86_64-gtk3
mingw-w64-x86_64-glib2
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkg-config
- name: Patch pkgconfig (Windows)
if: runner.os == 'Windows'
run: |
sed -i -e 's/-Wl,-luuid/-luuid/g' /mingw64/lib/pkgconfig/gdk-3.0.pc
#######################################################
## Caching Go modules and GTK dependencies
- name: Get Go environment
id: go-env
run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "lintcache=$HOME/.cache/golangci-lint" >> $GITHUB_ENV
# Example for caching Go dependencies:
# https://github.com/actions/cache/blob/main/examples.md#go---modules
- uses: actions/cache@v5
id: cache
with:
path: |
${{ env.cache }}
${{ env.modcache }}
${{ env.lintcache }}
key: ${{ matrix.name }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ matrix.name }}-go-
#######################################################
- name: Install GTK
if: steps.cache.outputs.cache-hit != 'true'
run: go install github.com/gotk3/gotk3/gtk
- name: Build the GUI binary
run: make build_gui
- name: Test the GUI binary
run: go test -tags gtk ./cmd/gtk/...
- name: Lint check (Linux only)
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v9
with:
version: v2.11.4
args: --build-tags gtk
================================================
FILE: .github/workflows/linting.yml
================================================
name: Lint and Format Check
permissions:
contents: read
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Checkout code
uses: actions/checkout@v6
- name: Check linting and formatting
uses: golangci/golangci-lint-action@v9
with:
version: v2.11.4
- name: Check proto files
run: |
go install github.com/bufbuild/buf/cmd/buf@v1.67.0
make proto-check
================================================
FILE: .github/workflows/packager.yml
================================================
## Important Notes:
## 1. The Releaser workflow is triggered when a new tag is pushed to the repository.
## 2. The Packager workflow is triggered when the Releaser workflow completes successfully.
## 3. GitHub always executes this workflow using the version from the main branch
## 4. To package the correct release, it checks out the latest tag.
##
name: Packager
permissions:
contents: read
id-token: write
on:
workflow_run:
workflows: ["Releaser"]
types: ["completed"]
jobs:
packager:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
outputs:
dry_run: ${{ steps.release-type.outputs.dry_run }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Determine Release Type
id: release-type
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag: $LATEST_TAG"
if [[ "$LATEST_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "🚀 Final release detected."
DRY_RUN=false
elif [[ "$LATEST_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+$ ]]; then
echo "🧪 Pre-release detected, using dry-run."
DRY_RUN=true
else
echo "Tag $LATEST_TAG is invalid."
exit 1
fi
echo "dry_run=$DRY_RUN" >> "$GITHUB_OUTPUT"
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
git checkout $LATEST_TAG
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Create Packages
run: bash ./.github/packager/packager.sh
env:
VERSION: ${{ env.LATEST_TAG }}
- name: Upload `package-js-grpc` package
uses: actions/upload-artifact@v6
with:
name: package-js-grpc
path: packages/js/pactus-grpc
- name: Upload `package-js-jsonrpc` package
uses: actions/upload-artifact@v6
with:
name: package-js-jsonrpc
path: packages/js/pactus-jsonrpc
- name: Upload `package-python-grpc` package
uses: actions/upload-artifact@v6
with:
name: package-python-grpc
path: packages/python/pactus-grpc
- name: Upload `package-python-jsonrpc` package
uses: actions/upload-artifact@v6
with:
name: package-python-jsonrpc
path: packages/python/pactus-jsonrpc
- name: Upload `package-rust-grpc` package
uses: actions/upload-artifact@v6
with:
name: package-rust-grpc
path: packages/rust/pactus-grpc
- name: Upload `package-rust-jsonrpc` package
uses: actions/upload-artifact@v6
with:
name: package-rust-jsonrpc
path: packages/rust/pactus-jsonrpc
publish-npm-grpc:
name: Publish pactus-grpc package to npm
needs: packager
runs-on: ubuntu-latest
environment:
name: npmjs.com
url: https://npmjs.com/package/pactus-grpc
steps:
- name: Download JavaScript Package
uses: actions/download-artifact@v6
with:
name: package-js-grpc
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Publish to npm
run: |
if [[ "${{ needs.packager.outputs.dry_run }}" == "true" ]]; then
npm publish --access public --dry-run
else
npm publish --access public
fi
publish-npm-jsonrpc:
name: Publish pactus-jsonrpc package to npm
needs: packager
runs-on: ubuntu-latest
environment:
name: npmjs.com
url: https://npmjs.com/package/pactus-jsonrpc
steps:
- name: Download JavaScript Package
uses: actions/download-artifact@v6
with:
name: package-js-jsonrpc
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Publish to npm
run: |
if [[ "${{ needs.packager.outputs.dry_run }}" == "true" ]]; then
npm publish --access public --dry-run
else
npm publish --access public
fi
publish-pypi-grpc:
name: Publish pactus-grpc package to PyPI
needs: packager
runs-on: ubuntu-latest
environment:
name: pypi.org
url: https://pypi.org/p/pactus-grpc
steps:
- name: Download Python Package
uses: actions/download-artifact@v6
with:
name: package-python-grpc
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install build tools and build Python wheel
run: |
python3 -m pip install build --user
python3 -m build
- name: Publish distribution to PyPI
if: needs.packager.outputs.dry_run == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
publish-pypi-jsonrpc:
name: Publish pactus-jsonrpc package to PyPI
needs: packager
runs-on: ubuntu-latest
environment:
name: pypi.org
url: https://pypi.org/p/pactus-jsonrpc
steps:
- name: Download Python Package
uses: actions/download-artifact@v6
with:
name: package-python-jsonrpc
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install build tools and build Python wheel
run: |
python3 -m pip install build --user
python3 -m build
- name: Publish distribution to PyPI
if: needs.packager.outputs.dry_run == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
publish-crates-grpc:
name: Publish pactus-grpc package to crates.io
needs: packager
runs-on: ubuntu-latest
environment:
name: crates.io
url: https://crates.io/crates/pactus-grpc
steps:
- name: Download Rust Package
uses: actions/download-artifact@v6
with:
name: package-rust-grpc
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
- name: Publish to crates.io
run: |
if [[ "${{ needs.packager.outputs.dry_run }}" == "true" ]]; then
cargo publish --dry-run
else
cargo publish
fi
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
publish-crates-jsonrpc:
name: Publish pactus-jsonrpc package to crates.io
needs: packager
runs-on: ubuntu-latest
environment:
name: crates.io
url: https://crates.io/crates/pactus-jsonrpc
steps:
- name: Download Rust Package
uses: actions/download-artifact@v6
with:
name: package-rust-jsonrpc
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
- name: Publish to crates.io
run: |
if [[ "${{ needs.packager.outputs.dry_run }}" == "true" ]]; then
cargo publish --dry-run
else
cargo publish
fi
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
================================================
FILE: .github/workflows/releaser.yml
================================================
name: Releaser
permissions:
# https://github.com/softprops/action-gh-release?tab=readme-ov-file#permissions
contents: write
on:
push:
tags: ["v*"]
jobs:
########################################
build-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: |
sudo apt update
sudo apt install zip
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Create release files
run: bash ./.github/releasers/releaser_cli.sh
- name: Calculate sha256sum
run: sha256sum pactus-*.zip pactus-*tar.gz > checksum-cli.txt
- name: Upload checksum artifact
uses: actions/upload-artifact@v6
with:
name: checksum-cli
path: checksum-cli.txt
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: |
pactus-*.zip
pactus-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
########################################
build-gui-linux:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
name: [linux-amd64, linux-arm64]
include:
- name: linux-amd64
runner: ubuntu-24.04
- name: linux-arm64
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: |
sudo apt update
sudo apt install libgtk-3-dev libcairo2-dev libglib2.0-dev libfuse2 pkg-config dpkg dpkg-dev
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Create release files
run: bash ./.github/releasers/releaser_gui_linux.sh
- name: Calculate sha256sum
run: sha256sum pactus-gui*.tar.gz pactus-gui*.AppImage > checksum-${{ matrix.name }}.txt
- name: Upload checksum artifact
uses: actions/upload-artifact@v6
with:
name: checksum-${{ matrix.name }}
path: checksum-${{ matrix.name }}.txt
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: |
pactus-gui*.tar.gz
pactus-gui*.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
########################################
build-gui-macos:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
name: [macos-amd64, macos-arm64]
include:
- name: macos-amd64
runner: macos-15-intel
lib_home: /usr/local
- name: macos-arm64
runner: macos-26
lib_home: /opt/homebrew
env:
LIB_HOME: ${{ matrix.lib_home }}
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: brew install gtk+3 librsvg create-dmg coreutils gdk-pixbuf glib-networking pkg-config
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Create release files
run: bash ./.github/releasers/releaser_gui_macos.sh
- name: Calculate sha256sum
run: sha256sum pactus-*.dmg pactus-*.tar.gz > checksum-${{ matrix.name }}.txt
- name: Upload checksum artifact
uses: actions/upload-artifact@v6
with:
name: checksum-${{ matrix.name }}
path: checksum-${{ matrix.name }}.txt
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: |
pactus-*.dmg
pactus-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
########################################
build-gui-windows:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
name: [windows_amd64]
include:
- name: windows_amd64
runner: windows-2025
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git
make
p7zip
glib2-devel
mingw-w64-x86_64-go
mingw-w64-x86_64-gtk3
mingw-w64-x86_64-glib2
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-adwaita-icon-theme
mingw-w64-x86_64-hicolor-icon-theme
- name: Get Version
id: get_version
run: |
VERSION="$(echo `git -C . describe --abbrev=0 --tags` | sed 's/^.//')"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Build Binaries
run: bash ./.github/releasers/releaser_gui_windows_build.sh
- name: Sign Pactus Daemon
uses: ./.github/actions/windows-signing
with:
signpath-api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
signpath-signing-policy-slug: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }}
artifact-name: pactus-daemon
- name: Sign Pactus Wallet
uses: ./.github/actions/windows-signing
with:
signpath-api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
signpath-signing-policy-slug: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }}
artifact-name: pactus-wallet
- name: Sign Pactus Shell
uses: ./.github/actions/windows-signing
with:
signpath-api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
signpath-signing-policy-slug: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }}
artifact-name: pactus-shell
- name: Sign Pactus GUI
uses: ./.github/actions/windows-signing
with:
signpath-api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
signpath-signing-policy-slug: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }}
artifact-name: pactus-gui
- name: Build Installer
run: bash ./.github/releasers/releaser_gui_windows_installer.sh
- name: Sign Installer
uses: ./.github/actions/windows-signing
with:
signpath-api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
signpath-signing-policy-slug: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }}
artifact-name: pactus-gui_${{ steps.get_version.outputs.VERSION }}_${{ matrix.name }}_installer
- name: Move Installer to Root
run: mv ./build/signed/pactus-gui_*_installer.exe .
- name: Calculate sha256sum
run: sha256sum pactus-gui_*.zip pactus-gui_*_installer.exe > checksum-${{ matrix.name }}.txt
- name: Upload checksum artifact
uses: actions/upload-artifact@v6
with:
name: checksum-${{ matrix.name }}
path: checksum-${{ matrix.name }}.txt
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: |
pactus-gui_*.zip
pactus-gui_*_installer.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
########################################
checksums:
needs:
[
build-cli,
build-gui-linux,
build-gui-macos,
build-gui-windows,
]
runs-on: ubuntu-latest
steps:
- name: Download checksum artifacts
uses: actions/download-artifact@v6
with:
path: checksums
- name: Combine checksums
run: |
cat checksums/*/*.txt > SHA256SUMS
cat SHA256SUMS
- name: Upload SHA256SUMS as an artifact
uses: actions/upload-artifact@v6
with:
name: sha256sums
path: SHA256SUMS
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: SHA256SUMS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
########################################
cosign:
needs: [checksums]
runs-on: ubuntu-latest
steps:
- name: Download SHA256SUMS artifact
uses: actions/download-artifact@v6
with:
name: sha256sums
- uses: sigstore/cosign-installer@v3
- name: Sign Checksum
run: cosign sign-blob --yes --key env://COSIGN_PRIVATE_KEY SHA256SUMS > SHA256SUMS.sig
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: SHA256SUMS.sig
########################################
downloader:
needs: [cosign]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Create Downloader file
run: |
VERSION="$(echo `git -C . describe --abbrev=0 --tags` | sed 's/^.//')" # "v1.2.3" -> "1.2.3"
echo ${VERSION}
sed -i "s/__VERSION__/${VERSION}/g" .github/releasers/pactus_downloader.sh
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: .github/releasers/pactus_downloader.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/semantic-pr.yml
================================================
name: Semantic PR
permissions:
pull-requests: read
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which scopes are allowed (newline-delimited).
scopes: |
github
linter
deps
makefile
release
releaser
packager
other
daemon
cbor
cmd
firewall
gtk
shell
wallet-cmd
committee
config
consensus
crypto
docs
docker
encoding
execution
genesis
network
node
sandbox
scripts
sortition
state
store
sync
main
txpool
types
util
version
wallet
www
grpc
proto
jsonrpc
http
html
zeromq
windows
linux
macos
# Configure that a scope must always be provided.
requireScope: true
# The subject should not start with an uppercase character and should not end with a period.
subjectPattern: ^(?![A-Z]).+[^.]$
subjectPatternError: |
The subject "{subject}" cannot start with an uppercase character or end with a period.
================================================
FILE: .github/workflows/testing.yml
================================================
name: Unit Testing
permissions:
contents: read
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
- name: Unit tests
run: make unit_test
================================================
FILE: .gitignore
================================================
build/
.DS_Store
# IDEs
.idea
.vscode
# TODO tasks
todo
# Releasers output
/pactus-*
# VIM artifacts
.swp
.*.sw*
packages/
================================================
FILE: .golangci.yml
================================================
version: "2"
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- copyloopvar
- decorder
- dogsled
- dupword
- durationcheck
- errchkjson
- errname
- errorlint
- exhaustive
- forbidigo
- gocheckcompilerdirectives
- gocognit
- gocritic
- gocyclo
- godot
- goheader
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- grouper
- importas
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nosprintfhostport
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- tagalign
- tagliatelle
- testableexamples
- testifylint
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
- usetesting
- varnamelen
- wastedassign
- whitespace
- zerologlint
settings:
gocritic:
disabled-checks:
- ifElseChain
- unnamedResult
- importShadow
enabled-tags:
- diagnostic
- style
- performance
gosec:
excludes:
- G304
- G204
- G115
- G704 # SSRF via taint analysis - ignore (URLs are validated/trusted)
- G705 # XSS via taint analysis - ignore (internal HTML, values escaped)
govet:
disable:
- fieldalignment
enable-all: true
settings:
shadow:
strict: true
nestif:
min-complexity: 6
predeclared:
ignore:
- len
- ' min'
- ' max'
qualified-name: true
revive:
enable-all-rules: true
rules:
- name: exported
disabled: true
- name: package-comments
disabled: true
- name: add-constant
disabled: true
- name: line-length-limit
disabled: true
- name: cognitive-complexity
disabled: true
- name: function-length
disabled: true
- name: cyclomatic
disabled: true
- name: unchecked-type-assertion
disabled: true
- name: max-public-structs
disabled: true
- name: flag-parameter
disabled: true
- name: deep-exit
disabled: true
- name: get-return
disabled: true
- name: confusing-naming
disabled: true
- name: function-result-limit
disabled: true
- name: import-shadowing
disabled: true
- name: redefines-builtin-id
disabled: true
- name: enforce-switch-style
disabled: true
- name: identical-switch-branches
disabled: true
- name: package-naming
disabled: true
# - name: use-slices-sort
# disabled: true
- name: var-naming
arguments:
- [] # AllowList
- [] # DenyList
- -
skip-package-name-checks: true
- name: unhandled-error
arguments:
- fmt.Printf
- fmt.Println
- fmt.Fprintf
- strings.Builder.WriteString
- strings.Builder.WriteRune
- strings.Builder.WriteByte
- bytes.Buffer.Write
- bytes.Buffer.WriteString
staticcheck:
checks:
- all
- -ST1000
- -QF1008
testifylint:
enable-all: true
usetesting:
os-temp-dir: true
context-background: true
context-todo: true
tagliatelle:
case:
rules:
json: snake
yaml: snake
use-field-name: false
varnamelen:
ignore-names:
- ok
- ip
- db
- "no"
- tt
- n
- i
- j
- l
- h
- il
- r
- w
ignore-decls:
- wg sync.WaitGroup
- ts *testsuite.TestSuite
- td *testData
- ma multiaddr.Multiaddr
- db *leveldb.DB
exclusions:
generated: lax
rules:
- linters:
- forbidigo
- gocognit
- maintidx
- nestif
- gosec
path: _test.go
- path: (.+)\.go$
text: 'shadow: declaration of "err" shadows'
- path: (.+)\.go$
text: 'builtinShadow: shadowing of predeclared identifier: min'
- path: (.+)\.go$
text: 'builtinShadow: shadowing of predeclared identifier: max'
- path: (.+)\.go$
text: 'builtinShadow: shadowing of predeclared identifier: len'
paths:
- third_party$
- builtin$
- examples$
- util/bip39/wordlists/
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
================================================
FILE: CHANGELOG.md
================================================
# Changelog
## [1.13.0](https://github.com/pactus-project/pactus/compare/v1.12.0...v1.13.0) (2026-04-03)
### Feat
- **grpc**: update validator object to support delegation ([#2117](https://github.com/pactus-project/pactus/pull/2117))
- **cmd**: add delegation flags for bond and unbond transactions ([#2106](https://github.com/pactus-project/pactus/pull/2106))
- **other**: implement PIP-49 ([#2101](https://github.com/pactus-project/pactus/pull/2101))
- **gtk**: add network info tab ([#2098](https://github.com/pactus-project/pactus/pull/2098))
- **gtk**: add committee info tab ([#2096](https://github.com/pactus-project/pactus/pull/2096))
### Fix
- **sync**: update the latest support version ([#2125](https://github.com/pactus-project/pactus/pull/2125))
- **state**: fix delegate reward on boundaries ([#2120](https://github.com/pactus-project/pactus/pull/2120))
- **state**: check subsidy transaction for delegated reward ([#2119](https://github.com/pactus-project/pactus/pull/2119))
- **types**: check decode size for validator ([#2116](https://github.com/pactus-project/pactus/pull/2116))
- **cmd**: set protocol version for localnet ([#2114](https://github.com/pactus-project/pactus/pull/2114))
- **gtk**: set percentage of protocol versions ([#2113](https://github.com/pactus-project/pactus/pull/2113))
- **gtk**: set public key for known validators ([#2112](https://github.com/pactus-project/pactus/pull/2112))
- **wallet**: ignore delegation on normal bond tx ([#2111](https://github.com/pactus-project/pactus/pull/2111))
- **state**: set subsidy for delegated reward ([#2109](https://github.com/pactus-project/pactus/pull/2109))
- **execution**: check delegation for withdraw execution ([#2108](https://github.com/pactus-project/pactus/pull/2108))
- **execution**: check delegation for unbond execution ([#2107](https://github.com/pactus-project/pactus/pull/2107))
- **types**: set delegation-owner for unbond transaction ([#2105](https://github.com/pactus-project/pactus/pull/2105))
- **types**: fix bond encoding issue ([#2104](https://github.com/pactus-project/pactus/pull/2104))
- **wallet**: set remote provider if not specified ([#2097](https://github.com/pactus-project/pactus/pull/2097))
## [1.12.0](https://github.com/pactus-project/pactus/compare/v1.11.0...v1.12.0) (2026-02-21)
### Feat
- **grpc**: add committee_size to blockchain_info ([#2091](https://github.com/pactus-project/pactus/pull/2091))
- **gtk**: add node-agent field ([#2090](https://github.com/pactus-project/pactus/pull/2090))
- **gtk**: connect to remote node ([#2079](https://github.com/pactus-project/pactus/pull/2079))
- **grpc**: decouple peer list API ([#2078](https://github.com/pactus-project/pactus/pull/2078))
- **gtk**: add validator page ([#2068](https://github.com/pactus-project/pactus/pull/2068))
### Fix
- **grpc**: add in_committee field to blockchain info ([#2089](https://github.com/pactus-project/pactus/pull/2089))
- **util**: prevent panic on sha256 mismatch error ([#2088](https://github.com/pactus-project/pactus/pull/2088))
- **gtk**: set connection label ([#2085](https://github.com/pactus-project/pactus/pull/2085))
- **gtk**: update view asynchronously ([#2082](https://github.com/pactus-project/pactus/pull/2082))
- **gtk**: ensure GTK UIs run on main thread ([#2081](https://github.com/pactus-project/pactus/pull/2081))
- **gtk**: define validator model ([#2075](https://github.com/pactus-project/pactus/pull/2075))
- **gtk**: close wallet on node startup ([#2057](https://github.com/pactus-project/pactus/pull/2057))
### Refactor
- **gtk**: refactor controllers ([#2080](https://github.com/pactus-project/pactus/pull/2080))
- **gtk**: use gRPC connection for node model ([#2077](https://github.com/pactus-project/pactus/pull/2077))
- **node**: set global context ([#2076](https://github.com/pactus-project/pactus/pull/2076))
- **grpc**: update blockchain info API ([#2073](https://github.com/pactus-project/pactus/pull/2073))
- **gtk**: use gRPC for wallet model ([#2070](https://github.com/pactus-project/pactus/pull/2070))
- **grpc**: define wallet transaction info ([#2071](https://github.com/pactus-project/pactus/pull/2071))
## [1.11.0](https://github.com/pactus-project/pactus/compare/v1.10.0...v1.11.0) (2026-01-25)
### Feat
- **gtk**: use timeout to refresh wallet page ([#2039](https://github.com/pactus-project/pactus/pull/2039))
- **gtk**: add transactions page ([#2035](https://github.com/pactus-project/pactus/pull/2035))
- **types**: define ShortString for Address and Hash ([#2031](https://github.com/pactus-project/pactus/pull/2031))
- **gtk**: add splash screen for starting the node ([#2019](https://github.com/pactus-project/pactus/pull/2019))
- **wallet**: define query parameters for list of transactions ([#2014](https://github.com/pactus-project/pactus/pull/2014))
- **wallet**: define Blockchain Provider interface ([#2013](https://github.com/pactus-project/pactus/pull/2013))
- **wallet**: process blocks for wallet transactions ([#2011](https://github.com/pactus-project/pactus/pull/2011))
- **cmd**: add transaction command ([#2006](https://github.com/pactus-project/pactus/pull/2006))
- **grpc**: add List Transaction API for wallets ([#2005](https://github.com/pactus-project/pactus/pull/2005))
- **grpc**: add Update Password API for wallets ([#2004](https://github.com/pactus-project/pactus/pull/2004))
- **wallet**: add SQLite3 storage ([#2001](https://github.com/pactus-project/pactus/pull/2001))
- **util**: add LogString for compact log formatting ([#2000](https://github.com/pactus-project/pactus/pull/2000))
- **types**: decode transaction from hex string ([#1998](https://github.com/pactus-project/pactus/pull/1998))
- **types**: decode block from hex string ([#1999](https://github.com/pactus-project/pactus/pull/1999))
- **types**: format amount with thousand separators ([#1977](https://github.com/pactus-project/pactus/pull/1977))
### Fix
- **txpool**: perform basic check on appending transactions ([#2050](https://github.com/pactus-project/pactus/pull/2050))
- **gtk**: refresh wallet info ([#2049](https://github.com/pactus-project/pactus/pull/2049))
- **wallet**: close wallet before starting the node ([#2047](https://github.com/pactus-project/pactus/pull/2047))
- **gtk**: refresh wallet view on changing address ([#2041](https://github.com/pactus-project/pactus/pull/2041))
- **wallet**: total balance for non-existing accounts ([#2040](https://github.com/pactus-project/pactus/pull/2040))
- **wallet**: add no column for transaction table ([#2034](https://github.com/pactus-project/pactus/pull/2034))
- **wallet**: configure Pragmas and create indices ([#2030](https://github.com/pactus-project/pactus/pull/2030))
- **wallet**: deprecate load wallet API ([#2029](https://github.com/pactus-project/pactus/pull/2029))
- **cmd**: ensure provider is set when recovering wallet ([#2027](https://github.com/pactus-project/pactus/pull/2027))
- **grpc**: correct wallet verbs and add validator addresses route ([#2023](https://github.com/pactus-project/pactus/pull/2023))
- **wallet**: set default values for address and direction ([#2022](https://github.com/pactus-project/pactus/pull/2022))
- **cmd**: show transaction list in a table ([#2015](https://github.com/pactus-project/pactus/pull/2015))
- **grpc**: include driver and path in GetWalletInfo response ([#2010](https://github.com/pactus-project/pactus/pull/2010))
- **wallet**: load default_wallet on startup ([#2008](https://github.com/pactus-project/pactus/pull/2008))
- **util**: list only top-level files and directories without recursion ([#2009](https://github.com/pactus-project/pactus/pull/2009))
- **wallet**: list SQLite wallets in wallet manager ([#2003](https://github.com/pactus-project/pactus/pull/2003))
- **wallet**: add Close method for wallet ([#2002](https://github.com/pactus-project/pactus/pull/2002))
- **network**: remove leading and trailing spaces from network key ([#1992](https://github.com/pactus-project/pactus/pull/1992))
- **gtk**: fix dark theme issue in Windows ([#1973](https://github.com/pactus-project/pactus/pull/1973))
- **wallet**: panic on disconnect of wallet client connection ([#1971](https://github.com/pactus-project/pactus/pull/1971))
### Refactor
- **other**: use pipeline package ([#2033](https://github.com/pactus-project/pactus/pull/2033))
- **consensus, network, util**: use scheduler package to manage … ([#2032](https://github.com/pactus-project/pactus/pull/2032))
- **wallet**: define storage interface ([#1995](https://github.com/pactus-project/pactus/pull/1995))
- **gtk**: refactor Pactus GUI ([#1994](https://github.com/pactus-project/pactus/pull/1994))
- **wallet**: refactor wallet manager ([#1993](https://github.com/pactus-project/pactus/pull/1993))
- **version**: replace Split in loops with more efficient SplitSeq ([#1982](https://github.com/pactus-project/pactus/pull/1982))
- **crypto**: use b.Loop() to simplify the code and improve performance ([#1970](https://github.com/pactus-project/pactus/pull/1970))
## [1.10.0](https://github.com/pactus-project/pactus/compare/v1.9.0...v1.10.0) (2025-10-27)
### Feat
- **gtk**: prefer dark theme ([#1965](https://github.com/pactus-project/pactus/pull/1965))
- **wallet**: export the bootstrap and gRPC server list ([#1961](https://github.com/pactus-project/pactus/pull/1961))
- **util**: operating system signal handling package ([#1959](https://github.com/pactus-project/pactus/pull/1959))
- **util**: rename Extend to PadToLeft; add PadToRight ([#1953](https://github.com/pactus-project/pactus/pull/1953))
- **gtk**: set default fee dialog ([#1946](https://github.com/pactus-project/pactus/pull/1946))
- **gtk**: add address recovery page for restore wallet ([#1940](https://github.com/pactus-project/pactus/pull/1940))
- **cmd**: update daemon init for recovery addresses ([#1939](https://github.com/pactus-project/pactus/pull/1939))
- **grpc**: impl gRPC ping api for latency measurement ([#1936](https://github.com/pactus-project/pactus/pull/1936))
- **wallet**: implement check activity on wallet ([#1938](https://github.com/pactus-project/pactus/pull/1938))
- **wallet**: introduce address recovery ([#1934](https://github.com/pactus-project/pactus/pull/1934))
- **state**: calculate the number of active validators ([#1927](https://github.com/pactus-project/pactus/pull/1927))
- **packager**: add rust-jsonrpc package ([#1911](https://github.com/pactus-project/pactus/pull/1911))
- **packager**: add rust-grpc package ([#1909](https://github.com/pactus-project/pactus/pull/1909))
- **consensus**: the Cheetah implementation ([#1858](https://github.com/pactus-project/pactus/pull/1858))
### Fix
- **sync**: set supporting version to 1.9.0 ([#1949](https://github.com/pactus-project/pactus/pull/1949))
- **network**: set deadline for streams ([#1947](https://github.com/pactus-project/pactus/pull/1947))
- **grpc**: set default fee for WalletInfo API ([#1944](https://github.com/pactus-project/pactus/pull/1944))
- **wallet**: use GetAccount API to check active account ([#1945](https://github.com/pactus-project/pactus/pull/1945))
- **grpc**: set required fields in OpenRPC spec ([#1920](https://github.com/pactus-project/pactus/pull/1920))
- **grpc**: define map as object in OpenRPC sepc ([#1910](https://github.com/pactus-project/pactus/pull/1910))
- **network**: set limit for network message size ([#1904](https://github.com/pactus-project/pactus/pull/1904))
- **cbor**: set limit for Map and Array in CBOR decoder ([#1905](https://github.com/pactus-project/pactus/pull/1905))
- **encoding**: prevent data-length attack ([#1907](https://github.com/pactus-project/pactus/pull/1907))
- **gtk**: ensure GTK starts on main thread ([#1885](https://github.com/pactus-project/pactus/pull/1885))
- **gtk**: change fontmap backend for macOS ([#1884](https://github.com/pactus-project/pactus/pull/1884))
- **gtk**: resolve crash issue on MacOs ([#1882](https://github.com/pactus-project/pactus/pull/1882))
### Refactor
- **cmd, gtk**: separate address recovery from node creation flow ([#1964](https://github.com/pactus-project/pactus/pull/1964))
- **util**: use b.Loop() to simplify the code and improve performance ([#1957](https://github.com/pactus-project/pactus/pull/1957))
- **wallet**: re-structure the server list ([#1962](https://github.com/pactus-project/pactus/pull/1962))
- **util**: define terminal package ([#1960](https://github.com/pactus-project/pactus/pull/1960))
- **cmd**: move prompt to util package ([#1958](https://github.com/pactus-project/pactus/pull/1958))
- **crypto**: check BLS aggregate primitive error ([#1956](https://github.com/pactus-project/pactus/pull/1956))
- **network**: use WaitGroup.Go to simplify code ([#1935](https://github.com/pactus-project/pactus/pull/1935))
- **state**: refactor reward transaction ([#1901](https://github.com/pactus-project/pactus/pull/1901))
- **state**: check genesis state using certificate presence ([#1899](https://github.com/pactus-project/pactus/pull/1899))
- **other**: use maps.Copy for cleaner map handling ([#1900](https://github.com/pactus-project/pactus/pull/1900))
## [1.9.0](https://github.com/pactus-project/pactus/compare/v1.8.0...v1.9.0) (2025-09-10)
### Feat
- **grpc**: report current time in node API ([#1864](https://github.com/pactus-project/pactus/pull/1864))
- **state**: update block version on forks ([#1863](https://github.com/pactus-project/pactus/pull/1863))
- **state**: set foundation addresses for split reward ([#1859](https://github.com/pactus-project/pactus/pull/1859))
- **wallet**: set default transaction fee ([#1849](https://github.com/pactus-project/pactus/pull/1849))
- **committee**: check if committee support a protocol version ([#1855](https://github.com/pactus-project/pactus/pull/1855))
- **sync**: set protocol version for proposal message ([#1854](https://github.com/pactus-project/pactus/pull/1854))
- **committee**: calculate committee protocol version percentages ([#1853](https://github.com/pactus-project/pactus/pull/1853))
- **state**: set protocol version for validators ([#1851](https://github.com/pactus-project/pactus/pull/1851))
- **types**: define protocol version ([#1850](https://github.com/pactus-project/pactus/pull/1850))
- **state**: implement PIP-43 ([#1840](https://github.com/pactus-project/pactus/pull/1840))
- **cmd**: add label option for new address command ([#1842](https://github.com/pactus-project/pactus/pull/1842))
### Fix
- **util**: ignore filtered levels ([#1874](https://github.com/pactus-project/pactus/pull/1874))
- **sync**: ignore hello message from outdated nodes ([#1873](https://github.com/pactus-project/pactus/pull/1873))
- **state**: update protocol version for own validators ([#1871](https://github.com/pactus-project/pactus/pull/1871))
- **sync**: banned peer recovery ([#1869](https://github.com/pactus-project/pactus/pull/1869))
- **state**: update block version on enabling fork ([#1866](https://github.com/pactus-project/pactus/pull/1866))
- **sandbox**: remove check height for banned address ([#1868](https://github.com/pactus-project/pactus/pull/1868))
- **state**: check protocol version to enable split-reward fork ([#1857](https://github.com/pactus-project/pactus/pull/1857))
- **cmd**: prevent panic on redownloading chunk ([#1847](https://github.com/pactus-project/pactus/pull/1847))
- **state**: enable soft fork for split reward ([#1846](https://github.com/pactus-project/pactus/pull/1846))
- **cmd**: prompt for label if it is empty ([#1845](https://github.com/pactus-project/pactus/pull/1845))
- **state**: check foundation address in subsidy transaction ([#1844](https://github.com/pactus-project/pactus/pull/1844))
- **wallet**: set Testnet network on upgrading wallet ([#1841](https://github.com/pactus-project/pactus/pull/1841))
- **execution**: remove Ed25519 check ([#1835](https://github.com/pactus-project/pactus/pull/1835))
### Refactor
- **sync**: refactor handshaking protocol ([#1872](https://github.com/pactus-project/pactus/pull/1872))
- **util**: use slices.Equal to simplify code ([#1837](https://github.com/pactus-project/pactus/pull/1837))
- **shell**: rename shell command to interactive ([#1734](https://github.com/pactus-project/pactus/pull/1734))
- **docker**: update go version for Dockerfile ([#1834](https://github.com/pactus-project/pactus/pull/1834))
- **other**: update dependencies ([#1833](https://github.com/pactus-project/pactus/pull/1833))
## [1.8.0](https://github.com/pactus-project/pactus/compare/v1.7.0...v1.8.0) (2025-07-01)
### Feat
- **cmd**: add transport switch in flag start daemon ([#1681](https://github.com/pactus-project/pactus/pull/1681))
- **grpc**: add get raw batch transfer transaction ([#1799](https://github.com/pactus-project/pactus/pull/1799))
- **types**: implement batch transfer payload ([#1793](https://github.com/pactus-project/pactus/pull/1793))
- **packager**: publish jsonrpc packages on release ([#1776](https://github.com/pactus-project/pactus/pull/1776))
- **rest**: define base path for REST APIs ([#1770](https://github.com/pactus-project/pactus/pull/1770))
- **grpc**: define Rest-API server ([#1765](https://github.com/pactus-project/pactus/pull/1765))
- **docs**: add openrpc template and schema ([#1767](https://github.com/pactus-project/pactus/pull/1767))
- **grpc**: support gRPC Web library ([#1762](https://github.com/pactus-project/pactus/pull/1762))
- **jsonrpc**: add CORS support ([#1755](https://github.com/pactus-project/pactus/pull/1755))
- **grpc**: publish `pactus_grpc` package for Python ([#1732](https://github.com/pactus-project/pactus/pull/1732))
- **grpc**: publish `pactus_grpc` package for JS ([#1736](https://github.com/pactus-project/pactus/pull/1736))
- **wallet**: support of AES-256-CBC for the encryption ([#1706](https://github.com/pactus-project/pactus/pull/1706))
- **wallet-cmd**: add Neuter command for wallet ([#1683](https://github.com/pactus-project/pactus/pull/1683))
- **grpc**: add decode raw transaction method ([#1671](https://github.com/pactus-project/pactus/pull/1671))
### Fix
- **execution**: check network type for batch transfer ([#1812](https://github.com/pactus-project/pactus/pull/1812))
- **execution**: set batch transfer height ([#1811](https://github.com/pactus-project/pactus/pull/1811))
- **util**: panic on importing snapshot ([#1807](https://github.com/pactus-project/pactus/pull/1807))
- **sync**: drop messages with mismatched consensus height ([#1810](https://github.com/pactus-project/pactus/pull/1810))
- **firewall**: remove decoding bundle for expired message ([#1682](https://github.com/pactus-project/pactus/pull/1682))
- **util**: replace go-bip39 ([#1795](https://github.com/pactus-project/pactus/pull/1795))
- **wallet**: set Argon2 derived bytes for AES IV ([#1703](https://github.com/pactus-project/pactus/pull/1703))
- **consensus**: schedule timeout to retry querying for the proposal or votes ([#1698](https://github.com/pactus-project/pactus/pull/1698))
- **util**: add manually copy to prevent invalid cross-device link ([#1684](https://github.com/pactus-project/pactus/pull/1684))
### Refactor
- **util**: use the built-in max/min to simplify the code ([#1819](https://github.com/pactus-project/pactus/pull/1819))
- **other**: use slices.Contains to simplify code ([#1802](https://github.com/pactus-project/pactus/pull/1802))
- **www**: rename Rest to HTTP-API ([#1774](https://github.com/pactus-project/pactus/pull/1774))
- **grpc**: update buf.build ([#1716](https://github.com/pactus-project/pactus/pull/1716))
## [1.7.0](https://github.com/pactus-project/pactus/compare/v1.6.0...v1.7.0) (2025-01-23)
### Feat
- **zeromq**: add ZMQ Publishers to NodeInfo API ([#1674](https://github.com/pactus-project/pactus/pull/1674))
- **zeromq**: add publisher raw tx ([#1672](https://github.com/pactus-project/pactus/pull/1672))
- **zeromq**: add publisher raw block ([#1670](https://github.com/pactus-project/pactus/pull/1670))
- **zeromq**: add publisher transaction info ([#1669](https://github.com/pactus-project/pactus/pull/1669))
- **zeromq**: add block info publisher ([#1666](https://github.com/pactus-project/pactus/pull/1666))
- **grpc**: support Ed25519 message signing and verification ([#1667](https://github.com/pactus-project/pactus/pull/1667))
- **other**: add zeromq server with configuration ([#1660](https://github.com/pactus-project/pactus/pull/1660))
- **cmd**: read password from file ([#1653](https://github.com/pactus-project/pactus/pull/1653))
- **network**: evaluate propagate policy for gossip messages ([#1647](https://github.com/pactus-project/pactus/pull/1647))
- **config**: add firewall module to logger config ([#1637](https://github.com/pactus-project/pactus/pull/1637))
### Fix
- **gtk**: panic on windows 11 and mac ([#1650](https://github.com/pactus-project/pactus/pull/1650))
- **consensus**: refactor strong termination for change-proposer phase ([#1643](https://github.com/pactus-project/pactus/pull/1643))
- **network**: restore default message queue size in PubSub module ([#1642](https://github.com/pactus-project/pactus/pull/1642))
- **consensus**: refactor strong termination for change-proposer phase ([#1641](https://github.com/pactus-project/pactus/pull/1641))
- **grpc**: define address for the aggregated public key ([#1608](https://github.com/pactus-project/pactus/pull/1608))
- **gtk**: last block height icon ([#1611](https://github.com/pactus-project/pactus/pull/1611))
- **crypto, state**: resolve panic on 32-bit OSes ([#1604](https://github.com/pactus-project/pactus/pull/1604))
- **cmd**: parse withdraw fee using transaction options ([#1602](https://github.com/pactus-project/pactus/pull/1602))
## [1.6.0](https://github.com/pactus-project/pactus/compare/v1.5.0...v1.6.0) (2024-11-14)
### Feat
- **grpc**: add bls public key and signature aggregate methods ([#1587](https://github.com/pactus-project/pactus/pull/1587))
- **wallet**: create single ed25519 reward address for all validators ([#1570](https://github.com/pactus-project/pactus/pull/1570))
- **gtk**: add fee entry for transfer, bond and withdraw ([#1575](https://github.com/pactus-project/pactus/pull/1575))
- **txpool**: add consumptional fee model ([#1572](https://github.com/pactus-project/pactus/pull/1572))
- **txpool**: calculate consumption when committing a new block ([#1554](https://github.com/pactus-project/pactus/pull/1554))
- **sync**: add metric to track the network activity ([#1552](https://github.com/pactus-project/pactus/pull/1552))
- **wallet**: add wallet service API ([#1548](https://github.com/pactus-project/pactus/pull/1548))
- **config**: add consumption fee configs ([#1547](https://github.com/pactus-project/pactus/pull/1547))
### Fix
- **config**: update TOML parser ([#1592](https://github.com/pactus-project/pactus/pull/1592))
- **gtk**: prevent duplicate address on enter signal in create modal ([#1590](https://github.com/pactus-project/pactus/pull/1590))
- **txpool, cmd, gtk**: broadcast transactions with zero fee ([#1589](https://github.com/pactus-project/pactus/pull/1589))
- **consensus**: send decided vote for previous round on query vote ([#1567](https://github.com/pactus-project/pactus/pull/1567))
- **grpc**: get tx pool content filter by payload type ([#1581](https://github.com/pactus-project/pactus/pull/1581))
- **wallet, cmd**: add support for importing Ed25519 private keys ([#1584](https://github.com/pactus-project/pactus/pull/1584))
- **gtk**: change transactions to transaction in tx link ([#1580](https://github.com/pactus-project/pactus/pull/1580))
- **grpc**: set Bond public key for decoded transaction ([#1577](https://github.com/pactus-project/pactus/pull/1577))
- **other**: add varnamelen linter to improve name convention ([#1568](https://github.com/pactus-project/pactus/pull/1568))
- **grpc**: encode data and signature properly ([#1538](https://github.com/pactus-project/pactus/pull/1538))
- **gtk**: change some text in GUI and pruned position ([#1536](https://github.com/pactus-project/pactus/pull/1536))
### Refactor
- **cmd**: get first account address from wallet as reward address ([#1594](https://github.com/pactus-project/pactus/pull/1594))
- **grpc**: revert GetRawTransfer method and undo deprecation ([#1560](https://github.com/pactus-project/pactus/pull/1560))
- **crypto**: define SerializeSize for PublicKey and Signature ([#1534](https://github.com/pactus-project/pactus/pull/1534))
## [1.5.0](https://github.com/pactus-project/pactus/compare/v1.4.0...v1.5.0) (2024-10-08)
### Feat
- **cmd**: pactus-wallet add info commands ([#1496](https://github.com/pactus-project/pactus/pull/1496))
- **state**: enable Ed25519 for the Testnet ([#1497](https://github.com/pactus-project/pactus/pull/1497))
- **gtk**: support create Ed25519 in gtk ([#1489](https://github.com/pactus-project/pactus/pull/1489))
- **grpc**: add Ed25519 to AddressType proto ([#1492](https://github.com/pactus-project/pactus/pull/1492))
- **wallet**: upgrade wallet ([#1491](https://github.com/pactus-project/pactus/pull/1491))
- **wallet**: supporting Ed25519 curve in wallet ([#1484](https://github.com/pactus-project/pactus/pull/1484))
- **grpc**: add `Proposal` to `ConsensusInfo` API ([#1469](https://github.com/pactus-project/pactus/pull/1469))
- **crypto**: supporting ed25519 ([#1481](https://github.com/pactus-project/pactus/pull/1481))
- **gtk**: adding IsPrune to node widget ([#1470](https://github.com/pactus-project/pactus/pull/1470))
- **daemon**: warn at pruning a prune node attempt ([#1471](https://github.com/pactus-project/pactus/pull/1471))
- **genesis**: separating chain param from genesis param ([#1463](https://github.com/pactus-project/pactus/pull/1463))
- **cmd**: pactus-shell support interactive shell ([#1460](https://github.com/pactus-project/pactus/pull/1460))
### Fix
- **gtk**: increase window width to show availability score ([#1529](https://github.com/pactus-project/pactus/pull/1529))
- **state**: set hard-fork height for the mainnet ([#1528](https://github.com/pactus-project/pactus/pull/1528))
- **wallet**: change to prompt password for masking ([#1527](https://github.com/pactus-project/pactus/pull/1527))
- **deps**: go version docker image to build go v1.23.2 ([#1522](https://github.com/pactus-project/pactus/pull/1522))
- **network**: close stream on timeout ([#1520](https://github.com/pactus-project/pactus/pull/1520))
- **http**: add pprof link in http web interface ([#1518](https://github.com/pactus-project/pactus/pull/1518))
- **sync**: close stream on read error ([#1519](https://github.com/pactus-project/pactus/pull/1519))
- **sync**: set last support version to 1.5.0 ([#1517](https://github.com/pactus-project/pactus/pull/1517))
- **http**: pprof in http server ([#1515](https://github.com/pactus-project/pactus/pull/1515))
- **cmd**: add flag debug to enable pprof ([#1512](https://github.com/pactus-project/pactus/pull/1512))
- **cmd**: add pprof as default in http server ([#1511](https://github.com/pactus-project/pactus/pull/1511))
- **grpc**: merge raw transaction methods to one rpc method ([#1500](https://github.com/pactus-project/pactus/pull/1500))
- **wallet, cmd**: adding ed25519_account in help and set as default ([#1485](https://github.com/pactus-project/pactus/pull/1485))
- **wallet**: add memo in confirmation wallet CLI ([#1499](https://github.com/pactus-project/pactus/pull/1499))
- **store**: cache Ed25519 Public Keys ([#1495](https://github.com/pactus-project/pactus/pull/1495))
- **grpc**: adding pyi files for python generated files ([#1479](https://github.com/pactus-project/pactus/pull/1479))
- **grpc**: change enum type to numeric for documentation ([#1474](https://github.com/pactus-project/pactus/pull/1474))
- **shell**: stop showing usage on error ([#1467](https://github.com/pactus-project/pactus/pull/1467))
- **util**: chunked download to improve download speed ([#1459](https://github.com/pactus-project/pactus/pull/1459))
- **gtk**: width size of listbox and download button ([#1434](https://github.com/pactus-project/pactus/pull/1434))
- **grpc**: add example json-rpc in generated doc ([#1461](https://github.com/pactus-project/pactus/pull/1461))
- **grpc**: add basic check for grpc configuration to check basic auth ([#1455](https://github.com/pactus-project/pactus/pull/1455))
- **util**: remove util.Now helper function ([#1442](https://github.com/pactus-project/pactus/pull/1442))
### Refactor
- **crypto**: replace bls12-381 kilic with gnark ([#1510](https://github.com/pactus-project/pactus/pull/1510))
- **crypto**: define errors for crypto package ([#1507](https://github.com/pactus-project/pactus/pull/1507))
- **sync**: define errors for sync package ([#1504](https://github.com/pactus-project/pactus/pull/1504))
- **types**: define errors for vote package ([#1503](https://github.com/pactus-project/pactus/pull/1503))
- **state**: define errors for state package ([#1457](https://github.com/pactus-project/pactus/pull/1457))
- **util**: remove GenericError code ([#1454](https://github.com/pactus-project/pactus/pull/1454))
- **types**: using options pattern for memo parameter on new tx functions ([#1443](https://github.com/pactus-project/pactus/pull/1443))
## [1.4.0](https://github.com/pactus-project/pactus/compare/v1.3.0...v1.4.0) (2024-08-01)
### Feat
- **cmd**: add node type page to the startup assistant ([#1431](https://github.com/pactus-project/pactus/pull/1431))
- **grpc**: adding is-pruned and pruning-height to blockchain info API ([#1420](https://github.com/pactus-project/pactus/pull/1420))
- **daemon**: add import command to download pruned snapshots ([#1424](https://github.com/pactus-project/pactus/pull/1424))
- **util**: file downloader with verify sha256 hash ([#1422](https://github.com/pactus-project/pactus/pull/1422))
- **sync**: define full and prune service ([#1412](https://github.com/pactus-project/pactus/pull/1412))
- **pip**: implement PIP-23 ([#1397](https://github.com/pactus-project/pactus/pull/1397))
- **firewall**: check valid gossip and stream messages ([#1402](https://github.com/pactus-project/pactus/pull/1402))
- **state**: prune block on commit ([#1404](https://github.com/pactus-project/pactus/pull/1404))
- **core**: pruning client by prune command ([#1400](https://github.com/pactus-project/pactus/pull/1400))
- **store**: prune block function ([#1399](https://github.com/pactus-project/pactus/pull/1399))
- **wallet**: add timeout client connection ([#1396](https://github.com/pactus-project/pactus/pull/1396))
- add backup tool script ([#1373](https://github.com/pactus-project/pactus/pull/1373))
### Fix
- **consensus**: handle query for decided proposal ([#1438](https://github.com/pactus-project/pactus/pull/1438))
- **gtk**: solve dynamic library dependencies and import path on macOS ([#1435](https://github.com/pactus-project/pactus/pull/1435))
- **cmd**: prevent sudden crash on download error ([#1432](https://github.com/pactus-project/pactus/pull/1432))
- **store**: pruning height returns zero when store is not in prune mode ([#1430](https://github.com/pactus-project/pactus/pull/1430))
- **grpc**: add last-block-time to blockchain-info API ([#1428](https://github.com/pactus-project/pactus/pull/1428))
- **grpc**: show negative pruning height when is pruned false ([#1429](https://github.com/pactus-project/pactus/pull/1429))
- **sync**: fix syncing issue on prune mode ([#1415](https://github.com/pactus-project/pactus/pull/1415))
- **grpc**: return error on invalid arguments for VerifyMessage ([#1411](https://github.com/pactus-project/pactus/pull/1411))
- **network**: accept messages originating from self ([#1408](https://github.com/pactus-project/pactus/pull/1408))
- change wallet rpc ip to dns address ([#1398](https://github.com/pactus-project/pactus/pull/1398))
- **pactus-shell**: pactus shell support basic auth ([#1384](https://github.com/pactus-project/pactus/pull/1384))
- **gui**: support ctrl+c for interrupt gui ([#1385](https://github.com/pactus-project/pactus/pull/1385))
- **grpc**: add basic auth in swagger header ([#1383](https://github.com/pactus-project/pactus/pull/1383))
### Refactor
- **execution**: simplify executors and tests ([#1425](https://github.com/pactus-project/pactus/pull/1425))
## [1.3.0](https://github.com/pactus-project/pactus/compare/v1.2.0...v1.3.0) (2024-06-27)
### Feat
- **grpc**: get txpool content API ([#1364](https://github.com/pactus-project/pactus/pull/1364))
- **network**: permanent peer store ([#1354](https://github.com/pactus-project/pactus/pull/1354))
### Fix
- **grpc**: change bytes type to hex string ([#1371](https://github.com/pactus-project/pactus/pull/1371))
- **http**: add basic auth middleware for http server ([#1372](https://github.com/pactus-project/pactus/pull/1372))
- **network**: use goroutines for sending streams ([#1365](https://github.com/pactus-project/pactus/pull/1365))
## [1.2.0](https://github.com/pactus-project/pactus/compare/v1.1.0...v1.2.0) (2024-06-20)
### Feat
- **config**: make minimum fee configurable ([#1349](https://github.com/pactus-project/pactus/pull/1349))
- apply rate limit for the network topics ([#1332](https://github.com/pactus-project/pactus/pull/1332))
- add ipblocker package ([#1323](https://github.com/pactus-project/pactus/pull/1323))
- **consensus**: fast consensus path implementation ([#1253](https://github.com/pactus-project/pactus/pull/1253))
- **version**: add alias to node version ([#1281](https://github.com/pactus-project/pactus/pull/1281))
- **ntp**: add ntp util ([#1274](https://github.com/pactus-project/pactus/pull/1274))
- **gRPC**: add connection info to node info ([#1273](https://github.com/pactus-project/pactus/pull/1273))
- **gRPC**: add only_connected parameter to getNetworkInfo API ([#1264](https://github.com/pactus-project/pactus/pull/1264))
- **grpc**: refactor CreateWallet and add RestoreWallet API endpoint ([#1256](https://github.com/pactus-project/pactus/pull/1256))
- add wallet service ([#1241](https://github.com/pactus-project/pactus/pull/1241))
- ban attacker validators ([#1235](https://github.com/pactus-project/pactus/pull/1235))
- **txpool**: prevent spamming transactions by defining a minimum value ([#1233](https://github.com/pactus-project/pactus/pull/1233))
- reject direct message from non-supporting agents ([#1225](https://github.com/pactus-project/pactus/pull/1225))
### Fix
- **wallet**: add public key on get new address ([#1350](https://github.com/pactus-project/pactus/pull/1350))
- **sync**: add IsBannedAddress check in processing connect event ([#1347](https://github.com/pactus-project/pactus/pull/1347))
- **sync**: update latest supporting version ([#1336](https://github.com/pactus-project/pactus/pull/1336))
- **state**: improve node startup by optimizing availability score calculation ([#1338](https://github.com/pactus-project/pactus/pull/1338))
- **HTTP**: add clock offset and connection info to node-info API ([#1334](https://github.com/pactus-project/pactus/pull/1334))
- **grpc**: add stacktrace to locate panic ([#1333](https://github.com/pactus-project/pactus/pull/1333))
- **consensus**: implement PIP-26 ([#1331](https://github.com/pactus-project/pactus/pull/1331))
- **grpc**: improve grpc server and client ([#1330](https://github.com/pactus-project/pactus/pull/1330))
- **util**: add more ntp pool ([#1328](https://github.com/pactus-project/pactus/pull/1328))
- **jsonrpc**: update JSON-RPC Gateway to support headers and improve client registry ([#1327](https://github.com/pactus-project/pactus/pull/1327))
- **consensus**: improve consensus alghorithm ([#1329](https://github.com/pactus-project/pactus/pull/1329))
- **txpool**: set fix fee of 0.1 PAC for transactions ([#1320](https://github.com/pactus-project/pactus/pull/1320))
- **network**: add block and transaction topics ([#1319](https://github.com/pactus-project/pactus/pull/1319))
- **gRPC**: prevent concurrent map iteration and map write ([#1279](https://github.com/pactus-project/pactus/pull/1279))
- **api**: add swagger schemes ([#1270](https://github.com/pactus-project/pactus/pull/1270))
- **network**: set infinite limit for resource manager ([#1261](https://github.com/pactus-project/pactus/pull/1261))
- **sync**: introduce session manager ([#1257](https://github.com/pactus-project/pactus/pull/1257))
- **HTTP**: using amount type for fee in transaction details ([#1255](https://github.com/pactus-project/pactus/pull/1255))
- **network**: disconnect from peers that has no protocol ([#1243](https://github.com/pactus-project/pactus/pull/1243))
- **wallet**: saving wallet file after generating new address in gRPC ([#1236](https://github.com/pactus-project/pactus/pull/1236))
- prevent zero stake for bond transactions ([#1227](https://github.com/pactus-project/pactus/pull/1227))
- set bounding interval for first boudning tx only ([#1224](https://github.com/pactus-project/pactus/pull/1224))
### Refactor
- **wallet**: set server address on loading wallet ([#1348](https://github.com/pactus-project/pactus/pull/1348))
- removed deprecated LockWallet and UnLockWallet from WalletService ([#1343](https://github.com/pactus-project/pactus/pull/1343))
- **crypto**: decode data to point on verification ([#1339](https://github.com/pactus-project/pactus/pull/1339))
- **network**: define connection info in network proto ([#1297](https://github.com/pactus-project/pactus/pull/1297))
- **sync**: define peer package ([#1271](https://github.com/pactus-project/pactus/pull/1271))
- **network**: refactor peer manager and redefine the min cons ([#1259](https://github.com/pactus-project/pactus/pull/1259))
## [1.1.0](https://github.com/pactus-project/pactus/compare/v1.0.0...v1.1.0) (2024-04-14)
### Feat
- **gRPC**: add get address history method ([#1206](https://github.com/pactus-project/pactus/pull/1206))
- **grpc**: Add GetNewAddress/GetTotalBalance endpoint to gateway ([#1197](https://github.com/pactus-project/pactus/pull/1197))
- **GUI**: adding total balance to wallet widget ([#1194](https://github.com/pactus-project/pactus/pull/1194))
- Add GetNewAddress gRPC API ([#1193](https://github.com/pactus-project/pactus/pull/1193))
- **gRPC**: add new API to get the total balance of wallet ([#1190](https://github.com/pactus-project/pactus/pull/1190))
- **GUI**: showing transaction hash after broadcasting transaction ([#1187](https://github.com/pactus-project/pactus/pull/1187))
- add jsonrpc gateway support ([#1183](https://github.com/pactus-project/pactus/pull/1183))
- **config**: one reward address in config for all validators ([#1178](https://github.com/pactus-project/pactus/pull/1178))
- **GUI**: memo field for transactions on GUI wallet ([#1182](https://github.com/pactus-project/pactus/pull/1182))
- implement basic auth for pactus shell ([#1177](https://github.com/pactus-project/pactus/pull/1177))
- **grpc**: add rust code gen for proto ([#1151](https://github.com/pactus-project/pactus/pull/1151))
- **testnet**: define permanent Testent genesis ([#1173](https://github.com/pactus-project/pactus/pull/1173))
- add basic auth authentication for securing grpc ([#1162](https://github.com/pactus-project/pactus/pull/1162))
- **grpc**: calculate fee for create-raw-transaction APIs ([#1159](https://github.com/pactus-project/pactus/pull/1159))
- **grpc**: add fixed-amount to calc-fee API ([#1146](https://github.com/pactus-project/pactus/pull/1146))
- **wallet**: adding all account address functions ([#1128](https://github.com/pactus-project/pactus/pull/1128))
- **grpc**: update swagger API to version 1.1 ([#1106](https://github.com/pactus-project/pactus/pull/1106))
- **GUI**: adding availability score in wallet ([#1118](https://github.com/pactus-project/pactus/pull/1118))
- **logger**: adding log target ([#1122](https://github.com/pactus-project/pactus/pull/1122))
- **logger**: adding file_only option ([#1117](https://github.com/pactus-project/pactus/pull/1117))
- **gui**: add connections and moniker fields to main windows ([#1090](https://github.com/pactus-project/pactus/pull/1090))
- implementation for PIP-22 ([#1067](https://github.com/pactus-project/pactus/pull/1067))
- generate documentation for proto files ([#1064](https://github.com/pactus-project/pactus/pull/1064))
- pactus-ctl ([#946](https://github.com/pactus-project/pactus/pull/946))
### Fix
- **cmd**: ignore error on balance query ([#1220](https://github.com/pactus-project/pactus/pull/1220))
- **gRPC**: add basic auth option in header ([#1217](https://github.com/pactus-project/pactus/pull/1217))
- **gRPC**: not return block data on information verbosity ([#1212](https://github.com/pactus-project/pactus/pull/1212))
- **wallet**: fix wallet conn issue ([#1211](https://github.com/pactus-project/pactus/pull/1211))
- **GUI**: update total balance on wallet timeout ([#1204](https://github.com/pactus-project/pactus/pull/1204))
- accept small bond to existing validator ([#1152](https://github.com/pactus-project/pactus/pull/1152))
- **GUI**: make transaction hash selactable ([#1196](https://github.com/pactus-project/pactus/pull/1196))
- close connections with peers that have no supported protocol ([#1181](https://github.com/pactus-project/pactus/pull/1181))
- **sync**: check the start block request height ([#1176](https://github.com/pactus-project/pactus/pull/1176))
- **config**: load logger levels in Mainnet config ([#1168](https://github.com/pactus-project/pactus/pull/1168))
- **gRPC**: pactus swagger not found ([#1163](https://github.com/pactus-project/pactus/pull/1163))
- add error type for invalid configs ([#1153](https://github.com/pactus-project/pactus/pull/1153))
- save Mainnet config with inline comments ([#1143](https://github.com/pactus-project/pactus/pull/1143))
- **network**: set deadline for streams ([#1149](https://github.com/pactus-project/pactus/pull/1149))
- **grpc**: fix error 404 on grpc gateway ([#1144](https://github.com/pactus-project/pactus/pull/1144))
- **wallet**: checking args in history add ([#1141](https://github.com/pactus-project/pactus/pull/1141))
- **gRPC**: adding sign raw transaction API to gateway ([#1116](https://github.com/pactus-project/pactus/pull/1116))
- **sync**: fix concurrent map read-write crash ([#1112](https://github.com/pactus-project/pactus/pull/1112))
- **network**: remove disconnected peers from peerMgr ([#1110](https://github.com/pactus-project/pactus/pull/1110))
- **network**: set dial and accept limit in connection gater ([#1089](https://github.com/pactus-project/pactus/pull/1089))
- stderr logger in windows os ([#1081](https://github.com/pactus-project/pactus/pull/1081))
- **sync**: improve syncing process ([#1087](https://github.com/pactus-project/pactus/pull/1087))
- **network**: redefine resource limits ([#1086](https://github.com/pactus-project/pactus/pull/1086))
### Refactor
- **sync**: improve syncing process ([#1207](https://github.com/pactus-project/pactus/pull/1207))
- move fee calculation logic to execution package ([#1195](https://github.com/pactus-project/pactus/pull/1195))
- introduce Amount data type for converting PAC units ([#1174](https://github.com/pactus-project/pactus/pull/1174))
- using PAC instead of atomic units for external input/outputs ([#1161](https://github.com/pactus-project/pactus/pull/1161))
- change func() to cancel func type ([#1142](https://github.com/pactus-project/pactus/pull/1142))
## [1.0.0](https://github.com/pactus-project/pactus/compare/v0.20.0...v1.0.0) (2024-01-31)
### Feat
- implement get validator address for grpc ([#975](https://github.com/pactus-project/pactus/pull/975))
- add bootstrap.json and load in config on build ([#964](https://github.com/pactus-project/pactus/pull/964))
- add mainnet config and genesis files ([#951](https://github.com/pactus-project/pactus/pull/951))
- add Consensus-address to network info ([#952](https://github.com/pactus-project/pactus/pull/952))
- **grpc**: sign transaction using wallet client ([#945](https://github.com/pactus-project/pactus/pull/945))
- pactus gui lock support ([#947](https://github.com/pactus-project/pactus/pull/947))
- **consensus**: turning consensus to a zero-config module ([#942](https://github.com/pactus-project/pactus/pull/942))
### Fix
- localnet wallet issue ([#970](https://github.com/pactus-project/pactus/pull/970))
- **sync**: remove ReachabilityStatus from agent info ([#956](https://github.com/pactus-project/pactus/pull/956))
- **daemon**: keeping previous behavior for password flag, linting CLI messages ([#950](https://github.com/pactus-project/pactus/pull/950))
- **consensus**: detect if the system time is behind the network ([#939](https://github.com/pactus-project/pactus/pull/939))
## [0.20.0](https://github.com/pactus-project/pactus/compare/v0.19.0...v0.20.0) (2024-01-11)
### Feat
- implement relay service ([#931](https://github.com/pactus-project/pactus/pull/931))
- **HTTP**: Integrate AddRowDouble and update tests ([#926](https://github.com/pactus-project/pactus/pull/926))
- **network**: making listen address private in config ([#921](https://github.com/pactus-project/pactus/pull/921))
- **http**: adding AvailabilityScore to http module ([#917](https://github.com/pactus-project/pactus/pull/917))
- **network**: adding 'enable_udp' config ([#918](https://github.com/pactus-project/pactus/pull/918))
- **network**: removing gossip node service ([#916](https://github.com/pactus-project/pactus/pull/916))
- **gRPC**: adding AvailabilityScore to gRPC ([#910](https://github.com/pactus-project/pactus/pull/910))
- **GUI**: unbond and withdraw transaction dialogs ([#908](https://github.com/pactus-project/pactus/pull/908))
### Fix
- **gRPC**: adding missing get raw transaction APIs to gRPC gateway ([#925](https://github.com/pactus-project/pactus/pull/925))
- **network**: preventing self dial ([#924](https://github.com/pactus-project/pactus/pull/924))
- fixing time lag on starting node ([#923](https://github.com/pactus-project/pactus/pull/923))
- **network**: fixing network deadlock on linux arm64 ([#922](https://github.com/pactus-project/pactus/pull/922))
- **GUI**: updating unbond and withdraw dialogs ([#911](https://github.com/pactus-project/pactus/pull/911))
- fixing gRPC node info issue ([#906](https://github.com/pactus-project/pactus/pull/906))
## [0.19.0](https://github.com/pactus-project/pactus/compare/v0.18.0...v0.19.0) (2024-01-04)
### Feat
- **gRPC**: defining network and peers info response's properly ([#898](https://github.com/pactus-project/pactus/pull/898))
- implementing pip-19 ([#899](https://github.com/pactus-project/pactus/pull/899))
- **network**: disabling GosipSub, only FloodSub ([#895](https://github.com/pactus-project/pactus/pull/895))
- **www**: adding change proposer round and value to consensus info votes ([#892](https://github.com/pactus-project/pactus/pull/892))
- **network**: adding relay service to dial relay nodes ([#887](https://github.com/pactus-project/pactus/pull/887))
- implementing pip-15 ([#843](https://github.com/pactus-project/pactus/pull/843))
- check already running by lock file ([#871](https://github.com/pactus-project/pactus/pull/871))
### Fix
- **store**: use cache to check if public key exists ([#902](https://github.com/pactus-project/pactus/pull/902))
- **executor**: not rejecting bond transaction for bootstrap validator ([#901](https://github.com/pactus-project/pactus/pull/901))
- **GUI**: removing unnecessary tags in transaction confirm dialog ([#893](https://github.com/pactus-project/pactus/pull/893))
- **network**: close relay connection for public node ([#891](https://github.com/pactus-project/pactus/pull/891))
- **network**: refining GossipSubParams for Gossiper node ([#882](https://github.com/pactus-project/pactus/pull/882))
- **sync**: adding sequence number to the bundle ([#881](https://github.com/pactus-project/pactus/pull/881))
- **network**: turn off mesh for gossiper node ([#880](https://github.com/pactus-project/pactus/pull/880))
- **consensus**: check voteset for CP strong termination ([#879](https://github.com/pactus-project/pactus/pull/879))
- adding querier to query messages ([#878](https://github.com/pactus-project/pactus/pull/878))
- **execution**: fixing issue #869 ([#870](https://github.com/pactus-project/pactus/pull/870))
- fixing logger issue on rotating log file ([#859](https://github.com/pactus-project/pactus/pull/859))
## [0.18.0](https://github.com/pactus-project/pactus/compare/v0.17.0...v0.18.0) (2023-12-11)
### Feat
- implement pip-14 ([#841](https://github.com/pactus-project/pactus/pull/841))
- sort wallet addresses ([#836](https://github.com/pactus-project/pactus/pull/836))
- **grpc**: endpoints for creating raw transaction ([#838](https://github.com/pactus-project/pactus/pull/838))
- network reachability API ([#834](https://github.com/pactus-project/pactus/pull/834))
- implement pip-13 ([#835](https://github.com/pactus-project/pactus/pull/835))
- subscribing to libp2p eventbus ([#831](https://github.com/pactus-project/pactus/pull/831))
- implement helper methods for wallet address path ([#830](https://github.com/pactus-project/pactus/pull/830))
- **logger**: adding rotate log file after days, compress and max backups for logger config ([#822](https://github.com/pactus-project/pactus/pull/822))
- enable bandwidth router metric ([#819](https://github.com/pactus-project/pactus/pull/819))
### Fix
- **network**: refining the connection limit ([#849](https://github.com/pactus-project/pactus/pull/849))
- corrected mistake when retrieving the reward address ([#848](https://github.com/pactus-project/pactus/pull/848))
- **config**: restore default config when it is deleted ([#847](https://github.com/pactus-project/pactus/pull/847))
- **cmd**: changing home directory for root users ([#846](https://github.com/pactus-project/pactus/pull/846))
- removing BasicCheck for hash ([#845](https://github.com/pactus-project/pactus/pull/845))
- disabling libp2p ping protocol ([#844](https://github.com/pactus-project/pactus/pull/844))
- build docker file ([#839](https://github.com/pactus-project/pactus/pull/839))
- **sync**: ignore publishing a block if it is received before ([#829](https://github.com/pactus-project/pactus/pull/829))
- **network**: subscribing to the Libp2p event bus ([#828](https://github.com/pactus-project/pactus/pull/828))
- **sync**: ignore block request if blocks are already inside the cache ([#817](https://github.com/pactus-project/pactus/pull/817))
## [0.17.0](https://github.com/pactus-project/pactus/compare/v0.16.0...v0.17.0) (2023-11-12)
### Feat
- **network**: default configs for bootstrap and relay peers ([#812](https://github.com/pactus-project/pactus/pull/812))
- introducing node gossip type ([#811](https://github.com/pactus-project/pactus/pull/811))
- **sync**: adding remote address to the peer info ([#804](https://github.com/pactus-project/pactus/pull/804))
- **network**: adding public address to factory ([#795](https://github.com/pactus-project/pactus/pull/795))
- **network**: filter private ips ([#793](https://github.com/pactus-project/pactus/pull/793))
### Fix
- upgrading Testnet ([#814](https://github.com/pactus-project/pactus/pull/814))
- **sync**: prevent opening sessions indefinitely ([#813](https://github.com/pactus-project/pactus/pull/813))
- **execution**: fixing mistake on calculating unbonded power ([#806](https://github.com/pactus-project/pactus/pull/806))
- **network**: check connection threshold on gater ([#803](https://github.com/pactus-project/pactus/pull/803))
- **network**: no transient connection ([#799](https://github.com/pactus-project/pactus/pull/799))
- not close connection for bootstrap nodes ([#792](https://github.com/pactus-project/pactus/pull/792))
### Refactor
- **sync**: refactoring sync process ([#807](https://github.com/pactus-project/pactus/pull/807))
## [0.16.0](https://github.com/pactus-project/pactus/compare/v0.15.0...v0.16.0) (2023-10-29)
### Feat
- **gui**: display network ID ([#780](https://github.com/pactus-project/pactus/pull/780))
- create new validator address (CLI and GUI) ([#757](https://github.com/pactus-project/pactus/pull/757))
- add community bootstrap nodes to testnet config ([#764](https://github.com/pactus-project/pactus/pull/764))
- **network**: implementing connection manager ([#773](https://github.com/pactus-project/pactus/pull/773))
- **network**: adding bootstrapper mode to the network config ([#760](https://github.com/pactus-project/pactus/pull/760))
### Fix
- **network**: redefine the network limits ([#788](https://github.com/pactus-project/pactus/pull/788))
- **consensus**: not increase the vote-box power on duplicated votes ([#785](https://github.com/pactus-project/pactus/pull/785))
- **network**: close connection when unbale to get supported protocols ([#781](https://github.com/pactus-project/pactus/pull/781))
- **network**: enabling peer exchange for bootstrappers ([#779](https://github.com/pactus-project/pactus/pull/779))
- **network**: set connection limit for the resource manager ([#775](https://github.com/pactus-project/pactus/pull/775))
- **sync**: peer status set to known on sucessfull handshaking ([#774](https://github.com/pactus-project/pactus/pull/774))
- **consensus**: strong termination for the binary agreement ([#765](https://github.com/pactus-project/pactus/pull/765))
- **consensus**: not increase the voting power on duplicated binary votes ([#762](https://github.com/pactus-project/pactus/pull/762))
### Refactor
- **network**: refactoring peer manager ([#787](https://github.com/pactus-project/pactus/pull/787))
## [0.15.0](https://github.com/pactus-project/pactus/compare/v0.13.0...v0.15.0) (2023-10-15)
### Feat
- **gui**: adding the splash screen ([#743](https://github.com/pactus-project/pactus/pull/743))
- add absentees votes to the certificate ([#746](https://github.com/pactus-project/pactus/pull/746))
- **logger**: short stringer for loggers ([#732](https://github.com/pactus-project/pactus/pull/732))
- implementing pip-7 ([#731](https://github.com/pactus-project/pactus/pull/731))
- implementing pip-11 ([#712](https://github.com/pactus-project/pactus/pull/712))
- implementing pip-8 ([#711](https://github.com/pactus-project/pactus/pull/711))
- implementing pip-9 ([#706](https://github.com/pactus-project/pactus/pull/706))
- new API to get Public key by address ([#704](https://github.com/pactus-project/pactus/pull/704))
- Adding address field for AccountInfo ([#703](https://github.com/pactus-project/pactus/pull/703))
- CreateValidatorEvent and CreateAccountEvent for nanomsg ([#702](https://github.com/pactus-project/pactus/pull/702))
- implementing PIP-2 and PIP-3 ([#699](https://github.com/pactus-project/pactus/pull/699))
- Adding Hole Punching to network ([#697](https://github.com/pactus-project/pactus/pull/697))
- write logs into file ([#673](https://github.com/pactus-project/pactus/pull/673))
- check protocol support before sending connect/disconnect event ([#683](https://github.com/pactus-project/pactus/pull/683))
- updating genesis for pre-testnet-2 ([#679](https://github.com/pactus-project/pactus/pull/679))
- adding udp protocol for network ([#672](https://github.com/pactus-project/pactus/pull/672))
- implementing pip-4 ([#671](https://github.com/pactus-project/pactus/pull/671))
- Notifee service events ([#628](https://github.com/pactus-project/pactus/pull/628))
- adding MinimumStake parameter ([#574](https://github.com/pactus-project/pactus/pull/574))
- adding Sent and Received bytes per message metrics for peers ([#618](https://github.com/pactus-project/pactus/pull/618))
- add reason to BlockResponse messages ([#607](https://github.com/pactus-project/pactus/pull/607))
- Add CalcualteFee in GRPC ([#601](https://github.com/pactus-project/pactus/pull/601))
- add sent bytes and received bytes metrics to peerset plus update grpc ([#606](https://github.com/pactus-project/pactus/pull/606))
- added metrics of libp2p with supporting prometheus ([#588](https://github.com/pactus-project/pactus/pull/588))
- Check node address is valid ([#565](https://github.com/pactus-project/pactus/pull/565))
- add LastSent and LastReceived properties to peer ([#569](https://github.com/pactus-project/pactus/pull/569))
### Fix
- data race issue on updating certificate ([#747](https://github.com/pactus-project/pactus/pull/747))
- **network**: async connection ([#744](https://github.com/pactus-project/pactus/pull/744))
- adding query vote timer for CP phase ([#738](https://github.com/pactus-project/pactus/pull/738))
- trim transactions in proposed block ([#737](https://github.com/pactus-project/pactus/pull/737))
- fixing query votes and proposal issue ([#736](https://github.com/pactus-project/pactus/pull/736))
- fixing issue when a block has max transactions ([#735](https://github.com/pactus-project/pactus/pull/735))
- **consensus**: anti-entroy mechanism for the consensus ([#734](https://github.com/pactus-project/pactus/pull/734))
- **logger**: invalid level parsing error ([#733](https://github.com/pactus-project/pactus/pull/733))
- cache certificate by height ([#730](https://github.com/pactus-project/pactus/pull/730))
- fixing a crash on consensus ([#729](https://github.com/pactus-project/pactus/pull/729))
- **consensus**: prevent double entry in new height ([#728](https://github.com/pactus-project/pactus/pull/728))
- resolve consensus halt caused by time discrepancy in network. ([#727](https://github.com/pactus-project/pactus/pull/727))
- unsorted addresses in wallet listing ([#721](https://github.com/pactus-project/pactus/pull/721))
- send query votes message, if there is no proposal yet ([#723](https://github.com/pactus-project/pactus/pull/723))
- fixing logger level issue ([#722](https://github.com/pactus-project/pactus/pull/722))
- fixing syncing stuck issue ([#720](https://github.com/pactus-project/pactus/pull/720))
- fixing some minor issues on pre-testnet ([#719](https://github.com/pactus-project/pactus/pull/719))
- supporting go version 1.21 and higher ([#692](https://github.com/pactus-project/pactus/pull/692))
- ensure log rotation using tests ([#693](https://github.com/pactus-project/pactus/pull/693))
- restoring at the first block ([#691](https://github.com/pactus-project/pactus/pull/691))
- swagger doesn't work with multiple proto files ([#687](https://github.com/pactus-project/pactus/pull/687))
- fixing wallet-cli issues ([#686](https://github.com/pactus-project/pactus/pull/686))
- prevent stripping public key for subsidy transactions ([#678](https://github.com/pactus-project/pactus/pull/678))
- updating the consensus protocol ([#668](https://github.com/pactus-project/pactus/pull/668))
- aggregating signature for hello message ([#640](https://github.com/pactus-project/pactus/pull/640))
- error case for logger ([#634](https://github.com/pactus-project/pactus/pull/634))
- adding committers to the certificate ([#623](https://github.com/pactus-project/pactus/pull/623))
- updating sortition executor ([#608](https://github.com/pactus-project/pactus/pull/608))
- update buf and fixing proto generation issue ([#600](https://github.com/pactus-project/pactus/pull/600))
- adding block hash to peer ([#584](https://github.com/pactus-project/pactus/pull/584))
- copy to clipboard option for address and pubkey ([#583](https://github.com/pactus-project/pactus/pull/583))
- public key aggregate ([#576](https://github.com/pactus-project/pactus/pull/576))
- remove GetValidators rpc method ([#573](https://github.com/pactus-project/pactus/pull/573))
- missing swagger ui for grpc get account by number ([#564](https://github.com/pactus-project/pactus/pull/564))
- incorrect handler for validator by number ([#563](https://github.com/pactus-project/pactus/pull/563))
### Refactor
- **sync**: refactoring syncing process ([#676](https://github.com/pactus-project/pactus/pull/676))
- remove payload prefix from payload transaction type ([#669](https://github.com/pactus-project/pactus/pull/669))
- change Hello message from broadcasting to direct messaging ([#665](https://github.com/pactus-project/pactus/pull/665))
- **committee**: using generic list for validators ([#667](https://github.com/pactus-project/pactus/pull/667))
- rename SanityCheck to BasicCheck ([#643](https://github.com/pactus-project/pactus/pull/643))
- **cli**: Migrating from mow.cli to cobra for wallet ([#629](https://github.com/pactus-project/pactus/pull/629))
- **cli**: replacing mow.cli with cobra for daemon ([#621](https://github.com/pactus-project/pactus/pull/621))
- **logger**: using fast JSON logger (zerolog) ([#613](https://github.com/pactus-project/pactus/pull/613))
- Using Generics for calculating Min and Max for numeric type #604 ([#609](https://github.com/pactus-project/pactus/pull/609))
- Updating LRU cache to version 2 #514 ([#602](https://github.com/pactus-project/pactus/pull/602))
## [0.13.0](https://github.com/pactus-project/pactus/compare/v0.12.0...v0.13.0) (2023-06-30)
### Fix
- implemented restore wallet base on input seed ([#553](https://github.com/pactus-project/pactus/pull/553))
- measuring total sent and received bytes ([#552](https://github.com/pactus-project/pactus/pull/552))
- add validate seed and restore wallet ([#533](https://github.com/pactus-project/pactus/pull/533))
- **HTTP**: Missing handlers ([#549](https://github.com/pactus-project/pactus/pull/549))
- **gui**: update about dialog and menu items in help ([#532](https://github.com/pactus-project/pactus/pull/532))
### Refactor
- implementing TestSuite ([#535](https://github.com/pactus-project/pactus/pull/535))
## [0.12.0](https://github.com/pactus-project/pactus/compare/v0.11.0...v0.12.0) (2023-06-19)
### Feat
- add GetAccountByNumber API to get account by number ([#511](https://github.com/pactus-project/pactus/pull/511))
### Fix
- caching account and validator in store ([#513](https://github.com/pactus-project/pactus/pull/513))
- get recent blocks by stamp ([#509](https://github.com/pactus-project/pactus/pull/509))
- closing the mDNS connection upon stopping the network ([#508](https://github.com/pactus-project/pactus/pull/508))
- updating linkedmap to use generic ([#507](https://github.com/pactus-project/pactus/pull/507))
- removing state from cache ([#506](https://github.com/pactus-project/pactus/pull/506))
- Typo in GUI ([#499](https://github.com/pactus-project/pactus/pull/499))
- supporting localnet ([#492](https://github.com/pactus-project/pactus/pull/492))
### Refactor
- update total power calculation based on power change(deltas) ([#518](https://github.com/pactus-project/pactus/pull/518))
- GetValidators return all validators in state validators map ([#512](https://github.com/pactus-project/pactus/pull/512))
## [0.11.0](https://github.com/pactus-project/pactus/compare/v0.10.0...v0.11.0) (2023-05-29)
### Fix
- **gui**: showing the total number of validators ([#474](https://github.com/pactus-project/pactus/pull/474))
- **network**: fixing relay connection issue ([#475](https://github.com/pactus-project/pactus/pull/475))
- **consensus**: rejecting vote with round numbers exceeding the limit ([#466](https://github.com/pactus-project/pactus/pull/466))
- increase failed counter when stream got error ([#489](https://github.com/pactus-project/pactus/pull/489))
- boosting syncing process ([#482](https://github.com/pactus-project/pactus/pull/482))
- waiting for proposal in pre-commit phase ([#486](https://github.com/pactus-project/pactus/pull/486))
- retrieving public key from wallet for bond transactions ([#485](https://github.com/pactus-project/pactus/pull/485))
- restoring config file to the default ([#484](https://github.com/pactus-project/pactus/pull/484))
- defining ChainType in genesis to detect the type of network ([#483](https://github.com/pactus-project/pactus/pull/483))
- reducing the default Argon2d to consume less memory ([#480](https://github.com/pactus-project/pactus/pull/480))
- adding password option to the start commands ([#473](https://github.com/pactus-project/pactus/pull/473))
### Refactor
- rename send to transfer. ([#469](https://github.com/pactus-project/pactus/pull/469))
## [0.10.0](https://github.com/pactus-project/pactus/compare/v0.9.0...v0.10.0) (2023-05-09)
### Feat
- removing address from account ([#454](https://github.com/pactus-project/pactus/pull/454))
- supporting multiple consensus instances ([#450](https://github.com/pactus-project/pactus/pull/450))
- adding sortition interval to the parameters ([#442](https://github.com/pactus-project/pactus/pull/442))
### Fix
- `GetBlockchainInfo` API in gRPC now returns the total number of validators and accounts
- **gui**: check if the node has an active consensus instance ([#458](https://github.com/pactus-project/pactus/pull/458))
- wallet path as argument ([#455](https://github.com/pactus-project/pactus/pull/455))
- adding reward addresses to config ([#453](https://github.com/pactus-project/pactus/pull/453))
- removing committers from the certificate hash ([#444](https://github.com/pactus-project/pactus/pull/444))
- prevent data race conditions in committee ([#452](https://github.com/pactus-project/pactus/pull/452))
- using 2^256 for the vrf denominator ([#445](https://github.com/pactus-project/pactus/pull/445))
- updating tla+ readme ([#443](https://github.com/pactus-project/pactus/pull/443))
## 0.9.0 (2022-09-05)
No changelog
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
Thank you for considering contributing to the Pactus blockchain!
Please read these guidelines before submitting a pull request or opening an issue.
## Code Guidelines
We strive to maintain clean, readable, and maintainable code in the Pactus blockchain.
Please follow these guidelines when contributing to the project:
- Follow the [Effective Go](https://golang.org/doc/effective_go.html) guidelines.
- Follow the [Go Doc Comments](https://go.dev/doc/comment) guidelines.
- Follow the principles of clean code as outlined in
Robert C. Martin's "[Clean Code](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)" book.
- Write tests for new code or changes to existing code, and make sure all tests pass before submitting a pull request.
### Makefile Targets
You can use these commands in the Makefile:
- `make build` compiles the code into executable binaries.
- `make build_gui` compiles the gtk GUI code into executable binary.
- `make devtools` installs required development tools.
- `make fmt` formats the code according to the Go standards.
- `make check` runs checks on the code, including formatting and linting.
- `make test` runs all the tests, including unit tests and system tests.
- `make unit_test` runs only unit tests.
- `make proto` generates gRPC code from [Protobuf](https://protobuf.dev/) files.
- `make proto-check` validates Protobuf files against best practices.
- `make proto-format` formats Protobuf files.
### GUI Development
Development of the Pactus Core GUI have some requirements on your machine which you can find a [quick guide about it here](./docs/gtk-gui-development.md).
### Error and Log Messages
Error and log messages should not start with a capital letter (unless it's a proper noun or acronym) and
should not end with punctuation.
All changes on core must contain proper and well-defined unit-tests, also previous tests must be passed as well.
This codebase used `testify` for unit tests, make sure you follow these guide for tests:
- For panic cases make sure you use `assert.Panics`
- For checking err using `assert.ErrorIs` make sure you pass expected error as second argument.
- For checking equality using `assert.Equal` make sure you pass expected value as the first argument.
> This code guideline must be followed for both contributors and maintainers to review the PRs.
#### Examples
- Correct ✅: "unable to connect to server"
- Incorrect ❌: "Unable to connect to server"
- Incorrect ❌: "unable to connect to server."
### Help Messages
Follow these rules for help messages for CLI commands and flags:
- Help string should not start with a capital letter.
- Help string should not end with punctuation.
- Don't include default value in the help string.
- Include the acceptable range for the flags that accept a range of values.
## Commit Guidelines
Please follow these rules when committing changes to the Pactus blockchain:
- Each commit should represent a single, atomic change to the codebase.
Avoid making multiple unrelated changes in a single commit.
- Use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format for commit messages and
Pull Request titles.
### Commit type
List of conventional commit [types](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
| Types | Description |
| -------- | --------------------------------------------------------------------------------- |
| fix | A big fix |
| feat | A new feature |
| docs | Documentation only changes |
| test | Adding missing tests or correcting existing tests |
| build | Changes that affect the build system or external dependencies |
| ci | Changes to our CI configuration files and scripts |
| perf | A code change that improves performance |
| refactor | A code change that neither fixes a bug nor adds a feature |
| style | Changes that do not affect the meaning of the code (white-space, formatting, etc) |
| chore | Other changes that don't modify src or test files |
### Commit Scope
The scope helps specify which part of the code is affected by your commit.
It must be included in the commit message to provide clarity.
Multiple scopes can be used if the changes impact several areas.
Here’s a list of available scopes: [available scopes](./.github/workflows/semantic-pr.yml).
### Commit Description
- Keep the commit message under 50 characters.
- Start the commit message with a lowercase letter and do not end with punctuation.
- Write commit messages in the imperative: "fix bug" not "fixed bug" or "fixes bug".
### Examples
- Correct ✅: "feat(grpc): sign transaction using wallet client"
- Correct ✅: "feat(grpc, wallet): sign transaction using wallet client"
- Incorrect ❌: "feat(gRPC): Sign transaction using wallet client."
- Incorrect ❌: "feat(grpc): Sign transaction using wallet client."
- Incorrect ❌: "feat(grpc): signed transaction using wallet client"
- Incorrect ❌: "sign transaction using wallet client"
## Code of Conduct
This project has adapted the
[Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)
to ensure that our community is welcoming and inclusive for all.
Please read it before contributing to the project.
---
Thank you for your contributions to the Pactus blockchain!
================================================
FILE: Dockerfile
================================================
FROM golang:1.26.2-alpine3.23 AS builder
RUN apk add --no-cache git gmp-dev build-base g++ openssl-dev
ADD . /pactus
# Building pactus-daemon
RUN cd /pactus && \
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ./build/pactus-daemon ./cmd/daemon && \
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ./build/pactus-wallet ./cmd/wallet && \
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o ./build/pactus-shell ./cmd/shell
## Copy binary files from builder into second container
FROM alpine:3.23
COPY --from=builder /pactus/build/pactus-daemon /usr/bin
COPY --from=builder /pactus/build/pactus-wallet /usr/bin
COPY --from=builder /pactus/build/pactus-shell /usr/bin
ENV WORKING_DIR="/pactus"
VOLUME $WORKING_DIR
WORKDIR $WORKING_DIR
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2020 Pactus blockchain
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Makefile
================================================
PACKAGES=$(shell go list ./... | grep -v 'tests' | grep -v 'grpc/gen')
ifneq (,$(filter $(OS),Windows_NT MINGW64))
EXE = .exe
endif
# Handle sed differences between macOS and Linux
ifeq ($(shell uname),Darwin)
SED_CMD = sed -i ''
else
SED_CMD = sed -i
endif
all: build test
########################################
### Tools needed for development
devtools:
@echo "Installing devtools"
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.28.0
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.28.0
go install github.com/NathanBaulch/protoc-gen-cobra@v1.2.1
go install github.com/pactus-project/protoc-gen-doc/cmd/protoc-gen-doc@v0.0.0-20260124125944-b6e7c1776266
go install github.com/bufbuild/buf/cmd/buf@v1.67.0
go install mvdan.cc/gofumpt@latest
go install github.com/pacviewer/jrpc-gateway/protoc-gen-jrpc-gateway@v0.6
go install go.uber.org/mock/mockgen@latest
########################################
### Building
build:
go build -o ./build/pactus-daemon$(EXE) ./cmd/daemon
go build -o ./build/pactus-wallet$(EXE) ./cmd/wallet
go build -o ./build/pactus-shell$(EXE) ./cmd/shell
build_race:
go build -race -o ./build/pactus-daemon$(EXE) ./cmd/daemon
go build -race -o ./build/pactus-wallet$(EXE) ./cmd/wallet
build_gui:
go build -tags gtk -o ./build/pactus-gui$(EXE) ./cmd/gtk
########################################
### Testing
mocks:
@echo "Generating mocks..."
mockgen -source=txpool/interface.go -destination=txpool/txpool_mock.go -package=txpool
mockgen -source=wallet/manager/interface.go -destination=wallet/manager/manager_mock.go -package=manager
mockgen -source=wallet/provider/interface.go -destination=wallet/provider/provider_mock.go -package=provider
mockgen -source=wallet/storage/interface.go -destination=wallet/storage/storage_mock.go -package=storage
unit_test:
@go test $(PACKAGES)
test:
@go test ./... -covermode=atomic
test_race:
@go test ./... --race
########################################
### Docker
docker:
docker build --tag pactus .
########################################
### proto
# This target works only on Unix-like terminals.
proto:
rm -rf www/grpc/gen
cd www/grpc && buf generate --template ./buf/buf.gen.yaml --config ./buf/buf.yaml ./proto
proto-check:
cd www/grpc && buf lint --config ./buf/buf.yaml
proto-format:
cd www/grpc && buf format --config ./buf/buf.yaml -w
########################################
### Formatting the code
fmt:
gofumpt -l -w .
check:
golangci-lint run --build-tags "${BUILD_TAG}" --timeout=20m0s
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: build build_gui
.PHONY: test unit_test test_race mocks
.PHONY: proto proto-format proto-check
.PHONY: devtools fmt check docker
================================================
FILE: README.md
================================================
[](https://codecov.io/gh/pactus-project/pactus)
[](https://goreportcard.com/report/github.com/pactus-project/pactus)
[](https://x.com/PactusChain)
[](https://discord.gg/H5vZkNnXCu)
------
# Pactus Blockchain
A full-node implementation of the Pactus blockchain in Go.
## Install
Please check the [install](./docs/install.md) document to build and run the Pactus blockchain.
## Contribution
Contributions to the Pactus blockchain are appreciated.
Please read the [CONTRIBUTING](./CONTRIBUTING.md) guidelines before submitting a pull request or opening an issue.
## License
The Pactus blockchain is under MIT [license](./LICENSE).
================================================
FILE: cmd/cmd.go
================================================
package cmd
import (
"context"
"errors"
"fmt"
"os"
"os/user"
"path/filepath"
"runtime"
"syscall"
"time"
"github.com/ezex-io/gopkg/signal"
"github.com/pactus-project/pactus/config"
"github.com/pactus-project/pactus/crypto"
"github.com/pactus-project/pactus/crypto/bls"
"github.com/pactus-project/pactus/genesis"
"github.com/pactus-project/pactus/node"
"github.com/pactus-project/pactus/types/account"
"github.com/pactus-project/pactus/types/protocol"
"github.com/pactus-project/pactus/types/validator"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/terminal"
"github.com/pactus-project/pactus/wallet"
"github.com/pactus-project/pactus/wallet/types"
)
const (
DefaultHomeDirName = "pactus"
DefaultWalletsDirName = "wallets"
DefaultWalletName = "default_wallet"
)
func PactusDefaultHomeDir() string {
home := ""
usr, err := user.Current()
if err != nil {
terminal.PrintWarnMsgf("unable to get current user: %v", err)
} else {
home = filepath.Join(usr.HomeDir, home, DefaultHomeDirName)
}
return home
}
func PactusWalletDir(home string) string {
return filepath.Join(home, "wallets")
}
func PactusGenesisPath(home string) string {
return filepath.Join(home, "genesis.json")
}
func PactusConfigPath(home string) string {
return filepath.Join(home, "config.toml")
}
func PactusLockFilePath(home string) string {
return filepath.Join(home, ".pactus.lock")
}
func PactusDefaultWalletPath(home string) string {
return filepath.Join(PactusWalletDir(home), DefaultWalletName)
}
func PactusDaemonName() string {
if runtime.GOOS == "windows" {
return "pactus-daemon.exe"
}
return "./pactus-daemon"
}
func CreateNode(ctx context.Context, numValidators int, chain genesis.ChainType, workingDir string,
mnemonic string, walletPassword string,
) (*wallet.Wallet, string, error) {
walletPath := PactusDefaultWalletPath(workingDir)
wlt, err := wallet.Create(ctx, walletPath, mnemonic, walletPassword, chain)
if err != nil {
return nil, "", err
}
for i := 0; i < numValidators; i++ {
_, err := wlt.NewAddress(crypto.AddressTypeValidator, fmt.Sprintf("Validator address %v", i+1))
if err != nil {
return nil, "", err
}
}
rewardAddrInfo, err := wlt.NewAddress(crypto.AddressTypeEd25519Account, "Reward address",
wallet.WithPassword(walletPassword))
if err != nil {
return nil, "", err
}
confPath := PactusConfigPath(workingDir)
genPath := PactusGenesisPath(workingDir)
switch chain {
case genesis.Mainnet:
genDoc := genesis.MainnetGenesis()
if err := genDoc.SaveToFile(genPath); err != nil {
return nil, "", err
}
err := config.SaveMainnetConfig(confPath)
if err != nil {
return nil, "", err
}
case genesis.Testnet:
genDoc := genesis.TestnetGenesis()
if err := genDoc.SaveToFile(genPath); err != nil {
return nil, "", err
}
conf := config.DefaultConfigTestnet()
if err := conf.Save(confPath); err != nil {
return nil, "", err
}
case genesis.Localnet:
if numValidators < 4 {
return nil, "", errors.New("localnet needs at least 4 validators")
}
genDoc := makeLocalGenesis(wlt)
if err := genDoc.SaveToFile(genPath); err != nil {
return nil, "", err
}
conf := config.DefaultConfigLocalnet()
if err := conf.Save(confPath); err != nil {
return nil, "", err
}
}
return wlt, rewardAddrInfo.Address, nil
}
// StartNode starts the node from the given working directory.
// The passwordFetcher will be used to fetch the password for the default_wallet if it is encrypted.
// It returns an error if the genesis doc or default_wallet can't be found inside the working directory.
// TODO: write test for me.
func StartNode(ctx context.Context, workingDir string, passwordFetcher func() (string, bool),
configModifier func(cfg *config.Config) *config.Config,
) (*node.Node, error) {
conf, gen, err := MakeConfig(workingDir)
if err != nil {
return nil, err
}
if configModifier != nil {
conf = configModifier(conf)
}
defaultWalletPath := PactusDefaultWalletPath(workingDir)
wlt, err := wallet.Open(ctx, defaultWalletPath)
if err != nil {
return nil, err
}
valList := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
if len(valList) == 0 {
return nil, errors.New("no validator addresses found in the wallet")
}
if len(valList) > 32 {
terminal.PrintWarnMsgf("wallet has more than 32 validator addresses, only the first 32 will be used")
valList = valList[:32]
}
rewardAddrs, err := MakeRewardAddresses(wlt, valList, conf.Node.RewardAddresses)
if err != nil {
return nil, err
}
valKeys, err := MakeValidatorKey(wlt, valList, passwordFetcher)
if err != nil {
return nil, err
}
wlt.Close()
node, err := node.NewNode(ctx, gen, conf, valKeys, rewardAddrs)
if err != nil {
return nil, err
}
err = node.Start()
if err != nil {
return nil, err
}
return node, nil
}
// makeLocalGenesis makes genesis file for the local network.
func makeLocalGenesis(wlt *wallet.Wallet) *genesis.Genesis {
// Treasury account
acc := account.NewAccount(0)
acc.AddToBalance(21 * 1e14)
accs := map[crypto.Address]*account.Account{
crypto.TreasuryAddress: acc,
}
genValNum := 4
vals := make([]*validator.Validator, genValNum)
addrs := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
for i := 0; i < genValNum; i++ {
info, _ := wlt.AddressInfo(addrs[i].Address)
pub, _ := bls.PublicKeyFromString(info.PublicKey)
vals[i] = validator.NewValidator(pub, int32(i))
}
// create genesis
params := genesis.DefaultGenesisParams()
params.BlockVersion = protocol.ProtocolVersionLatest
gen := genesis.MakeGenesis(util.RoundNow(60), accs, vals, params)
return gen
}
// MakeConfig attempts to load the configuration file and
// returns an instance of the configuration along with the genesis document.
// The genesis document is required to determine the chain type, which influences the configuration settings.
// The function sets various private configurations, such as the "wallets directory" and chain-specific HRP values.
// If the configuration file cannot be loaded, it tries to recover or restore the configuration.
func MakeConfig(workingDir string) (*config.Config, *genesis.Genesis, error) {
gen, err := genesis.LoadFromFile(PactusGenesisPath(workingDir))
if err != nil {
return nil, nil, err
}
if !gen.ChainType().IsMainnet() {
crypto.ToTestnetHRP()
}
walletsDir := PactusWalletDir(workingDir)
confPath := PactusConfigPath(workingDir)
var defConf *config.Config
chainType := gen.ChainType()
switch chainType {
case genesis.Mainnet:
defConf = config.DefaultConfigMainnet()
case genesis.Testnet:
defConf = config.DefaultConfigTestnet()
case genesis.Localnet:
defConf = config.DefaultConfigLocalnet()
}
conf, err := config.LoadFromFile(confPath, true, defConf)
if err != nil {
terminal.PrintWarnMsgf("Unable to load the config: %s", err)
terminal.PrintInfoMsgf("Attempting to update or restore the config file...")
conf, err = RecoverConfig(confPath, defConf, chainType)
if err != nil {
return nil, nil, err
}
}
// Now we can update the private filed, if any
genParams := gen.Params()
conf.Store.TxCacheWindow = genParams.TransactionToLiveInterval
conf.Store.SeedCacheWindow = genParams.SortitionInterval
conf.Store.AccountCacheSize = 1024
conf.Store.PublicKeyCacheSize = 1024
conf.WalletManager.ChainType = chainType
conf.WalletManager.WalletsDir = walletsDir
if err := conf.BasicCheck(); err != nil {
return nil, nil, err
}
return conf, gen, nil
}
func RecoverConfig(confPath string, defConf *config.Config, chainType genesis.ChainType) (*config.Config, error) {
// Try to attempt to load config in non-strict mode
conf, err := config.LoadFromFile(confPath, false, defConf)
// Create a backup of the config
if util.PathExists(confPath) {
confBackupPath := fmt.Sprintf("%v_bak_%s", confPath, time.Now().Format("2006-01-02T15-04-05"))
renameErr := os.Rename(confPath, confBackupPath)
if renameErr != nil {
return nil, renameErr
}
}
if err == nil {
err := conf.Save(confPath)
if err != nil {
return nil, err
}
terminal.PrintSuccessMsgf("Config updated.")
} else {
switch chainType {
case genesis.Mainnet:
err = config.SaveMainnetConfig(confPath)
if err != nil {
return nil, err
}
case genesis.Testnet,
genesis.Localnet:
err = defConf.Save(confPath)
if err != nil {
return nil, err
}
}
terminal.PrintSuccessMsgf("Config restored to the default values")
conf, _ = config.LoadFromFile(confPath, true, defConf) // This time it should be OK
}
return conf, err
}
// MakeRewardAddresses generates a list of reward addresses based on wallet and configuration.
// If no reward addresses are provided in the config,
// the function attempts to use Ed25519 or BLS addresses from the wallet.
func MakeRewardAddresses(wlt *wallet.Wallet, valList []types.AddressInfo,
confRewardAddrs []string,
) ([]crypto.Address, error) {
rewardAddrs := make([]crypto.Address, 0, len(valList))
switch {
// Case 1: No reward addresses in the config file.
case len(confRewardAddrs) == 0:
var addrInfo *types.AddressInfo
// Try to use the first Ed25519 address from the wallet as the reward address.
ed25519Addrs := wlt.ListAddresses(wallet.WithAddressType(crypto.AddressTypeEd25519Account))
if len(ed25519Addrs) == 0 {
// If no Ed25519 address is found, try the first BLS address instead.
blsAddrs := wlt.ListAddresses(wallet.WithAddressType(crypto.AddressTypeBLSAccount))
if len(blsAddrs) == 0 {
return nil, errors.New("unable to find a reward address in the wallet")
}
addrInfo = &blsAddrs[0]
} else {
addrInfo = &ed25519Addrs[0]
}
addr, _ := crypto.AddressFromString(addrInfo.Address)
for i := 0; i < len(valList); i++ {
rewardAddrs = append(rewardAddrs, addr)
}
// Case 2: One reward address is specified in the config file.
case len(confRewardAddrs) == 1:
// Use this single address for all validators.
addr, _ := crypto.AddressFromString(confRewardAddrs[0])
for i := 0; i < len(valList); i++ {
rewardAddrs = append(rewardAddrs, addr)
}
// Case 3: Each validator has a corresponding reward address in the config file.
case len(confRewardAddrs) == len(valList):
for _, addrStr := range confRewardAddrs {
addr, _ := crypto.AddressFromString(addrStr)
rewardAddrs = append(rewardAddrs, addr)
}
default:
return nil, fmt.Errorf("expected %v reward addresses, but got %v",
len(valList), len(confRewardAddrs))
}
return rewardAddrs, nil
}
func MakeValidatorKey(walletInstance *wallet.Wallet, valAddrsInfo []types.AddressInfo,
passwordFetcher func() (string, bool),
) ([]*bls.ValidatorKey, error) {
valAddrs := make([]string, len(valAddrsInfo))
for i := 0; i < len(valAddrs); i++ {
valAddr, _ := crypto.AddressFromString(valAddrsInfo[i].Address)
if !valAddr.IsValidatorAddress() {
return nil, fmt.Errorf("invalid validator address: %s", valAddrsInfo[i].Address)
}
valAddrs[i] = valAddr.String()
}
valKeys := make([]*bls.ValidatorKey, len(valAddrsInfo))
walletPassword := ""
if walletInstance.IsEncrypted() {
password, ok := passwordFetcher()
if !ok {
return nil, errors.New("aborted")
}
walletPassword = password
}
prvKeys, err := walletInstance.PrivateKeys(walletPassword, valAddrs)
if err != nil {
return nil, err
}
for i, prv := range prvKeys {
valKeys[i] = bls.NewValidatorKey(prv.(*bls.PrivateKey))
}
return valKeys, nil
}
func RecoverWalletAddresses(wlt *wallet.Wallet, password string) {
ctx, cancel := context.WithCancel(context.Background())
signal.HandleSignals(func(os.Signal) {
cancel()
}, syscall.SIGINT, syscall.SIGTERM)
terminal.PrintInfoMsgf("🔄 Recovering wallet addresses...")
terminal.PrintInfoMsgf(" Press 'Ctrl+C' to abort if needed")
terminal.PrintLine()
index := 0
err := wlt.RecoveryAddresses(ctx, password, func(addr string) {
terminal.PrintInfoMsgf("%d. %s", index+1, addr)
index++
})
if err != nil {
if errors.Is(err, context.Canceled) {
terminal.PrintWarnMsgf("Address recovery aborted")
} else {
terminal.PrintErrorMsgf("Address recovery failed: %v", err)
}
}
}
================================================
FILE: cmd/cmd_test.go
================================================
package cmd
import (
"runtime"
"testing"
"github.com/pactus-project/pactus/config"
"github.com/pactus-project/pactus/genesis"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/testsuite"
"github.com/pactus-project/pactus/wallet"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestMakeConfig(t *testing.T) {
t.Run("No genesis file, Should return error", func(t *testing.T) {
workingDir := util.TempDirPath()
_, _, err := MakeConfig(workingDir)
require.Error(t, err)
})
t.Run("No Config file, Should recover it", func(t *testing.T) {
workingDir := util.TempDirPath()
genPath := PactusGenesisPath(workingDir)
gen := genesis.MainnetGenesis()
err := gen.SaveToFile(genPath)
require.NoError(t, err)
_, _, err = MakeConfig(workingDir)
require.NoError(t, err)
})
t.Run("Invalid Config file, Should recover it", func(t *testing.T) {
workingDir := util.TempDirPath()
genPath := PactusGenesisPath(workingDir)
confPath := PactusConfigPath(workingDir)
gen := genesis.MainnetGenesis()
err := gen.SaveToFile(genPath)
require.NoError(t, err)
err = util.WriteFile(confPath, []byte("invalid-config"))
require.NoError(t, err)
_, _, err = MakeConfig(workingDir)
require.NoError(t, err)
})
t.Run("Everything is good", func(t *testing.T) {
workingDir := util.TempDirPath()
genPath := PactusGenesisPath(workingDir)
confPath := PactusConfigPath(workingDir)
gen := genesis.MainnetGenesis()
err := gen.SaveToFile(genPath)
require.NoError(t, err)
err = config.SaveMainnetConfig(confPath)
require.NoError(t, err)
_, _, err = MakeConfig(workingDir)
require.NoError(t, err)
})
}
func TestPathsUnix(t *testing.T) {
if runtime.GOOS == "windows" {
return
}
tests := []struct {
home string
expectedWalletDir string
expectedDefaultWalletPath string
expectedGenesisPath string
expectedConfigPath string
}{
{
"/home/pactus",
"/home/pactus/wallets",
"/home/pactus/wallets/default_wallet",
"/home/pactus/genesis.json",
"/home/pactus/config.toml",
},
{
"/home/pactus/",
"/home/pactus/wallets",
"/home/pactus/wallets/default_wallet",
"/home/pactus/genesis.json",
"/home/pactus/config.toml",
},
}
for _, tt := range tests {
walletDir := PactusWalletDir(tt.home)
defaultWalletPath := PactusDefaultWalletPath(tt.home)
genesisPath := PactusGenesisPath(tt.home)
configPath := PactusConfigPath(tt.home)
assert.Equal(t, tt.expectedWalletDir, walletDir)
assert.Equal(t, tt.expectedDefaultWalletPath, defaultWalletPath)
assert.Equal(t, tt.expectedGenesisPath, genesisPath)
assert.Equal(t, tt.expectedConfigPath, configPath)
}
}
func TestPathsWindows(t *testing.T) {
if runtime.GOOS != "windows" {
return
}
tests := []struct {
home string
expectedWalletDir string
expectedDefaultWalletPath string
expectedGenesisPath string
expectedConfigPath string
}{
{
"c:\\pactus",
"c:\\pactus\\wallets",
"c:\\pactus\\wallets\\default_wallet",
"c:\\pactus\\genesis.json",
"c:\\pactus\\config.toml",
},
{
"c:\\home\\",
"c:\\home\\wallets",
"c:\\home\\wallets\\default_wallet",
"c:\\home\\genesis.json",
"c:\\home\\config.toml",
},
}
for _, tt := range tests {
walletDir := PactusWalletDir(tt.home)
defaultWalletPath := PactusDefaultWalletPath(tt.home)
genesisPath := PactusGenesisPath(tt.home)
configPath := PactusConfigPath(tt.home)
assert.Equal(t, tt.expectedWalletDir, walletDir)
assert.Equal(t, tt.expectedDefaultWalletPath, defaultWalletPath)
assert.Equal(t, tt.expectedGenesisPath, genesisPath)
assert.Equal(t, tt.expectedConfigPath, configPath)
}
}
func TestMakeRewardAddresses(t *testing.T) {
ts := testsuite.NewTestSuite(t)
setupWallet := func() *wallet.Wallet {
walletPath := util.TempFilePath()
mnemonic, _ := wallet.GenerateMnemonic(128)
wlt, err := wallet.Create(t.Context(), walletPath, mnemonic, "", genesis.Mainnet)
require.NoError(t, err)
_, _ = wlt.NewValidatorAddress("Validator 1")
_, _ = wlt.NewValidatorAddress("Validator 2")
_, _ = wlt.NewValidatorAddress("Validator 3")
return wlt
}
t.Run("No reward addresses in wallet", func(t *testing.T) {
wlt := setupWallet()
valAddrsInfo := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
confRewardAddresses := []string{}
_, err := MakeRewardAddresses(wlt, valAddrsInfo, confRewardAddresses)
assert.ErrorContains(t, err, "unable to find a reward address in the wallet")
})
t.Run("Wallet with one Ed25519 address", func(t *testing.T) {
wlt := setupWallet()
addr1Info, _ := wlt.NewEd25519AccountAddress("", "")
_, _ = wlt.NewEd25519AccountAddress("", "")
_, _ = wlt.NewBLSAccountAddress("")
valAddrsInfo := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
confRewardAddresses := []string{}
rewardAddrs, err := MakeRewardAddresses(wlt, valAddrsInfo, confRewardAddresses)
require.NoError(t, err)
assert.Equal(t, rewardAddrs[0].String(), addr1Info.Address)
assert.Equal(t, rewardAddrs[1].String(), addr1Info.Address)
assert.Equal(t, rewardAddrs[2].String(), addr1Info.Address)
})
t.Run("Wallet with one BLS address", func(t *testing.T) {
wlt := setupWallet()
addr1Info, _ := wlt.NewBLSAccountAddress("")
_, _ = wlt.NewBLSAccountAddress("")
valAddrsInfo := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
confRewardAddresses := []string{}
rewardAddrs, err := MakeRewardAddresses(wlt, valAddrsInfo, confRewardAddresses)
require.NoError(t, err)
assert.Equal(t, rewardAddrs[0].String(), addr1Info.Address)
assert.Equal(t, rewardAddrs[1].String(), addr1Info.Address)
assert.Equal(t, rewardAddrs[2].String(), addr1Info.Address)
})
t.Run("One reward address in config", func(t *testing.T) {
wlt := setupWallet()
valAddrsInfo := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
confRewardAddresses := []string{
ts.RandAccAddress().String(),
}
rewardAddrs, err := MakeRewardAddresses(wlt, valAddrsInfo, confRewardAddresses)
require.NoError(t, err)
assert.Equal(t, rewardAddrs[0].String(), confRewardAddresses[0])
assert.Equal(t, rewardAddrs[1].String(), confRewardAddresses[0])
assert.Equal(t, rewardAddrs[2].String(), confRewardAddresses[0])
})
t.Run("Three reward addresses in config", func(t *testing.T) {
wlt := setupWallet()
valAddrsInfo := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
confRewardAddresses := []string{
ts.RandAccAddress().String(),
ts.RandAccAddress().String(),
ts.RandAccAddress().String(),
}
rewardAddrs, err := MakeRewardAddresses(wlt, valAddrsInfo, confRewardAddresses)
require.NoError(t, err)
assert.Equal(t, rewardAddrs[0].String(), confRewardAddresses[0])
assert.Equal(t, rewardAddrs[1].String(), confRewardAddresses[1])
assert.Equal(t, rewardAddrs[2].String(), confRewardAddresses[2])
})
t.Run("Insufficient reward addresses in config", func(t *testing.T) {
wlt := setupWallet()
valAddrsInfo := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
confRewardAddresses := []string{
ts.RandAccAddress().String(),
ts.RandAccAddress().String(),
}
_, err := MakeRewardAddresses(wlt, valAddrsInfo, confRewardAddresses)
assert.ErrorContains(t, err, "expected 3 reward addresses, but got 2")
})
}
func TestCreateNode(t *testing.T) {
tests := []struct {
name string
numValidators int
chain genesis.ChainType
workingDir string
mnemonic string
withErr bool
validatorAddrs []string
rewardAddrs string
}{
{
name: "Create node for Mainnet",
numValidators: 1,
chain: genesis.Mainnet,
workingDir: util.TempDirPath(),
mnemonic: "legal winner thank year wave sausage worth useful legal winner thank yellow",
validatorAddrs: []string{"pc1pqpu5tkuctj6ecxjs85f9apm802hhc65amwhuyw"},
rewardAddrs: "pc1rkg0nhswqj85wnz9sm0g9kfkxj68lfx9lhftl8n",
withErr: false,
},
{
name: "Create node for Testnet",
numValidators: 1,
chain: genesis.Testnet,
workingDir: util.TempDirPath(),
mnemonic: "legal winner thank year wave sausage worth useful legal winner thank yellow",
validatorAddrs: []string{"tpc1p54ex6jvqkz6qyld5wgm77qm7walgy664hxz2pc"},
rewardAddrs: "tpc1rps3xncfvepre5w754xtxxqmrmhwuackjvaft5y",
withErr: false,
},
{
name: "Create node for Localnet",
numValidators: 4,
chain: genesis.Localnet,
workingDir: util.TempDirPath(),
mnemonic: "legal winner thank year wave sausage worth useful legal winner thank yellow",
validatorAddrs: []string{
"tpc1p54ex6jvqkz6qyld5wgm77qm7walgy664hxz2pc",
"tpc1pdf5e0q4d6eaww3uq5pmw5aayqpaqplra0pj8z2",
"tpc1pe5px2dddn6g4zgnu3wpwgrqpdjrufvda57a4wm",
"tpc1p8yyhysp380j9q9gxa6vlhstgkd94238kunttpr",
},
rewardAddrs: "tpc1rps3xncfvepre5w754xtxxqmrmhwuackjvaft5y",
withErr: false,
},
{
name: "Localnet with one validator",
numValidators: 1,
chain: genesis.Localnet,
workingDir: util.TempDirPath(),
mnemonic: "legal winner thank year wave sausage worth useful legal winner thank yellow",
validatorAddrs: nil,
rewardAddrs: "",
withErr: true,
},
{
name: "Invalid mnemonic",
numValidators: 4,
chain: genesis.Mainnet,
workingDir: util.TempDirPath(),
mnemonic: "",
validatorAddrs: nil,
rewardAddrs: "",
withErr: true,
},
}
for _, tt := range tests {
wlt, rewardAddrs, err := CreateNode(t.Context(),
tt.numValidators, tt.chain, tt.workingDir, tt.mnemonic, "")
if tt.withErr {
require.Error(t, err)
} else {
require.NoError(t, err)
valInfos := wlt.ListAddresses(wallet.OnlyValidatorAddresses())
for i, addr := range tt.validatorAddrs {
assert.Equal(t, valInfos[i].Address, addr)
}
assert.Equal(t, tt.rewardAddrs, rewardAddrs)
}
}
}
================================================
FILE: cmd/daemon/import.go
================================================
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/ezex-io/gopkg/signal"
"github.com/gofrs/flock"
"github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/downloader"
"github.com/pactus-project/pactus/util/prompt"
"github.com/pactus-project/pactus/util/terminal"
"github.com/spf13/cobra"
)
func buildImportCmd(parentCmd *cobra.Command) {
importCmd := &cobra.Command{
Use: "import",
Short: "download and import pruned data",
}
parentCmd.AddCommand(importCmd)
workingDirOpt := addWorkingDirOption(importCmd)
serverAddrOpt := importCmd.Flags().String("server-addr", cmd.DefaultSnapshotURL,
"import server address")
importCmd.Run = func(cobra *cobra.Command, _ []string) {
workingDir, err := filepath.Abs(*workingDirOpt)
terminal.FatalErrorCheck(err)
err = os.Chdir(workingDir)
terminal.FatalErrorCheck(err)
conf, gen, err := cmd.MakeConfig(workingDir)
terminal.FatalErrorCheck(err)
lockFilePath := filepath.Join(workingDir, ".pactus.lock")
fileLock := flock.New(lockFilePath)
locked, err := fileLock.TryLock()
terminal.FatalErrorCheck(err)
if !locked {
terminal.PrintWarnMsgf("Could not lock '%s', another instance is running?", lockFilePath)
return
}
terminal.PrintLine()
snapshotURL := *serverAddrOpt
importer, err := cmd.NewImporter(
gen.ChainType(),
snapshotURL,
conf.Store.DataPath(),
)
terminal.FatalErrorCheck(err)
metadata, err := importer.GetMetadata(cobra.Context())
terminal.FatalErrorCheck(err)
snapshots := make([]string, 0, len(metadata))
for _, md := range metadata {
item := fmt.Sprintf("snapshot %s (%s)",
md.CreatedAtTime().Format("2006-01-02"),
util.FormatBytesToHumanReadable(md.Data.Size),
)
snapshots = append(snapshots, item)
}
terminal.PrintLine()
choice := prompt.PromptSelect("Please select a snapshot", snapshots)
selected := metadata[choice]
signal.HandleInterrupt(func() {
_ = fileLock.Unlock()
_ = importer.Cleanup()
})
terminal.PrintLine()
err = importer.Download(cobra.Context(), &selected, downloadProgressBar)
terminal.FatalErrorCheck(err)
terminal.PrintLine()
terminal.PrintLine()
terminal.PrintInfoMsgf("📦 Extracting snapshot files...")
err = importer.ExtractAndStoreFiles()
terminal.FatalErrorCheck(err)
terminal.PrintInfoMsgf("📁 Moving data to node directory...")
err = importer.MoveStore()
terminal.FatalErrorCheck(err)
terminal.PrintInfoMsgf("🧹 Cleaning up temporary files...")
err = importer.Cleanup()
terminal.FatalErrorCheck(err)
_ = fileLock.Unlock()
terminal.PrintLine()
terminal.PrintSuccessMsgf("✅ Node successfully imported pruned data!")
terminal.PrintLine()
terminal.PrintInfoMsgf("🚀 To start your node, run:")
terminal.PrintInfoMsgBoldf(" %s start -w %s", cmd.PactusDaemonName(), workingDir)
}
}
func downloadProgressBar(fileName string) func(stats downloader.Stats) {
return func(stats downloader.Stats) {
if !stats.Completed {
bar := terminal.ProgressBar(stats.TotalSize, 30)
bar.Describe(fmt.Sprintf("%s (%s/%s)",
fileName,
util.FormatBytesToHumanReadable(uint64(stats.Downloaded)),
util.FormatBytesToHumanReadable(uint64(stats.TotalSize)),
))
// Ignore progress bar errors
_ = bar.Add64(stats.Downloaded)
}
}
}
================================================
FILE: cmd/daemon/init.go
================================================
package main
import (
"context"
"path/filepath"
"github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/crypto"
"github.com/pactus-project/pactus/genesis"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/prompt"
"github.com/pactus-project/pactus/util/terminal"
"github.com/pactus-project/pactus/wallet"
"github.com/spf13/cobra"
)
// buildInitCmd builds a sub-command to initialize the Pactus blockchain node.
func buildInitCmd(parentCmd *cobra.Command) {
initCmd := &cobra.Command{
Use: "init",
Short: "initialize the Pactus blockchain node",
}
parentCmd.AddCommand(initCmd)
workingDirOpt := addWorkingDirOption(initCmd)
testnetOpt := initCmd.Flags().Bool("testnet", false,
"initialize working directory for joining the testnet")
localnetOpt := initCmd.Flags().Bool("localnet", false,
"initialize working directory for localnet (for development)")
restoreOpt := initCmd.Flags().String("restore", "",
"restore the 'default_wallet' using a mnemonic or seed phrase")
passwordOpt := initCmd.Flags().StringP("password", "p", "",
"the wallet password")
entropyOpt := initCmd.Flags().IntP("entropy", "e", 128,
"entropy bits for seed generation. range: 128 to 256")
valNumOpt := initCmd.Flags().IntP("val-num", "", 0,
"number of validators to be created. range: 1 to 32")
initCmd.Run = func(_ *cobra.Command, _ []string) {
workingDir, _ := filepath.Abs(*workingDirOpt)
if !util.IsDirNotExistsOrEmpty(workingDir) {
terminal.PrintErrorMsgf("The working directory is not empty: %s", workingDir)
return
}
var mnemonic string
if *restoreOpt == "" {
mnemonic, _ = wallet.GenerateMnemonic(*entropyOpt)
terminal.PrintLine()
terminal.PrintInfoMsgf("🌱 Your wallet seed phrase:")
terminal.PrintInfoMsgBoldf(" %s", mnemonic)
terminal.PrintLine()
terminal.PrintWarnMsgf("⚠️ CRITICAL: Write down this seed phrase and store it safely!")
terminal.PrintWarnMsgf(" This is the ONLY way to recover your wallet if needed.")
terminal.PrintWarnMsgf(" Never share it with anyone or store it electronically.")
terminal.PrintLine()
confirmed := prompt.PromptConfirm("Have you written down the seed phrase? Continue with initialization")
if !confirmed {
return
}
} else {
mnemonic = *restoreOpt
err := wallet.CheckMnemonic(*restoreOpt)
terminal.FatalErrorCheck(err)
}
var password string
if *passwordOpt == "" {
terminal.PrintLine()
terminal.PrintInfoMsgf("🔐 Set a password for your wallet")
terminal.PrintInfoMsgf(" This password will be required to access your wallet")
password = prompt.PromptPassword("Wallet Password", true)
} else {
password = *passwordOpt
}
var valNum int
if *valNumOpt == 0 {
terminal.PrintLine()
terminal.PrintInfoMsgBoldf("🏛️ How many validators do you want to create?")
terminal.PrintInfoMsgf(" • Each node can run up to 32 validators")
terminal.PrintInfoMsgf(" • Each validator can stake up to 1,000 coins")
terminal.PrintInfoMsgf(" • Choose based on your total stake amount")
terminal.PrintLine()
valNum = prompt.PromptInputWithRange("Number of Validators", 7, 1, 32)
} else {
if *valNumOpt < 1 || *valNumOpt > 32 {
terminal.PrintErrorMsgf("%v is not in valid range of validator number, it should be between 1 and 32", *valNumOpt)
return
}
valNum = *valNumOpt
}
chain := genesis.Mainnet
// The order of checking the network (chain type) matters here.
if *testnetOpt {
crypto.ToTestnetHRP()
chain = genesis.Testnet
}
if *localnetOpt {
crypto.ToTestnetHRP()
chain = genesis.Localnet
}
ctx := context.Background()
wlt, rewardAddrs, err := cmd.CreateNode(ctx,
valNum, chain, workingDir, mnemonic, password)
terminal.FatalErrorCheck(err)
// Recovering addresses
if *restoreOpt != "" {
cmd.RecoverWalletAddresses(wlt, password)
}
terminal.PrintLine()
terminal.PrintInfoMsgBoldf("🏛️ Validator Addresses:")
for i, addrInfo := range wlt.ListAddresses(wallet.OnlyValidatorAddresses()) {
terminal.PrintInfoMsgf(" %d. %s", i+1, addrInfo.Address)
}
terminal.PrintLine()
terminal.PrintInfoMsgBoldf("💰 Reward Address:")
terminal.PrintInfoMsgf(" %s", rewardAddrs)
terminal.PrintLine()
terminal.PrintInfoMsgf("🌐 Network: %v", chain.String())
terminal.PrintInfoMsgf("📁 Working Directory: %v", workingDir)
terminal.PrintLine()
terminal.PrintSuccessMsgf("✅ Pactus node successfully initialized!")
terminal.PrintLine()
terminal.PrintInfoMsgf("🚀 To start your node, run:")
terminal.PrintInfoMsgBoldf(" %s start -w %s", cmd.PactusDaemonName(), workingDir)
}
}
================================================
FILE: cmd/daemon/main.go
================================================
package main
import (
"github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/util/terminal"
"github.com/pactus-project/pactus/version"
"github.com/spf13/cobra"
)
func init() {
version.NodeAgent.AppType = "daemon"
}
func main() {
rootCmd := &cobra.Command{
Use: "pactus-daemon",
Short: "Pactus daemon",
CompletionOptions: cobra.CompletionOptions{HiddenDefaultCmd: true},
}
// Hide the "help" sub-command
rootCmd.SetHelpCommand(&cobra.Command{Hidden: true})
buildVersionCmd(rootCmd)
buildInitCmd(rootCmd)
buildStartCmd(rootCmd)
buildPruneCmd(rootCmd)
buildImportCmd(rootCmd)
err := rootCmd.Execute()
if err != nil {
terminal.PrintErrorMsgf(err.Error())
}
}
func addWorkingDirOption(c *cobra.Command) *string {
return c.Flags().StringP("working-dir", "w", cmd.PactusDefaultHomeDir(),
"the path to the working directory that keeps the wallets and node files")
}
================================================
FILE: cmd/daemon/prune.go
================================================
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"github.com/ezex-io/gopkg/signal"
"github.com/gofrs/flock"
"github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/store"
"github.com/pactus-project/pactus/types"
"github.com/pactus-project/pactus/util/logger"
"github.com/pactus-project/pactus/util/prompt"
"github.com/pactus-project/pactus/util/terminal"
"github.com/spf13/cobra"
)
func buildPruneCmd(parentCmd *cobra.Command) {
pruneCmd := &cobra.Command{
Use: "prune",
Short: "prune old blocks and transactions from the node",
Long: "The prune command optimizes blockchain storage by removing outdated blocks and transactions, " +
"freeing up disk space and enhancing node performance.",
}
parentCmd.AddCommand(pruneCmd)
workingDirOpt := addWorkingDirOption(pruneCmd)
pruneCmd.Run = func(_ *cobra.Command, _ []string) {
workingDir, _ := filepath.Abs(*workingDirOpt)
// change working directory
err := os.Chdir(workingDir)
terminal.FatalErrorCheck(err)
// Define the lock file path
lockFilePath := filepath.Join(workingDir, ".pactus.lock")
fileLock := flock.New(lockFilePath)
locked, err := fileLock.TryLock()
terminal.FatalErrorCheck(err)
if !locked {
terminal.PrintWarnMsgf("Could not lock '%s', another instance is running?", lockFilePath)
return
}
conf, _, err := cmd.MakeConfig(workingDir)
terminal.FatalErrorCheck(err)
// Disable logger
conf.Logger.Targets = []string{}
logger.InitGlobalLogger(context.Background(), conf.Logger)
t
gitextract_gyguei1v/
├── .dockerignore
├── .editorconfig
├── .entire/
│ └── .gitignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── windows-signing/
│ │ └── action.yml
│ ├── codecov.yml
│ ├── packager/
│ │ ├── js/
│ │ │ ├── grpc/
│ │ │ │ ├── README.md
│ │ │ │ └── package.json
│ │ │ └── jsonrpc/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── packager.sh
│ │ ├── python/
│ │ │ ├── grpc/
│ │ │ │ ├── README.md
│ │ │ │ ├── pactus_grpc/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── __init__.pyi
│ │ │ │ ├── pyproject.toml
│ │ │ │ └── setup.py
│ │ │ └── jsonrpc/
│ │ │ ├── README.md
│ │ │ ├── pactus_jsonrpc/
│ │ │ │ └── __init__.py
│ │ │ ├── pyproject.toml
│ │ │ └── setup.py
│ │ └── rust/
│ │ ├── grpc/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ └── jsonrpc/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ └── lib.rs
│ ├── releasers/
│ │ ├── linux/
│ │ │ └── pactus-gui.desktop
│ │ ├── macos/
│ │ │ ├── Info.plist
│ │ │ ├── gtk3-launcher.sh
│ │ │ ├── gui.bundle
│ │ │ ├── pactus.icns
│ │ │ └── run-install-name-tool-change.sh
│ │ ├── pactus_downloader.sh
│ │ ├── releaser_cli.sh
│ │ ├── releaser_gui_linux.sh
│ │ ├── releaser_gui_macos.sh
│ │ ├── releaser_gui_windows_build.sh
│ │ ├── releaser_gui_windows_installer.sh
│ │ └── windows/
│ │ ├── README.md
│ │ ├── gtk-win-bundler.py
│ │ ├── pactus-gui.manifest
│ │ └── rsrc_windows_amd64.syso
│ └── workflows/
│ ├── codeql.yml
│ ├── coverage.yml
│ ├── deadlock.yml
│ ├── docker.yml
│ ├── gui.yml
│ ├── linting.yml
│ ├── packager.yml
│ ├── releaser.yml
│ ├── semantic-pr.yml
│ └── testing.yml
├── .gitignore
├── .golangci.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── cmd/
│ ├── cmd.go
│ ├── cmd_test.go
│ ├── daemon/
│ │ ├── import.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── prune.go
│ │ ├── start.go
│ │ └── version.go
│ ├── gtk/
│ │ ├── app/
│ │ │ └── run.go
│ │ ├── assets/
│ │ │ ├── assets.go
│ │ │ ├── css/
│ │ │ │ └── style.css
│ │ │ ├── css.go
│ │ │ ├── dialogs.go
│ │ │ ├── icons.go
│ │ │ ├── images.go
│ │ │ ├── main_ui.go
│ │ │ └── ui/
│ │ │ ├── dialog_about.ui
│ │ │ ├── dialog_about_gtk.ui
│ │ │ ├── dialog_address_details.ui
│ │ │ ├── dialog_address_label.ui
│ │ │ ├── dialog_address_private_key.ui
│ │ │ ├── dialog_transaction_bond.ui
│ │ │ ├── dialog_transaction_transfer.ui
│ │ │ ├── dialog_transaction_unbond.ui
│ │ │ ├── dialog_transaction_withdraw.ui
│ │ │ ├── dialog_wallet_change_password.ui
│ │ │ ├── dialog_wallet_create_address.ui
│ │ │ ├── dialog_wallet_password.ui
│ │ │ ├── dialog_wallet_set_default_fee.ui
│ │ │ ├── dialog_wallet_show_seed.ui
│ │ │ ├── main_window.ui
│ │ │ ├── widget_committee.ui
│ │ │ ├── widget_network.ui
│ │ │ ├── widget_node.ui
│ │ │ ├── widget_validator.ui
│ │ │ └── widget_wallet.ui
│ │ ├── controller/
│ │ │ ├── address_details_dialog_controller.go
│ │ │ ├── address_label_dialog_controller.go
│ │ │ ├── address_private_key_dialog_controller.go
│ │ │ ├── committee_widget_controller.go
│ │ │ ├── controller.go
│ │ │ ├── main_window_controller.go
│ │ │ ├── navigator.go
│ │ │ ├── network_widget_controller.go
│ │ │ ├── node_widget_controller.go
│ │ │ ├── password_prompt.go
│ │ │ ├── tx_bond_dialog_controller.go
│ │ │ ├── tx_transfer_dialog_controller.go
│ │ │ ├── tx_unbond_dialog_controller.go
│ │ │ ├── tx_withdraw_dialog_controller.go
│ │ │ ├── validator_widget_controller.go
│ │ │ ├── wallet_change_password_dialog_controller.go
│ │ │ ├── wallet_create_address_dialog_controller.go
│ │ │ ├── wallet_default_fee_dialog_controller.go
│ │ │ ├── wallet_password_dialog_controller.go
│ │ │ ├── wallet_seed_dialog_controller.go
│ │ │ └── wallet_widget_controller.go
│ │ ├── gtkutil/
│ │ │ ├── format.go
│ │ │ ├── format_test.go
│ │ │ ├── gtkutil.go
│ │ │ └── gtkutil_test.go
│ │ ├── main.go
│ │ ├── model/
│ │ │ ├── committee_model.go
│ │ │ ├── network_model.go
│ │ │ ├── node_model.go
│ │ │ ├── validator_model.go
│ │ │ └── wallet_model.go
│ │ ├── startup_assistant.go
│ │ └── view/
│ │ ├── about_dialog_view.go
│ │ ├── about_gtk_dialog_view.go
│ │ ├── address_details_dialog_view.go
│ │ ├── address_label_dialog_view.go
│ │ ├── address_private_key_dialog_view.go
│ │ ├── committee_widget_view.go
│ │ ├── main_window_view.go
│ │ ├── network_widget_view.go
│ │ ├── node_widget_view.go
│ │ ├── splash_window_view.go
│ │ ├── tx_bond_dialog_view.go
│ │ ├── tx_transfer_dialog_view.go
│ │ ├── tx_unbond_dialog_view.go
│ │ ├── tx_withdraw_dialog_view.go
│ │ ├── validator_widget_view.go
│ │ ├── view_builder.go
│ │ ├── wallet_change_password_dialog_view.go
│ │ ├── wallet_create_address_dialog_view.go
│ │ ├── wallet_default_fee_dialog_view.go
│ │ ├── wallet_password_dialog_view.go
│ │ ├── wallet_seed_dialog_view.go
│ │ └── wallet_widget_view.go
│ ├── helper.go
│ ├── importer.go
│ ├── shell/
│ │ ├── main.go
│ │ └── main_test.go
│ └── wallet/
│ ├── address.go
│ ├── create.go
│ ├── fee.go
│ ├── info.go
│ ├── main.go
│ ├── neuter.go
│ ├── password.go
│ ├── recover.go
│ ├── send.go
│ └── transaction.go
├── committee/
│ ├── committee.go
│ ├── committee_test.go
│ └── interface.go
├── config/
│ ├── banned_addrs.json
│ ├── bootstrap.json
│ ├── config.go
│ ├── config_test.go
│ ├── errors.go
│ └── example_config.toml
├── consensus/
│ ├── commit.go
│ ├── config.go
│ ├── config_test.go
│ ├── consensus.go
│ ├── consensus_test.go
│ ├── cp.go
│ ├── cp_decide.go
│ ├── cp_mainvote.go
│ ├── cp_prevote.go
│ ├── cp_test.go
│ ├── errors.go
│ ├── height.go
│ ├── height_test.go
│ ├── interface.go
│ ├── log/
│ │ ├── log.go
│ │ ├── log_test.go
│ │ └── messages.go
│ ├── manager/
│ │ ├── interface.go
│ │ ├── manager.go
│ │ ├── manager_test.go
│ │ └── mock.go
│ ├── mediator.go
│ ├── mock.go
│ ├── precommit.go
│ ├── precommit_test.go
│ ├── prepare.go
│ ├── prepare_test.go
│ ├── propose.go
│ ├── propose_test.go
│ ├── spec/
│ │ ├── .gitignore
│ │ ├── Pactus.cfg
│ │ ├── Pactus.tla
│ │ └── README.md
│ ├── state.go
│ ├── ticker.go
│ └── voteset/
│ ├── binary_voteset.go
│ ├── block_voteset.go
│ ├── errors.go
│ ├── vote_box.go
│ ├── vote_box_test.go
│ ├── voteset.go
│ └── voteset_test.go
├── consensusv2/
│ ├── commit.go
│ ├── config.go
│ ├── config_test.go
│ ├── consensus.go
│ ├── consensus_test.go
│ ├── cp.go
│ ├── cp_decide.go
│ ├── cp_mainvote.go
│ ├── cp_prevote.go
│ ├── cp_test.go
│ ├── errors.go
│ ├── height.go
│ ├── height_test.go
│ ├── log/
│ │ ├── log.go
│ │ ├── log_test.go
│ │ └── messages.go
│ ├── mediator.go
│ ├── precommit.go
│ ├── precommit_test.go
│ ├── propose.go
│ ├── propose_test.go
│ ├── spec/
│ │ ├── .gitignore
│ │ ├── Pactus.cfg
│ │ ├── Pactus.tla
│ │ └── README.md
│ ├── state.go
│ ├── ticker.go
│ └── voteset/
│ ├── binary_voteset.go
│ ├── block_voteset.go
│ ├── errors.go
│ ├── vote_box.go
│ ├── vote_box_test.go
│ ├── voteset.go
│ └── voteset_test.go
├── crypto/
│ ├── address.go
│ ├── address_test.go
│ ├── address_type.go
│ ├── bls/
│ │ ├── bls.go
│ │ ├── bls_bench_test.go
│ │ ├── bls_test.go
│ │ ├── errors.go
│ │ ├── hdkeychain/
│ │ │ ├── errors.go
│ │ │ ├── extendedkey.go
│ │ │ └── extendedkey_test.go
│ │ ├── private_key.go
│ │ ├── private_key_test.go
│ │ ├── public_key.go
│ │ ├── public_key_test.go
│ │ ├── signature.go
│ │ ├── signature_test.go
│ │ ├── validator_key.go
│ │ └── validator_key_test.go
│ ├── crypto.go
│ ├── ed25519/
│ │ ├── ed25519.go
│ │ ├── ed25519_test.go
│ │ ├── errors.go
│ │ ├── hdkeychain/
│ │ │ ├── errors.go
│ │ │ ├── extendedkey.go
│ │ │ └── extendedkey_test.go
│ │ ├── private_key.go
│ │ ├── private_key_test.go
│ │ ├── public_key.go
│ │ ├── public_key_test.go
│ │ ├── signature.go
│ │ └── signature_test.go
│ ├── errors.go
│ ├── hash/
│ │ ├── errors.go
│ │ ├── hash.go
│ │ └── hash_test.go
│ ├── private_key.go
│ ├── public_key.go
│ └── signature.go
├── docs/
│ ├── bootstrap.md
│ ├── gtk-gui-development.md
│ ├── install.md
│ ├── metrics.md
│ ├── patching.md
│ ├── release-candidate.md
│ ├── releasing.md
│ └── update-dependencies.md
├── execution/
│ ├── errors.go
│ ├── execution.go
│ ├── execution_test.go
│ └── executor/
│ ├── batch_transfer.go
│ ├── batch_transfer_test.go
│ ├── bond.go
│ ├── bond_test.go
│ ├── errors.go
│ ├── executor.go
│ ├── executor_test.go
│ ├── sortition.go
│ ├── sortition_test.go
│ ├── transfer.go
│ ├── transfer_test.go
│ ├── unbond.go
│ ├── unbond_test.go
│ ├── withdraw.go
│ └── withdraw_test.go
├── genesis/
│ ├── genesis.go
│ ├── genesis_params.go
│ ├── genesis_test.go
│ ├── mainnet.go
│ ├── mainnet.json
│ ├── testnet.go
│ └── testnet.json
├── go.mod
├── go.sum
├── network/
│ ├── config.go
│ ├── config_test.go
│ ├── dht.go
│ ├── errors.go
│ ├── gater.go
│ ├── gater_test.go
│ ├── gossip.go
│ ├── gossip_test.go
│ ├── interface.go
│ ├── mdns.go
│ ├── mdns_test.go
│ ├── mock.go
│ ├── network.go
│ ├── network_test.go
│ ├── notifee.go
│ ├── peermgr.go
│ ├── peermgr_test.go
│ ├── stream.go
│ ├── stream_test.go
│ ├── utils.go
│ └── utils_test.go
├── node/
│ ├── node.go
│ └── node_test.go
├── sandbox/
│ ├── interface.go
│ ├── mock.go
│ ├── sandbox.go
│ └── sandbox_test.go
├── scripts/
│ └── snapshot.py
├── sortition/
│ ├── proof.go
│ ├── proof_test.go
│ ├── seed.go
│ ├── seed_test.go
│ ├── sortition.go
│ ├── sortition_test.go
│ ├── vrf.go
│ └── vrf_test.go
├── state/
│ ├── errors.go
│ ├── execution.go
│ ├── execution_test.go
│ ├── facade.go
│ ├── lastinfo/
│ │ ├── last_info.go
│ │ └── last_info_test.go
│ ├── mock.go
│ ├── param/
│ │ ├── foundation_mainnet.json
│ │ ├── foundation_testnet.json
│ │ └── param.go
│ ├── score/
│ │ ├── score.go
│ │ └── score_test.go
│ ├── state.go
│ ├── state_test.go
│ ├── validation.go
│ └── validation_test.go
├── store/
│ ├── account.go
│ ├── account_test.go
│ ├── block.go
│ ├── block_test.go
│ ├── config.go
│ ├── config_test.go
│ ├── errors.go
│ ├── interface.go
│ ├── mock.go
│ ├── store.go
│ ├── store_test.go
│ ├── tx.go
│ ├── validator.go
│ └── validator_test.go
├── sync/
│ ├── bundle/
│ │ ├── bundle.go
│ │ ├── bundle_test.go
│ │ └── message/
│ │ ├── block_announce.go
│ │ ├── block_announce_test.go
│ │ ├── blocks_request.go
│ │ ├── blocks_request_test.go
│ │ ├── blocks_response.go
│ │ ├── blocks_response_test.go
│ │ ├── errors.go
│ │ ├── hello.go
│ │ ├── hello_ack.go
│ │ ├── hello_ack_test.go
│ │ ├── hello_test.go
│ │ ├── message.go
│ │ ├── message_test.go
│ │ ├── proposal.go
│ │ ├── proposal_test.go
│ │ ├── query_proposal.go
│ │ ├── query_proposal_test.go
│ │ ├── query_votes.go
│ │ ├── query_votes_test.go
│ │ ├── transactions.go
│ │ ├── transactions_test.go
│ │ ├── vote.go
│ │ └── vote_test.go
│ ├── cache/
│ │ ├── cache.go
│ │ └── cache_test.go
│ ├── config.go
│ ├── config_test.go
│ ├── firewall/
│ │ ├── config.go
│ │ ├── errors.go
│ │ ├── firewall.go
│ │ └── firewall_test.go
│ ├── handler.go
│ ├── handler_block_announce.go
│ ├── handler_block_announce_test.go
│ ├── handler_blocks_request.go
│ ├── handler_blocks_request_test.go
│ ├── handler_blocks_response.go
│ ├── handler_blocks_response_test.go
│ ├── handler_hello.go
│ ├── handler_hello_ack.go
│ ├── handler_hello_ack_test.go
│ ├── handler_hello_test.go
│ ├── handler_proposal.go
│ ├── handler_proposal_test.go
│ ├── handler_query_proposal.go
│ ├── handler_query_proposal_test.go
│ ├── handler_query_votes.go
│ ├── handler_query_votes_test.go
│ ├── handler_transactions.go
│ ├── handler_transactions_test.go
│ ├── handler_vote.go
│ ├── handler_vote_test.go
│ ├── interface.go
│ ├── mock.go
│ ├── peerset/
│ │ ├── peer/
│ │ │ ├── metric/
│ │ │ │ ├── metric.go
│ │ │ │ └── metric_test.go
│ │ │ ├── peer.go
│ │ │ ├── peer_test.go
│ │ │ ├── service/
│ │ │ │ ├── services.go
│ │ │ │ └── services_test.go
│ │ │ └── status/
│ │ │ └── status.go
│ │ ├── peer_set.go
│ │ ├── peer_set_test.go
│ │ └── session/
│ │ ├── manager.go
│ │ ├── session.go
│ │ └── stats.go
│ ├── sync.go
│ └── sync_test.go
├── tests/
│ ├── account_test.go
│ ├── block_test.go
│ ├── main_test.go
│ ├── transaction_test.go
│ └── validator_test.go
├── txpool/
│ ├── config.go
│ ├── config_test.go
│ ├── errors.go
│ ├── interface.go
│ ├── pool.go
│ ├── txpool.go
│ ├── txpool_mock.go
│ └── txpool_test.go
├── types/
│ ├── account/
│ │ ├── account.go
│ │ └── account_test.go
│ ├── amount/
│ │ ├── amount.go
│ │ ├── amount_test.go
│ │ └── errors.go
│ ├── block/
│ │ ├── block.go
│ │ ├── block_test.go
│ │ ├── errors.go
│ │ ├── header.go
│ │ ├── txs.go
│ │ └── txs_test.go
│ ├── certificate/
│ │ ├── certificate.go
│ │ ├── certificate_test.go
│ │ ├── errors.go
│ │ ├── power.go
│ │ └── power_test.go
│ ├── height.go
│ ├── height_test.go
│ ├── proposal/
│ │ ├── errors.go
│ │ ├── proposal.go
│ │ └── proposal_test.go
│ ├── protocol/
│ │ ├── protocol.go
│ │ └── protocol_test.go
│ ├── round.go
│ ├── round_test.go
│ ├── tx/
│ │ ├── errors.go
│ │ ├── factory.go
│ │ ├── payload/
│ │ │ ├── batch_transfer.go
│ │ │ ├── batch_transfer_test.go
│ │ │ ├── bond.go
│ │ │ ├── bond_test.go
│ │ │ ├── errors.go
│ │ │ ├── payload.go
│ │ │ ├── sortition.go
│ │ │ ├── sortition_test.go
│ │ │ ├── transfer.go
│ │ │ ├── transfer_test.go
│ │ │ ├── unbond.go
│ │ │ ├── unbond_test.go
│ │ │ ├── withdraw.go
│ │ │ └── withdraw_test.go
│ │ ├── tx.go
│ │ └── tx_test.go
│ ├── validator/
│ │ ├── validator.go
│ │ └── validator_test.go
│ └── vote/
│ ├── cp_just.go
│ ├── cp_vote.go
│ ├── errors.go
│ ├── vote.go
│ ├── vote_test.go
│ └── vote_type.go
├── util/
│ ├── bech32m/
│ │ ├── bech32m.go
│ │ ├── bech32m_test.go
│ │ └── error.go
│ ├── bip39/
│ │ ├── README.md
│ │ ├── bip39.go
│ │ ├── bip39_test.go
│ │ ├── example_test.go
│ │ └── wordlists/
│ │ ├── chinese_simplified.go
│ │ ├── chinese_traditional.go
│ │ ├── czech.go
│ │ ├── english.go
│ │ ├── french.go
│ │ ├── italian.go
│ │ ├── japanese.go
│ │ ├── korean.go
│ │ └── spanish.go
│ ├── downloader/
│ │ ├── chunk.go
│ │ ├── chunk_test.go
│ │ ├── downloader.go
│ │ ├── downloader_test.go
│ │ ├── errors.go
│ │ └── options.go
│ ├── encoding/
│ │ ├── encoding.go
│ │ └── encoding_test.go
│ ├── htpasswd/
│ │ ├── htpasswd.go
│ │ └── htpasswd_test.go
│ ├── io.go
│ ├── io_test.go
│ ├── ipblocker/
│ │ ├── ipblocker.go
│ │ └── ipblocker_test.go
│ ├── linkedlist/
│ │ ├── linkedlist.go
│ │ └── linkedlist_test.go
│ ├── linkedmap/
│ │ ├── linkedmap.go
│ │ └── linkedmap_test.go
│ ├── logger/
│ │ ├── config.go
│ │ ├── logger.go
│ │ └── logger_test.go
│ ├── net.go
│ ├── ntp/
│ │ ├── ntp.go
│ │ ├── ntp_test.go
│ │ └── query.go
│ ├── number.go
│ ├── number_test.go
│ ├── pairslice/
│ │ ├── pairslice.go
│ │ └── pairslice_test.go
│ ├── persistentmerkle/
│ │ ├── merkle.go
│ │ └── merkle_test.go
│ ├── prompt/
│ │ └── prompt.go
│ ├── ratelimit/
│ │ ├── ratelimit.go
│ │ └── ratelimit_test.go
│ ├── shell/
│ │ ├── shell.go
│ │ └── shell_test.go
│ ├── simplemerkle/
│ │ ├── merkle.go
│ │ ├── merkle_test.go
│ │ └── printing.go
│ ├── slice.go
│ ├── slice_test.go
│ ├── terminal/
│ │ ├── terminal.go
│ │ └── terminal_test.go
│ ├── testsuite/
│ │ ├── logger.go
│ │ └── testsuite.go
│ ├── time.go
│ ├── time_test.go
│ ├── utils.go
│ └── utils_test.go
├── version/
│ ├── agent.go
│ ├── agent_test.go
│ ├── version.go
│ ├── version.json
│ └── version_test.go
├── wallet/
│ ├── addresses.go
│ ├── addresses_test.go
│ ├── addresspath/
│ │ ├── errors.go
│ │ ├── path.go
│ │ └── path_test.go
│ ├── encrypter/
│ │ ├── encrypter.go
│ │ ├── encrypter_test.go
│ │ ├── error.go
│ │ ├── params.go
│ │ └── params_test.go
│ ├── errors.go
│ ├── manager/
│ │ ├── config.go
│ │ ├── config_test.go
│ │ ├── errors.go
│ │ ├── interface.go
│ │ ├── manager.go
│ │ ├── manager_mock.go
│ │ └── manager_test.go
│ ├── provider/
│ │ ├── interface.go
│ │ ├── local/
│ │ │ └── local.go
│ │ ├── offline/
│ │ │ └── offline.go
│ │ ├── provider_mock.go
│ │ └── remote/
│ │ ├── errors.go
│ │ ├── remote.go
│ │ ├── servers.go
│ │ └── servers.json
│ ├── storage/
│ │ ├── errors.go
│ │ ├── interface.go
│ │ ├── jsonstorage/
│ │ │ ├── errors.go
│ │ │ ├── storage.go
│ │ │ ├── storage_test.go
│ │ │ ├── store.go
│ │ │ ├── testdata/
│ │ │ │ ├── neuter_wallet
│ │ │ │ ├── testnet_wallet
│ │ │ │ ├── unsupported_wallet
│ │ │ │ ├── wallet_version_1
│ │ │ │ ├── wallet_version_2
│ │ │ │ ├── wallet_version_3
│ │ │ │ ├── wallet_version_4
│ │ │ │ └── wallet_version_5
│ │ │ ├── upgrader.go
│ │ │ ├── upgrader_test.go
│ │ │ └── version.go
│ │ ├── sqlitestorage/
│ │ │ ├── options.go
│ │ │ ├── sql.go
│ │ │ ├── storage.go
│ │ │ ├── storage_test.go
│ │ │ └── version.go
│ │ └── storage_mock.go
│ ├── transactions.go
│ ├── transactions_test.go
│ ├── tx_builder.go
│ ├── types/
│ │ └── types.go
│ ├── vault/
│ │ ├── errors.go
│ │ ├── utils.go
│ │ ├── utils_test.go
│ │ ├── vault.go
│ │ └── vault_test.go
│ ├── wallet.go
│ └── wallet_test.go
└── www/
├── grpc/
│ ├── README.md
│ ├── basicauth/
│ │ ├── basicauth.go
│ │ └── basicauth_test.go
│ ├── blockchain.go
│ ├── blockchain_test.go
│ ├── buf/
│ │ ├── buf.gen.yaml
│ │ ├── buf.yaml
│ │ ├── grpc-gateway.config.yaml
│ │ ├── openapi.config.yaml
│ │ └── templates/
│ │ ├── components.tmpl
│ │ ├── grpc.md.tmpl
│ │ ├── json-rpc.md.tmpl
│ │ └── openrpc.tmpl
│ ├── config.go
│ ├── gen/
│ │ ├── dart/
│ │ │ ├── blockchain.pb.dart
│ │ │ ├── blockchain.pbenum.dart
│ │ │ ├── blockchain.pbjson.dart
│ │ │ ├── blockchain.pbserver.dart
│ │ │ ├── network.pb.dart
│ │ │ ├── network.pbenum.dart
│ │ │ ├── network.pbjson.dart
│ │ │ ├── network.pbserver.dart
│ │ │ ├── transaction.pb.dart
│ │ │ ├── transaction.pbenum.dart
│ │ │ ├── transaction.pbjson.dart
│ │ │ ├── transaction.pbserver.dart
│ │ │ ├── utils.pb.dart
│ │ │ ├── utils.pbenum.dart
│ │ │ ├── utils.pbjson.dart
│ │ │ ├── utils.pbserver.dart
│ │ │ ├── wallet.pb.dart
│ │ │ ├── wallet.pbenum.dart
│ │ │ ├── wallet.pbjson.dart
│ │ │ └── wallet.pbserver.dart
│ │ ├── docs/
│ │ │ ├── grpc.md
│ │ │ └── json-rpc.md
│ │ ├── go/
│ │ │ ├── blockchain.cobra.pb.go
│ │ │ ├── blockchain.pb.go
│ │ │ ├── blockchain.pb.gw.go
│ │ │ ├── blockchain_grpc.pb.go
│ │ │ ├── blockchain_jgw.pb.go
│ │ │ ├── network.cobra.pb.go
│ │ │ ├── network.pb.go
│ │ │ ├── network.pb.gw.go
│ │ │ ├── network_grpc.pb.go
│ │ │ ├── network_jgw.pb.go
│ │ │ ├── transaction.cobra.pb.go
│ │ │ ├── transaction.pb.go
│ │ │ ├── transaction.pb.gw.go
│ │ │ ├── transaction_grpc.pb.go
│ │ │ ├── transaction_jgw.pb.go
│ │ │ ├── utils.cobra.pb.go
│ │ │ ├── utils.pb.go
│ │ │ ├── utils.pb.gw.go
│ │ │ ├── utils_grpc.pb.go
│ │ │ ├── utils_jgw.pb.go
│ │ │ ├── wallet.cobra.pb.go
│ │ │ ├── wallet.pb.go
│ │ │ ├── wallet.pb.gw.go
│ │ │ ├── wallet_grpc.pb.go
│ │ │ └── wallet_jgw.pb.go
│ │ ├── java/
│ │ │ └── pactus/
│ │ │ ├── BlockchainGrpc.java
│ │ │ ├── BlockchainOuterClass.java
│ │ │ ├── NetworkGrpc.java
│ │ │ ├── NetworkOuterClass.java
│ │ │ ├── TransactionGrpc.java
│ │ │ ├── TransactionOuterClass.java
│ │ │ ├── UtilsGrpc.java
│ │ │ ├── UtilsOuterClass.java
│ │ │ ├── WalletGrpc.java
│ │ │ └── WalletOuterClass.java
│ │ ├── js/
│ │ │ ├── blockchain_grpc_pb.js
│ │ │ ├── blockchain_grpc_web_pb.js
│ │ │ ├── blockchain_pb.js
│ │ │ ├── network_grpc_pb.js
│ │ │ ├── network_grpc_web_pb.js
│ │ │ ├── network_pb.js
│ │ │ ├── transaction_grpc_pb.js
│ │ │ ├── transaction_grpc_web_pb.js
│ │ │ ├── transaction_pb.js
│ │ │ ├── utils_grpc_pb.js
│ │ │ ├── utils_grpc_web_pb.js
│ │ │ ├── utils_pb.js
│ │ │ ├── wallet_grpc_pb.js
│ │ │ ├── wallet_grpc_web_pb.js
│ │ │ └── wallet_pb.js
│ │ ├── open-rpc/
│ │ │ └── pactus-openrpc.json
│ │ ├── python/
│ │ │ ├── blockchain_pb2.py
│ │ │ ├── blockchain_pb2.pyi
│ │ │ ├── blockchain_pb2_grpc.py
│ │ │ ├── network_pb2.py
│ │ │ ├── network_pb2.pyi
│ │ │ ├── network_pb2_grpc.py
│ │ │ ├── transaction_pb2.py
│ │ │ ├── transaction_pb2.pyi
│ │ │ ├── transaction_pb2_grpc.py
│ │ │ ├── utils_pb2.py
│ │ │ ├── utils_pb2.pyi
│ │ │ ├── utils_pb2_grpc.py
│ │ │ ├── wallet_pb2.py
│ │ │ ├── wallet_pb2.pyi
│ │ │ └── wallet_pb2_grpc.py
│ │ └── rust/
│ │ ├── pactus.rs
│ │ ├── pactus.serde.rs
│ │ └── pactus.tonic.rs
│ ├── middleware.go
│ ├── middleware_test.go
│ ├── network.go
│ ├── network_test.go
│ ├── proto/
│ │ ├── .clang-format
│ │ ├── blockchain.proto
│ │ ├── network.proto
│ │ ├── transaction.proto
│ │ ├── utils.proto
│ │ └── wallet.proto
│ ├── server.go
│ ├── server_test.go
│ ├── transaction.go
│ ├── transaction_test.go
│ ├── utils.go
│ ├── utils_test.go
│ ├── wallet.go
│ └── wallet_test.go
├── html/
│ ├── README.md
│ ├── blockchain.go
│ ├── blockchain_test.go
│ ├── config.go
│ ├── html_test.go
│ ├── middleware.go
│ ├── middleware_test.go
│ ├── network.go
│ ├── network_test.go
│ ├── server.go
│ ├── transaction.go
│ └── transaction_test.go
├── http/
│ ├── config.go
│ ├── config_test.go
│ ├── server.go
│ ├── server_test.go
│ └── swagger-ui/
│ ├── LICENSE
│ ├── README.md
│ ├── index.css
│ ├── index.html
│ ├── oauth2-redirect.html
│ ├── pactus.swagger.json
│ ├── swagger-initializer.js
│ ├── swagger-ui-bundle.js
│ ├── swagger-ui-es-bundle-core.js
│ ├── swagger-ui-es-bundle.js
│ ├── swagger-ui-standalone-preset.js
│ ├── swagger-ui.css
│ └── swagger-ui.js
├── jsonrpc/
│ ├── config.go
│ └── server.go
└── zmq/
├── config.go
├── config_test.go
├── mock.go
├── publisher.go
├── publisher_block_info.go
├── publisher_block_info_test.go
├── publisher_raw_block.go
├── publisher_raw_block_test.go
├── publisher_raw_tx.go
├── publisher_raw_tx_test.go
├── publisher_test.go
├── publisher_tx_info.go
├── publisher_tx_info_test.go
├── server.go
├── server_test.go
├── topic.go
└── topic_test.go
Showing preview only (2,440K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (25946 symbols across 640 files)
FILE: .github/releasers/windows/gtk-win-bundler.py
class GTKBundler (line 15) | class GTKBundler:
method __init__ (line 16) | def __init__(self, mingw_prefix: str, target_dir: str):
method run_command (line 20) | def run_command(self, cmd: List[str]) -> str:
method get_dependencies (line 29) | def get_dependencies(self, exe_path: Path, dependencies: List[Path]) -...
method copy_file (line 45) | def copy_file(self, src: Path, dst: Path) -> None:
method copy_dir (line 66) | def copy_dir(self, src_path: str, dst_path: str) -> None:
method copy_gtk_dependencies (line 80) | def copy_gtk_dependencies(self, exe_path: Path, target_exe_dir: Path) ...
method copy_gtk_resources (line 102) | def copy_gtk_resources(self) -> None:
method copy_gtk_executables (line 149) | def copy_gtk_executables(self, target_exe_dir: Path) -> None:
method bundle_application (line 165) | def bundle_application(self, exe_path: Path) -> None:
function main (line 182) | def main():
FILE: cmd/cmd.go
constant DefaultHomeDirName (line 30) | DefaultHomeDirName = "pactus"
constant DefaultWalletsDirName (line 31) | DefaultWalletsDirName = "wallets"
constant DefaultWalletName (line 32) | DefaultWalletName = "default_wallet"
function PactusDefaultHomeDir (line 35) | func PactusDefaultHomeDir() string {
function PactusWalletDir (line 47) | func PactusWalletDir(home string) string {
function PactusGenesisPath (line 51) | func PactusGenesisPath(home string) string {
function PactusConfigPath (line 55) | func PactusConfigPath(home string) string {
function PactusLockFilePath (line 59) | func PactusLockFilePath(home string) string {
function PactusDefaultWalletPath (line 63) | func PactusDefaultWalletPath(home string) string {
function PactusDaemonName (line 67) | func PactusDaemonName() string {
function CreateNode (line 75) | func CreateNode(ctx context.Context, numValidators int, chain genesis.Ch...
function StartNode (line 142) | func StartNode(ctx context.Context, workingDir string, passwordFetcher f...
function makeLocalGenesis (line 196) | func makeLocalGenesis(wlt *wallet.Wallet) *genesis.Genesis {
function MakeConfig (line 226) | func MakeConfig(workingDir string) (*config.Config, *genesis.Genesis, er...
function RecoverConfig (line 280) | func RecoverConfig(confPath string, defConf *config.Config, chainType ge...
function MakeRewardAddresses (line 325) | func MakeRewardAddresses(wlt *wallet.Wallet, valList []types.AddressInfo,
function MakeValidatorKey (line 376) | func MakeValidatorKey(walletInstance *wallet.Wallet, valAddrsInfo []type...
function RecoverWalletAddresses (line 411) | func RecoverWalletAddresses(wlt *wallet.Wallet, password string) {
FILE: cmd/cmd_test.go
function TestMakeConfig (line 16) | func TestMakeConfig(t *testing.T) {
function TestPathsUnix (line 68) | func TestPathsUnix(t *testing.T) {
function TestPathsWindows (line 108) | func TestPathsWindows(t *testing.T) {
function TestMakeRewardAddresses (line 148) | func TestMakeRewardAddresses(t *testing.T) {
function TestCreateNode (line 251) | func TestCreateNode(t *testing.T) {
FILE: cmd/daemon/import.go
function buildImportCmd (line 18) | func buildImportCmd(parentCmd *cobra.Command) {
function downloadProgressBar (line 116) | func downloadProgressBar(fileName string) func(stats downloader.Stats) {
FILE: cmd/daemon/init.go
function buildInitCmd (line 18) | func buildInitCmd(parentCmd *cobra.Command) {
FILE: cmd/daemon/main.go
function init (line 10) | func init() {
function main (line 14) | func main() {
function addWorkingDirOption (line 36) | func addWorkingDirOption(c *cobra.Command) *string {
FILE: cmd/daemon/prune.go
function buildPruneCmd (line 20) | func buildPruneCmd(parentCmd *cobra.Command) {
function pruningProgressBar (line 126) | func pruningProgressBar(prunedCount, skippedCount, totalCount uint32) {
FILE: cmd/daemon/start.go
function buildStartCmd (line 20) | func buildStartCmd(parentCmd *cobra.Command) {
FILE: cmd/daemon/version.go
function buildVersionCmd (line 9) | func buildVersionCmd(parentCmd *cobra.Command) {
FILE: cmd/gtk/app/run.go
type GUI (line 18) | type GUI struct
method Cleanup (line 118) | func (g *GUI) Cleanup() {
function Run (line 31) | func Run(ctx context.Context, conn grpc.ClientConnInterface,
FILE: cmd/gtk/assets/assets.go
function InitAssets (line 10) | func InitAssets() {
function missingPixbuf (line 17) | func missingPixbuf(size int) *gdk.Pixbuf {
FILE: cmd/gtk/assets/icons.go
function initIcons (line 58) | func initIcons() {
FILE: cmd/gtk/assets/images.go
function initImages (line 26) | func initImages() {
FILE: cmd/gtk/controller/address_details_dialog_controller.go
type AddressDetailsDialogController (line 11) | type AddressDetailsDialogController struct
method Run (line 23) | func (c *AddressDetailsDialogController) Run(addr string) {
function NewAddressDetailsDialogController (line 16) | func NewAddressDetailsDialogController(
FILE: cmd/gtk/controller/address_label_dialog_controller.go
type AddressLabelDialogController (line 11) | type AddressLabelDialogController struct
method Run (line 23) | func (c *AddressLabelDialogController) Run(address string) {
function NewAddressLabelDialogController (line 16) | func NewAddressLabelDialogController(
FILE: cmd/gtk/controller/address_private_key_dialog_controller.go
type AddressPrivateKeyDialogController (line 11) | type AddressPrivateKeyDialogController struct
method Run (line 23) | func (c *AddressPrivateKeyDialogController) Run(addr string) {
function NewAddressPrivateKeyDialogController (line 16) | func NewAddressPrivateKeyDialogController(
FILE: cmd/gtk/controller/committee_widget_controller.go
type CommitteeWidgetController (line 21) | type CommitteeWidgetController struct
method BuildView (line 32) | func (c *CommitteeWidgetController) BuildView(ctx context.Context) err...
method refresh (line 40) | func (c *CommitteeWidgetController) refresh(_ context.Context) {
function NewCommitteeWidgetController (line 26) | func NewCommitteeWidgetController(
FILE: cmd/gtk/controller/main_window_controller.go
type MainWindowController (line 10) | type MainWindowController struct
method BuildView (line 18) | func (c *MainWindowController) BuildView(nav *Navigator) {
function NewMainWindowController (line 14) | func NewMainWindowController(view *view.MainWindowView) *MainWindowContr...
FILE: cmd/gtk/controller/navigator.go
type Navigator (line 14) | type Navigator struct
method ShowAbout (line 30) | func (*Navigator) ShowAbout() {
method ShowAboutGtk (line 38) | func (*Navigator) ShowAboutGtk() {
method ShowWalletShowSeed (line 46) | func (n *Navigator) ShowWalletShowSeed() {
method ShowWalletNewAddress (line 54) | func (n *Navigator) ShowWalletNewAddress() {
method ShowWalletSetDefaultFee (line 66) | func (n *Navigator) ShowWalletSetDefaultFee() {
method ShowWalletChangePassword (line 78) | func (n *Navigator) ShowWalletChangePassword() {
method ShowTransactionTransfer (line 90) | func (n *Navigator) ShowTransactionTransfer() {
method ShowTransactionBond (line 102) | func (n *Navigator) ShowTransactionBond() {
method ShowTransactionUnbond (line 114) | func (n *Navigator) ShowTransactionUnbond() {
method ShowTransactionWithdraw (line 126) | func (n *Navigator) ShowTransactionWithdraw() {
method BrowseWebsite (line 138) | func (n *Navigator) BrowseWebsite() {
method BrowseExplorer (line 142) | func (n *Navigator) BrowseExplorer() {
method BrowseDocs (line 146) | func (n *Navigator) BrowseDocs() {
method openWebsite (line 150) | func (*Navigator) openWebsite(url string) {
method Quit (line 154) | func (n *Navigator) Quit() {
function NewNavigator (line 20) | func NewNavigator(gtkApp *gtk.Application,
FILE: cmd/gtk/controller/network_widget_controller.go
function peerDirectionString (line 17) | func peerDirectionString(d pactus.Direction) string {
type NetworkWidgetController (line 31) | type NetworkWidgetController struct
method BuildView (line 42) | func (c *NetworkWidgetController) BuildView(ctx context.Context) error {
method refresh (line 50) | func (c *NetworkWidgetController) refresh() {
function NewNetworkWidgetController (line 36) | func NewNetworkWidgetController(
FILE: cmd/gtk/controller/node_widget_controller.go
constant clockOutOfSyncThreshold (line 22) | clockOutOfSyncThreshold = 5 * time.Second
type NodeWidgetController (line 24) | type NodeWidgetController struct
method BuildView (line 35) | func (c *NodeWidgetController) BuildView(ctx context.Context, connecti...
method timeout1 (line 70) | func (c *NodeWidgetController) timeout1() {
method timeout10 (line 100) | func (c *NodeWidgetController) timeout10() {
method setClockOffset (line 153) | func (c *NodeWidgetController) setClockOffset(styleContext *gtk.StyleC...
method setInCommittee (line 175) | func (c *NodeWidgetController) setInCommittee(inCommittee bool) {
function NewNodeWidgetController (line 29) | func NewNodeWidgetController(view *view.NodeWidgetView, model *model.Nod...
constant syncProgressWindowBlocks (line 68) | syncProgressWindowBlocks = 60
FILE: cmd/gtk/controller/password_prompt.go
function PasswordProvider (line 13) | func PasswordProvider(model *model.WalletModel) (string, bool) {
function PromptWalletPassword (line 23) | func PromptWalletPassword() (string, bool) {
FILE: cmd/gtk/controller/tx_bond_dialog_controller.go
type TxBondDialogController (line 17) | type TxBondDialogController struct
method Run (line 38) | func (c *TxBondDialogController) Run() {
method onSenderChanged (line 63) | func (c *TxBondDialogController) onSenderChanged() {
method onReceiverChanged (line 79) | func (c *TxBondDialogController) onReceiverChanged() {
method onFeeChanged (line 97) | func (c *TxBondDialogController) onFeeChanged() {
method onSend (line 102) | func (c *TxBondDialogController) onSend() {
method onCancel (line 174) | func (c *TxBondDialogController) onCancel() {
function NewTxBondDialogController (line 22) | func NewTxBondDialogController(
function setHint (line 29) | func setHint(lbl *gtk.Label, hint string) {
FILE: cmd/gtk/controller/tx_transfer_dialog_controller.go
type TxTransferDialogController (line 17) | type TxTransferDialogController struct
method Run (line 38) | func (c *TxTransferDialogController) Run() {
method onSenderChanged (line 62) | func (c *TxTransferDialogController) onSenderChanged() {
method onReceiverChanged (line 78) | func (c *TxTransferDialogController) onReceiverChanged() {
method onFeeChanged (line 87) | func (c *TxTransferDialogController) onFeeChanged() {
method onSend (line 93) | func (c *TxTransferDialogController) onSend() {
method onCancel (line 163) | func (c *TxTransferDialogController) onCancel() {
function NewTxTransferDialogController (line 22) | func NewTxTransferDialogController(
function setHintLabel (line 29) | func setHintLabel(lbl *gtk.Label, hint string) {
FILE: cmd/gtk/controller/tx_unbond_dialog_controller.go
type TxUnbondDialogController (line 14) | type TxUnbondDialogController struct
method Run (line 26) | func (c *TxUnbondDialogController) Run() {
method onValidatorChanged (line 41) | func (c *TxUnbondDialogController) onValidatorChanged() {
method onSend (line 63) | func (c *TxUnbondDialogController) onSend() {
method onCancel (line 115) | func (c *TxUnbondDialogController) onCancel() {
function NewTxUnbondDialogController (line 19) | func NewTxUnbondDialogController(
FILE: cmd/gtk/controller/tx_withdraw_dialog_controller.go
type TxWithdrawDialogController (line 16) | type TxWithdrawDialogController struct
method Run (line 28) | func (c *TxWithdrawDialogController) Run() {
method applyDefaults (line 46) | func (c *TxWithdrawDialogController) applyDefaults() {
method populateCombos (line 52) | func (c *TxWithdrawDialogController) populateCombos() {
method onSenderChanged (line 63) | func (c *TxWithdrawDialogController) onSenderChanged() {
method onReceiverChanged (line 87) | func (c *TxWithdrawDialogController) onReceiverChanged() {
method onFeeChanged (line 97) | func (c *TxWithdrawDialogController) onFeeChanged() {
method onSend (line 102) | func (c *TxWithdrawDialogController) onSend() {
function NewTxWithdrawDialogController (line 21) | func NewTxWithdrawDialogController(
FILE: cmd/gtk/controller/validator_widget_controller.go
type ValidatorWidgetController (line 17) | type ValidatorWidgetController struct
method BuildView (line 28) | func (c *ValidatorWidgetController) BuildView(ctx context.Context) err...
method refresh (line 37) | func (c *ValidatorWidgetController) refresh() {
function NewValidatorWidgetController (line 22) | func NewValidatorWidgetController(
FILE: cmd/gtk/controller/wallet_change_password_dialog_controller.go
type WalletChangePasswordDialogController (line 11) | type WalletChangePasswordDialogController struct
method Run (line 23) | func (c *WalletChangePasswordDialogController) Run() {
function NewWalletChangePasswordDialogController (line 16) | func NewWalletChangePasswordDialogController(
FILE: cmd/gtk/controller/wallet_create_address_dialog_controller.go
type WalletCreateAddressDialogController (line 12) | type WalletCreateAddressDialogController struct
method Run (line 24) | func (c *WalletCreateAddressDialogController) Run() {
function NewWalletCreateAddressDialogController (line 17) | func NewWalletCreateAddressDialogController(
FILE: cmd/gtk/controller/wallet_default_fee_dialog_controller.go
type WalletDefaultFeeDialogController (line 15) | type WalletDefaultFeeDialogController struct
method Run (line 27) | func (c *WalletDefaultFeeDialogController) Run() {
function NewWalletDefaultFeeDialogController (line 20) | func NewWalletDefaultFeeDialogController(
FILE: cmd/gtk/controller/wallet_password_dialog_controller.go
type WalletPasswordDialogController (line 10) | type WalletPasswordDialogController struct
method Run (line 20) | func (c *WalletPasswordDialogController) Run() (string, bool) {
function NewWalletPasswordDialogController (line 14) | func NewWalletPasswordDialogController(
FILE: cmd/gtk/controller/wallet_seed_dialog_controller.go
type WalletSeedDialogController (line 11) | type WalletSeedDialogController struct
method Run (line 23) | func (c *WalletSeedDialogController) Run() {
function NewWalletSeedDialogController (line 16) | func NewWalletSeedDialogController(
FILE: cmd/gtk/controller/wallet_widget_controller.go
type WalletWidgetController (line 22) | type WalletWidgetController struct
method BuildView (line 38) | func (c *WalletWidgetController) BuildView(ctx context.Context, nav *N...
method selectedAddress (line 116) | func (c *WalletWidgetController) selectedAddress() string {
method Refresh (line 139) | func (c *WalletWidgetController) Refresh() {
method RefreshInfo (line 145) | func (c *WalletWidgetController) RefreshInfo() {
method RefreshAddresses (line 165) | func (c *WalletWidgetController) RefreshAddresses() {
method RefreshTransactions (line 185) | func (c *WalletWidgetController) RefreshTransactions() {
method ShowUpdateLabel (line 213) | func (c *WalletWidgetController) ShowUpdateLabel(address string) {
method ShowAddressDetails (line 221) | func (c *WalletWidgetController) ShowAddressDetails(address string) {
method ShowPrivateKey (line 227) | func (c *WalletWidgetController) ShowPrivateKey(address string) {
method prevTransactionsPage (line 233) | func (c *WalletWidgetController) prevTransactionsPage() {
method nextTransactionsPage (line 242) | func (c *WalletWidgetController) nextTransactionsPage() {
function NewWalletWidgetController (line 30) | func NewWalletWidgetController(view *view.WalletWidgetView, model *model...
function getDirectionTextWithIcon (line 126) | func getDirectionTextWithIcon(dir types.TxDirection) string {
FILE: cmd/gtk/gtkutil/format.go
function escapeMarkup (line 10) | func escapeMarkup(text string) string {
function SmallGray (line 24) | func SmallGray(text string) string {
function ImportedLabel (line 29) | func ImportedLabel(label string, imported bool) string {
function YesNo (line 40) | func YesNo(v bool) string {
function AvailabilityScorePercent (line 49) | func AvailabilityScorePercent(score float64) string {
FILE: cmd/gtk/gtkutil/format_test.go
function TestSmallGray_EscapesMarkup (line 11) | func TestSmallGray_EscapesMarkup(t *testing.T) {
FILE: cmd/gtk/gtkutil/gtkutil.go
function updateMessageDialog (line 22) | func updateMessageDialog(dlg *gtk.MessageDialog) {
function ShowQuestionDialog (line 36) | func ShowQuestionDialog(parent gtk.IWindow, msg string) bool {
function ShowInfoDialog (line 47) | func ShowInfoDialog(parent gtk.IWindow, msg string) {
function ShowWarningDialog (line 56) | func ShowWarningDialog(parent gtk.IWindow, msg string) {
function ShowErrorDialog (line 65) | func ShowErrorDialog(parent gtk.IWindow, msg string) {
function ShowError (line 75) | func ShowError(err error) {
function FatalErrorCheck (line 82) | func FatalErrorCheck(err error) {
type PixbufOption (line 90) | type PixbufOption
type pixbufOptions (line 92) | type pixbufOptions struct
function WithSize (line 98) | func WithSize(width, height int) PixbufOption {
function PixbufFromBytes (line 107) | func PixbufFromBytes(data []byte, opts ...PixbufOption) (*gdk.Pixbuf, er...
function ImageFromPixbuf (line 144) | func ImageFromPixbuf(pixbuf *gdk.Pixbuf) *gtk.Image {
function GetTextViewContent (line 155) | func GetTextViewContent(tv *gtk.TextView) string {
function SetTextViewContent (line 166) | func SetTextViewContent(tv *gtk.TextView, content string) {
function OpenURLInBrowser (line 175) | func OpenURLInBrowser(address string) error {
function BuildExtendedEntry (line 204) | func BuildExtendedEntry(builder *gtk.Builder, overlayID string) *gtk.Ent...
function SetCSSClass (line 246) | func SetCSSClass(widget *gtk.Widget, name string) {
function RunDialog (line 253) | func RunDialog(dlg *gtk.Dialog) gtk.ResponseType {
function ComboBoxActiveValue (line 265) | func ComboBoxActiveValue(combo *gtk.ComboBox) int {
function GetEntryText (line 281) | func GetEntryText(entry *gtk.Entry) string {
type Color (line 289) | type Color
constant ColorRed (line 292) | ColorRed Color = iota
constant ColorGreen (line 293) | ColorGreen
constant ColorBlue (line 294) | ColorBlue
constant ColorYellow (line 295) | ColorYellow
constant ColorOrange (line 296) | ColorOrange
constant ColorPurple (line 297) | ColorPurple
constant ColorGray (line 298) | ColorGray
function getColorHex (line 302) | func getColorHex(color Color) string {
function SetColoredText (line 323) | func SetColoredText(label *gtk.Label, str string, color Color) {
function IdleAddAsync (line 329) | func IdleAddAsync(fun func()) {
function IdleAddSync (line 339) | func IdleAddSync(fun func()) {
function IdleAddSyncT (line 347) | func IdleAddSyncT[T any](fun func() T) T {
function IdleAddSyncTT (line 355) | func IdleAddSyncTT[T1, T2 any](fun func() (T1, T2)) (T1, T2) {
function Logf (line 382) | func Logf(msg string, args ...any) {
function GoroutineID (line 386) | func GoroutineID() int64 {
FILE: cmd/gtk/main.go
constant appID (line 35) | appID = "com.github.pactus-project.pactus.pactus-gui"
function init (line 45) | func init() {
function main (line 62) | func main() {
type statusReporter (line 228) | type statusReporter
function reportStatus (line 230) | func reportStatus(cb statusReporter, msg string) {
function newRemoteGRPCConn (line 237) | func newRemoteGRPCConn(addr string, insecureCredentials bool) (*grpc.Cli...
function methodPrefixUnaryInterceptor (line 260) | func methodPrefixUnaryInterceptor(prefix string) grpc.UnaryClientInterce...
function methodPrefixStreamInterceptor (line 268) | func methodPrefixStreamInterceptor(prefix string) grpc.StreamClientInter...
function newNode (line 276) | func newNode(ctx context.Context, workingDir string, statusCb statusRepo...
FILE: cmd/gtk/model/committee_model.go
type CommitteeModel (line 13) | type CommitteeModel struct
method GetCommitteeInfo (line 30) | func (m *CommitteeModel) GetCommitteeInfo() (*pactus.GetCommitteeInfoR...
function NewCommitteeModel (line 19) | func NewCommitteeModel(
FILE: cmd/gtk/model/network_model.go
type NetworkModel (line 13) | type NetworkModel struct
method GetNetworkInfo (line 30) | func (m *NetworkModel) GetNetworkInfo() (*pactus.GetNetworkInfoRespons...
method ListPeers (line 35) | func (m *NetworkModel) ListPeers(includeDisconnected bool) (*pactus.Li...
function NewNetworkModel (line 19) | func NewNetworkModel(
FILE: cmd/gtk/model/node_model.go
type NodeModel (line 13) | type NodeModel struct
method GetBlockchainInfo (line 33) | func (m *NodeModel) GetBlockchainInfo() (*pactus.GetBlockchainInfoResp...
method GetCommitteeInfo (line 38) | func (m *NodeModel) GetCommitteeInfo() (*pactus.GetCommitteeInfoRespon...
method GetConsensusInfo (line 43) | func (m *NodeModel) GetConsensusInfo() (*pactus.GetConsensusInfoRespon...
method GetNodeInfo (line 48) | func (m *NodeModel) GetNodeInfo() (*pactus.GetNodeInfoResponse, error) {
function NewNodeModel (line 20) | func NewNodeModel(
FILE: cmd/gtk/model/validator_model.go
type ValidatorModel (line 13) | type ValidatorModel struct
method Validators (line 31) | func (m *ValidatorModel) Validators() ([]*pactus.ValidatorInfo, error) {
function NewValidatorModel (line 19) | func NewValidatorModel(
FILE: cmd/gtk/model/wallet_model.go
type WalletModel (line 20) | type WalletModel struct
method WalletName (line 57) | func (model *WalletModel) WalletName() string {
method IsEncrypted (line 61) | func (model *WalletModel) IsEncrypted() bool {
method WalletInfo (line 72) | func (model *WalletModel) WalletInfo() (*types.WalletInfo, error) {
method TotalBalance (line 97) | func (model *WalletModel) TotalBalance() (amount.Amount, error) {
method TotalStake (line 108) | func (model *WalletModel) TotalStake() (amount.Amount, error) {
method AddressInfo (line 119) | func (model *WalletModel) AddressInfo(addr string) *pactus.AddressInfo {
method ListAddresses (line 131) | func (model *WalletModel) ListAddresses(addressTypes ...crypto.Address...
method Balance (line 148) | func (model *WalletModel) Balance(addr string) (amount.Amount, error) {
method Stake (line 159) | func (model *WalletModel) Stake(addr string) (amount.Amount, error) {
method ValidatorInfo (line 170) | func (model *WalletModel) ValidatorInfo(addr string) *pactus.Validator...
method PrivateKey (line 181) | func (model *WalletModel) PrivateKey(password, addr string) (crypto.Pr...
method Mnemonic (line 206) | func (model *WalletModel) Mnemonic(password string) (string, error) {
method UpdatePassword (line 218) | func (model *WalletModel) UpdatePassword(oldPassword, newPassword stri...
method SetDefaultFee (line 228) | func (model *WalletModel) SetDefaultFee(fee amount.Amount) error {
method NewAddress (line 237) | func (model *WalletModel) NewAddress(
method AddressLabel (line 260) | func (model *WalletModel) AddressLabel(addr string) string {
method SetAddressLabel (line 272) | func (model *WalletModel) SetAddressLabel(addr, label string) error {
method AddressRows (line 283) | func (model *WalletModel) AddressRows() []AddressRow {
method MakeTransferTx (line 309) | func (model *WalletModel) MakeTransferTx(
method MakeBondTx (line 330) | func (model *WalletModel) MakeBondTx(
method MakeUnbondTx (line 362) | func (model *WalletModel) MakeUnbondTx(validatorAddr, memo string) (*t...
method MakeWithdrawTx (line 375) | func (model *WalletModel) MakeWithdrawTx(
method SignTransaction (line 396) | func (model *WalletModel) SignTransaction(password string, trx *tx.Tx)...
method BroadcastTransaction (line 420) | func (model *WalletModel) BroadcastTransaction(trx *tx.Tx) (string, er...
method Transactions (line 435) | func (model *WalletModel) Transactions(count, skip int) []*pactus.Wall...
type AddressRow (line 30) | type AddressRow struct
function NewWalletModel (line 40) | func NewWalletModel(
FILE: cmd/gtk/startup_assistant.go
type assistantFunc (line 25) | type assistantFunc
function setMargin (line 28) | func setMargin(widget gtk.IWidget, top, bottom, start, end int) {
function startupAssistant (line 36) | func startupAssistant(ctx context.Context, workingDir string, chain gene...
function pageAssistant (line 466) | func pageAssistant() assistantFunc {
function pageWalletMode (line 503) | func pageWalletMode(assistant *gtk.Assistant, assistFunc assistantFunc) ...
function pageSeedGenerate (line 535) | func pageSeedGenerate(assistant *gtk.Assistant, assistFunc assistantFunc...
function pageSeedRestore (line 564) | func pageSeedRestore(assistant *gtk.Assistant, assistFunc assistantFunc)...
function pageSeedConfirm (line 591) | func pageSeedConfirm(assistant *gtk.Assistant, assistFunc assistantFunc,
function pageNodeType (line 642) | func pageNodeType(assistant *gtk.Assistant, assistFunc assistantFunc) (
function pagePassword (line 695) | func pagePassword(assistant *gtk.Assistant, assistFunc assistantFunc) (*...
function pageNumValidators (line 769) | func pageNumValidators(assistant *gtk.Assistant,
function pageAddressRecovery (line 824) | func pageAddressRecovery(assistant *gtk.Assistant, assistFunc assistantF...
function pageSummary (line 881) | func pageSummary(assistant *gtk.Assistant, assistFunc assistantFunc) (*g...
function assistantPageComplete (line 914) | func assistantPageComplete(assistant *gtk.Assistant, page gtk.IWidget, c...
function getMetadata (line 919) | func getMetadata(
FILE: cmd/gtk/view/about_dialog_view.go
function NewAboutDialog (line 10) | func NewAboutDialog() *gtk.AboutDialog {
FILE: cmd/gtk/view/about_gtk_dialog_view.go
function NewAboutGTKDialog (line 10) | func NewAboutGTKDialog() *gtk.AboutDialog {
FILE: cmd/gtk/view/address_details_dialog_view.go
type AddressDetailsDialogView (line 11) | type AddressDetailsDialogView struct
function NewAddressDetailsDialogView (line 23) | func NewAddressDetailsDialogView() *AddressDetailsDialogView {
FILE: cmd/gtk/view/address_label_dialog_view.go
type AddressLabelDialogView (line 11) | type AddressLabelDialogView struct
function NewAddressLabelDialogView (line 21) | func NewAddressLabelDialogView() *AddressLabelDialogView {
FILE: cmd/gtk/view/address_private_key_dialog_view.go
type AddressPrivateKeyDialogView (line 11) | type AddressPrivateKeyDialogView struct
function NewAddressPrivateKeyDialogView (line 21) | func NewAddressPrivateKeyDialogView() *AddressPrivateKeyDialogView {
FILE: cmd/gtk/view/committee_widget_view.go
type CommitteeWidgetView (line 12) | type CommitteeWidgetView struct
method ClearRows (line 80) | func (view *CommitteeWidgetView) ClearRows() {
method AppendRow (line 84) | func (view *CommitteeWidgetView) AppendRow(cols []int, values []any) {
function NewCommitteeWidgetView (line 26) | func NewCommitteeWidgetView() *CommitteeWidgetView {
FILE: cmd/gtk/view/main_window_view.go
type MainWindowView (line 12) | type MainWindowView struct
method Cleanup (line 59) | func (v *MainWindowView) Cleanup() {
function NewMainWindowView (line 24) | func NewMainWindowView() *MainWindowView {
FILE: cmd/gtk/view/network_widget_view.go
type NetworkWidgetView (line 12) | type NetworkWidgetView struct
method ClearRows (line 72) | func (view *NetworkWidgetView) ClearRows() {
method AppendRow (line 76) | func (view *NetworkWidgetView) AppendRow(cols []int, values []any) {
function NewNetworkWidgetView (line 24) | func NewNetworkWidgetView() *NetworkWidgetView {
FILE: cmd/gtk/view/node_widget_view.go
type NodeWidgetView (line 10) | type NodeWidgetView struct
function NewNodeWidgetView (line 38) | func NewNodeWidgetView() *NodeWidgetView {
FILE: cmd/gtk/view/splash_window_view.go
type SplashWindow (line 14) | type SplashWindow struct
method ShowAll (line 71) | func (s *SplashWindow) ShowAll() {
method Destroy (line 76) | func (s *SplashWindow) Destroy() {
method SetStatus (line 80) | func (s *SplashWindow) SetStatus(text string) {
method SetVersion (line 84) | func (s *SplashWindow) SetVersion(text string) {
method Window (line 88) | func (s *SplashWindow) Window() *gtk.ApplicationWindow {
function NewSplashWindow (line 21) | func NewSplashWindow(app *gtk.Application) *SplashWindow {
FILE: cmd/gtk/view/tx_bond_dialog_view.go
type TxBondDialogView (line 11) | type TxBondDialogView struct
function NewTxBondDialogView (line 31) | func NewTxBondDialogView() *TxBondDialogView {
FILE: cmd/gtk/view/tx_transfer_dialog_view.go
type TxTransferDialogView (line 11) | type TxTransferDialogView struct
function NewTxTransferDialogView (line 30) | func NewTxTransferDialogView() *TxTransferDialogView {
FILE: cmd/gtk/view/tx_unbond_dialog_view.go
type TxUnbondDialogView (line 11) | type TxUnbondDialogView struct
function NewTxUnbondDialogView (line 24) | func NewTxUnbondDialogView() *TxUnbondDialogView {
FILE: cmd/gtk/view/tx_withdraw_dialog_view.go
type TxWithdrawDialogView (line 11) | type TxWithdrawDialogView struct
function NewTxWithdrawDialogView (line 30) | func NewTxWithdrawDialogView() *TxWithdrawDialogView {
FILE: cmd/gtk/view/validator_widget_view.go
type ValidatorWidgetView (line 12) | type ValidatorWidgetView struct
method ClearRows (line 71) | func (view *ValidatorWidgetView) ClearRows() {
method AppendRow (line 75) | func (view *ValidatorWidgetView) AppendRow(cols []int, values []any) {
function NewValidatorWidgetView (line 21) | func NewValidatorWidgetView() *ValidatorWidgetView {
FILE: cmd/gtk/view/view_builder.go
type ViewBuilder (line 12) | type ViewBuilder struct
method Builder (line 23) | func (vb *ViewBuilder) Builder() *gtk.Builder {
method GetObj (line 27) | func (vb *ViewBuilder) GetObj(name string) glib.IObject {
method GetApplicationWindowObj (line 34) | func (vb *ViewBuilder) GetApplicationWindowObj(name string) *gtk.Appli...
method GetDialogObj (line 38) | func (vb *ViewBuilder) GetDialogObj(name string) *gtk.Dialog {
method GetAboutDialogObj (line 42) | func (vb *ViewBuilder) GetAboutDialogObj(name string) *gtk.AboutDialog {
method GetComboBoxTextObj (line 46) | func (vb *ViewBuilder) GetComboBoxTextObj(name string) *gtk.ComboBoxTe...
method GetEntryObj (line 50) | func (vb *ViewBuilder) GetEntryObj(name string) *gtk.Entry {
method GetOverlayObj (line 54) | func (vb *ViewBuilder) GetOverlayObj(name string) *gtk.Overlay {
method GetTreeViewObj (line 58) | func (vb *ViewBuilder) GetTreeViewObj(name string) *gtk.TreeView {
method GetTextViewObj (line 62) | func (vb *ViewBuilder) GetTextViewObj(name string) *gtk.TextView {
method GetBoxObj (line 66) | func (vb *ViewBuilder) GetBoxObj(name string) *gtk.Box {
method GetLabelObj (line 70) | func (vb *ViewBuilder) GetLabelObj(name string) *gtk.Label {
method GetToolButtonObj (line 74) | func (vb *ViewBuilder) GetToolButtonObj(name string) *gtk.ToolButton {
method GetButtonObj (line 78) | func (vb *ViewBuilder) GetButtonObj(name string) *gtk.Button {
method GetImageObj (line 82) | func (vb *ViewBuilder) GetImageObj(name string) *gtk.Image {
method GetProgressBarObj (line 86) | func (vb *ViewBuilder) GetProgressBarObj(name string) *gtk.ProgressBar {
method GetMenuItem (line 90) | func (vb *ViewBuilder) GetMenuItem(name string) *gtk.MenuItem {
method BuildExtendedEntry (line 94) | func (vb *ViewBuilder) BuildExtendedEntry(name string) *gtk.Entry {
method ConnectSignals (line 98) | func (vb *ViewBuilder) ConnectSignals(signals map[string]any) {
function NewViewBuilder (line 16) | func NewViewBuilder(ui []byte) ViewBuilder {
FILE: cmd/gtk/view/wallet_change_password_dialog_view.go
type WalletChangePasswordDialogView (line 11) | type WalletChangePasswordDialogView struct
function NewWalletChangePasswordDialogView (line 25) | func NewWalletChangePasswordDialogView() *WalletChangePasswordDialogView {
FILE: cmd/gtk/view/wallet_create_address_dialog_view.go
type WalletCreateAddressDialogView (line 11) | type WalletCreateAddressDialogView struct
function NewWalletCreateAddressDialogView (line 22) | func NewWalletCreateAddressDialogView() *WalletCreateAddressDialogView {
FILE: cmd/gtk/view/wallet_default_fee_dialog_view.go
type WalletDefaultFeeDialogView (line 11) | type WalletDefaultFeeDialogView struct
function NewWalletDefaultFeeDialogView (line 22) | func NewWalletDefaultFeeDialogView() *WalletDefaultFeeDialogView {
FILE: cmd/gtk/view/wallet_password_dialog_view.go
type WalletPasswordDialogView (line 11) | type WalletPasswordDialogView struct
function NewWalletPasswordDialogView (line 21) | func NewWalletPasswordDialogView() *WalletPasswordDialogView {
FILE: cmd/gtk/view/wallet_seed_dialog_view.go
type WalletSeedDialogView (line 11) | type WalletSeedDialogView struct
function NewWalletSeedDialogView (line 21) | func NewWalletSeedDialogView() *WalletSeedDialogView {
FILE: cmd/gtk/view/wallet_widget_view.go
type WalletWidgetView (line 12) | type WalletWidgetView struct
method ClearRows (line 198) | func (view *WalletWidgetView) ClearRows() {
method AppendRow (line 202) | func (view *WalletWidgetView) AppendRow(cols []int, values []any) {
method ClearTxRows (line 207) | func (view *WalletWidgetView) ClearTxRows() {
method AppendTxRow (line 211) | func (view *WalletWidgetView) AppendTxRow(cols []int, values []any) {
method SetTxPager (line 216) | func (view *WalletWidgetView) SetTxPager(prevEnabled, nextEnabled bool) {
method SelectionAddress (line 221) | func (view *WalletWidgetView) SelectionAddress(addressColumn int) (str...
function createTextColumn (line 46) | func createTextColumn(title string, columnID int) *gtk.TreeViewColumn {
function NewWalletWidgetView (line 58) | func NewWalletWidgetView() *WalletWidgetView {
FILE: cmd/helper.go
function ShortHash (line 8) | func ShortHash(id string) string {
function ShortAddress (line 17) | func ShortAddress(addr string) string {
FILE: cmd/importer.go
constant DefaultSnapshotURL (line 22) | DefaultSnapshotURL = "https://snapshot.pactus.org"
constant maxDecompressedSize (line 24) | maxDecompressedSize = 10 << 20
type ImporterStateFunc (line 26) | type ImporterStateFunc
type Metadata (line 28) | type Metadata struct
method CreatedAtTime (line 42) | func (md *Metadata) CreatedAtTime() time.Time {
type SnapshotData (line 35) | type SnapshotData struct
type Importer (line 54) | type Importer struct
method GetMetadata (line 84) | func (i *Importer) GetMetadata(ctx context.Context) ([]Metadata, error) {
method Download (line 123) | func (i *Importer) Download(ctx context.Context, metadata *Metadata,
method Cleanup (line 143) | func (i *Importer) Cleanup() error {
method ExtractAndStoreFiles (line 147) | func (i *Importer) ExtractAndStoreFiles() error {
method extractAndWriteFile (line 166) | func (i *Importer) extractAndWriteFile(file *zip.File) error {
method MoveStore (line 210) | func (i *Importer) MoveStore() error {
function NewImporter (line 61) | func NewImporter(chainType genesis.ChainType, snapshotURL, storeDir stri...
FILE: cmd/shell/main.go
constant defaultServerAddr (line 20) | defaultServerAddr = "localhost:50051"
constant defaultResponseFormat (line 21) | defaultResponseFormat = "prettyjson"
function createRootCommand (line 28) | func createRootCommand() *cobra.Command {
function main (line 102) | func main() {
function livePrefix (line 111) | func livePrefix() (string, bool) {
function clearScreen (line 115) | func clearScreen() *cobra.Command {
function cls (line 125) | func cls() {
function setAuthContext (line 130) | func setAuthContext(c *cobra.Command, username, password string) {
FILE: cmd/shell/main_test.go
function TestCreateRootCommand (line 10) | func TestCreateRootCommand(t *testing.T) {
function TestLivePrefix (line 82) | func TestLivePrefix(t *testing.T) {
function TestClearScreenCommand (line 91) | func TestClearScreenCommand(t *testing.T) {
function TestSetAuthContext (line 104) | func TestSetAuthContext(t *testing.T) {
function TestConstants (line 120) | func TestConstants(t *testing.T) {
function TestClsFunction (line 126) | func TestClsFunction(t *testing.T) {
FILE: cmd/wallet/address.go
function buildAddressCmd (line 19) | func buildAddressCmd(parentCmd *cobra.Command) {
function buildAddressAllCmd (line 36) | func buildAddressAllCmd(parentCmd *cobra.Command) {
function buildAddressNewCmd (line 75) | func buildAddressNewCmd(parentCmd *cobra.Command) {
function buildAddressBalanceCmd (line 123) | func buildAddressBalanceCmd(parentCmd *cobra.Command) {
function buildAddressPrivCmd (line 148) | func buildAddressPrivCmd(parentCmd *cobra.Command) {
function buildAddressPubCmd (line 176) | func buildAddressPubCmd(parentCmd *cobra.Command) {
function buildAddressImportCmd (line 208) | func buildAddressImportCmd(parentCmd *cobra.Command) {
function buildAddressLabelCmd (line 264) | func buildAddressLabelCmd(parentCmd *cobra.Command) {
FILE: cmd/wallet/create.go
function buildCreateCmd (line 14) | func buildCreateCmd(parentCmd *cobra.Command) {
FILE: cmd/wallet/fee.go
function buildFeeCmd (line 12) | func buildFeeCmd(parentCmd *cobra.Command) {
FILE: cmd/wallet/info.go
function buildInfoCmd (line 12) | func buildInfoCmd(parentCmd *cobra.Command) {
FILE: cmd/wallet/main.go
function addPasswordOption (line 22) | func addPasswordOption(c *cobra.Command) *string {
function openWallet (line 27) | func openWallet(ctx context.Context) (*wallet.Wallet, error) {
function setProvider (line 41) | func setProvider(ctx context.Context, wlt *wallet.Wallet) error {
function main (line 67) | func main() {
FILE: cmd/wallet/neuter.go
function buildNeuterCmd (line 12) | func buildNeuterCmd(parentCmd *cobra.Command) {
FILE: cmd/wallet/password.go
function buildPasswordCmd (line 12) | func buildPasswordCmd(parentCmd *cobra.Command) {
FILE: cmd/wallet/recover.go
function buildRecoverCmd (line 15) | func buildRecoverCmd(parentCmd *cobra.Command) {
function buildGetSeedCmd (line 56) | func buildGetSeedCmd(parentCmd *cobra.Command) {
FILE: cmd/wallet/send.go
function buildSendCmd (line 16) | func buildSendCmd(parentCmd *cobra.Command) {
function buildSendTransferCmd (line 30) | func buildSendTransferCmd(parentCmd *cobra.Command) {
function buildSendBondCmd (line 74) | func buildSendBondCmd(parentCmd *cobra.Command) {
function buildSendUnbondCmd (line 128) | func buildSendUnbondCmd(parentCmd *cobra.Command) {
function buildSendWithdrawCmd (line 170) | func buildSendWithdrawCmd(parentCmd *cobra.Command) {
function addCommonTxOptions (line 213) | func addCommonTxOptions(cobra *cobra.Command) (lockTimeOpt *int, feeOpt,...
function signAndPublishTx (line 229) | func signAndPublishTx(wlt *wallet.Wallet, trx *tx.Tx, noConfirm bool, pa...
function getPassword (line 260) | func getPassword(wlt *wallet.Wallet, passOpt string) string {
FILE: cmd/wallet/transaction.go
function buildTransactionCmd (line 16) | func buildTransactionCmd(parentCmd *cobra.Command) {
function buildTransactionAddCmd (line 29) | func buildTransactionAddCmd(parentCmd *cobra.Command) {
function buildTransactionListCmd (line 56) | func buildTransactionListCmd(parentCmd *cobra.Command) {
FILE: committee/committee.go
type committee (line 19) | type committee struct
method TotalPower (line 49) | func (c *committee) TotalPower() int64 {
method Update (line 60) | func (c *committee) Update(lastRound types.Round, joined []*validator....
method Validators (line 118) | func (c *committee) Validators() []*validator.Validator {
method Contains (line 131) | func (c *committee) Contains(addr crypto.Address) bool {
method find (line 135) | func (c *committee) find(addr crypto.Address) *validator.Validator {
method IsProposer (line 151) | func (c *committee) IsProposer(addr crypto.Address, round types.Round)...
method Proposer (line 159) | func (c *committee) Proposer(round types.Round) *validator.Validator {
method proposer (line 163) | func (c *committee) proposer(round types.Round) *validator.Validator {
method Committers (line 175) | func (c *committee) Committers() []int32 {
method Size (line 188) | func (c *committee) Size() int {
method String (line 192) | func (c *committee) String() string {
method iterate (line 211) | func (c *committee) iterate(consumer func(*validator.Validator) (stop ...
method ProtocolVersions (line 221) | func (c *committee) ProtocolVersions() map[protocol.Version]float64 {
method SupportProtocolVersion (line 243) | func (c *committee) SupportProtocolVersion(version protocol.Version) b...
function NewCommittee (line 25) | func NewCommittee(validators []*validator.Validator, committeeSize int,
FILE: committee/committee_test.go
function TestContains (line 15) | func TestContains(t *testing.T) {
function TestProposer (line 25) | func TestProposer(t *testing.T) {
function TestInvalidProposerJoinAndLeave (line 38) | func TestInvalidProposerJoinAndLeave(t *testing.T) {
function TestProposerMove (line 52) | func TestProposerMove(t *testing.T) {
function TestValidatorConsistency (line 99) | func TestValidatorConsistency(t *testing.T) {
function TestProposerJoin (line 117) | func TestProposerJoin(t *testing.T) {
function TestProposerJoinAndLeave (line 179) | func TestProposerJoinAndLeave(t *testing.T) {
function TestIsProposer (line 317) | func TestIsProposer(t *testing.T) {
function TestCommitters (line 336) | func TestCommitters(t *testing.T) {
function TestSortJoined (line 349) | func TestSortJoined(t *testing.T) {
function TestTotalPower (line 369) | func TestTotalPower(t *testing.T) {
function TestProtocolVersionPercentages (line 388) | func TestProtocolVersionPercentages(t *testing.T) {
function TestSupportProtocolVersion (line 411) | func TestSupportProtocolVersion(t *testing.T) {
FILE: committee/interface.go
type Reader (line 10) | type Reader interface
type Committee (line 23) | type Committee interface
FILE: config/config.go
type Config (line 40) | type Config struct
method Save (line 242) | func (conf *Config) Save(path string) error {
method toTOML (line 246) | func (conf *Config) toTOML() []byte {
method BasicCheck (line 278) | func (conf *Config) BasicCheck() error {
type BootstrapInfo (line 58) | type BootstrapInfo struct
type NodeConfig (line 65) | type NodeConfig struct
method BasicCheck (line 76) | func (conf *NodeConfig) BasicCheck() error {
function DefaultNodeConfig (line 69) | func DefaultNodeConfig() *NodeConfig {
function defaultConfig (line 95) | func defaultConfig() *Config {
function DefaultConfigMainnet (line 116) | func DefaultConfigMainnet() *Config {
function DefaultConfigTestnet (line 170) | func DefaultConfigTestnet() *Config {
function DefaultConfigLocalnet (line 204) | func DefaultConfigLocalnet() *Config {
function SaveMainnetConfig (line 236) | func SaveMainnetConfig(path string) error {
function LoadFromFile (line 258) | func LoadFromFile(file string, strict bool, defaultConfig *Config) (*Con...
function GetBootstrapNodes (line 322) | func GetBootstrapNodes() ([]BootstrapInfo, error) {
FILE: config/config_test.go
function TestSaveMainnetConfig (line 14) | func TestSaveMainnetConfig(t *testing.T) {
function TestSaveTestnetConfig (line 30) | func TestSaveTestnetConfig(t *testing.T) {
function TestDefaultConfig (line 45) | func TestDefaultConfig(t *testing.T) {
function TestMainnetConfig (line 64) | func TestMainnetConfig(t *testing.T) {
function TestTestnetConfig (line 83) | func TestTestnetConfig(t *testing.T) {
function TestLocalnetConfig (line 105) | func TestLocalnetConfig(t *testing.T) {
function TestLoadFromFile (line 124) | func TestLoadFromFile(t *testing.T) {
function TestExampleConfig (line 140) | func TestExampleConfig(t *testing.T) {
function TestNodeConfigBasicCheck (line 168) | func TestNodeConfigBasicCheck(t *testing.T) {
function TestGetBootstrapNodes (line 237) | func TestGetBootstrapNodes(t *testing.T) {
function TestBootstrapInfoStructure (line 269) | func TestBootstrapInfoStructure(t *testing.T) {
FILE: config/errors.go
type NodeConfigError (line 4) | type NodeConfigError struct
method Error (line 8) | func (e NodeConfigError) Error() string {
FILE: consensus/commit.go
type commitState (line 8) | type commitState struct
method enter (line 12) | func (s *commitState) enter() {
method decide (line 16) | func (s *commitState) decide() {
method onAddVote (line 35) | func (*commitState) onAddVote(_ *vote.Vote) {
method onSetProposal (line 39) | func (*commitState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 43) | func (*commitState) onTimeout(_ *ticker) {
method name (line 47) | func (*commitState) name() string {
FILE: consensus/config.go
type Config (line 10) | type Config struct
method BasicCheck (line 27) | func (conf *Config) BasicCheck() error {
method CalculateChangeProposerTimeout (line 47) | func (conf *Config) CalculateChangeProposerTimeout(round types.Round) ...
function DefaultConfig (line 17) | func DefaultConfig() *Config {
FILE: consensus/config_test.go
function TestConfigBasicCheck (line 11) | func TestConfigBasicCheck(t *testing.T) {
function TestCalculateChangeProposerTimeout (line 75) | func TestCalculateChangeProposerTimeout(t *testing.T) {
FILE: consensus/consensus.go
type broadcaster (line 27) | type broadcaster
type consensus (line 29) | type consensus struct
method LogString (line 126) | func (cs *consensus) LogString() string {
method ConsensusKey (line 132) | func (cs *consensus) ConsensusKey() *bls.PublicKey {
method HeightRound (line 139) | func (cs *consensus) HeightRound() (types.Height, types.Round) {
method HasVote (line 146) | func (cs *consensus) HasVote(h hash.Hash) bool {
method AllVotes (line 156) | func (cs *consensus) AllVotes() []*vote.Vote {
method enterNewState (line 169) | func (cs *consensus) enterNewState(s consState) {
method MoveToNewHeight (line 174) | func (cs *consensus) MoveToNewHeight() {
method scheduleTimeout (line 188) | func (cs *consensus) scheduleTimeout(duration time.Duration,
method handleTimeout (line 199) | func (cs *consensus) handleTimeout(ticker *ticker) {
method SetProposal (line 216) | func (cs *consensus) SetProposal(prop *proposal.Proposal) {
method AddVote (line 279) | func (cs *consensus) AddVote(vte *vote.Vote) {
method proposer (line 319) | func (cs *consensus) proposer(round types.Round) *validator.Validator {
method IsProposer (line 323) | func (cs *consensus) IsProposer() bool {
method isProposer (line 330) | func (cs *consensus) isProposer() bool {
method signAddCPPreVote (line 334) | func (cs *consensus) signAddCPPreVote(h hash.Hash,
method signAddCPMainVote (line 342) | func (cs *consensus) signAddCPMainVote(h hash.Hash,
method signAddCPDecidedVote (line 350) | func (cs *consensus) signAddCPDecidedVote(h hash.Hash,
method signAddPrepareVote (line 358) | func (cs *consensus) signAddPrepareVote(h hash.Hash) {
method signAddPrecommitVote (line 363) | func (cs *consensus) signAddPrecommitVote(h hash.Hash) {
method signAddVote (line 368) | func (cs *consensus) signAddVote(vte *vote.Vote) {
method queryProposal (line 381) | func (cs *consensus) queryProposal() {
method queryVote (line 387) | func (cs *consensus) queryVote() {
method broadcastProposal (line 392) | func (cs *consensus) broadcastProposal(p *proposal.Proposal) {
method broadcastVote (line 398) | func (cs *consensus) broadcastVote(v *vote.Vote) {
method announceNewBlock (line 404) | func (cs *consensus) announceNewBlock(blk *block.Block,
method makeCertificate (line 412) | func (cs *consensus) makeCertificate(votes map[crypto.Address]*vote.Vote,
method signersInfo (line 424) | func (cs *consensus) signersInfo(votes map[crypto.Address]*vote.Vote) (
method IsActive (line 449) | func (cs *consensus) IsActive() bool {
method Proposal (line 460) | func (cs *consensus) Proposal() *proposal.Proposal {
method HandleQueryProposal (line 467) | func (cs *consensus) HandleQueryProposal(height types.Height, round ty...
method HandleQueryVote (line 498) | func (cs *consensus) HandleQueryVote(height types.Height, round types....
method startChangingProposer (line 533) | func (cs *consensus) startChangingProposer() {
method IsDeprecated (line 543) | func (*consensus) IsDeprecated() bool {
function NewConsensus (line 60) | func NewConsensus(
function makeConsensus (line 77) | func makeConsensus(
FILE: consensus/consensus_test.go
constant tIndexX (line 34) | tIndexX = 0
constant tIndexY (line 35) | tIndexY = 1
constant tIndexB (line 36) | tIndexB = 2
constant tIndexP (line 37) | tIndexP = 3
type consMessage (line 40) | type consMessage struct
type testData (line 44) | type testData struct
method shouldPublishBlockAnnounce (line 156) | func (td *testData) shouldPublishBlockAnnounce(t *testing.T, cons *con...
method shouldPublishProposal (line 171) | func (td *testData) shouldPublishProposal(t *testing.T, cons *consensus,
method shouldNotPublish (line 192) | func (td *testData) shouldNotPublish(t *testing.T, cons *consensus, ms...
method shouldPublishQueryProposal (line 203) | func (td *testData) shouldPublishQueryProposal(t *testing.T, cons *con...
method shouldPublishQueryVote (line 221) | func (td *testData) shouldPublishQueryVote(t *testing.T, cons *consens...
method shouldPublishVote (line 241) | func (td *testData) shouldPublishVote(t *testing.T, cons *consensus, v...
method checkHeightRound (line 261) | func (*testData) checkHeightRound(t *testing.T, cons *consensus, heigh...
method addPrepareVote (line 269) | func (td *testData) addPrepareVote(cons *consensus, blockHash hash.Has...
method addPrecommitVote (line 277) | func (td *testData) addPrecommitVote(cons *consensus, blockHash hash.H...
method addCPPreVote (line 285) | func (td *testData) addCPPreVote(cons *consensus, blockHash hash.Hash,...
method addCPMainVote (line 292) | func (td *testData) addCPMainVote(cons *consensus, blockHash hash.Hash...
method addCPDecidedVote (line 299) | func (td *testData) addCPDecidedVote(cons *consensus, blockHash hash.H...
method addVote (line 306) | func (td *testData) addVote(cons *consensus, v *vote.Vote, valID int) ...
method newHeightTimeout (line 313) | func (*testData) newHeightTimeout(cons *consensus) {
method queryProposalTimeout (line 319) | func (*testData) queryProposalTimeout(cons *consensus) {
method changeProposerTimeout (line 325) | func (*testData) changeProposerTimeout(cons *consensus) {
method enterNewHeight (line 333) | func (td *testData) enterNewHeight(cons *consensus) {
method enterNextRound (line 342) | func (*testData) enterNextRound(cons *consensus) {
method commitBlockForAllStates (line 349) | func (td *testData) commitBlockForAllStates(t *testing.T) (*block.Bloc...
method makeProposal (line 381) | func (td *testData) makeProposal(t *testing.T, height types.Height, ro...
method makeMainCertificate (line 411) | func (td *testData) makeMainCertificate(t *testing.T,
function testConfig (line 57) | func testConfig() *Config {
function setup (line 65) | func setup(t *testing.T) *testData {
function setupWithSeed (line 71) | func setupWithSeed(t *testing.T, seed int64) *testData {
function TestStart (line 451) | func TestStart(t *testing.T) {
function TestNotInCommittee (line 458) | func TestNotInCommittee(t *testing.T) {
function TestIsProposer (line 474) | func TestIsProposer(t *testing.T) {
function TestVoteWithInvalidHeight (line 486) | func TestVoteWithInvalidHeight(t *testing.T) {
function TestConsensusNormalCase (line 503) | func TestConsensusNormalCase(t *testing.T) {
function TestConsensusAddVote (line 525) | func TestConsensusAddVote(t *testing.T) {
function TestConsensusLateProposal (line 552) | func TestConsensusLateProposal(t *testing.T) {
function TestSetProposalOnPrepare (line 574) | func TestSetProposalOnPrepare(t *testing.T) {
function TestSetProposalOnPrecommit (line 599) | func TestSetProposalOnPrecommit(t *testing.T) {
function TestHandleQueryVote (line 628) | func TestHandleQueryVote(t *testing.T) {
function TestHandleQueryProposal (line 684) | func TestHandleQueryProposal(t *testing.T) {
function TestSetProposalFromPreviousRound (line 712) | func TestSetProposalFromPreviousRound(t *testing.T) {
function TestSetProposalFromPreviousHeight (line 726) | func TestSetProposalFromPreviousHeight(t *testing.T) {
function TestDuplicateProposal (line 739) | func TestDuplicateProposal(t *testing.T) {
function TestNonActiveValidator (line 761) | func TestNonActiveValidator(t *testing.T) {
function TestVoteWithBigRound (line 811) | func TestVoteWithBigRound(t *testing.T) {
function TestProposalWithBigRound (line 820) | func TestProposalWithBigRound(t *testing.T) {
function TestInvalidProposal (line 830) | func TestInvalidProposal(t *testing.T) {
function TestCases (line 841) | func TestCases(t *testing.T) {
function TestFaulty (line 872) | func TestFaulty(t *testing.T) {
function TestByzantine (line 898) | func TestByzantine(t *testing.T) {
function checkConsensus (line 994) | func checkConsensus(td *testData, height types.Height, byzVotes []*vote....
FILE: consensus/cp.go
type changeProposer (line 13) | type changeProposer struct
method onSetProposal (line 17) | func (*changeProposer) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 21) | func (cp *changeProposer) onTimeout(t *ticker) {
method checkCPValue (line 28) | func (*changeProposer) checkCPValue(vote *vote.Vote, allowedValues ......
method checkJustInitNo (line 39) | func (cp *changeProposer) checkJustInitNo(just vote.Just, blockHash ha...
method checkJustInitYes (line 59) | func (*changeProposer) checkJustInitYes(just vote.Just) error {
method checkJustPreVoteHard (line 71) | func (cp *changeProposer) checkJustPreVoteHard(just vote.Just,
method checkJustPreVoteSoft (line 94) | func (cp *changeProposer) checkJustPreVoteSoft(just vote.Just,
method checkJustMainVoteNoConflict (line 117) | func (cp *changeProposer) checkJustMainVoteNoConflict(just vote.Just,
method checkJustMainVoteConflict (line 141) | func (cp *changeProposer) checkJustMainVoteConflict(just vote.Just,
method checkJustPreVote (line 194) | func (cp *changeProposer) checkJustPreVote(vte *vote.Vote) error {
method checkJustMainVote (line 247) | func (cp *changeProposer) checkJustMainVote(vte *vote.Vote) error {
method checkJustDecide (line 274) | func (cp *changeProposer) checkJustDecide(vte *vote.Vote) error {
method checkJust (line 300) | func (cp *changeProposer) checkJust(vte *vote.Vote) error {
method cpStrongTermination (line 313) | func (cp *changeProposer) cpStrongTermination(round types.Round, cpRou...
FILE: consensus/cp_decide.go
type cpDecideState (line 8) | type cpDecideState struct
method enter (line 12) | func (s *cpDecideState) enter() {
method decide (line 17) | func (s *cpDecideState) decide() {
method onAddVote (line 51) | func (s *cpDecideState) onAddVote(vte *vote.Vote) {
method name (line 61) | func (*cpDecideState) name() string {
FILE: consensus/cp_mainvote.go
type cpMainVoteState (line 8) | type cpMainVoteState struct
method enter (line 12) | func (s *cpMainVoteState) enter() {
method decide (line 17) | func (s *cpMainVoteState) decide() {
method checkForWeakValidity (line 60) | func (s *cpMainVoteState) checkForWeakValidity() {
method detectByzantineProposal (line 74) | func (s *cpMainVoteState) detectByzantineProposal() {
method onAddVote (line 90) | func (s *cpMainVoteState) onAddVote(vte *vote.Vote) {
method name (line 100) | func (*cpMainVoteState) name() string {
FILE: consensus/cp_prevote.go
type cpPreVoteState (line 8) | type cpPreVoteState struct
method enter (line 12) | func (s *cpPreVoteState) enter() {
method decide (line 16) | func (s *cpPreVoteState) decide() {
method onAddVote (line 72) | func (*cpPreVoteState) onAddVote(_ *vote.Vote) {
method name (line 76) | func (*cpPreVoteState) name() string {
FILE: consensus/cp_test.go
function TestChangeProposer (line 15) | func TestChangeProposer(t *testing.T) {
function TestSetProposalAfterChangeProposer (line 24) | func TestSetProposalAfterChangeProposer(t *testing.T) {
function TestChangeProposerAgreementYes (line 39) | func TestChangeProposerAgreementYes(t *testing.T) {
function TestChangeProposerAgreementNo (line 61) | func TestChangeProposerAgreementNo(t *testing.T) {
function TestCrashOnTestnet (line 97) | func TestCrashOnTestnet(t *testing.T) {
function TestInvalidJustInitOne (line 135) | func TestInvalidJustInitOne(t *testing.T) {
function TestInvalidJustInitZero (line 175) | func TestInvalidJustInitZero(t *testing.T) {
function TestInvalidJustPreVoteHard (line 216) | func TestInvalidJustPreVoteHard(t *testing.T) {
function TestInvalidJustPreVoteSoft (line 257) | func TestInvalidJustPreVoteSoft(t *testing.T) {
function TestInvalidJustMainVoteNoConflict (line 298) | func TestInvalidJustMainVoteNoConflict(t *testing.T) {
function TestInvalidJustMainVoteConflict (line 329) | func TestInvalidJustMainVoteConflict(t *testing.T) {
function TestInvalidJustDecided (line 439) | func TestInvalidJustDecided(t *testing.T) {
FILE: consensus/errors.go
type InvalidJustificationError (line 11) | type InvalidJustificationError struct
method Error (line 16) | func (e InvalidJustificationError) Error() string {
type ConfigError (line 22) | type ConfigError struct
method Error (line 26) | func (e ConfigError) Error() string {
FILE: consensus/height.go
type newHeightState (line 10) | type newHeightState struct
method enter (line 14) | func (s *newHeightState) enter() {
method decide (line 18) | func (s *newHeightState) decide() {
method onAddVote (line 33) | func (s *newHeightState) onAddVote(_ *vote.Vote) {
method onSetProposal (line 45) | func (*newHeightState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 49) | func (s *newHeightState) onTimeout(t *ticker) {
method name (line 57) | func (*newHeightState) name() string {
FILE: consensus/height_test.go
function TestNewHeightTimeout (line 11) | func TestNewHeightTimeout(t *testing.T) {
function TestNewHeightDoubleEntry (line 29) | func TestNewHeightDoubleEntry(t *testing.T) {
function TestNewHeightTimeBehindNetwork (line 45) | func TestNewHeightTimeBehindNetwork(t *testing.T) {
FILE: consensus/interface.go
type Reader (line 11) | type Reader interface
type Consensus (line 23) | type Consensus interface
FILE: consensus/log/log.go
type Log (line 13) | type Log struct
method RoundMessages (line 25) | func (log *Log) RoundMessages(round types.Round) *Messages {
method HasVote (line 29) | func (log *Log) HasVote(h hash.Hash) bool {
method mustGetRoundMessages (line 39) | func (log *Log) mustGetRoundMessages(round types.Round) *Messages {
method AddVote (line 55) | func (log *Log) AddVote(v *vote.Vote) (bool, error) {
method PrepareVoteSet (line 61) | func (log *Log) PrepareVoteSet(round types.Round) *voteset.BlockVoteSet {
method PrecommitVoteSet (line 67) | func (log *Log) PrecommitVoteSet(round types.Round) *voteset.BlockVote...
method CPPreVoteVoteSet (line 73) | func (log *Log) CPPreVoteVoteSet(round types.Round) *voteset.BinaryVot...
method CPMainVoteVoteSet (line 79) | func (log *Log) CPMainVoteVoteSet(round types.Round) *voteset.BinaryVo...
method CPDecidedVoteSet (line 85) | func (log *Log) CPDecidedVoteSet(round types.Round) *voteset.BinaryVot...
method HasRoundProposal (line 91) | func (log *Log) HasRoundProposal(round types.Round) bool {
method RoundProposal (line 95) | func (log *Log) RoundProposal(round types.Round) *proposal.Proposal {
method SetRoundProposal (line 104) | func (log *Log) SetRoundProposal(round types.Round, prop *proposal.Pro...
method MoveToNewHeight (line 109) | func (log *Log) MoveToNewHeight(validators []*validator.Validator) {
method CanVote (line 119) | func (log *Log) CanVote(addr crypto.Address) bool {
function NewLog (line 19) | func NewLog() *Log {
FILE: consensus/log/log_test.go
function TestMustGetRound (line 13) | func TestMustGetRound(t *testing.T) {
function TestAddValidVote (line 22) | func TestAddValidVote(t *testing.T) {
function TestAddInvalidVoteType (line 61) | func TestAddInvalidVoteType(t *testing.T) {
function TestSetRoundProposal (line 80) | func TestSetRoundProposal(t *testing.T) {
function TestCanVote (line 97) | func TestCanVote(t *testing.T) {
FILE: consensus/log/messages.go
type Messages (line 12) | type Messages struct
method addVote (line 21) | func (m *Messages) addVote(vte *vote.Vote) (bool, error) {
method HasVote (line 38) | func (m *Messages) HasVote(h hash.Hash) bool {
method AllVotes (line 49) | func (m *Messages) AllVotes() []*vote.Vote {
FILE: consensus/manager/interface.go
type Reader (line 11) | type Reader interface
type Consensus (line 23) | type Consensus interface
type ManagerReader (line 32) | type ManagerReader interface
type Manager (line 41) | type Manager interface
FILE: consensus/manager/manager.go
type manager (line 19) | type manager struct
method Instances (line 85) | func (mgr *manager) Instances() []Reader {
method Proposal (line 95) | func (mgr *manager) Proposal() *proposal.Proposal {
method HandleQueryProposal (line 102) | func (mgr *manager) HandleQueryProposal(height types.Height, round typ...
method HandleQueryVote (line 109) | func (mgr *manager) HandleQueryVote(height types.Height, round types.R...
method HeightRound (line 116) | func (mgr *manager) HeightRound() (types.Height, types.Round) {
method HasActiveInstance (line 123) | func (mgr *manager) HasActiveInstance() bool {
method MoveToNewHeight (line 134) | func (mgr *manager) MoveToNewHeight() {
method AddVote (line 183) | func (mgr *manager) AddVote(vote *vote.Vote) {
method SetProposal (line 201) | func (mgr *manager) SetProposal(prop *proposal.Proposal) {
method getBestInstance (line 224) | func (mgr *manager) getBestInstance() Consensus {
method IsDeprecated (line 235) | func (mgr *manager) IsDeprecated() bool {
function NewManagerV1 (line 33) | func NewManagerV1(
function NewManagerV2 (line 58) | func NewManagerV2(
FILE: consensus/manager/manager_test.go
function TestManager (line 20) | func TestManager(t *testing.T) {
function TestMediator (line 154) | func TestMediator(t *testing.T) {
FILE: consensus/manager/mock.go
function MockingManager (line 12) | func MockingManager(ts *testsuite.TestSuite, state *state.MockState,
FILE: consensus/mediator.go
type mediator (line 10) | type mediator interface
type ConcreteMediator (line 18) | type ConcreteMediator struct
method OnPublishProposal (line 26) | func (m *ConcreteMediator) OnPublishProposal(from Consensus, prop *pro...
method OnPublishVote (line 34) | func (m *ConcreteMediator) OnPublishVote(from Consensus, vote *vote.Vo...
method OnBlockAnnounce (line 42) | func (m *ConcreteMediator) OnBlockAnnounce(from Consensus) {
method Register (line 51) | func (m *ConcreteMediator) Register(cons Consensus) {
function NewConcreteMediator (line 22) | func NewConcreteMediator() mediator {
FILE: consensus/mock.go
type MockConsensus (line 16) | type MockConsensus struct
method ConsensusKey (line 37) | func (m *MockConsensus) ConsensusKey() *bls.PublicKey {
method MoveToNewHeight (line 41) | func (m *MockConsensus) MoveToNewHeight() {
method AddVote (line 45) | func (m *MockConsensus) AddVote(v *vote.Vote) {
method AllVotes (line 49) | func (m *MockConsensus) AllVotes() []*vote.Vote {
method SetProposal (line 53) | func (m *MockConsensus) SetProposal(p *proposal.Proposal) {
method HasVote (line 57) | func (m *MockConsensus) HasVote(h hash.Hash) bool {
method Proposal (line 67) | func (m *MockConsensus) Proposal() *proposal.Proposal {
method HandleQueryProposal (line 71) | func (m *MockConsensus) HandleQueryProposal(_ types.Height, _ types.Ro...
method HeightRound (line 75) | func (m *MockConsensus) HeightRound() (types.Height, types.Round) {
method LogString (line 79) | func (*MockConsensus) LogString() string {
method HandleQueryVote (line 83) | func (m *MockConsensus) HandleQueryVote(_ types.Height, _ types.Round)...
method IsActive (line 92) | func (m *MockConsensus) IsActive() bool {
method IsProposer (line 96) | func (m *MockConsensus) IsProposer() bool {
method SetActive (line 100) | func (m *MockConsensus) SetActive(active bool) {
method IsDeprecated (line 104) | func (*MockConsensus) IsDeprecated() bool {
function MockingConsensus (line 29) | func MockingConsensus(ts *testsuite.TestSuite, state *state.MockState, v...
FILE: consensus/precommit.go
type precommitState (line 8) | type precommitState struct
method enter (line 13) | func (s *precommitState) enter() {
method decide (line 19) | func (s *precommitState) decide() {
method vote (line 44) | func (s *precommitState) vote() {
method onAddVote (line 72) | func (s *precommitState) onAddVote(v *vote.Vote) {
method onSetProposal (line 79) | func (s *precommitState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 83) | func (s *precommitState) onTimeout(t *ticker) {
method name (line 89) | func (*precommitState) name() string {
FILE: consensus/precommit_test.go
function TestPrecommitQueryProposal (line 12) | func TestPrecommitQueryProposal(t *testing.T) {
function TestPrecommitDuplicatedProposal (line 34) | func TestPrecommitDuplicatedProposal(t *testing.T) {
function TestGoToChangeProposerFromPrecommit (line 69) | func TestGoToChangeProposerFromPrecommit(t *testing.T) {
FILE: consensus/prepare.go
type prepareState (line 8) | type prepareState struct
method enter (line 13) | func (s *prepareState) enter() {
method decide (line 24) | func (s *prepareState) decide() {
method vote (line 45) | func (s *prepareState) vote() {
method onTimeout (line 62) | func (s *prepareState) onTimeout(ticker *ticker) {
method onAddVote (line 85) | func (s *prepareState) onAddVote(v *vote.Vote) {
method onSetProposal (line 92) | func (s *prepareState) onSetProposal(_ *proposal.Proposal) {
method name (line 96) | func (*prepareState) name() string {
FILE: consensus/prepare_test.go
function TestChangeProposerTimeout (line 12) | func TestChangeProposerTimeout(t *testing.T) {
function TestQueryProposal (line 21) | func TestQueryProposal(t *testing.T) {
function TestQueryVote (line 35) | func TestQueryVote(t *testing.T) {
function TestGoToChangeProposerFromPrepare (line 53) | func TestGoToChangeProposerFromPrepare(t *testing.T) {
FILE: consensus/propose.go
type proposeState (line 9) | type proposeState struct
method enter (line 13) | func (s *proposeState) enter() {
method decide (line 17) | func (s *proposeState) decide() {
method createProposal (line 44) | func (s *proposeState) createProposal(height types.Height, round types...
method onAddVote (line 63) | func (*proposeState) onAddVote(_ *vote.Vote) {
method onSetProposal (line 67) | func (*proposeState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 71) | func (*proposeState) onTimeout(_ *ticker) {
method name (line 75) | func (*proposeState) name() string {
FILE: consensus/propose_test.go
function TestProposeBlock (line 14) | func TestProposeBlock(t *testing.T) {
function TestSetProposalInvalidProposer (line 22) | func TestSetProposalInvalidProposer(t *testing.T) {
function TestSetProposalInvalidBlock (line 40) | func TestSetProposalInvalidBlock(t *testing.T) {
function TestSetProposalInvalidHeight (line 56) | func TestSetProposalInvalidHeight(t *testing.T) {
function TestNetworkLagging (line 69) | func TestNetworkLagging(t *testing.T) {
function TestProposalNextRound (line 92) | func TestProposalNextRound(t *testing.T) {
FILE: consensus/state.go
type consState (line 8) | type consState interface
FILE: consensus/ticker.go
type tickerTarget (line 10) | type tickerTarget
method String (line 19) | func (rs tickerTarget) String() string {
constant tickerTargetNewHeight (line 13) | tickerTargetNewHeight = tickerTarget(1)
constant tickerTargetChangeProposer (line 14) | tickerTargetChangeProposer = tickerTarget(2)
constant tickerTargetQueryProposal (line 15) | tickerTargetQueryProposal = tickerTarget(3)
constant tickerTargetQueryVote (line 16) | tickerTargetQueryVote = tickerTarget(4)
type ticker (line 34) | type ticker struct
method LogString (line 42) | func (ti ticker) LogString() string {
FILE: consensus/voteset/binary_voteset.go
type roundVotes (line 12) | type roundVotes struct
method addVote (line 32) | func (rv *roundVotes) addVote(v *vote.Vote, power int64) {
function newRoundVotes (line 19) | func newRoundVotes() *roundVotes {
type BinaryVoteSet (line 37) | type BinaryVoteSet struct
method mustGetRoundVotes (line 73) | func (vs *BinaryVoteSet) mustGetRoundVotes(cpRound int16) *roundVotes {
method AllVotes (line 83) | func (vs *BinaryVoteSet) AllVotes() []*vote.Vote {
method AddVote (line 95) | func (vs *BinaryVoteSet) AddVote(vote *vote.Vote) (bool, error) {
method HasOneThirdOfTotalPower (line 121) | func (vs *BinaryVoteSet) HasOneThirdOfTotalPower(cpRound int16) bool {
method HasTwoThirdOfTotalPower (line 127) | func (vs *BinaryVoteSet) HasTwoThirdOfTotalPower(cpRound int16) bool {
method HasAnyVoteFor (line 133) | func (vs *BinaryVoteSet) HasAnyVoteFor(cpRound int16, cpValue vote.CPV...
method HasAllVotesFor (line 139) | func (vs *BinaryVoteSet) HasAllVotesFor(cpRound int16, cpValue vote.CP...
method HasQuorumVotesFor (line 145) | func (vs *BinaryVoteSet) HasQuorumVotesFor(cpRound int16, cpValue vote...
method BinaryVotes (line 151) | func (vs *BinaryVoteSet) BinaryVotes(cpRound int16, cpValue vote.CPVal...
method GetRandomVote (line 160) | func (vs *BinaryVoteSet) GetRandomVote(cpRound int16, cpValue vote.CPV...
function NewCPPreVoteVoteSet (line 42) | func NewCPPreVoteVoteSet(round types.Round, totalPower int64,
function NewCPMainVoteVoteSet (line 50) | func NewCPMainVoteVoteSet(round types.Round, totalPower int64,
function NewCPDecidedVoteSet (line 58) | func NewCPDecidedVoteSet(round types.Round, totalPower int64,
function newBinaryVoteSet (line 66) | func newBinaryVoteSet(voteSet *voteSet) *BinaryVoteSet {
FILE: consensus/voteset/block_voteset.go
type BlockVoteSet (line 13) | type BlockVoteSet struct
method BlockVotes (line 44) | func (vs *BlockVoteSet) BlockVotes(blockHash hash.Hash) map[crypto.Add...
method mustGetBlockVotes (line 52) | func (vs *BlockVoteSet) mustGetBlockVotes(blockHash hash.Hash) *voteBox {
method AllVotes (line 63) | func (vs *BlockVoteSet) AllVotes() []*vote.Vote {
method AddVote (line 73) | func (vs *BlockVoteSet) AddVote(vote *vote.Vote) (bool, error) {
method HasQuorumHash (line 103) | func (vs *BlockVoteSet) HasQuorumHash() bool {
method QuorumHash (line 109) | func (vs *BlockVoteSet) QuorumHash() *hash.Hash {
function NewPrepareVoteSet (line 20) | func NewPrepareVoteSet(round types.Round, totalPower int64,
function NewPrecommitVoteSet (line 28) | func NewPrecommitVoteSet(round types.Round, totalPower int64,
function newBlockVoteSet (line 36) | func newBlockVoteSet(voteSet *voteSet) *BlockVoteSet {
FILE: consensus/voteset/errors.go
type IneligibleVoterError (line 14) | type IneligibleVoterError struct
method Error (line 18) | func (e IneligibleVoterError) Error() string {
FILE: consensus/voteset/vote_box.go
type voteBox (line 8) | type voteBox struct
method addVote (line 20) | func (vs *voteBox) addVote(vote *vote.Vote, power int64) {
function newVoteBox (line 13) | func newVoteBox() *voteBox {
FILE: consensus/voteset/vote_box_test.go
function TestDuplicateVote (line 11) | func TestDuplicateVote(t *testing.T) {
FILE: consensus/voteset/voteset.go
type voteSet (line 10) | type voteSet struct
method Round (line 27) | func (vs *voteSet) Round() types.Round {
method verifyVote (line 33) | func (vs *voteSet) verifyVote(vote *vote.Vote) (int64, error) {
method isTwoThirdOfTotalPower (line 49) | func (vs *voteSet) isTwoThirdOfTotalPower(power int64) bool {
method isOneThirdOfTotalPower (line 53) | func (vs *voteSet) isOneThirdOfTotalPower(power int64) bool {
function newVoteSet (line 16) | func newVoteSet(round types.Round, totalPower int64,
FILE: consensus/voteset/voteset_test.go
function setupCommittee (line 17) | func setupCommittee(ts *testsuite.TestSuite, stakes ...amount.Amount) (
function TestAddBlockVote (line 38) | func TestAddBlockVote(t *testing.T) {
function TestAddBinaryVote (line 80) | func TestAddBinaryVote(t *testing.T) {
function TestDuplicateBlockVote (line 125) | func TestDuplicateBlockVote(t *testing.T) {
function TestDuplicateBinaryVote (line 166) | func TestDuplicateBinaryVote(t *testing.T) {
function TestQuorum (line 201) | func TestQuorum(t *testing.T) {
function TestAllBlockVotes (line 246) | func TestAllBlockVotes(t *testing.T) {
function TestAllBinaryVotes (line 289) | func TestAllBinaryVotes(t *testing.T) {
function TestOneThirdPower (line 326) | func TestOneThirdPower(t *testing.T) {
function TestDecidedVoteset (line 387) | func TestDecidedVoteset(t *testing.T) {
FILE: consensusv2/commit.go
type commitState (line 8) | type commitState struct
method enter (line 12) | func (s *commitState) enter() {
method decide (line 16) | func (s *commitState) decide() {
method onAddVote (line 36) | func (*commitState) onAddVote(_ *vote.Vote) {
method onSetProposal (line 40) | func (*commitState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 44) | func (*commitState) onTimeout(_ *ticker) {
method name (line 48) | func (*commitState) name() string {
FILE: consensusv2/config.go
type Config (line 10) | type Config struct
method BasicCheck (line 27) | func (conf *Config) BasicCheck() error {
method CalculateChangeProposerTimeout (line 47) | func (conf *Config) CalculateChangeProposerTimeout(round types.Round) ...
function DefaultConfig (line 17) | func DefaultConfig() *Config {
FILE: consensusv2/config_test.go
function TestConfigBasicCheck (line 11) | func TestConfigBasicCheck(t *testing.T) {
function TestConfigCalculateChangeProposerTimeout (line 75) | func TestConfigCalculateChangeProposerTimeout(t *testing.T) {
FILE: consensusv2/consensus.go
type broadcaster (line 28) | type broadcaster
type consensusV2 (line 30) | type consensusV2 struct
method LogString (line 127) | func (cs *consensusV2) LogString() string {
method ConsensusKey (line 133) | func (cs *consensusV2) ConsensusKey() *bls.PublicKey {
method HeightRound (line 140) | func (cs *consensusV2) HeightRound() (types.Height, types.Round) {
method HasVote (line 147) | func (cs *consensusV2) HasVote(h hash.Hash) bool {
method AllVotes (line 157) | func (cs *consensusV2) AllVotes() []*vote.Vote {
method enterNewState (line 170) | func (cs *consensusV2) enterNewState(s consState) {
method MoveToNewHeight (line 175) | func (cs *consensusV2) MoveToNewHeight() {
method scheduleTimeout (line 185) | func (cs *consensusV2) scheduleTimeout(duration time.Duration,
method handleTimeout (line 196) | func (cs *consensusV2) handleTimeout(ticker *ticker) {
method SetProposal (line 211) | func (cs *consensusV2) SetProposal(prop *proposal.Proposal) {
method AddVote (line 261) | func (cs *consensusV2) AddVote(vte *vote.Vote) {
method proposer (line 301) | func (cs *consensusV2) proposer(round types.Round) *validator.Validator {
method IsProposer (line 305) | func (cs *consensusV2) IsProposer() bool {
method isProposer (line 312) | func (cs *consensusV2) isProposer() bool {
method signAddCPPreVote (line 316) | func (cs *consensusV2) signAddCPPreVote(h hash.Hash,
method signAddCPMainVote (line 324) | func (cs *consensusV2) signAddCPMainVote(h hash.Hash,
method signAddCPDecidedVote (line 332) | func (cs *consensusV2) signAddCPDecidedVote(h hash.Hash,
method signAddPrecommitVote (line 340) | func (cs *consensusV2) signAddPrecommitVote(h hash.Hash) {
method signAddVote (line 345) | func (cs *consensusV2) signAddVote(vte *vote.Vote) {
method queryProposal (line 358) | func (cs *consensusV2) queryProposal() {
method queryVote (line 364) | func (cs *consensusV2) queryVote() {
method broadcastProposal (line 369) | func (cs *consensusV2) broadcastProposal(p *proposal.Proposal) {
method broadcastVote (line 375) | func (cs *consensusV2) broadcastVote(v *vote.Vote) {
method announceNewBlock (line 381) | func (cs *consensusV2) announceNewBlock(blk *block.Block,
method makeCertificate (line 390) | func (cs *consensusV2) makeCertificate(votes map[crypto.Address]*vote....
method IsActive (line 416) | func (cs *consensusV2) IsActive() bool {
method Proposal (line 423) | func (cs *consensusV2) Proposal() *proposal.Proposal {
method HandleQueryProposal (line 430) | func (cs *consensusV2) HandleQueryProposal(height types.Height, round ...
method HandleQueryVote (line 461) | func (cs *consensusV2) HandleQueryVote(height types.Height, round type...
method startChangingProposer (line 496) | func (cs *consensusV2) startChangingProposer() {
method absoluteCommit (line 505) | func (cs *consensusV2) absoluteCommit() {
method IsDeprecated (line 519) | func (*consensusV2) IsDeprecated() bool {
function NewConsensus (line 62) | func NewConsensus(
function makeConsensus (line 79) | func makeConsensus(
FILE: consensusv2/consensus_test.go
constant tIndexX (line 34) | tIndexX = 0
constant tIndexY (line 35) | tIndexY = 1
constant tIndexB (line 36) | tIndexB = 2
constant tIndexP (line 37) | tIndexP = 3
type consMessage (line 40) | type consMessage struct
type testData (line 45) | type testData struct
method shouldNotPublish (line 161) | func (td *testData) shouldNotPublish(t *testing.T, cons *consensusV2, ...
method shouldPublishBlockAnnounce (line 172) | func (td *testData) shouldPublishBlockAnnounce(t *testing.T, cons *con...
method shouldPublishProposal (line 187) | func (td *testData) shouldPublishProposal(t *testing.T, cons *consensu...
method shouldPublishQueryProposal (line 207) | func (td *testData) shouldPublishQueryProposal(t *testing.T, cons *con...
method shouldPublishQueryVote (line 228) | func (td *testData) shouldPublishQueryVote(t *testing.T, cons *consens...
method shouldPublishVote (line 247) | func (td *testData) shouldPublishVote(t *testing.T, cons *consensusV2,...
method checkHeightRound (line 266) | func (*testData) checkHeightRound(t *testing.T, cons *consensusV2, hei...
method addPrecommitVote (line 274) | func (td *testData) addPrecommitVote(t *testing.T, cons *consensusV2, ...
method addCPPreVote (line 284) | func (td *testData) addCPPreVote(t *testing.T, cons *consensusV2, bloc...
method addCPMainVote (line 294) | func (td *testData) addCPMainVote(t *testing.T, cons *consensusV2, blo...
method addCPDecidedVote (line 304) | func (td *testData) addCPDecidedVote(t *testing.T, cons *consensusV2,
method addVote (line 315) | func (td *testData) addVote(t *testing.T, cons *consensusV2, vote *vot...
method newHeightTimeout (line 324) | func (*testData) newHeightTimeout(cons *consensusV2) {
method queryProposalTimeout (line 330) | func (*testData) queryProposalTimeout(cons *consensusV2) {
method changeProposerTimeout (line 336) | func (*testData) changeProposerTimeout(cons *consensusV2) {
method queryVoteTimeout (line 342) | func (*testData) queryVoteTimeout(cons *consensusV2) {
method enterNewHeight (line 350) | func (td *testData) enterNewHeight(cons *consensusV2) {
method enterNextRound (line 359) | func (*testData) enterNextRound(cons *consensusV2) {
method commitBlockForAllStates (line 366) | func (td *testData) commitBlockForAllStates(t *testing.T) (*block.Bloc...
method makeProposal (line 397) | func (td *testData) makeProposal(t *testing.T, height types.Height, ro...
method makeChangeProposerJusts (line 435) | func (td *testData) makeChangeProposerJusts(t *testing.T, propBlockHas...
method executeConsensusNormal (line 909) | func (td *testData) executeConsensusNormal(t *testing.T) *certificate....
method executeConsensusByzantine (line 969) | func (td *testData) executeConsensusByzantine(t *testing.T) *certifica...
function testConfig (line 58) | func testConfig() *Config {
function setup (line 66) | func setup(t *testing.T) *testData {
function setupWithSeed (line 72) | func setupWithSeed(t *testing.T, seed int64) *testData {
function TestStart (line 503) | func TestStart(t *testing.T) {
function TestNotInCommittee (line 511) | func TestNotInCommittee(t *testing.T) {
function TestIsProposer (line 528) | func TestIsProposer(t *testing.T) {
function TestVoteWithInvalidHeight (line 540) | func TestVoteWithInvalidHeight(t *testing.T) {
function TestConsensusAbsoluteCommit (line 557) | func TestConsensusAbsoluteCommit(t *testing.T) {
function TestConsensusAddVote (line 576) | func TestConsensusAddVote(t *testing.T) {
function TestConsensusDelayedProposal (line 601) | func TestConsensusDelayedProposal(t *testing.T) {
function TestConsensusDelayedVote (line 627) | func TestConsensusDelayedVote(t *testing.T) {
function TestHandleQueryVote (line 653) | func TestHandleQueryVote(t *testing.T) {
function TestHandleQueryProposal (line 708) | func TestHandleQueryProposal(t *testing.T) {
function TestSetProposalFromPreviousRound (line 739) | func TestSetProposalFromPreviousRound(t *testing.T) {
function TestSetProposalFromPreviousHeight (line 753) | func TestSetProposalFromPreviousHeight(t *testing.T) {
function TestDoubleProposal (line 767) | func TestDoubleProposal(t *testing.T) {
function TestNonActiveValidator (line 788) | func TestNonActiveValidator(t *testing.T) {
function TestVoteWithBigRound (line 838) | func TestVoteWithBigRound(t *testing.T) {
function TestProposalWithBigRound (line 847) | func TestProposalWithBigRound(t *testing.T) {
function TestInvalidProposal (line 857) | func TestInvalidProposal(t *testing.T) {
function TestCasesNormal (line 869) | func TestCasesNormal(t *testing.T) {
function TestConsensusNormal (line 902) | func TestConsensusNormal(t *testing.T) {
function TestCasesByzantine (line 927) | func TestCasesByzantine(t *testing.T) {
function TestConsensusByzantine (line 962) | func TestConsensusByzantine(t *testing.T) {
function executeConsensus (line 1066) | func executeConsensus(td *testData, withoutByzantineNode bool) (
FILE: consensusv2/cp.go
type changeProposer (line 12) | type changeProposer struct
method onSetProposal (line 16) | func (*changeProposer) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 20) | func (cp *changeProposer) onTimeout(t *ticker) {
method cpCheckCPValue (line 27) | func (*changeProposer) cpCheckCPValue(value vote.CPValue, allowedValue...
method cpCheckJustInitNo (line 37) | func (cp *changeProposer) cpCheckJustInitNo(just vote.Just,
method cpCheckJustInitYes (line 66) | func (cp *changeProposer) cpCheckJustInitYes(just vote.Just,
method cpCheckJustPreVoteHard (line 96) | func (cp *changeProposer) cpCheckJustPreVoteHard(just vote.Just,
method cpCheckJustPreVoteSoft (line 128) | func (cp *changeProposer) cpCheckJustPreVoteSoft(just vote.Just,
method cpCheckJustMainVoteNoConflict (line 160) | func (cp *changeProposer) cpCheckJustMainVoteNoConflict(just vote.Just,
method cpCheckJustMainVoteConflict (line 185) | func (cp *changeProposer) cpCheckJustMainVoteConflict(just vote.Just,
method cpCheckJustDecide (line 252) | func (cp *changeProposer) cpCheckJustDecide(just vote.Just,
method cpCheckJust (line 278) | func (cp *changeProposer) cpCheckJust(vte *vote.Vote) error {
method cpStrongTermination (line 320) | func (cp *changeProposer) cpStrongTermination() {
FILE: consensusv2/cp_decide.go
type cpDecideState (line 8) | type cpDecideState struct
method enter (line 12) | func (s *cpDecideState) enter() {
method decide (line 16) | func (s *cpDecideState) decide() {
method onAddVote (line 46) | func (s *cpDecideState) onAddVote(_ *vote.Vote) {
method name (line 50) | func (*cpDecideState) name() string {
FILE: consensusv2/cp_mainvote.go
type cpMainVoteState (line 8) | type cpMainVoteState struct
method enter (line 12) | func (s *cpMainVoteState) enter() {
method decide (line 16) | func (s *cpMainVoteState) decide() {
method checkForWeakValidity (line 61) | func (s *cpMainVoteState) checkForWeakValidity() {
method detectDoubleProposal (line 73) | func (s *cpMainVoteState) detectDoubleProposal() {
method onAddVote (line 90) | func (s *cpMainVoteState) onAddVote(_ *vote.Vote) {
method name (line 94) | func (*cpMainVoteState) name() string {
FILE: consensusv2/cp_prevote.go
type cpPreVoteState (line 9) | type cpPreVoteState struct
method enter (line 13) | func (s *cpPreVoteState) enter() {
method decide (line 19) | func (s *cpPreVoteState) decide() {
method decideFirstRound (line 30) | func (s *cpPreVoteState) decideFirstRound() {
method decideNextRounds (line 69) | func (s *cpPreVoteState) decideNextRounds() {
method onAddVote (line 101) | func (s *cpPreVoteState) onAddVote(_ *vote.Vote) {
method name (line 105) | func (*cpPreVoteState) name() string {
FILE: consensusv2/cp_test.go
function TestCPChangeProposer (line 14) | func TestCPChangeProposer(t *testing.T) {
function TestCPQueryVote (line 23) | func TestCPQueryVote(t *testing.T) {
function TestCPSetProposalAfterChangeProposer (line 35) | func TestCPSetProposalAfterChangeProposer(t *testing.T) {
function TestCPChangeProposerAgreementYes (line 50) | func TestCPChangeProposerAgreementYes(t *testing.T) {
function TestCPChangeProposerAgreementNo (line 72) | func TestCPChangeProposerAgreementNo(t *testing.T) {
function TestCPCrashOnTestnet (line 103) | func TestCPCrashOnTestnet(t *testing.T) {
function TestCPMoveToNextRoundOnDecidedVoteYes (line 126) | func TestCPMoveToNextRoundOnDecidedVoteYes(t *testing.T) {
function TestCPInvalidJustInitYes (line 142) | func TestCPInvalidJustInitYes(t *testing.T) {
function TestCPInvalidJustInitNo (line 179) | func TestCPInvalidJustInitNo(t *testing.T) {
function TestCPInvalidJustPreVoteHard (line 215) | func TestCPInvalidJustPreVoteHard(t *testing.T) {
function TestCPInvalidJustPreVoteSoft (line 253) | func TestCPInvalidJustPreVoteSoft(t *testing.T) {
function TestCPInvalidJustMainVoteNoConflict (line 291) | func TestCPInvalidJustMainVoteNoConflict(t *testing.T) {
function TestCPInvalidJustMainVoteConflict (line 320) | func TestCPInvalidJustMainVoteConflict(t *testing.T) {
function TestCPInvalidJustDecided (line 416) | func TestCPInvalidJustDecided(t *testing.T) {
FILE: consensusv2/errors.go
type InvalidJustificationError (line 9) | type InvalidJustificationError struct
method Error (line 13) | func (e InvalidJustificationError) Error() string {
type ConfigError (line 18) | type ConfigError struct
method Error (line 22) | func (e ConfigError) Error() string {
FILE: consensusv2/height.go
type newHeightState (line 11) | type newHeightState struct
method enter (line 15) | func (s *newHeightState) enter() {
method decide (line 19) | func (s *newHeightState) decide() {
method onAddVote (line 38) | func (s *newHeightState) onAddVote(_ *vote.Vote) {
method onSetProposal (line 52) | func (*newHeightState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 56) | func (s *newHeightState) onTimeout(t *ticker) {
method name (line 64) | func (*newHeightState) name() string {
FILE: consensusv2/height_test.go
function TestNewHeightTimeout (line 11) | func TestNewHeightTimeout(t *testing.T) {
function TestNewHeightDoubleEntry (line 29) | func TestNewHeightDoubleEntry(t *testing.T) {
function TestNewHeightTimeBehindNetwork (line 45) | func TestNewHeightTimeBehindNetwork(t *testing.T) {
FILE: consensusv2/log/log.go
type Log (line 13) | type Log struct
method RoundMessages (line 25) | func (log *Log) RoundMessages(round types.Round) *Messages {
method HasVote (line 29) | func (log *Log) HasVote(h hash.Hash) bool {
method mustGetRoundMessages (line 39) | func (log *Log) mustGetRoundMessages(round types.Round) *Messages {
method AddVote (line 54) | func (log *Log) AddVote(v *vote.Vote) (bool, error) {
method PrecommitVoteSet (line 60) | func (log *Log) PrecommitVoteSet(round types.Round) *voteset.BlockVote...
method CPPreVoteVoteSet (line 66) | func (log *Log) CPPreVoteVoteSet(round types.Round) *voteset.BinaryVot...
method CPMainVoteVoteSet (line 72) | func (log *Log) CPMainVoteVoteSet(round types.Round) *voteset.BinaryVo...
method CPDecidedVoteSet (line 78) | func (log *Log) CPDecidedVoteSet(round types.Round) *voteset.BinaryVot...
method HasRoundProposal (line 84) | func (log *Log) HasRoundProposal(round types.Round) bool {
method RoundProposal (line 88) | func (log *Log) RoundProposal(round types.Round) *proposal.Proposal {
method SetRoundProposal (line 97) | func (log *Log) SetRoundProposal(round types.Round, prop *proposal.Pro...
method MoveToNewHeight (line 102) | func (log *Log) MoveToNewHeight(validators []*validator.Validator) {
method CanVote (line 112) | func (log *Log) CanVote(addr crypto.Address) bool {
method TotalPower (line 122) | func (log *Log) TotalPower() int64 {
function NewLog (line 19) | func NewLog() *Log {
FILE: consensusv2/log/log_test.go
function TestMustGetRound (line 13) | func TestMustGetRound(t *testing.T) {
function TestAddValidVote (line 22) | func TestAddValidVote(t *testing.T) {
function TestAddInvalidVoteType (line 65) | func TestAddInvalidVoteType(t *testing.T) {
function TestSetRoundProposal (line 85) | func TestSetRoundProposal(t *testing.T) {
function TestCanVote (line 102) | func TestCanVote(t *testing.T) {
function TestTotalPower (line 114) | func TestTotalPower(t *testing.T) {
FILE: consensusv2/log/messages.go
type Messages (line 12) | type Messages struct
method addVote (line 20) | func (m *Messages) addVote(vte *vote.Vote) (bool, error) {
method HasVote (line 37) | func (m *Messages) HasVote(h hash.Hash) bool {
method AllVotes (line 48) | func (m *Messages) AllVotes() []*vote.Vote {
FILE: consensusv2/mediator.go
type mediator (line 11) | type mediator interface
type ConcreteMediator (line 19) | type ConcreteMediator struct
method OnPublishProposal (line 27) | func (m *ConcreteMediator) OnPublishProposal(from consensus.Consensus,...
method OnPublishVote (line 35) | func (m *ConcreteMediator) OnPublishVote(from consensus.Consensus, vte...
method OnBlockAnnounce (line 43) | func (m *ConcreteMediator) OnBlockAnnounce(from consensus.Consensus) {
method Register (line 52) | func (m *ConcreteMediator) Register(cons consensus.Consensus) {
function newConcreteMediator (line 23) | func newConcreteMediator() mediator {
FILE: consensusv2/precommit.go
type precommitState (line 8) | type precommitState struct
method enter (line 13) | func (s *precommitState) enter() {
method decide (line 26) | func (s *precommitState) decide() {
method vote (line 70) | func (s *precommitState) vote() {
method onAddVote (line 87) | func (s *precommitState) onAddVote(_ *vote.Vote) {
method onSetProposal (line 91) | func (s *precommitState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 95) | func (s *precommitState) onTimeout(ticker *ticker) {
method name (line 118) | func (*precommitState) name() string {
FILE: consensusv2/precommit_test.go
function TestPrecommitStrongCommit (line 12) | func TestPrecommitStrongCommit(t *testing.T) {
function TestPrecommitQueryProposal (line 35) | func TestPrecommitQueryProposal(t *testing.T) {
function TestPrecommitQueryVote (line 50) | func TestPrecommitQueryVote(t *testing.T) {
function TestPrecommitChangeProposerTimeout (line 65) | func TestPrecommitChangeProposerTimeout(t *testing.T) {
function TestPrecommitChangeProposer (line 74) | func TestPrecommitChangeProposer(t *testing.T) {
function TestPrecommitQueryProposalWithCert (line 93) | func TestPrecommitQueryProposalWithCert(t *testing.T) {
function TestPrecommitQueryVoteWithCert (line 109) | func TestPrecommitQueryVoteWithCert(t *testing.T) {
FILE: consensusv2/propose.go
type proposeState (line 10) | type proposeState struct
method enter (line 14) | func (s *proposeState) enter() {
method decide (line 18) | func (s *proposeState) decide() {
method createProposal (line 46) | func (s *proposeState) createProposal(height types.Height, round types...
method onAddVote (line 65) | func (*proposeState) onAddVote(_ *vote.Vote) {
method onSetProposal (line 69) | func (*proposeState) onSetProposal(_ *proposal.Proposal) {
method onTimeout (line 73) | func (*proposeState) onTimeout(_ *ticker) {
method name (line 77) | func (*proposeState) name() string {
FILE: consensusv2/propose_test.go
function TestProposePublishProposal (line 14) | func TestProposePublishProposal(t *testing.T) {
function TestProposeInvalidProposer (line 22) | func TestProposeInvalidProposer(t *testing.T) {
function TestProposeInvalidBlock (line 40) | func TestProposeInvalidBlock(t *testing.T) {
function TestProposeInvalidHeight (line 56) | func TestProposeInvalidHeight(t *testing.T) {
function TestProposeNetworkLagging (line 69) | func TestProposeNetworkLagging(t *testing.T) {
function TestProposeNextRound (line 91) | func TestProposeNextRound(t *testing.T) {
FILE: consensusv2/state.go
type consState (line 8) | type consState interface
FILE: consensusv2/ticker.go
type tickerTarget (line 10) | type tickerTarget
method String (line 19) | func (rs tickerTarget) String() string {
constant tickerTargetNewHeight (line 13) | tickerTargetNewHeight = tickerTarget(1)
constant tickerTargetChangeProposer (line 14) | tickerTargetChangeProposer = tickerTarget(2)
constant tickerTargetQueryProposal (line 15) | tickerTargetQueryProposal = tickerTarget(3)
constant tickerTargetQueryVote (line 16) | tickerTargetQueryVote = tickerTarget(4)
type ticker (line 34) | type ticker struct
method LogString (line 42) | func (ti ticker) LogString() string {
FILE: consensusv2/voteset/binary_voteset.go
type roundVotes (line 12) | type roundVotes struct
method addVote (line 32) | func (rv *roundVotes) addVote(v *vote.Vote, power int64) {
function newRoundVotes (line 19) | func newRoundVotes() *roundVotes {
type BinaryVoteSet (line 37) | type BinaryVoteSet struct
method mustGetRoundVotes (line 73) | func (vs *BinaryVoteSet) mustGetRoundVotes(cpRound int16) *roundVotes {
method AllVotes (line 83) | func (vs *BinaryVoteSet) AllVotes() []*vote.Vote {
method AddVote (line 95) | func (vs *BinaryVoteSet) AddVote(vote *vote.Vote) (bool, error) {
method Has2FP1Votes (line 122) | func (vs *BinaryVoteSet) Has2FP1Votes(cpRound int16) bool {
method HasAnyVoteFor (line 129) | func (vs *BinaryVoteSet) HasAnyVoteFor(cpRound int16, cpValue vote.CPV...
method HasAllVotesFor (line 136) | func (vs *BinaryVoteSet) HasAllVotesFor(cpRound int16, cpValue vote.CP...
method Has1FP1VotesFor (line 143) | func (vs *BinaryVoteSet) Has1FP1VotesFor(cpRound int16, cpValue vote.C...
method Has2FP1VotesFor (line 150) | func (vs *BinaryVoteSet) Has2FP1VotesFor(cpRound int16, cpValue vote.C...
method BinaryVotes (line 157) | func (vs *BinaryVoteSet) BinaryVotes(cpRound int16, cpValue vote.CPVal...
method GetRandomVote (line 167) | func (vs *BinaryVoteSet) GetRandomVote(cpRound int16, cpValue vote.CPV...
method VotedPower (line 177) | func (vs *BinaryVoteSet) VotedPower(cpRound int16) int64 {
function NewCPPreVoteVoteSet (line 42) | func NewCPPreVoteVoteSet(round types.Round, totalPower int64,
function NewCPMainVoteVoteSet (line 50) | func NewCPMainVoteVoteSet(round types.Round, totalPower int64,
function NewCPDecidedVoteSet (line 58) | func NewCPDecidedVoteSet(round types.Round, totalPower int64,
function newBinaryVoteSet (line 66) | func newBinaryVoteSet(voteSet *voteSet) *BinaryVoteSet {
FILE: consensusv2/voteset/block_voteset.go
type BlockVoteSet (line 13) | type BlockVoteSet struct
method BlockVotes (line 37) | func (vs *BlockVoteSet) BlockVotes(blockHash hash.Hash) map[crypto.Add...
method mustGetBlockVotes (line 45) | func (vs *BlockVoteSet) mustGetBlockVotes(blockHash hash.Hash) *voteBox {
method AllVotes (line 56) | func (vs *BlockVoteSet) AllVotes() []*vote.Vote {
method AddVote (line 67) | func (vs *BlockVoteSet) AddVote(vote *vote.Vote) (bool, error) {
method Has2FP1Votes (line 94) | func (vs *BlockVoteSet) Has2FP1Votes() bool {
method Has3FP1VotesFor (line 99) | func (vs *BlockVoteSet) Has3FP1VotesFor(blockHash hash.Hash) bool {
method Has2FP1VotesFor (line 106) | func (vs *BlockVoteSet) Has2FP1VotesFor(blockHash hash.Hash) bool {
method Has1FP1VotesFor (line 113) | func (vs *BlockVoteSet) Has1FP1VotesFor(blockHash hash.Hash) bool {
method VotedPower (line 120) | func (vs *BlockVoteSet) VotedPower() int64 {
function NewPrecommitVoteSet (line 20) | func NewPrecommitVoteSet(round types.Round, totalPower int64,
function newBlockVoteSet (line 28) | func newBlockVoteSet(voteSet *voteSet) *BlockVoteSet {
FILE: consensusv2/voteset/errors.go
type IneligibleVoterError (line 14) | type IneligibleVoterError struct
method Error (line 18) | func (e IneligibleVoterError) Error() string {
FILE: consensusv2/voteset/vote_box.go
type voteBox (line 8) | type voteBox struct
method addVote (line 20) | func (vs *voteBox) addVote(vote *vote.Vote, power int64) {
function newVoteBox (line 13) | func newVoteBox() *voteBox {
FILE: consensusv2/voteset/vote_box_test.go
function TestDoubleVote (line 11) | func TestDoubleVote(t *testing.T) {
FILE: consensusv2/voteset/voteset.go
type voteSet (line 11) | type voteSet struct
method Round (line 28) | func (vs *voteSet) Round() types.Round {
method verifyVote (line 34) | func (vs *voteSet) verifyVote(vote *vote.Vote) (int64, error) {
method has2FP1Power (line 58) | func (vs *voteSet) has2FP1Power(power int64) bool {
method has1FP1Power (line 64) | func (vs *voteSet) has1FP1Power(power int64) bool {
function newVoteSet (line 17) | func newVoteSet(round types.Round, totalPower int64,
method has3FP1Power (line 52) | func (vs *BlockVoteSet) has3FP1Power(power int64) bool {
FILE: consensusv2/voteset/voteset_test.go
function setupCommittee (line 17) | func setupCommittee(ts *testsuite.TestSuite, stakes ...amount.Amount) (
function TestAddBlockVote (line 35) | func TestAddBlockVote(t *testing.T) {
function TestAddBinaryVote (line 78) | func TestAddBinaryVote(t *testing.T) {
function TestDoubleBlockVote (line 123) | func TestDoubleBlockVote(t *testing.T) {
function TestDoubleBinaryVote (line 160) | func TestDoubleBinaryVote(t *testing.T) {
function TestAllBlockVotes (line 197) | func TestAllBlockVotes(t *testing.T) {
function TestAllBinaryVotes (line 223) | func TestAllBinaryVotes(t *testing.T) {
function TestBlockQuorumVotes (line 255) | func TestBlockQuorumVotes(t *testing.T) {
function TestBinaryQuorumVotes (line 295) | func TestBinaryQuorumVotes(t *testing.T) {
function TestBlockVotes (line 348) | func TestBlockVotes(t *testing.T) {
function TestBinaryVotes (line 372) | func TestBinaryVotes(t *testing.T) {
function TestDecidedVoteset (line 401) | func TestDecidedVoteset(t *testing.T) {
function TestBlockVotedPower (line 421) | func TestBlockVotedPower(t *testing.T) {
function TestBinaryVotedPower (line 451) | func TestBinaryVotedPower(t *testing.T) {
function TestBlockHas2FP1Votes (line 488) | func TestBlockHas2FP1Votes(t *testing.T) {
function TestBinaryHas3FP1Votes (line 513) | func TestBinaryHas3FP1Votes(t *testing.T) {
FILE: crypto/address.go
constant SignatureTypeBLS (line 16) | SignatureTypeBLS byte = 1
constant SignatureTypeEd25519 (line 17) | SignatureTypeEd25519 byte = 3
constant AddressSize (line 21) | AddressSize = 21
constant treasuryAddressString (line 22) | treasuryAddressString = "000000000000000000000000000000000000000000"
type Address (line 27) | type Address
method Bytes (line 79) | func (addr Address) Bytes() []byte {
method String (line 84) | func (addr Address) String() string {
method ShortString (line 98) | func (addr Address) ShortString() string {
method LogString (line 105) | func (addr Address) LogString() string {
method Type (line 109) | func (addr Address) Type() AddressType {
method Encode (line 113) | func (addr Address) Encode(w io.Writer) error {
method Decode (line 126) | func (addr *Address) Decode(r io.Reader) error {
method SerializeSize (line 144) | func (addr Address) SerializeSize() int {
method IsTreasuryAddress (line 157) | func (addr Address) IsTreasuryAddress() bool {
method IsAccountAddress (line 161) | func (addr Address) IsAccountAddress() bool {
method IsValidatorAddress (line 167) | func (addr Address) IsValidatorAddress() bool {
function AddressFromString (line 31) | func AddressFromString(text string) (Address, error) {
function NewAddress (line 70) | func NewAddress(typ AddressType, data []byte) Address {
FILE: crypto/address_test.go
function TestTreasuryAddressType (line 17) | func TestTreasuryAddressType(t *testing.T) {
function TestAddressType (line 25) | func TestAddressType(t *testing.T) {
function TestFromString (line 44) | func TestFromString(t *testing.T) {
function TestAddressDecoding (line 161) | func TestAddressDecoding(t *testing.T) {
function TestShortString (line 233) | func TestShortString(t *testing.T) {
FILE: crypto/address_type.go
type AddressType (line 3) | type AddressType
method String (line 12) | func (t AddressType) String() string {
constant AddressTypeTreasury (line 6) | AddressTypeTreasury AddressType = 0
constant AddressTypeValidator (line 7) | AddressTypeValidator AddressType = 1
constant AddressTypeBLSAccount (line 8) | AddressTypeBLSAccount AddressType = 2
constant AddressTypeEd25519Account (line 9) | AddressTypeEd25519Account AddressType = 3
FILE: crypto/bls/bls.go
function init (line 25) | func init() {
function SignatureAggregate (line 32) | func SignatureAggregate(sigs ...*Signature) (*Signature, error) {
function PublicKeyAggregate (line 60) | func PublicKeyAggregate(pubs ...*PublicKey) (*PublicKey, error) {
FILE: crypto/bls/bls_bench_test.go
function BenchmarkEncode (line 10) | func BenchmarkEncode(b *testing.B) {
function BenchmarkDecodeSign (line 24) | func BenchmarkDecodeSign(b *testing.B) {
function BenchmarkVerify (line 40) | func BenchmarkVerify(b *testing.B) {
function BenchmarkDecode (line 56) | func BenchmarkDecode(b *testing.B) {
FILE: crypto/bls/bls_test.go
function TestSigning (line 15) | func TestSigning(t *testing.T) {
function TestSignatureAggregate (line 35) | func TestSignatureAggregate(t *testing.T) {
function TestAggregateFailed (line 51) | func TestAggregateFailed(t *testing.T) {
function TestAggregateOnlyOneSignature (line 106) | func TestAggregateOnlyOneSignature(t *testing.T) {
function TestAggregateOnlyOnePublicKey (line 117) | func TestAggregateOnlyOnePublicKey(t *testing.T) {
function TestDuplicatedAggregate (line 127) | func TestDuplicatedAggregate(t *testing.T) {
function TestHashToCurve (line 153) | func TestHashToCurve(t *testing.T) {
function TestSignatureAggregateErrorHandling (line 206) | func TestSignatureAggregateErrorHandling(t *testing.T) {
function TestPublicKeyAggregateErrorHandling (line 241) | func TestPublicKeyAggregateErrorHandling(t *testing.T) {
FILE: crypto/bls/hdkeychain/extendedkey.go
constant hardenedKeyStart (line 28) | hardenedKeyStart = uint32(0x80000000)
constant MinSeedBytes (line 32) | MinSeedBytes = 16
constant MaxSeedBytes (line 36) | MaxSeedBytes = 64
type ExtendedKey (line 41) | type ExtendedKey struct
method pubKeyBytes (line 68) | func (k *ExtendedKey) pubKeyBytes() []byte {
method IsPrivate (line 97) | func (k *ExtendedKey) IsPrivate() bool {
method DerivePath (line 103) | func (k *ExtendedKey) DerivePath(path []uint32) (*ExtendedKey, error) {
method Derive (line 135) | func (k *ExtendedKey) Derive(index uint32) (*ExtendedKey, error) {
method Path (line 304) | func (k *ExtendedKey) Path() []uint32 {
method RawPrivateKey (line 312) | func (k *ExtendedKey) RawPrivateKey() ([]byte, error) {
method RawPublicKey (line 321) | func (k *ExtendedKey) RawPublicKey() []byte {
method Neuter (line 333) | func (k *ExtendedKey) Neuter() *ExtendedKey {
method String (line 348) | func (k *ExtendedKey) String() string {
function newExtendedKey (line 52) | func newExtendedKey(key, chainCode []byte, path []uint32, isPrivate, pub...
function NewKeyFromString (line 411) | func NewKeyFromString(str string) (*ExtendedKey, error) {
function NewMaster (line 470) | func NewMaster(seed []byte, pubOnG1 bool) (*ExtendedKey, error) {
function GenerateSeed (line 507) | func GenerateSeed(length uint8) ([]byte, error) {
FILE: crypto/bls/hdkeychain/extendedkey_test.go
function TestNonHardenedDerivation (line 17) | func TestNonHardenedDerivation(t *testing.T) {
function TestHardenedDerivation (line 49) | func TestHardenedDerivation(t *testing.T) {
function TestDerivation (line 71) | func TestDerivation(t *testing.T) {
function TestInvalidDerivation (line 193) | func TestInvalidDerivation(t *testing.T) {
function TestGenerateSeed (line 236) | func TestGenerateSeed(t *testing.T) {
function TestNewMaster (line 267) | func TestNewMaster(t *testing.T) {
function TestKeyToString (line 336) | func TestKeyToString(t *testing.T) {
function TestInvalidString (line 437) | func TestInvalidString(t *testing.T) {
function TestNeuter (line 504) | func TestNeuter(t *testing.T) {
FILE: crypto/bls/private_key.go
constant PrivateKeySize (line 19) | PrivateKeySize = 32
type PrivateKey (line 21) | type PrivateKey struct
method String (line 103) | func (prv *PrivateKey) String() string {
method Bytes (line 113) | func (prv *PrivateKey) Bytes() []byte {
method Sign (line 122) | func (prv *PrivateKey) Sign(msg []byte) crypto.Signature {
method SignNative (line 126) | func (prv *PrivateKey) SignNative(msg []byte) *Signature {
method PublicKeyNative (line 142) | func (prv *PrivateKey) PublicKeyNative() *PublicKey {
method PublicKey (line 153) | func (prv *PrivateKey) PublicKey() crypto.PublicKey {
method EqualsTo (line 157) | func (prv *PrivateKey) EqualsTo(x crypto.PrivateKey) bool {
function PrivateKeyFromString (line 27) | func PrivateKeyFromString(text string) (*PrivateKey, error) {
function KeyGen (line 49) | func KeyGen(ikm, keyInfo []byte) (*PrivateKey, error) {
function PrivateKeyFromBytes (line 91) | func PrivateKeyFromBytes(data []byte) (*PrivateKey, error) {
FILE: crypto/bls/private_key_test.go
function TestPrivateKeyEqualsTo (line 14) | func TestPrivateKeyEqualsTo(t *testing.T) {
function TestPrivateKeyFromString (line 26) | func TestPrivateKeyFromString(t *testing.T) {
function TestKeyGen (line 105) | func TestKeyGen(t *testing.T) {
FILE: crypto/bls/public_key.go
constant PublicKeySize (line 18) | PublicKeySize = 96
type PublicKey (line 20) | type PublicKey struct
method Bytes (line 56) | func (pub *PublicKey) Bytes() []byte {
method String (line 61) | func (pub *PublicKey) String() string {
method MarshalCBOR (line 71) | func (pub *PublicKey) MarshalCBOR() ([]byte, error) {
method UnmarshalCBOR (line 76) | func (pub *PublicKey) UnmarshalCBOR(bs []byte) error {
method Encode (line 86) | func (pub *PublicKey) Encode(w io.Writer) error {
method Decode (line 91) | func (pub *PublicKey) Decode(r io.Reader) error {
method Verify (line 106) | func (pub *PublicKey) Verify(msg []byte, sig crypto.Signature) error {
method SerializeSize (line 139) | func (*PublicKey) SerializeSize() int {
method EqualsTo (line 144) | func (pub *PublicKey) EqualsTo(x crypto.PublicKey) bool {
method AccountAddress (line 154) | func (pub *PublicKey) AccountAddress() crypto.Address {
method ValidatorAddress (line 162) | func (pub *PublicKey) ValidatorAddress() crypto.Address {
method VerifyAddress (line 170) | func (pub *PublicKey) VerifyAddress(addr crypto.Address) error {
method PointG2 (line 191) | func (pub *PublicKey) PointG2() (*bls12381.G2Affine, error) {
function PublicKeyFromString (line 27) | func PublicKeyFromString(text string) (*PublicKey, error) {
function PublicKeyFromBytes (line 47) | func PublicKeyFromBytes(data []byte) (*PublicKey, error) {
FILE: crypto/bls/public_key_test.go
function TestPublicKeyCBORMarshaling (line 17) | func TestPublicKeyCBORMarshaling(t *testing.T) {
function TestPublicKeyEqualsTo (line 38) | func TestPublicKeyEqualsTo(t *testing.T) {
function TestPublicKeyEncoding (line 50) | func TestPublicKeyEncoding(t *testing.T) {
function TestPublicKeyVerifyAddress (line 68) | func TestPublicKeyVerifyAddress(t *testing.T) {
function TestNilPublicKey (line 92) | func TestNilPublicKey(t *testing.T) {
function TestNilSignature (line 104) | func TestNilSignature(t *testing.T) {
function TestPublicKeyFromString (line 112) | func TestPublicKeyFromString(t *testing.T) {
function TestPointG2 (line 191) | func TestPointG2(t *testing.T) {
FILE: crypto/bls/signature.go
constant SignatureSize (line 17) | SignatureSize = 48
type Signature (line 19) | type Signature struct
method Bytes (line 45) | func (sig *Signature) Bytes() []byte {
method String (line 50) | func (sig *Signature) String() string {
method MarshalCBOR (line 55) | func (sig *Signature) MarshalCBOR() ([]byte, error) {
method UnmarshalCBOR (line 60) | func (sig *Signature) UnmarshalCBOR(bs []byte) error {
method Encode (line 70) | func (sig *Signature) Encode(w io.Writer) error {
method Decode (line 75) | func (sig *Signature) Decode(r io.Reader) error {
method SerializeSize (line 88) | func (*Signature) SerializeSize() int {
method EqualsTo (line 93) | func (sig *Signature) EqualsTo(x crypto.Signature) bool {
method PointG1 (line 103) | func (sig *Signature) PointG1() (*bls12381.G1Affine, error) {
function SignatureFromString (line 26) | func SignatureFromString(text string) (*Signature, error) {
function SignatureFromBytes (line 36) | func SignatureFromBytes(data []byte) (*Signature, error) {
FILE: crypto/bls/signature_test.go
function TestSignatureCBORMarshaling (line 17) | func TestSignatureCBORMarshaling(t *testing.T) {
function TestSignatureEqualsTo (line 39) | func TestSignatureEqualsTo(t *testing.T) {
function TestSignatureEncoding (line 55) | func TestSignatureEncoding(t *testing.T) {
function TestVerifyingSignature (line 74) | func TestVerifyingSignature(t *testing.T) {
function TestSignatureFromString (line 92) | func TestSignatureFromString(t *testing.T) {
function TestPointG1 (line 143) | func TestPointG1(t *testing.T) {
FILE: crypto/bls/validator_key.go
type ValidatorKey (line 8) | type ValidatorKey struct
method Address (line 24) | func (key *ValidatorKey) Address() crypto.Address {
method PublicKey (line 28) | func (key *ValidatorKey) PublicKey() *PublicKey {
method PrivateKey (line 32) | func (key *ValidatorKey) PrivateKey() *PrivateKey {
method Sign (line 36) | func (key *ValidatorKey) Sign(data []byte) *Signature {
function NewValidatorKey (line 14) | func NewValidatorKey(prv *PrivateKey) *ValidatorKey {
FILE: crypto/bls/validator_key_test.go
function TestValidatorKey (line 12) | func TestValidatorKey(t *testing.T) {
FILE: crypto/crypto.go
function ToTestnetHRP (line 17) | func ToTestnetHRP() {
function ToMainnetHRP (line 26) | func ToMainnetHRP() {
FILE: crypto/ed25519/ed25519_test.go
function TestSigning (line 13) | func TestSigning(t *testing.T) {
function TestEd25519S (line 35) | func TestEd25519S(t *testing.T) {
FILE: crypto/ed25519/hdkeychain/extendedkey.go
constant hardenedKeyStart (line 23) | hardenedKeyStart = uint32(0x80000000)
constant MinSeedBytes (line 27) | MinSeedBytes = 16
constant MaxSeedBytes (line 31) | MaxSeedBytes = 64
type ExtendedKey (line 36) | type ExtendedKey struct
method DerivePath (line 55) | func (k *ExtendedKey) DerivePath(path []uint32) (*ExtendedKey, error) {
method Derive (line 74) | func (k *ExtendedKey) Derive(index uint32) (*ExtendedKey, error) {
method Path (line 114) | func (k *ExtendedKey) Path() []uint32 {
method RawPrivateKey (line 119) | func (k *ExtendedKey) RawPrivateKey() []byte {
method RawPublicKey (line 124) | func (k *ExtendedKey) RawPublicKey() []byte {
method String (line 131) | func (k *ExtendedKey) String() string {
function newExtendedKey (line 45) | func newExtendedKey(key, chainCode []byte, path []uint32) *ExtendedKey {
function NewKeyFromString (line 187) | func NewKeyFromString(str string) (*ExtendedKey, error) {
function NewMaster (line 238) | func NewMaster(seed []byte) (*ExtendedKey, error) {
function GenerateSeed (line 266) | func GenerateSeed(length uint8) ([]byte, error) {
FILE: crypto/ed25519/hdkeychain/extendedkey_test.go
function TestNonHardenedDerivation (line 16) | func TestNonHardenedDerivation(t *testing.T) {
function TestHardenedDerivation (line 30) | func TestHardenedDerivation(t *testing.T) {
function TestDerivation (line 49) | func TestDerivation(t *testing.T) {
function TestGenerateSeed (line 114) | func TestGenerateSeed(t *testing.T) {
function TestNewMaster (line 145) | func TestNewMaster(t *testing.T) {
function TestKeyToString (line 206) | func TestKeyToString(t *testing.T) {
function TestInvalidString (line 262) | func TestInvalidString(t *testing.T) {
FILE: crypto/ed25519/private_key.go
constant PrivateKeySize (line 13) | PrivateKeySize = 32
type PrivateKey (line 15) | type PrivateKey struct
method String (line 51) | func (prv *PrivateKey) String() string {
method Bytes (line 61) | func (prv *PrivateKey) Bytes() []byte {
method Sign (line 67) | func (prv *PrivateKey) Sign(msg []byte) crypto.Signature {
method SignNative (line 71) | func (prv *PrivateKey) SignNative(msg []byte) *Signature {
method PublicKeyNative (line 79) | func (prv *PrivateKey) PublicKeyNative() *PublicKey {
method PublicKey (line 88) | func (prv *PrivateKey) PublicKey() crypto.PublicKey {
method EqualsTo (line 92) | func (prv *PrivateKey) EqualsTo(x crypto.PrivateKey) bool {
function PrivateKeyFromString (line 21) | func PrivateKeyFromString(text string) (*PrivateKey, error) {
function PrivateKeyFromBytes (line 41) | func PrivateKeyFromBytes(data []byte) (*PrivateKey, error) {
FILE: crypto/ed25519/private_key_test.go
function TestPrivateKeyEqualsTo (line 13) | func TestPrivateKeyEqualsTo(t *testing.T) {
function TestPrivateKeyFromString (line 25) | func TestPrivateKeyFromString(t *testing.T) {
FILE: crypto/ed25519/public_key.go
constant PublicKeySize (line 17) | PublicKeySize = 32
type PublicKey (line 19) | type PublicKey struct
method Bytes (line 54) | func (pub *PublicKey) Bytes() []byte {
method String (line 59) | func (pub *PublicKey) String() string {
method MarshalCBOR (line 69) | func (pub *PublicKey) MarshalCBOR() ([]byte, error) {
method UnmarshalCBOR (line 74) | func (pub *PublicKey) UnmarshalCBOR(bs []byte) error {
method Encode (line 84) | func (pub *PublicKey) Encode(w io.Writer) error {
method Decode (line 89) | func (pub *PublicKey) Decode(r io.Reader) error {
method SerializeSize (line 102) | func (*PublicKey) SerializeSize() int {
method Verify (line 108) | func (pub *PublicKey) Verify(msg []byte, sig crypto.Signature) error {
method EqualsTo (line 121) | func (pub *PublicKey) EqualsTo(x crypto.PublicKey) bool {
method AccountAddress (line 131) | func (pub *PublicKey) AccountAddress() crypto.Address {
method VerifyAddress (line 139) | func (pub *PublicKey) VerifyAddress(addr crypto.Address) error {
function PublicKeyFromString (line 25) | func PublicKeyFromString(text string) (*PublicKey, error) {
function PublicKeyFromBytes (line 45) | func PublicKeyFromBytes(data []byte) (*PublicKey, error) {
FILE: crypto/ed25519/public_key_test.go
function TestPublicKeyCBORMarshaling (line 17) | func TestPublicKeyCBORMarshaling(t *testing.T) {
function TestPublicKeyEqualsTo (line 35) | func TestPublicKeyEqualsTo(t *testing.T) {
function TestPublicKeyEncoding (line 47) | func TestPublicKeyEncoding(t *testing.T) {
function TestPublicKeyVerifyAddress (line 65) | func TestPublicKeyVerifyAddress(t *testing.T) {
function TestNilPublicKey (line 81) | func TestNilPublicKey(t *testing.T) {
function TestNilSignature (line 92) | func TestNilSignature(t *testing.T) {
function TestPublicKeyFromString (line 101) | func TestPublicKeyFromString(t *testing.T) {
FILE: crypto/ed25519/signature.go
constant SignatureSize (line 16) | SignatureSize = 64
type Signature (line 18) | type Signature struct
method Bytes (line 43) | func (sig *Signature) Bytes() []byte {
method String (line 48) | func (sig *Signature) String() string {
method MarshalCBOR (line 53) | func (sig *Signature) MarshalCBOR() ([]byte, error) {
method UnmarshalCBOR (line 58) | func (sig *Signature) UnmarshalCBOR(bs []byte) error {
method Encode (line 68) | func (sig *Signature) Encode(w io.Writer) error {
method Decode (line 73) | func (sig *Signature) Decode(r io.Reader) error {
method SerializeSize (line 86) | func (*Signature) SerializeSize() int {
method EqualsTo (line 91) | func (sig *Signature) EqualsTo(x crypto.Signature) bool {
function SignatureFromString (line 24) | func SignatureFromString(text string) (*Signature, error) {
function SignatureFromBytes (line 34) | func SignatureFromBytes(data []byte) (*Signature, error) {
FILE: crypto/ed25519/signature_test.go
function TestSignatureCBORMarshaling (line 17) | func TestSignatureCBORMarshaling(t *testing.T) {
function TestSignatureEqualsTo (line 36) | func TestSignatureEqualsTo(t *testing.T) {
function TestSignatureEncoding (line 52) | func TestSignatureEncoding(t *testing.T) {
function TestVerifyingSignature (line 71) | func TestVerifyingSignature(t *testing.T) {
function TestSignatureFromString (line 89) | func TestSignatureFromString(t *testing.T) {
FILE: crypto/errors.go
type InvalidLengthError (line 16) | type InvalidLengthError
method Error (line 18) | func (e InvalidLengthError) Error() string {
type InvalidHRPError (line 24) | type InvalidHRPError
method Error (line 26) | func (e InvalidHRPError) Error() string {
type InvalidAddressTypeError (line 31) | type InvalidAddressTypeError
method Error (line 33) | func (e InvalidAddressTypeError) Error() string {
type InvalidSignatureTypeError (line 38) | type InvalidSignatureTypeError
method Error (line 40) | func (e InvalidSignatureTypeError) Error() string {
type AddressMismatchError (line 46) | type AddressMismatchError struct
method Error (line 51) | func (e AddressMismatchError) Error() string {
FILE: crypto/hash/hash.go
constant HashSize (line 11) | HashSize = 32
type Hash (line 13) | type Hash
method Bytes (line 69) | func (h Hash) Bytes() []byte {
method String (line 74) | func (h Hash) String() string {
method ShortString (line 79) | func (h Hash) ShortString() string {
method LogString (line 84) | func (h Hash) LogString() string {
method IsUndef (line 88) | func (h Hash) IsUndef() bool {
function Hash256 (line 17) | func Hash256(data []byte) []byte {
function Hash160 (line 23) | func Hash160(data []byte) []byte {
function FromString (line 38) | func FromString(str string) (Hash, error) {
function FromBytes (line 51) | func FromBytes(data []byte) (Hash, error) {
function CalcHash (line 62) | func CalcHash(data []byte) Hash {
FILE: crypto/hash/hash_test.go
function TestHashFromString (line 13) | func TestHashFromString(t *testing.T) {
function TestHashEmpty (line 31) | func TestHashEmpty(t *testing.T) {
function TestHash256 (line 39) | func TestHash256(t *testing.T) {
function TestHash160 (line 46) | func TestHash160(t *testing.T) {
function TestHashBasicCheck (line 53) | func TestHashBasicCheck(t *testing.T) {
function TestShortString (line 60) | func TestShortString(t *testing.T) {
FILE: crypto/private_key.go
type PrivateKey (line 3) | type PrivateKey interface
FILE: crypto/public_key.go
type PublicKey (line 5) | type PublicKey interface
FILE: crypto/signature.go
type Signature (line 5) | type Signature interface
FILE: execution/errors.go
type TransactionCommittedError (line 15) | type TransactionCommittedError struct
method Error (line 19) | func (e TransactionCommittedError) Error() string {
type LockTimeExpiredError (line 27) | type LockTimeExpiredError struct
method Error (line 31) | func (e LockTimeExpiredError) Error() string {
type LockTimeInFutureError (line 38) | type LockTimeInFutureError struct
method Error (line 42) | func (e LockTimeInFutureError) Error() string {
type SignerBannedError (line 47) | type SignerBannedError struct
method Error (line 51) | func (e SignerBannedError) Error() string {
FILE: execution/execution.go
function Execute (line 10) | func Execute(trx *tx.Tx, sbx sandbox.Sandbox) error {
function CheckAndExecute (line 22) | func CheckAndExecute(trx *tx.Tx, sbx sandbox.Sandbox, strict bool) error {
function CheckLockTime (line 54) | func CheckLockTime(trx *tx.Tx, sbx sandbox.Sandbox, strict bool) error {
FILE: execution/execution_test.go
function TestTransferLockTime (line 14) | func TestTransferLockTime(t *testing.T) {
function TestSortitionLockTime (line 72) | func TestSortitionLockTime(t *testing.T) {
function TestSubsidyLockTime (line 131) | func TestSubsidyLockTime(t *testing.T) {
function TestExecute (line 177) | func TestExecute(t *testing.T) {
function TestCheck (line 208) | func TestCheck(t *testing.T) {
function TestReplay (line 258) | func TestReplay(t *testing.T) {
FILE: execution/executor/batch_transfer.go
type batchRecipient (line 12) | type batchRecipient struct
type BatchTransferExecutor (line 18) | type BatchTransferExecutor struct
method Check (line 59) | func (e *BatchTransferExecutor) Check(_ bool) error {
method Execute (line 67) | func (e *BatchTransferExecutor) Execute() {
function newBatchTransferExecutor (line 26) | func newBatchTransferExecutor(trx *tx.Tx, sbx sandbox.Sandbox) (*BatchTr...
FILE: execution/executor/batch_transfer_test.go
function TestExecuteBatchTransferTx (line 11) | func TestExecuteBatchTransferTx(t *testing.T) {
function TestBatchTransferToSelf (line 71) | func TestBatchTransferToSelf(t *testing.T) {
FILE: execution/executor/bond.go
type BondExecutor (line 12) | type BondExecutor struct
method Check (line 47) | func (e *BondExecutor) Check(strict bool) error {
method Execute (line 103) | func (e *BondExecutor) Execute() {
function newBondExecutor (line 20) | func newBondExecutor(trx *tx.Tx, sbx sandbox.Sandbox) (*BondExecutor, er...
FILE: execution/executor/bond_test.go
function TestExecuteBondTx (line 13) | func TestExecuteBondTx(t *testing.T) {
function TestPowerDeltaBond (line 121) | func TestPowerDeltaBond(t *testing.T) {
function TestSmallBond (line 142) | func TestSmallBond(t *testing.T) {
function TestExecuteDelegatedBondTx (line 187) | func TestExecuteDelegatedBondTx(t *testing.T) {
FILE: execution/executor/errors.go
type SmallStakeError (line 71) | type SmallStakeError struct
method Error (line 75) | func (e SmallStakeError) Error() string {
type MaximumStakeError (line 80) | type MaximumStakeError struct
method Error (line 84) | func (e MaximumStakeError) Error() string {
type InvalidPayloadTypeError (line 89) | type InvalidPayloadTypeError struct
method Error (line 93) | func (e InvalidPayloadTypeError) Error() string {
type AccountNotFoundError (line 98) | type AccountNotFoundError struct
method Error (line 102) | func (e AccountNotFoundError) Error() string {
type ValidatorNotFoundError (line 107) | type ValidatorNotFoundError struct
method Error (line 111) | func (e ValidatorNotFoundError) Error() string {
FILE: execution/executor/executor.go
type Executor (line 9) | type Executor interface
function MakeExecutor (line 14) | func MakeExecutor(trx *tx.Tx, sbx sandbox.Sandbox) (Executor, error) {
FILE: execution/executor/executor_test.go
type testData (line 14) | type testData struct
method checkTotalCoin (line 36) | func (td *testData) checkTotalCoin(t *testing.T, fee amount.Amount) {
method check (line 50) | func (td *testData) check(t *testing.T, trx *tx.Tx, strict bool, expec...
method execute (line 64) | func (td *testData) execute(t *testing.T, trx *tx.Tx) {
function setup (line 20) | func setup(t *testing.T) *testData {
FILE: execution/executor/sortition.go
type SortitionExecutor (line 14) | type SortitionExecutor struct
method Check (line 39) | func (e *SortitionExecutor) Check(strict bool) error {
method canJoinCommittee (line 63) | func (e *SortitionExecutor) canJoinCommittee() error {
method Execute (line 122) | func (e *SortitionExecutor) Execute() {
function newSortitionExecutor (line 21) | func newSortitionExecutor(trx *tx.Tx, sbx sandbox.Sandbox) (*SortitionEx...
FILE: execution/executor/sortition_test.go
function updateCommittee (line 13) | func updateCommittee(td *testData) {
function TestExecuteSortitionTx (line 25) | func TestExecuteSortitionTx(t *testing.T) {
function TestChangePower1 (line 121) | func TestChangePower1(t *testing.T) {
function TestChangePower2 (line 167) | func TestChangePower2(t *testing.T) {
function TestOldestDidNotPropose (line 227) | func TestOldestDidNotPropose(t *testing.T) {
FILE: execution/executor/transfer.go
type TransferExecutor (line 11) | type TransferExecutor struct
method Check (line 46) | func (e *TransferExecutor) Check(_ bool) error {
method Execute (line 54) | func (e *TransferExecutor) Execute() {
function newTransferExecutor (line 19) | func newTransferExecutor(trx *tx.Tx, sbx sandbox.Sandbox) (*TransferExec...
FILE: execution/executor/transfer_test.go
function TestExecuteTransferTx (line 10) | func TestExecuteTransferTx(t *testing.T) {
function TestTransferToSelf (line 53) | func TestTransferToSelf(t *testing.T) {
FILE: execution/executor/unbond.go
type UnbondExecutor (line 10) | type UnbondExecutor struct
method Check (line 31) | func (e *UnbondExecutor) Check(strict bool) error {
method Execute (line 63) | func (e *UnbondExecutor) Execute() {
function newUnbondExecutor (line 16) | func newUnbondExecutor(trx *tx.Tx, sbx sandbox.Sandbox) (*UnbondExecutor...
FILE: execution/executor/unbond_test.go
function TestExecuteUnbondTx (line 12) | func TestExecuteUnbondTx(t *testing.T) {
function TestPowerDeltaUnbond (line 82) | func TestPowerDeltaUnbond(t *testing.T) {
function TestExecuteDelegatedUnbondTx (line 99) | func TestExecuteDelegatedUnbondTx(t *testing.T) {
FILE: execution/executor/withdraw.go
type WithdrawExecutor (line 12) | type WithdrawExecutor struct
method Check (line 42) | func (e *WithdrawExecutor) Check(_ bool) error {
method Execute (line 65) | func (e *WithdrawExecutor) Execute() {
function newWithdrawExecutor (line 20) | func newWithdrawExecutor(trx *tx.Tx, sbx sandbox.Sandbox) (*WithdrawExec...
FILE: execution/executor/withdraw_test.go
function TestExecuteWithdrawTx (line 11) | func TestExecuteWithdrawTx(t *testing.T) {
function TestExecuteDelegatedWithdrawTx (line 86) | func TestExecuteDelegatedWithdrawTx(t *testing.T) {
FILE: genesis/genesis.go
type ChainType (line 18) | type ChainType
method IsMainnet (line 26) | func (n ChainType) IsMainnet() bool {
method IsTestnet (line 30) | func (n ChainType) IsTestnet() bool {
method String (line 34) | func (n ChainType) String() string {
constant Mainnet (line 21) | Mainnet ChainType = 0
constant Testnet (line 22) | Testnet ChainType = 1
constant Localnet (line 23) | Localnet ChainType = 2
type genAccount (line 47) | type genAccount struct
type genValidator (line 52) | type genValidator struct
type Genesis (line 57) | type Genesis struct
method Hash (line 68) | func (gen *Genesis) Hash() hash.Hash {
method GenesisTime (line 74) | func (gen *Genesis) GenesisTime() time.Time {
method Params (line 78) | func (gen *Genesis) Params() *GenesisParams {
method Accounts (line 82) | func (gen *Genesis) Accounts() map[crypto.Address]*account.Account {
method Validators (line 97) | func (gen *Genesis) Validators() []*validator.Validator {
method MarshalJSON (line 108) | func (gen *Genesis) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 112) | func (gen *Genesis) UnmarshalJSON(bs []byte) error {
method SaveToFile (line 169) | func (gen *Genesis) SaveToFile(file string) error {
method TotalSupply (line 179) | func (gen *Genesis) TotalSupply() amount.Amount {
method ChainType (line 188) | func (gen *Genesis) ChainType() ChainType {
type genesisData (line 61) | type genesisData struct
function makeGenesisAccount (line 116) | func makeGenesisAccount(addr crypto.Address, acc *account.Account) genAc...
function makeGenesisValidator (line 123) | func makeGenesisValidator(val *validator.Validator) genValidator {
function MakeGenesis (line 129) | func MakeGenesis(genesisTime time.Time, accounts map[crypto.Address]*acc...
function LoadFromFile (line 155) | func LoadFromFile(file string) (*Genesis, error) {
FILE: genesis/genesis_params.go
type GenesisParams (line 10) | type GenesisParams struct
method BlockInterval (line 46) | func (p *GenesisParams) BlockInterval() time.Duration {
function DefaultGenesisParams (line 26) | func DefaultGenesisParams() *GenesisParams {
FILE: genesis/genesis_test.go
function TestMarshaling (line 20) | func TestMarshaling(t *testing.T) {
function TestGenesisMainnet (line 53) | func TestGenesisMainnet(t *testing.T) {
function TestCheckGenesisAccountAndValidator (line 69) | func TestCheckGenesisAccountAndValidator(t *testing.T) {
function TestGenesisTestnet (line 93) | func TestGenesisTestnet(t *testing.T) {
FILE: genesis/mainnet.go
function MainnetGenesis (line 11) | func MainnetGenesis() *Genesis {
FILE: genesis/testnet.go
function TestnetGenesis (line 11) | func TestnetGenesis() *Genesis {
FILE: network/config.go
type Config (line 14) | type Config struct
method BasicCheck (line 89) | func (conf *Config) BasicCheck() error {
method PublicAddr (line 115) | func (conf *Config) PublicAddr() multiaddr.Multiaddr {
method ListenAddrs (line 125) | func (conf *Config) ListenAddrs() []multiaddr.Multiaddr {
method BootstrapAddrInfos (line 140) | func (conf *Config) BootstrapAddrInfos() []lp2ppeer.AddrInfo {
method CheckIsBootstrapper (line 147) | func (conf *Config) CheckIsBootstrapper(pid lp2pcore.PeerID) {
method MinConns (line 158) | func (conf *Config) MinConns() int {
function DefaultConfig (line 41) | func DefaultConfig() *Config {
function validateMultiAddr (line 66) | func validateMultiAddr(addrs ...string) error {
function validateAddrInfo (line 77) | func validateAddrInfo(addrs ...string) error {
FILE: network/config_test.go
function TestConfigBasicCheck (line 11) | func TestConfigBasicCheck(t *testing.T) {
function TestIsBootstrapper (line 135) | func TestIsBootstrapper(t *testing.T) {
function TestMinConns (line 154) | func TestMinConns(t *testing.T) {
function TestPublicAddr (line 175) | func TestPublicAddr(t *testing.T) {
FILE: network/dht.go
type dhtService (line 13) | type dhtService struct
method Start (line 50) | func (s *dhtService) Start() error {
method Stop (line 54) | func (s *dhtService) Stop() {
function newDHTService (line 20) | func newDHTService(ctx context.Context, host lp2phost.Host, conf *Config,
FILE: network/errors.go
type ConfigError (line 6) | type ConfigError struct
method Error (line 10) | func (e ConfigError) Error() string {
type NotSubscribedError (line 16) | type NotSubscribedError struct
method Error (line 20) | func (e NotSubscribedError) Error() string {
type InvalidTopicError (line 25) | type InvalidTopicError struct
method Error (line 29) | func (e InvalidTopicError) Error() string {
type LibP2PError (line 34) | type LibP2PError struct
method Error (line 38) | func (e LibP2PError) Error() string {
FILE: network/gater.go
type ConnectionGater (line 16) | type ConnectionGater struct
method SetPeerManager (line 45) | func (g *ConnectionGater) SetPeerManager(peerMgr *peerMgr) {
method onDialLimit (line 52) | func (g *ConnectionGater) onDialLimit() bool {
method onAcceptLimit (line 60) | func (g *ConnectionGater) onAcceptLimit() bool {
method InterceptPeerDial (line 68) | func (g *ConnectionGater) InterceptPeerDial(pid lp2ppeer.ID) bool {
method InterceptAddrDial (line 82) | func (g *ConnectionGater) InterceptAddrDial(pid lp2ppeer.ID, ma multia...
method InterceptAccept (line 103) | func (g *ConnectionGater) InterceptAccept(cma lp2pnetwork.ConnMultiadd...
method InterceptSecured (line 124) | func (*ConnectionGater) InterceptSecured(_ lp2pnetwork.Direction, _ lp...
method InterceptUpgraded (line 128) | func (*ConnectionGater) InterceptUpgraded(_ lp2pnetwork.Conn) (bool, l...
function NewConnectionGater (line 26) | func NewConnectionGater(conf *Config, log *logger.SubLogger) (*Connectio...
FILE: network/gater_test.go
type mockConnMultiaddrs (line 13) | type mockConnMultiaddrs struct
method LocalMultiaddr (line 17) | func (*mockConnMultiaddrs) LocalMultiaddr() multiaddr.Multiaddr {
method RemoteMultiaddr (line 21) | func (cma *mockConnMultiaddrs) RemoteMultiaddr() multiaddr.Multiaddr {
function TestAllowedConnections (line 25) | func TestAllowedConnections(t *testing.T) {
function TestDenyPrivate (line 43) | func TestDenyPrivate(t *testing.T) {
function TestMaxConnection (line 62) | func TestMaxConnection(t *testing.T) {
FILE: network/gossip.go
type gossipService (line 16) | type gossipService struct
method Broadcast (line 76) | func (g *gossipService) Broadcast(msg []byte, topicID TopicID) error {
method publish (line 110) | func (g *gossipService) publish(msg []byte, topic *lp2pps.Topic) error {
method JoinTopic (line 120) | func (g *gossipService) JoinTopic(topicID TopicID, evaluator Propagati...
method TopicName (line 157) | func (g *gossipService) TopicName(topicID TopicID) string {
method joinTopic (line 163) | func (g *gossipService) joinTopic(topicID TopicID, evaluator Propagati...
method createValidator (line 206) | func (g *gossipService) createValidator(topicID TopicID, evaluator Pro...
method Start (line 244) | func (*gossipService) Start() {
method Stop (line 249) | func (g *gossipService) Stop() {
method onReceiveMessage (line 260) | func (g *gossipService) onReceiveMessage(msg *GossipMessage) {
function newGossipService (line 31) | func newGossipService(ctx context.Context, host lp2phost.Host, conf *Con...
FILE: network/gossip_test.go
function TestJoinBlockTopic (line 13) | func TestJoinBlockTopic(t *testing.T) {
function TestJoinConsensusTopic (line 28) | func TestJoinConsensusTopic(t *testing.T) {
function TestJoinTransactionTopic (line 43) | func TestJoinTransactionTopic(t *testing.T) {
function TestJoinInvalidTopic (line 58) | func TestJoinInvalidTopic(t *testing.T) {
function TestInvalidTopic (line 72) | func TestInvalidTopic(t *testing.T) {
function TestTopicValidator (line 88) | func TestTopicValidator(t *testing.T) {
FILE: network/interface.go
type TopicID (line 10) | type TopicID
method String (line 19) | func (t TopicID) String() string {
constant TopicIDUnspecified (line 13) | TopicIDUnspecified TopicID = 0
constant TopicIDBlock (line 14) | TopicIDBlock TopicID = 1
constant TopicIDTransaction (line 15) | TopicIDTransaction TopicID = 2
constant TopicIDConsensus (line 16) | TopicIDConsensus TopicID = 3
type EventType (line 37) | type EventType
method String (line 47) | func (t EventType) String() string {
constant EventTypeConnect (line 40) | EventTypeConnect EventType = 1
constant EventTypeDisconnect (line 41) | EventTypeDisconnect EventType = 2
constant EventTypeProtocols (line 42) | EventTypeProtocols EventType = 3
constant EventTypeGossip (line 43) | EventTypeGossip EventType = 4
constant EventTypeStream (line 44) | EventTypeStream EventType = 5
type Event (line 68) | type Event interface
type GossipMessage (line 74) | type GossipMessage struct
method Type (line 80) | func (*GossipMessage) Type() EventType {
type StreamMessage (line 86) | type StreamMessage struct
method Type (line 91) | func (*StreamMessage) Type() EventType {
type ConnectEvent (line 96) | type ConnectEvent struct
method Type (line 102) | func (*ConnectEvent) Type() EventType {
type DisconnectEvent (line 107) | type DisconnectEvent struct
method Type (line 111) | func (*DisconnectEvent) Type() EventType {
type ProtocolsEvents (line 116) | type ProtocolsEvents struct
method Type (line 121) | func (*ProtocolsEvents) Type() EventType {
type PropagationPolicy (line 126) | type PropagationPolicy
constant Propagate (line 130) | Propagate = PropagationPolicy(0)
constant DropButConsume (line 132) | DropButConsume = PropagationPolicy(1)
constant Drop (line 134) | Drop = PropagationPolicy(2)
type PropagationEvaluator (line 138) | type PropagationEvaluator
type Network (line 140) | type Network interface
FILE: network/mdns.go
type mdnsService (line 13) | type mdnsService struct
method HandlePeerFound (line 37) | func (s *mdnsService) HandlePeerFound(addrInfo lp2ppeer.AddrInfo) {
method Start (line 49) | func (s *mdnsService) Start() error {
method Stop (line 58) | func (s *mdnsService) Stop() {
function newMdnsService (line 22) | func newMdnsService(ctx context.Context, host lp2phost.Host, log *logger...
FILE: network/mdns_test.go
function TestMDNS (line 12) | func TestMDNS(t *testing.T) {
FILE: network/mock.go
type PublishData (line 18) | type PublishData struct
type MockNetwork (line 24) | type MockNetwork struct
method Start (line 44) | func (*MockNetwork) Start() error {
method Stop (line 48) | func (*MockNetwork) Stop() {}
method Protect (line 50) | func (*MockNetwork) Protect(_ lp2pcore.PeerID, _ string) {}
method JoinTopic (line 52) | func (*MockNetwork) JoinTopic(_ TopicID, _ PropagationEvaluator) error {
method SelfID (line 56) | func (m *MockNetwork) SelfID() lp2ppeer.ID {
method SendTo (line 60) | func (m *MockNetwork) SendTo(data []byte, pid lp2pcore.PeerID) {
method Broadcast (line 81) | func (m *MockNetwork) Broadcast(data []byte, _ TopicID) {
method CloseConnection (line 104) | func (m *MockNetwork) CloseConnection(pid lp2ppeer.ID) {
method IsClosed (line 111) | func (m *MockNetwork) IsClosed(pid lp2ppeer.ID) bool {
method NumConnectedPeers (line 120) | func (m *MockNetwork) NumConnectedPeers() int {
method AddAnotherNetwork (line 124) | func (m *MockNetwork) AddAnotherNetwork(otherNet *MockNetwork, directi...
method ReachabilityStatus (line 142) | func (*MockNetwork) ReachabilityStatus() string {
method HostAddrs (line 146) | func (*MockNetwork) HostAddrs() []string {
method Name (line 150) | func (*MockNetwork) Name() string {
method Protocols (line 154) | func (*MockNetwork) Protocols() []string {
method NumInbound (line 158) | func (m *MockNetwork) NumInbound() int {
method NumOutbound (line 162) | func (m *MockNetwork) NumOutbound() int {
function MockingNetwork (line 34) | func MockingNetwork(ts *testsuite.TestSuite, pid lp2ppeer.ID) *MockNetwo...
FILE: network/network.go
type network (line 34) | type network struct
method Start (line 325) | func (n *network) Start() error {
method Stop (line 347) | func (n *network) Stop() {
method SelfID (line 363) | func (n *network) SelfID() lp2ppeer.ID {
method Protect (line 367) | func (n *network) Protect(pid lp2pcore.PeerID, tag string) {
method SendTo (line 373) | func (n *network) SendTo(msg []byte, pid lp2pcore.PeerID) {
method Broadcast (line 384) | func (n *network) Broadcast(msg []byte, topicID TopicID) {
method JoinTopic (line 393) | func (n *network) JoinTopic(topicID TopicID, evaluator PropagationEval...
method CloseConnection (line 397) | func (n *network) CloseConnection(pid lp2ppeer.ID) {
method LogString (line 408) | func (n *network) LogString() string {
method NumConnectedPeers (line 412) | func (n *network) NumConnectedPeers() int {
method ReachabilityStatus (line 416) | func (n *network) ReachabilityStatus() string {
method HostAddrs (line 420) | func (n *network) HostAddrs() []string {
method Name (line 429) | func (n *network) Name() string {
method Protocols (line 433) | func (n *network) Protocols() []string {
method NumInbound (line 443) | func (n *network) NumInbound() int {
method NumOutbound (line 447) | func (n *network) NumOutbound() int {
function loadOrCreateKey (line 49) | func loadOrCreateKey(path string) (lp2pcrypto.PrivKey, error) {
function NewNetwork (line 84) | func NewNetwork(ctx context.Context, conf *Config, networkPipe pipeline....
function makeNetwork (line 90) | func makeNetwork(ctx context.Context, conf *Config,
function findRelayPeers (line 279) | func findRelayPeers(networkGetter func() *network) func(ctx context.Cont...
FILE: network/network_test.go
function alwaysPropagate (line 21) | func alwaysPropagate(_ *GossipMessage) PropagationPolicy {
function makeTestNetwork (line 25) | func makeTestNetwork(t *testing.T, conf *Config, opts []lp2p.Option) *ne...
function testConfig (line 41) | func testConfig() *Config {
function shouldReceiveEvent (line 64) | func shouldReceiveEvent(t *testing.T, net *network, eventType EventType)...
function shouldNotReceiveEvent (line 84) | func shouldNotReceiveEvent(t *testing.T, net *network) {
function readData (line 102) | func readData(t *testing.T, r io.ReadCloser, length int) []byte {
function TestStoppingNetwork (line 115) | func TestStoppingNetwork(t *testing.T) {
function TestNetwork (line 137) | func TestNetwork(t *testing.T) {
function TestHostAddrs (line 412) | func TestHostAddrs(t *testing.T) {
function TestNetworkName (line 421) | func TestNetworkName(t *testing.T) {
function TestConnections (line 428) | func TestConnections(t *testing.T) {
function checkConnection (line 471) | func checkConnection(t *testing.T, networkP, networkB *network) {
function TestLoadOrCreateKey (line 489) | func TestLoadOrCreateKey(t *testing.T) {
FILE: network/notifee.go
type NotifeeService (line 17) | type NotifeeService struct
method Start (line 59) | func (s *NotifeeService) Start() {
method Stop (line 91) | func (s *NotifeeService) Stop() {
method Reachability (line 95) | func (s *NotifeeService) Reachability() lp2pnetwork.Reachability {
method Connected (line 99) | func (s *NotifeeService) Connected(_ lp2pnetwork.Network, conn lp2pnet...
method Disconnected (line 107) | func (s *NotifeeService) Disconnected(_ lp2pnetwork.Network, conn lp2p...
method Listen (line 115) | func (s *NotifeeService) Listen(_ lp2pnetwork.Network, ma multiaddr.Mu...
method ListenClose (line 121) | func (s *NotifeeService) ListenClose(_ lp2pnetwork.Network, ma multiad...
method sendProtocolsEvent (line 126) | func (s *NotifeeService) sendProtocolsEvent(pid lp2pcore.PeerID) {
method sendConnectEvent (line 141) | func (s *NotifeeService) sendConnectEvent(pid lp2pcore.PeerID,
method sendDisconnectEvent (line 152) | func (s *NotifeeService) sendDisconnectEvent(pid lp2pcore.PeerID) {
function newNotifeeService (line 28) | func newNotifeeService(ctx context.Context, host lp2phost.Host, networkP...
FILE: network/peermgr.go
type peerInfo (line 19) | type peerInfo struct
type peerMgr (line 27) | type peerMgr struct
method Start (line 78) | func (mgr *peerMgr) Start() {
method Stop (line 84) | func (mgr *peerMgr) Stop() {
method SetPeerConnected (line 90) | func (mgr *peerMgr) SetPeerConnected(pid lp2ppeer.ID, ma multiaddr.Mul...
method setPeerConnected (line 99) | func (mgr *peerMgr) setPeerConnected(pid lp2ppeer.ID, ma multiaddr.Mul...
method SetPeerDisconnected (line 125) | func (mgr *peerMgr) SetPeerDisconnected(pid lp2ppeer.ID) {
method setPeerDisconnected (line 132) | func (mgr *peerMgr) setPeerDisconnected(pid lp2ppeer.ID) {
method CheckConnectivity (line 159) | func (mgr *peerMgr) CheckConnectivity() {
method NumInbound (line 206) | func (mgr *peerMgr) NumInbound() int {
method NumOutbound (line 213) | func (mgr *peerMgr) NumOutbound() int {
method savePeerStore (line 220) | func (mgr *peerMgr) savePeerStore() error {
function newPeerMgr (line 42) | func newPeerMgr(ctx context.Context, host lp2phost.Host,
function loadPeerStore (line 237) | func loadPeerStore(path string) ([]lp2ppeer.AddrInfo, error) {
FILE: network/peermgr_test.go
function TestNumInboundOutbound (line 11) | func TestNumInboundOutbound(t *testing.T) {
FILE: network/stream.go
type streamService (line 16) | type streamService struct
method Start (line 44) | func (*streamService) Start() {}
method Stop (line 46) | func (*streamService) Stop() {}
method handleStream (line 48) | func (s *streamService) handleStream(stream lp2pnetwork.Stream) {
method SendTo (line 72) | func (s *streamService) SendTo(msg []byte, pid lp2peer.ID) (lp2pnetwor...
function newStreamService (line 26) | func newStreamService(ctx context.Context, host lp2phost.Host, conf *Con...
FILE: network/stream_test.go
function TestCloseStream (line 14) | func TestCloseStream(t *testing.T) {
FILE: network/utils.go
function MakeMultiAddrs (line 21) | func MakeMultiAddrs(addrs []string) ([]multiaddr.Multiaddr, error) {
function MakeAddrInfos (line 35) | func MakeAddrInfos(addrs []string) ([]lp2ppeer.AddrInfo, error) {
function IPToMultiAddr (line 48) | func IPToMultiAddr(ip string, port int) (multiaddr.Multiaddr, error) {
function HasPID (line 69) | func HasPID(pids []lp2ppeer.ID, pid lp2ppeer.ID) bool {
function ConnectAsync (line 73) | func ConnectAsync(ctx context.Context, h lp2phost.Host, addrInfo lp2ppee...
function ConnectSync (line 86) | func ConnectSync(ctx context.Context, h lp2phost.Host, addrInfo lp2ppeer...
function PrivateSubnets (line 94) | func PrivateSubnets() []*net.IPNet {
function SubnetsToFilters (line 128) | func SubnetsToFilters(subnets []*net.IPNet, action multiaddr.Action) *mu...
function MessageIDFunc (line 137) | func MessageIDFunc(m *lp2pspb.Message) string {
FILE: network/utils_test.go
function TestMakeMultiAddrs (line 13) | func TestMakeMultiAddrs(t *testing.T) {
function TestMakeAddrInfos (line 57) | func TestMakeAddrInfos(t *testing.T) {
function TestIPToMultiAddr (line 114) | func TestIPToMultiAddr(t *testing.T) {
function TestHasPID (line 139) | func TestHasPID(t *testing.T) {
function TestSubnetsToFilters (line 146) | func TestSubnetsToFilters(t *testing.T) {
function TestMessageIdFunc (line 159) | func TestMessageIdFunc(t *testing.T) {
FILE: node/node.go
type Node (line 32) | type Node struct
method Start (line 149) | func (n *Node) Start() error {
method Stop (line 202) | func (n *Node) Stop() {
method ConsManager (line 230) | func (n *Node) ConsManager() consmgr.ManagerReader {
method Sync (line 234) | func (n *Node) Sync() sync.Synchronizer {
method State (line 238) | func (n *Node) State() state.Facade {
method GRPC (line 242) | func (n *Node) GRPC() *grpc.Server {
method Network (line 246) | func (n *Node) Network() network.Network {
method WalletManager (line 250) | func (n *Node) WalletManager() wltmgr.IManager {
function NewNode (line 54) | func NewNode(ctx context.Context, genDoc *genesis.Genesis, conf *config....
FILE: node/node_test.go
function TestRunningNode (line 24) | func TestRunningNode(t *testing.T) {
FILE: sandbox/interface.go
type Sandbox (line 16) | type Sandbox interface
FILE: sandbox/mock.go
type MockSandbox (line 23) | type MockSandbox struct
method Account (line 68) | func (m *MockSandbox) Account(addr crypto.Address) *account.Account {
method MakeNewAccount (line 74) | func (m *MockSandbox) MakeNewAccount(_ crypto.Address) *account.Account {
method UpdateAccount (line 80) | func (m *MockSandbox) UpdateAccount(addr crypto.Address, acc *account....
method RecentTransaction (line 84) | func (m *MockSandbox) RecentTransaction(txID tx.ID) bool {
method Validator (line 92) | func (m *MockSandbox) Validator(addr crypto.Address) *validator.Valida...
method JoinedToCommittee (line 98) | func (m *MockSandbox) JoinedToCommittee(addr crypto.Address) {
method IsJoinedCommittee (line 102) | func (m *MockSandbox) IsJoinedCommittee(addr crypto.Address) bool {
method MakeNewValidator (line 106) | func (m *MockSandbox) MakeNewValidator(pub *bls.PublicKey) *validator....
method UpdateValidator (line 112) | func (m *MockSandbox) UpdateValidator(val *validator.Validator) {
method CurrentHeight (line 116) | func (m *MockSandbox) CurrentHeight() types.Height {
method IsMainnet (line 120) | func (*MockSandbox) IsMainnet() bool {
method Params (line 124) | func (m *MockSandbox) Params() *param.Params {
method IterateAccounts (line 128) | func (m *MockSandbox) IterateAccounts(consumer func(crypto.Address, *a...
method IterateValidators (line 136) | func (m *MockSandbox) IterateValidators(consumer func(*validator.Valid...
method Committee (line 144) | func (m *MockSandbox) Committee() committee.Reader {
method UpdatePowerDelta (line 148) | func (m *MockSandbox) UpdatePowerDelta(delta int64) {
method PowerDelta (line 152) | func (m *MockSandbox) PowerDelta() int64 {
method VerifyProof (line 156) | func (m *MockSandbox) VerifyProof(types.Height, sortition.Proof, *vali...
method CommitTransaction (line 160) | func (m *MockSandbox) CommitTransaction(trx *tx.Tx) {
method AccumulatedFee (line 164) | func (m *MockSandbox) AccumulatedFee() amount.Amount {
method IsBanned (line 168) | func (*MockSandbox) IsBanned(crypto.Address) bool {
function MockingSandbox (line 35) | func MockingSandbox(ts *testsuite.TestSuite) *MockSandbox {
FILE: sandbox/sandbox.go
type sandbox (line 22) | type sandbox struct
method shouldPanicForDuplicatedAddress (line 72) | func (*sandbox) shouldPanicForDuplicatedAddress() {
method shouldPanicForUnknownAddress (line 81) | func (*sandbox) shouldPanicForUnknownAddress() {
method Account (line 92) | func (sb *sandbox) Account(addr crypto.Address) *account.Account {
method MakeNewAccount (line 112) | func (sb *sandbox) MakeNewAccount(addr crypto.Address) *account.Account {
method UpdateAccount (line 133) | func (sb *sandbox) UpdateAccount(addr crypto.Address, acc *account.Acc...
method RecentTransaction (line 145) | func (sb *sandbox) RecentTransaction(txID tx.ID) bool {
method Validator (line 153) | func (sb *sandbox) Validator(addr crypto.Address) *validator.Validator {
method JoinedToCommittee (line 173) | func (sb *sandbox) JoinedToCommittee(addr crypto.Address) {
method IsJoinedCommittee (line 185) | func (sb *sandbox) IsJoinedCommittee(addr crypto.Address) bool {
method MakeNewValidator (line 197) | func (sb *sandbox) MakeNewValidator(pub *bls.PublicKey) *validator.Val...
method UpdateValidator (line 219) | func (sb *sandbox) UpdateValidator(val *validator.Validator) {
method Params (line 233) | func (sb *sandbox) Params() *param.Params {
method CurrentHeight (line 237) | func (sb *sandbox) CurrentHeight() types.Height {
method IsMainnet (line 244) | func (sb *sandbox) IsMainnet() bool {
method IterateAccounts (line 248) | func (sb *sandbox) IterateAccounts(
method IterateValidators (line 259) | func (sb *sandbox) IterateValidators(
method Committee (line 270) | func (sb *sandbox) Committee() committee.Reader {
method UpdatePowerDelta (line 276) | func (sb *sandbox) UpdatePowerDelta(delta int64) {
method PowerDelta (line 283) | func (sb *sandbox) PowerDelta() int64 {
method VerifyProof (line 291) | func (sb *sandbox) VerifyProof(blockHeight types.Height, proof sortiti...
method CommitTransaction (line 303) | func (sb *sandbox) CommitTransaction(trx *tx.Tx) {
method AccumulatedFee (line 311) | func (sb *sandbox) AccumulatedFee() amount.Amount {
method IsBanned (line 318) | func (sb *sandbox) IsBanned(addr crypto.Address) bool {
type sandboxValidator (line 40) | type sandboxValidator struct
type sandboxAccount (line 46) | type sandboxAccount struct
function NewSandbox (line 51) | func NewSandbox(height types.Height, store store.Reader, params *param.P...
FILE: sandbox/sandbox_test.go
type testData (line 20) | type testData struct
function setup (line 28) | func setup(t *testing.T) *testData {
function TestAccountChange (line 70) | func TestAccountChange(t *testing.T) {
function TestRecentTransaction (line 139) | func TestRecentTransaction(t *testing.T) {
function TestValidatorChange (line 154) | func TestValidatorChange(t *testing.T) {
function TestTotalAccountCounter (line 225) | func TestTotalAccountCounter(t *testing.T) {
function TestTotalValidatorCounter (line 239) | func TestTotalValidatorCounter(t *testing.T) {
function TestCreateDuplicated (line 255) | func TestCreateDuplicated(t *testing.T) {
function TestUpdateFromOutsideTheSandbox (line 276) | func TestUpdateFromOutsideTheSandbox(t *testing.T) {
function TestAccountDeepCopy (line 294) | func TestAccountDeepCopy(t *testing.T) {
function TestValidatorDeepCopy (line 322) | func TestValidatorDeepCopy(t *testing.T) {
function TestPowerDelta (line 350) | func TestPowerDelta(t *testing.T) {
function TestVerifyProof (line 360) | func TestVerifyProof(t *testing.T) {
FILE: scripts/snapshot.py
function setup_logging (line 41) | def setup_logging():
function get_timestamp_str (line 47) | def get_timestamp_str():
function get_current_time_iso (line 51) | def get_current_time_iso():
class Metadata (line 55) | class Metadata:
method sha256 (line 57) | def sha256(file_path):
method update_metadata_file (line 65) | def update_metadata_file(snapshot_path, snapshot_metadata):
method update_metadata_after_removal (line 88) | def update_metadata_after_removal(snapshots_dir, removed_snapshots):
method create_snapshot_json (line 105) | def create_snapshot_json(data_dir, snapshot_subdir):
method create_compressed_snapshot_json (line 124) | def create_compressed_snapshot_json(compressed_file, rel_path):
function run_command (line 136) | def run_command(command):
function get_service_name (line 161) | def get_service_name(service_path):
class DaemonManager (line 167) | class DaemonManager:
method start_service (line 169) | def start_service(service_path=None, docker_compose_path=None, docker_...
method stop_service (line 181) | def stop_service(service_path=None, docker_compose_path=None, docker_s...
class SnapshotManager (line 193) | class SnapshotManager:
method __init__ (line 194) | def __init__(self, args):
method manage_snapshots (line 197) | def manage_snapshots(self):
method create_snapshot (line 225) | def create_snapshot(self):
class Validation (line 267) | class Validation:
method validate_args (line 269) | def validate_args(args):
class ProcessBackup (line 330) | class ProcessBackup:
method __init__ (line 331) | def __init__(self, args):
method run (line 336) | def run(self):
function parse_args (line 356) | def parse_args():
function main (line 391) | def main():
FILE: sortition/proof.go
type Proof (line 8) | type Proof
function ProofFromString (line 10) | func ProofFromString(text string) (Proof, error) {
function ProofFromBytes (line 19) | func ProofFromBytes(data []byte) (Proof, error) {
FILE: sortition/proof_test.go
function TestProofFromString (line 9) | func TestProofFromString(t *testing.T) {
FILE: sortition/seed.go
type VerifiableSeed (line 11) | type VerifiableSeed
method GenerateNext (line 35) | func (s *VerifiableSeed) GenerateNext(prv *bls.PrivateKey) VerifiableS...
method Verify (line 43) | func (s *VerifiableSeed) Verify(public *bls.PublicKey, prevSeed Verifi...
function VerifiableSeedFromString (line 15) | func VerifiableSeedFromString(text string) (VerifiableSeed, error) {
function VerifiableSeedFromBytes (line 24) | func VerifiableSeedFromBytes(data []byte) (VerifiableSeed, error) {
FILE: sortition/seed_test.go
function TestSeedFromString (line 12) | func TestSeedFromString(t *testing.T) {
function TestValidate (line 19) | func TestValidate(t *testing.T) {
FILE: sortition/sortition.go
function EvaluateSortition (line 7) | func EvaluateSortition(seed VerifiableSeed, prv *bls.PrivateKey, total, ...
function VerifyProof (line 16) | func VerifyProof(seed VerifiableSeed, proof Proof, pub *bls.PublicKey, t...
FILE: sortition/sortition_test.go
function TestEvaluation (line 14) | func TestEvaluation(t *testing.T) {
function TestInvalidProof (line 55) | func TestInvalidProof(t *testing.T) {
function TestSortitionMedian (line 79) | func TestSortitionMedian(t *testing.T) {
FILE: sortition/vrf.go
function init (line 12) | func init() {
function Evaluate (line 20) | func Evaluate(seed VerifiableSeed, prv *bls.PrivateKey, max uint64) (uin...
function Verify (line 36) | func Verify(seed VerifiableSeed, pub *bls.PublicKey, proof Proof, max ui...
function GetIndex (line 55) | func GetIndex(proof Proof, max uint64) uint64 {
FILE: sortition/vrf_test.go
function TestVRF (line 14) | func TestVRF(t *testing.T) {
function TestRandomUint64 (line 41) | func TestRandomUint64(t *testing.T) {
function TestGetIndex (line 71) | func TestGetIndex(t *testing.T) {
FILE: state/errors.go
type InvalidSubsidyAmountError (line 30) | type InvalidSubsidyAmountError struct
method Error (line 35) | func (e InvalidSubsidyAmountError) Error() string {
type InvalidVoteForCertificateError (line 41) | type InvalidVoteForCertificateError struct
method Error (line 45) | func (e InvalidVoteForCertificateError) Error() string {
type InvalidStateRootHashError (line 52) | type InvalidStateRootHashError struct
method Error (line 57) | func (e InvalidStateRootHashError) Error() string {
type InvalidProposerError (line 63) | type InvalidProposerError struct
method Error (line 68) | func (e InvalidProposerError) Error() string {
type InvalidBlockTimeError (line 74) | type InvalidBlockTimeError struct
method Error (line 78) | func (e InvalidBlockTimeError) Error() string {
FILE: state/execution.go
method executeBlock (line 12) | func (st *state) executeBlock(blk *block.Block, sbx sandbox.Sandbox, che...
method checkSubsidy (line 53) | func (st *state) checkSubsidy(trx *tx.Tx, proposerAddr crypto.Address, s...
FILE: state/execution_test.go
function TestProposeBlock (line 18) | func TestProposeBlock(t *testing.T) {
function TestExecuteBlock (line 59) | func TestExecuteBlock(t *testing.T) {
function TestSubsidyTransaction (line 199) | func TestSubsidyTransaction(t *testing.T) {
FILE: state/facade.go
type ChainInfo (line 24) | type ChainInfo struct
type CommitteeInfo (line 43) | type CommitteeInfo struct
type Facade (line 49) | type Facade interface
FILE: state/lastinfo/last_info.go
type LastInfo (line 20) | type LastInfo struct
method SortitionSeed (line 32) | func (li *LastInfo) SortitionSeed() sortition.VerifiableSeed {
method BlockHeight (line 36) | func (li *LastInfo) BlockHeight() types.Height {
method BlockHash (line 44) | func (li *LastInfo) BlockHash() hash.Hash {
method Certificate (line 48) | func (li *LastInfo) Certificate() *certificate.Certificate {
method BlockTime (line 52) | func (li *LastInfo) BlockTime() time.Time {
method Validators (line 56) | func (li *LastInfo) Validators() []*validator.Validator {
method UpdateSortitionSeed (line 60) | func (li *LastInfo) UpdateSortitionSeed(lastSortitionSeed sortition.Ve...
method UpdateBlockHash (line 64) | func (li *LastInfo) UpdateBlockHash(lastBlockHash hash.Hash) {
method UpdateCertificate (line 68) | func (li *LastInfo) UpdateCertificate(lastCertificate *certificate.Cer...
method UpdateBlockTime (line 72) | func (li *LastInfo) UpdateBlockTime(lastBlockTime time.Time) {
method UpdateValidators (line 76) | func (li *LastInfo) UpdateValidators(vals []*validator.Validator) {
method RestoreLastInfo (line 80) | func (li *LastInfo) RestoreLastInfo(store store.Store, committeeSize i...
method restoreCommittee (line 109) | func (li *LastInfo) restoreCommittee(store store.Store, lastBlock *blo...
function NewLastInfo (line 28) | func NewLastInfo() *LastInfo {
FILE: state/lastinfo/last_info_test.go
type testData (line 23) | type testData struct
function setup (line 30) | func setup(t *testing.T) *testData {
function TestRestoreCommittee (line 102) | func TestRestoreCommittee(t *testing.T) {
function TestRestoreFailed (line 124) | func TestRestoreFailed(t *testing.T) {
FILE: state/mock.go
type MockState (line 31) | type MockState struct
method CommitTestBlocks (line 59) | func (m *MockState) CommitTestBlocks(num int) {
method Genesis (line 68) | func (m *MockState) Genesis() *genesis.Genesis {
method LastBlockHeight (line 72) | func (m *MockState) LastBlockHeight() types.Height {
method LastBlockHash (line 79) | func (m *MockState) LastBlockHash() hash.Hash {
method LastBlockTime (line 86) | func (m *MockState) LastBlockTime() time.Time {
method LastCertificate (line 97) | func (m *MockState) LastCertificate() *certificate.Certificate {
method UpdateLastCertificate (line 104) | func (*MockState) UpdateLastCertificate(_ *vote.Vote) error {
method CommitBlock (line 108) | func (m *MockState) CommitBlock(blk *block.Block, cert *certificate.Ce...
method Close (line 117) | func (*MockState) Close() {}
method ProposeBlock (line 119) | func (m *MockState) ProposeBlock(valKey *bls.ValidatorKey, _ crypto.Ad...
method ValidateBlock (line 125) | func (*MockState) ValidateBlock(_ *block.Block, _ types.Round) error {
method CommitteeValidators (line 129) | func (m *MockState) CommitteeValidators() []*validator.Validator {
method IsInCommittee (line 133) | func (m *MockState) IsInCommittee(addr crypto.Address) bool {
method Proposer (line 137) | func (m *MockState) Proposer(round types.Round) *validator.Validator {
method IsProposer (line 141) | func (m *MockState) IsProposer(addr crypto.Address, round types.Round)...
method IsValidator (line 145) | func (m *MockState) IsValidator(addr crypto.Address) bool {
method CommittedBlock (line 149) | func (m *MockState) CommittedBlock(height types.Height) (*store.Commit...
method CommittedTx (line 156) | func (m *MockState) CommittedTx(txID tx.ID) (*store.CommittedTx, error) {
method BlockHash (line 163) | func (m *MockState) BlockHash(height types.Height) hash.Hash {
method BlockHeight (line 170) | func (m *MockState) BlockHeight(h hash.Hash) types.Height {
method AccountByAddress (line 177) | func (m *MockState) AccountByAddress(addr crypto.Address) (*account.Ac...
method ValidatorAddresses (line 183) | func (m *MockState) ValidatorAddresses() []crypto.Address {
method ValidatorByAddress (line 187) | func (m *MockState) ValidatorByAddress(addr crypto.Address) (*validato...
method ValidatorByNumber (line 193) | func (m *MockState) ValidatorByNumber(n int32) (*validator.Validator, ...
method PendingTx (line 199) | func (m *MockState) PendingTx(txID tx.ID) *tx.Tx {
method AddPendingTx (line 203) | func (m *MockState) AddPendingTx(trx *tx.Tx) error {
method AddPendingTxAndBroadcast (line 207) | func (m *MockState) AddPendingTxAndBroadcast(trx *tx.Tx) error {
method Params (line 211) | func (m *MockState) Params() *param.Params {
method CalculateFee (line 215) | func (m *MockState) CalculateFee(amt amount.Amount, payloadType payloa...
method PublicKey (line 219) | func (m *MockState) PublicKey(addr crypto.Address) (crypto.PublicKey, ...
method AvailabilityScore (line 223) | func (*MockState) AvailabilityScore(_ int32) float64 {
method AllPendingTxs (line 227) | func (m *MockState) AllPendingTxs() []*tx.Tx {
method UpdateValidatorProtocolVersion (line 231) | func (m *MockState) UpdateValidatorProtocolVersion(addr crypto.Address...
method CommitteeInfo (line 235) | func (m *MockState) CommitteeInfo() *CommitteeInfo {
method ChainInfo (line 243) | func (m *MockState) ChainInfo() *ChainInfo {
method CheckTransaction (line 260) | func (*MockState) CheckTransaction(*tx.Tx) error {
function MockingState (line 44) | func MockingState(ts *testsuite.TestSuite) *MockState {
FILE: state/param/param.go
constant MaxDelegateOwnerRewardShare (line 24) | MaxDelegateOwnerRewardShare = amount.Amount(0.7 * amount.NanoPACPerPAC)
type Params (line 29) | type Params struct
method BlockInterval (line 97) | func (p *Params) BlockInterval() time.Duration {
function FromGenesis (line 45) | func FromGenesis(genDoc *genesis.Genesis) *Params {
FILE: state/score/score.go
type scoreData (line 8) | type scoreData struct
type Manager (line 13) | type Manager struct
method SetCertificate (line 27) | func (sm *Manager) SetCertificate(cert *certificate.Certificate) {
method AvailabilityScore (line 65) | func (sm *Manager) AvailabilityScore(valNum int32) float64 {
function NewScoreManager (line 19) | func NewScoreManager(maxCert uint32) *Manager {
FILE: state/score/score_test.go
function TestScoreManager (line 10) | func TestScoreManager(t *testing.T) {
FILE: state/state.go
type state (line 41) | type state struct
method concreteSandbox (line 148) | func (st *state) concreteSandbox() sandbox.Sandbox {
method tryLoadLastInfo (line 154) | func (st *state) tryLoadLastInfo() error {
method makeGenesisState (line 171) | func (st *state) makeGenesisState(genDoc *genesis.Genesis) error {
method loadMerkels (line 197) | func (st *state) loadMerkels() {
method retrieveTotalPower (line 211) | func (st *state) retrieveTotalPower() int64 {
method stateRoot (line 222) | func (st *state) stateRoot() hash.Hash {
method Close (line 231) | func (st *state) Close() {
method Genesis (line 238) | func (st *state) Genesis() *genesis.Genesis {
method LastBlockHeight (line 245) | func (st *state) LastBlockHeight() types.Height {
method LastBlockHash (line 252) | func (st *state) LastBlockHash() hash.Hash {
method LastBlockTime (line 259) | func (st *state) LastBlockTime() time.Time {
method LastCertificate (line 266) | func (st *state) LastCertificate() *certificate.Certificate {
method UpdateLastCertificate (line 273) | func (st *state) UpdateLastCertificate(vte *vote.Vote) error {
method createSubsidyTx (line 313) | func (st *state) createSubsidyTx(valAddr, rewardAddr crypto.Address, a...
method ProposeBlock (line 365) | func (st *state) ProposeBlock(valKey *bls.ValidatorKey, rewardAddr cry...
method ValidateBlock (line 410) | func (st *state) ValidateBlock(blk *block.Block, round types.Round) er...
method CommitBlock (line 428) | func (st *state) CommitBlock(blk *block.Block, cert *certificate.Certi...
method evaluateSortition (line 514) | func (st *state) evaluateSortition() bool {
method LogString (line 558) | func (st *state) LogString() string {
method commitSandbox (line 565) | func (st *state) commitSandbox(sbx sandbox.Sandbox, round types.Round) {
method validateBlockTime (line 593) | func (st *state) validateBlockTime(blockTime time.Time) error {
method proposeNextBlockTime (line 624) | func (st *state) proposeNextBlockTime() time.Time {
method CommitteeValidators (line 636) | func (st *state) CommitteeValidators() []*validator.Validator {
method IsInCommittee (line 643) | func (st *state) IsInCommittee(addr crypto.Address) bool {
method Proposer (line 650) | func (st *state) Proposer(round types.Round) *validator.Validator {
method IsProposer (line 657) | func (st *state) IsProposer(addr crypto.Address, round types.Round) bo...
method CommittedBlock (line 664) | func (st *state) CommittedBlock(height types.Height) (*store.Committed...
method CommittedTx (line 668) | func (st *state) CommittedTx(txID tx.ID) (*store.CommittedTx, error) {
method BlockHash (line 672) | func (st *state) BlockHash(height types.Height) hash.Hash {
method BlockHeight (line 676) | func (st *state) BlockHeight(h hash.Hash) types.Height {
method AccountByAddress (line 680) | func (st *state) AccountByAddress(addr crypto.Address) (*account.Accou...
method ValidatorAddresses (line 684) | func (st *state) ValidatorAddresses() []crypto.Address {
method ValidatorByAddress (line 688) | func (st *state) ValidatorByAddress(addr crypto.Address) (*validator.V...
method ValidatorByNumber (line 693) | func (st *state) ValidatorByNumber(n int32) (*validator.Validator, err...
method PendingTx (line 697) | func (st *state) PendingTx(txID tx.ID) *tx.Tx {
method AddPendingTx (line 701) | func (st *state) AddPendingTx(trx *tx.Tx) error {
method AddPendingTxAndBroadcast (line 705) | func (st *state) AddPendingTxAndBroadcast(trx *tx.Tx) error {
method Params (line 709) | func (st *state) Params() *param.Params {
method CalculateFee (line 713) | func (st *state) CalculateFee(amt amount.Amount, payloadType payload.T...
method PublicKey (line 717) | func (st *state) PublicKey(addr crypto.Address) (crypto.PublicKey, err...
method AvailabilityScore (line 724) | func (st *state) AvailabilityScore(valNum int32) float64 {
method AllPendingTxs (line 731) | func (st *state) AllPendingTxs() []*tx.Tx {
method publishEvent (line 738) | func (st *state) publishEvent(msg any) {
method UpdateValidatorProtocolVersion (line 742) | func (st *state) UpdateValidatorProtocolVersion(addr crypto.Address, v...
method CommitteeInfo (line 746) | func (st *state) CommitteeInfo() *CommitteeInfo {
method ChainInfo (line 757) | func (st *state) ChainInfo() *ChainInfo {
method calculateAverageScore (line 777) | func (st *state) calculateAverageScore() float64 {
method CheckTransaction (line 802) | func (st *state) CheckTransaction(trx *tx.Tx) error {
function LoadOrNewState (line 59) | func LoadOrNewState(
FILE: state/state_test.go
type testData (line 33) | type testData struct
method proposerKey (line 109) | func (td *testData) proposerKey(t *testing.T, round types.Round) *bls....
method makeBlockAndCertificate (line 120) | func (td *testData) makeBlockAndCertificate(t *testing.T, round types....
method makeCertificateAndSign (line 132) | func (td *testData) makeCertificateAndSign(t *testing.T, blockHash has...
method commitBlocks (line 155) | func (td *testData) commitBlocks(t *testing.T, count types.Height) {
function setup (line 42) | func setup(t *testing.T) *testData {
function TestClosingState (line 164) | func TestClosingState(t *testing.T) {
function TestBlockSubsidyTx (line 170) | func TestBlockSubsidyTx(t *testing.T) {
function TestBlockSubsidyWithDelegationTx (line 219) | func TestBlockSubsidyWithDelegationTx(t *testing.T) {
function TestTryCommitInvalidCertificate (line 314) | func TestTryCommitInvalidCertificate(t *testing.T) {
function TestTryCommitValidBlocks (line 325) | func TestTryCommitValidBlocks(t *testing.T) {
function TestCommitSandbox (line 343) | func TestCommitSandbox(t *testing.T) {
function TestUpdateLastCertificate (line 435) | func TestUpdateLastCertificate(t *testing.T) {
function TestForkDetection (line 483) | func TestForkDetection(t *testing.T) {
function TestSortition (line 507) | func TestSortition(t *testing.T) {
function TestValidateBlockTime (line 546) | func TestValidateBlockTime(t *testing.T) {
function TestValidatorHelpers (line 622) | func TestValidatorHelpers(t *testing.T) {
function TestLoadState (line 648) | func TestLoadState(t *testing.T) {
function TestIsInCommittee (line 679) | func TestIsInCommittee(t *testing.T) {
function TestCalculateFee (line 695) | func TestCalculateFee(t *testing.T) {
function TestCheckMaximumTransactionPerBlock (line 706) | func TestCheckMaximumTransactionPerBlock(t *testing.T) {
function TestCommittedBlock (line 726) | func TestCommittedBlock(t *testing.T) {
function TestUpdateProptocolVersion (line 755) | func TestUpdateProptocolVersion(t *testing.T) {
FILE: state/validation.go
method validateBlock (line 11) | func (st *state) validateBlock(blk *block.Block, round types.Round) error {
method validatePrevCertificate (line 43) | func (st *state) validatePrevCertificate(cert *certificate.Certificate, ...
method validateCurCertificate (line 59) | func (st *state) validateCurCertificate(cert *certificate.Certificate, b...
FILE: state/validation_test.go
function TestBlockValidation (line 16) | func TestBlockValidation(t *testing.T) {
FILE: store/account.go
type accountStore (line 12) | type accountStore struct
method hasAccount (line 41) | func (as *accountStore) hasAccount(addr crypto.Address) bool {
method account (line 50) | func (as *accountStore) account(addr crypto.Address) (*account.Account...
method iterateAccounts (line 71) | func (as *accountStore) iterateAccounts(consumer func(crypto.Address, ...
method updateAccount (line 97) | func (as *accountStore) updateAccount(batch *leveldb.Batch, addr crypt...
function accountKey (line 18) | func accountKey(addr crypto.Address) []byte { return append(accountPrefi...
function newAccountStore (line 20) | func newAccountStore(db *leveldb.DB, cacheSize int) *accountStore {
FILE: store/account_test.go
function TestAccountCounter (line 14) | func TestAccountCounter(t *testing.T) {
function TestAccountBatchSaving (line 45) | func TestAccountBatchSaving(t *testing.T) {
function TestAccountByAddress (line 65) | func TestAccountByAddress(t *testing.T) {
function TestIterateAccounts (line 102) | func TestIterateAccounts(t *testing.T) {
function TestAccountDeepCopy (line 133) | func TestAccountDeepCopy(t *testing.T) {
FILE: store/block.go
function blockKey (line 20) | func blockKey(height types.Height) []byte {
function publicKeyKey (line 24) | func publicKeyKey(addr crypto.Address) []byte {
function blockHashKey (line 28) | func blockHashKey(h hash.Hash) []byte {
type blockStore (line 32) | type blockStore struct
method saveBlock (line 53) | func (bs *blockStore) saveBlock(batch *leveldb.Batch, height types.Hei...
method block (line 110) | func (bs *blockStore) block(height types.Height) ([]byte, error) {
method blockHeight (line 119) | func (bs *blockStore) blockHeight(h hash.Hash) types.Height {
method sortitionSeed (line 128) | func (bs *blockStore) sortitionSeed(blockHeight types.Height) *sortiti...
method hasBlock (line 144) | func (bs *blockStore) hasBlock(height types.Height) bool {
method publicKey (line 148) | func (bs *blockStore) publicKey(addr crypto.Address) (crypto.PublicKey...
method hasPublicKey (line 183) | func (bs *blockStore) hasPublicKey(addr crypto.Address) bool {
method addToCache (line 192) | func (bs *blockStore) addToCache(blockHeight types.Height, sortitionSe...
function newBlockStore (line 39) | func newBlockStore(db *leveldb.DB, seedCacheWindow uint32, publicKeyCach...
FILE: store/block_test.go
function TestBlockStore (line 11) | func TestBlockStore(t *testing.T) {
function TestSortitionSeed (line 42) | func TestSortitionSeed(t *testing.T) {
FILE: store/config.go
constant blockPerDay (line 10) | blockPerDay = 8640
type Config (line 13) | type Config struct
method DataPath (line 37) | func (conf *Config) DataPath() string {
method StorePath (line 41) | func (conf *Config) StorePath() string {
method BasicCheck (line 46) | func (conf *Config) BasicCheck() error {
method RetentionBlocks (line 76) | func (conf *Config) RetentionBlocks() uint32 {
function DefaultConfig (line 25) | func DefaultConfig() *Config {
FILE: store/config_test.go
function TestConfigBasicCheck (line 12) | func TestConfigBasicCheck(t *testing.T) {
function TestConfigStorePath (line 76) | func TestConfigStorePath(t *testing.T) {
FILE: store/errors.go
type ConfigError (line 10) | type ConfigError struct
method Error (line 14) | func (e ConfigError) Error() string {
type PublicKeyNotFoundError (line 20) | type PublicKeyNotFoundError struct
method Error (line 24) | func (e PublicKeyNotFoundError) Error() string {
FILE: store/interface.go
type CommittedBlock (line 23) | type CommittedBlock struct
method ToBlock (line 31) | func (s *CommittedBlock) ToBlock() (*block.Block, error) {
type CommittedTx (line 54) | type CommittedTx struct
method ToTx (line 63) | func (s *CommittedTx) ToTx() (*tx.Tx, error) {
type Reader (line 82) | type Reader interface
type Store (line 108) | type Store interface
FILE: store/mock.go
type MockStore (line 22) | type MockStore struct
method Block (line 41) | func (m *MockStore) Block(height types.Height) (*CommittedBlock, error) {
method BlockHash (line 57) | func (m *MockStore) BlockHash(height types.Height) hash.Hash {
method BlockHeight (line 66) | func (m *MockStore) BlockHeight(h hash.Hash) types.Height {
method SortitionSeed (line 76) | func (m *MockStore) SortitionSeed(blockHeight types.Height) *sortition...
method PublicKey (line 86) | func (m *MockStore) PublicKey(addr crypto.Address) (crypto.PublicKey, ...
method HasPublicKey (line 103) | func (m *MockStore) HasPublicKey(addr crypto.Address) bool {
method Transaction (line 109) | func (m *MockStore) Transaction(txID tx.ID) (*CommittedTx, error) {
method RecentTransaction (line 128) | func (m *MockStore) RecentTransaction(txID tx.ID) bool {
method HasAccount (line 140) | func (m *MockStore) HasAccount(addr crypto.Address) bool {
method Account (line 146) | func (m *MockStore) Account(addr crypto.Address) (*account.Account, er...
method AccountByNumber (line 155) | func (m *MockStore) AccountByNumber(number int32) (*account.Account, e...
method UpdateAccount (line 165) | func (m *MockStore) UpdateAccount(addr crypto.Address, acc *account.Ac...
method TotalAccounts (line 169) | func (m *MockStore) TotalAccounts() int32 {
method HasValidator (line 173) | func (m *MockStore) HasValidator(addr crypto.Address) bool {
method ValidatorAddresses (line 179) | func (m *MockStore) ValidatorAddresses() []crypto.Address {
method Validator (line 188) | func (m *MockStore) Validator(addr crypto.Address) (*validator.Validat...
method ValidatorByNumber (line 197) | func (m *MockStore) ValidatorByNumber(num int32) (*validator.Validator...
method UpdateValidator (line 207) | func (m *MockStore) UpdateValidator(val *validator.Validator) {
method TotalValidators (line 211) | func (m *MockStore) TotalValidators() int32 {
method ActiveValidators (line 215) | func (m *MockStore) ActiveValidators() int32 {
method Close (line 219) | func (*MockStore) Close() {}
method HasAnyBlock (line 221) | func (m *MockStore) HasAnyBlock() bool {
method IterateAccounts (line 225) | func (m *MockStore) IterateAccounts(consumer func(crypto.Address, *acc...
method IterateValidators (line 234) | func (m *MockStore) IterateValidators(consumer func(*validator.Validat...
method SaveBlock (line 243) | func (m *MockStore) SaveBlock(blk *block.Block, cert *certificate.Cert...
method LastCertificate (line 249) | func (m *MockStore) LastCertificate() *certificate.Certificate {
method WriteBatch (line 257) | func (*MockStore) WriteBatch() error {
method AddTestValidator (line 261) | func (m *MockStore) AddTestValidator(options ...testsuite.ValidatorMak...
method AddTestAccount (line 268) | func (m *MockStore) AddTestAccount(options ...testsuite.AccountMakerOp...
method AddTestBlock (line 275) | func (m *MockStore) AddTestBlock(height types.Height) *block.Block {
method RandomTestAcc (line 282) | func (m *MockStore) RandomTestAcc() (crypto.Address, *account.Account) {
method RandomTestVal (line 295) | func (m *MockStore) RandomTestVal() *validator.Validator {
method IsBanned (line 302) | func (*MockStore) IsBanned(_ crypto.Address) bool {
method Prune (line 306) | func (*MockStore) Prune(_ func(_ bool, _ types.Height) bool) error {
method IsPruned (line 310) | func (*MockStore) IsPruned() bool {
method PruningHeight (line 314) | func (*MockStore) PruningHeight() types.Height {
method UpdateValidatorProtocolVersion (line 318) | func (m *MockStore) UpdateValidatorProtocolVersion(addr crypto.Address...
function MockingStore (line 32) | func MockingStore(ts *testsuite.TestSuite) *MockStore {
FILE: store/store.go
constant lastStoreVersion (line 31) | lastStoreVersion = int32(1)
function tryGet (line 44) | func tryGet(db *leveldb.DB, key []byte) ([]byte, error) {
function tryHas (line 56) | func tryHas(db *leveldb.DB, key []byte) bool {
type store (line 67) | type store struct
method Close (line 140) | func (s *store) Close() {
method SaveBlock (line 150) | func (s *store) SaveBlock(blk *block.Block, cert *certificate.Certific...
method Block (line 189) | func (s *store) Block(height types.Height) (*CommittedBlock, error) {
method block (line 196) | func (s *store) block(height types.Height) (*CommittedBlock, error) {
method BlockHeight (line 215) | func (s *store) BlockHeight(h hash.Hash) types.Height {
method BlockHash (line 222) | func (s *store) BlockHash(height types.Height) hash.Hash {
method SortitionSeed (line 236) | func (s *store) SortitionSeed(blockHeight types.Height) *sortition.Ver...
method PublicKey (line 243) | func (s *store) PublicKey(addr crypto.Address) (crypto.PublicKey, erro...
method HasPublicKey (line 250) | func (s *store) HasPublicKey(addr crypto.Address) bool {
method Transaction (line 257) | func (s *store) Transaction(txID tx.ID) (*CommittedTx, error) {
method RecentTransaction (line 289) | func (s *store) RecentTransaction(txID tx.ID) bool {
method HasAccount (line 296) | func (s *store) HasAccount(addr crypto.Address) bool {
method Account (line 303) | func (s *store) Account(addr crypto.Address) (*account.Account, error) {
method TotalAccounts (line 311) | func (s *store) TotalAccounts() int32 {
method IterateAccounts (line 318) | func (s *store) IterateAccounts(consumer func(crypto.Address, *account...
method UpdateAccount (line 325) | func (s *store) UpdateAccount(addr crypto.Address, acc *account.Accoun...
method HasValidator (line 332) | func (s *store) HasValidator(addr crypto.Address) bool {
method ValidatorAddresses (line 339) | func (s *store) ValidatorAddresses() []crypto.Address {
method Validator (line 346) | func (s *store) Validator(addr crypto.Address) (*validator.Validator, ...
method ValidatorByNumber (line 353) | func (s *store) ValidatorByNumber(num int32) (*validator.Validator, er...
method TotalValidators (line 361) | func (s *store) TotalValidators() int32 {
method ActiveValidators (line 369) | func (s *store) ActiveValidators() int32 {
method IterateValidators (line 376) | func (s *store) IterateValidators(consumer func(*validator.Validator) ...
method UpdateValidator (line 383) | func (s *store) UpdateValidator(acc *validator.Validator) {
method UpdateValidatorProtocolVersion (line 390) | func (s *store) UpdateValidatorProtocolVersion(addr crypto.Address, ve...
method LastCertificate (line 397) | func (s *store) LastCertificate() *certificate.Certificate {
method lastCertificate (line 404) | func (s *store) lastCertificate() *certificate.Certificate {
method WriteBatch (line 425) | func (s *store) WriteBatch() error {
method writeBatch (line 432) | func (s *store) writeBatch() error {
method IsBanned (line 443) | func (s *store) IsBanned(addr crypto.Address) bool {
method IsPruned (line 448) | func (s *store) IsPruned() bool {
method PruningHeight (line 454) | func (s *store) PruningHeight() types.Height {
method Prune (line 471) | func (s *store) Prune(callback func(pruned bool, pruningHeight types.H...
method pruneBlock (line 507) | func (s *store) pruneBlock(blockHeight types.Height) (bool, error) {
function NewStore (line 80) | func NewStore(conf *Config) (Store, error) {
FILE: store/store_test.go
type testData (line 17) | type testData struct
function testConfig (line 23) | func testConfig() *Config {
function setup (line 34) | func setup(t *testing.T, config *Config) *testData {
function TestReopenStore (line 63) | func TestReopenStore(t *testing.T) {
function TestBlockHash (line 73) | func TestBlockHash(t *testing.T) {
function TestBlockHeight (line 83) | func TestBlockHeight(t *testing.T) {
function TestUnknownTransactionID (line 93) | func TestUnknownTransactionID(t *testing.T) {
function TestWriteAndClosePeacefully (line 101) | func TestWriteAndClosePeacefully(t *testing.T) {
function TestRetrieveBlockAndTransactions (line 109) | func TestRetrieveBlockAndTransactions(t *testing.T) {
function TestIndexingPublicKeys (line 131) | func TestIndexingPublicKeys(t *testing.T) {
function TestStrippedPublicKey (line 161) | func TestStrippedPublicKey(t *testing.T) {
function TestIsBanned (line 244) | func TestIsBanned(t *testing.T) {
function TestPruneBlock (line 255) | func TestPruneBlock(t *testing.T) {
function TestPrune (line 293) | func TestPrune(t *testing.T) {
function TestCancelPrune (line 368) | func TestCancelPrune(t *testing.T) {
function TestRecentTransaction (line 393) | func TestRecentTransaction(t *testing.T) {
FILE: store/tx.go
type blockRegion (line 14) | type blockRegion struct
function txKey (line 20) | func txKey(txID tx.ID) []byte { return append(txPrefix, txID.Bytes()...) }
type txStore (line 22) | type txStore struct
method saveTxs (line 36) | func (ts *txStore) saveTxs(batch *leveldb.Batch, txs block.Txs, regs [...
method pruneCache (line 53) | func (ts *txStore) pruneCache(currentHeight types.Height) {
method recentTransaction (line 65) | func (ts *txStore) recentTransaction(txID tx.ID) bool {
method tx (line 69) | func (ts *txStore) tx(txID tx.ID) (*blockRegion, error) {
method addToCache (line 83) | func (ts *txStore) addToCache(txID tx.ID, height types.Height) {
function newTxStore (line 28) | func newTxStore(db *leveldb.DB, txCacheWindow uint32) *txStore {
FILE: store/validator.go
type validatorStore (line 12) | type validatorStore struct
method hasValidator (line 56) | func (vs *validatorStore) hasValidator(addr crypto.Address) bool {
method ValidatorAddresses (line 62) | func (vs *validatorStore) ValidatorAddresses() []crypto.Address {
method validator (line 71) | func (vs *validatorStore) validator(addr crypto.Address) (*validator.V...
method validatorByNumber (line 80) | func (vs *validatorStore) validatorByNumber(num int32) (*validator.Val...
method iterateValidators (line 89) | func (vs *validatorStore) iterateValidators(consumer func(*validator.V...
method updateValidator (line 101) | func (vs *validatorStore) updateValidator(batch *leveldb.Batch, val *v...
method updateValidatorProtocolVersion (line 120) | func (vs *validatorStore) updateValidatorProtocolVersion(addr crypto.A...
function valKey (line 20) | func valKey(addr crypto.Address) []byte { return append(validatorPrefix,...
function newValidatorStore (line 22) | func newValidatorStore(db *leveldb.DB) *validatorStore {
FILE: store/validator_test.go
function TestValidatorCounter (line 15) | func TestValidatorCounter(t *testing.T) {
function TestValidatorBatchSaving (line 56) | func TestValidatorBatchSaving(t *testing.T) {
function TestValidatorAddresses (line 76) | func TestValidatorAddresses(t *testing.T) {
function TestValidatorByNumber (line 92) | func TestValidatorByNumber(t *testing.T) {
function TestValidatorByAddress (line 145) | func TestValidatorByAddress(t *testing.T) {
function TestIterateValidators (line 186) | func TestIterateValidators(t *testing.T) {
function TestValidatorDeepCopy (line 217) | func TestValidatorDeepCopy(t *testing.T) {
function TestUpdateValidatorProtocolVersion (line 233) | func TestUpdateValidatorProtocolVersion(t *testing.T) {
FILE: sync/bundle/bundle.go
constant BundleFlagNetworkMainnet (line 15) | BundleFlagNetworkMainnet = 0x0001
constant BundleFlagNetworkTestnet (line 16) | BundleFlagNetworkTestnet = 0x0002
constant BundleFlagCarrierLibP2P (line 17) | BundleFlagCarrierLibP2P = 0x0010
constant BundleFlagCompressed (line 18) | BundleFlagCompressed = 0x0100
constant BundleFlagBroadcasted (line 19) | BundleFlagBroadcasted = 0x0200
constant BundleFlagHandshaking (line 20) | BundleFlagHandshaking = 0x0400
type fixedUint32 (line 24) | type fixedUint32
method MarshalCBOR (line 26) | func (u fixedUint32) MarshalCBOR() ([]byte, error) {
type Bundle (line 38) | type Bundle struct
method BasicCheck (line 53) | func (b *Bundle) BasicCheck() error {
method LogString (line 58) | func (b *Bundle) LogString() string {
method CompressIt (line 62) | func (b *Bundle) CompressIt() {
method Encode (line 73) | func (b *Bundle) Encode() ([]byte, error) {
method Decode (line 97) | func (b *Bundle) Decode(r io.Reader) (int, error) {
function NewBundle (line 44) | func NewBundle(msg message.Message) *Bundle {
type _Bundle (line 66) | type _Bundle struct
FILE: sync/bundle/bundle_test.go
function TestInvalidCBOR (line 17) | func TestInvalidCBOR(t *testing.T) {
function TestMessageCompress (line 30) | func TestMessageCompress(t *testing.T) {
function TestDecodeVoteMessage (line 68) | func TestDecodeVoteMessage(t *testing.T) {
function TestDecodeVoteCBOR (line 84) | func TestDecodeVoteCBOR(t *testing.T) {
function TestEncodingData (line 128) | func TestEncodingData(t *testing.T) {
function TestCBORLengthAttack (line 169) | func TestCBORLengthAttack(t *testing.T) {
FILE: sync/bundle/message/block_announce.go
type BlockAnnounceMessage (line 12) | type BlockAnnounceMessage struct
method BasicCheck (line 28) | func (m *BlockAnnounceMessage) BasicCheck() error {
method Height (line 42) | func (m *BlockAnnounceMessage) Height() types.Height {
method Type (line 46) | func (*BlockAnnounceMessage) Type() Type {
method TopicID (line 50) | func (*BlockAnnounceMessage) TopicID() network.TopicID {
method ShouldBroadcast (line 54) | func (*BlockAnnounceMessage) ShouldBroadcast() bool {
method ConsensusHeight (line 58) | func (m *BlockAnnounceMessage) ConsensusHeight() types.Height {
method LogString (line 63) | func (m *BlockAnnounceMessage) LogString() string {
function NewBlockAnnounceMessage (line 18) | func NewBlockAnnounceMessage(blk *block.Block,
FILE: sync/bundle/message/block_announce_test.go
function TestBlockAnnounceType (line 13) | func TestBlockAnnounceType(t *testing.T) {
function TestBlockAnnounceMessage (line 18) | func TestBlockAnnounceMessage(t *testing.T) {
FILE: sync/bundle/message/blocks_request.go
type BlocksRequestMessage (line 10) | type BlocksRequestMessage struct
method To (line 24) | func (m *BlocksRequestMessage) To() types.Height {
method BasicCheck (line 28) | func (m *BlocksRequestMessage) BasicCheck() error {
method Type (line 39) | func (*BlocksRequestMessage) Type() Type {
method TopicID (line 43) | func (*BlocksRequestMessage) TopicID() network.TopicID {
method ShouldBroadcast (line 47) | func (*BlocksRequestMessage) ShouldBroadcast() bool {
method ConsensusHeight (line 51) | func (*BlocksRequestMessage) ConsensusHeight() types.Height {
method LogString (line 56) | func (m *BlocksRequestMessage) LogString() string {
function NewBlocksRequestMessage (line 16) | func NewBlocksRequestMessage(sid int, from types.Height, count uint32) *...
FILE: sync/bundle/message/blocks_request_test.go
function TestLatestBlocksRequestType (line 11) | func TestLatestBlocksRequestType(t *testing.T) {
function TestBlocksRequestMessage (line 16) | func TestBlocksRequestMessage(t *testing.T) {
FILE: sync/bundle/message/blocks_response.go
type BlocksResponseMessage (line 11) | type BlocksResponseMessage struct
method BasicCheck (line 33) | func (m *BlocksResponseMessage) BasicCheck() error {
method Type (line 43) | func (*BlocksResponseMessage) Type() Type {
method TopicID (line 47) | func (*BlocksResponseMessage) TopicID() network.TopicID {
method ShouldBroadcast (line 51) | func (*BlocksResponseMessage) ShouldBroadcast() bool {
method ConsensusHeight (line 55) | func (*BlocksResponseMessage) ConsensusHeight() types.Height {
method Count (line 59) | func (m *BlocksResponseMessage) Count() uint32 {
method To (line 63) | func (m *BlocksResponseMessage) To() types.Height {
method LogString (line 73) | func (m *BlocksResponseMessage) LogString() string {
method IsRequestRejected (line 77) | func (m *BlocksResponseMessage) IsRequestRejected() bool {
function NewBlocksResponseMessage (line 20) | func NewBlocksResponseMessage(code ResponseCode, reason string, sid int,...
FILE: sync/bundle/message/blocks_response_test.go
function TestLatestBlocksResponseType (line 13) | func TestLatestBlocksResponseType(t *testing.T) {
function TestBlocksResponseMessage (line 18) | func TestBlocksResponseMessage(t *testing.T) {
function TestLatestBlocksResponseCode (line 50) | func TestLatestBlocksResponseCode(t *testing.T) {
FILE: sync/bundle/message/errors.go
type BasicCheckError (line 6) | type BasicCheckError struct
method Error (line 10) | func (e BasicCheckError) Error() string {
type InvalidMessageTypeError (line 15) | type InvalidMessageTypeError struct
method Error (line 19) | func (e InvalidMessageTypeError) Error() string {
FILE: sync/bundle/message/hello.go
type HelloMessage (line 16) | type HelloMessage struct
method BasicCheck (line 44) | func (m *HelloMessage) BasicCheck() error {
method MyTime (line 59) | func (m *HelloMessage) MyTime() time.Time {
method SignBytes (line 63) | func (m *HelloMessage) SignBytes() []byte {
method Type (line 67) | func (*HelloMessage) Type() Type {
method TopicID (line 71) | func (*HelloMessage) TopicID() network.TopicID {
method ShouldBroadcast (line 75) | func (*HelloMessage) ShouldBroadcast() bool {
method ConsensusHeight (line 79) | func (*HelloMessage) ConsensusHeight() types.Height {
method LogString (line 84) | func (m *HelloMessage) LogString() string {
method Sign (line 88) | func (m *HelloMessage) Sign(valKeys []*bls.ValidatorKey) {
function NewHelloMessage (line 29) | func NewHelloMessage(pid peer.ID, moniker string,
FILE: sync/bundle/message/hello_ack.go
type HelloAckMessage (line 10) | type HelloAckMessage struct
method BasicCheck (line 24) | func (*HelloAckMessage) BasicCheck() error {
method Type (line 28) | func (*HelloAckMessage) Type() Type {
method TopicID (line 32) | func (*HelloAckMessage) TopicID() network.TopicID {
method ShouldBroadcast (line 36) | func (*HelloAckMessage) ShouldBroadcast() bool {
method ConsensusHeight (line 40) | func (*HelloAckMessage) ConsensusHeight() types.Height {
method LogString (line 45) | func (m *HelloAckMessage) LogString() string {
function NewHelloAckMessage (line 16) | func NewHelloAckMessage(code ResponseCode, reason string, height types.H...
FILE: sync/bundle/message/hello_ack_test.go
function TestHelloAckType (line 10) | func TestHelloAckType(t *testing.T) {
function TestHelloAckMessage (line 15) | func TestHelloAckMessage(t *testing.T) {
FILE: sync/bundle/message/hello_test.go
function TestHelloType (line 15) | func TestHelloType(t *testing.T) {
function TestHelloMessage (line 20) | func TestHelloMessage(t *testing.T) {
FILE: sync/bundle/message/message.go
type ResponseCode (line 10) | type ResponseCode
method String (line 20) | func (c ResponseCode) String() string {
constant ResponseCodeOK (line 13) | ResponseCodeOK = ResponseCode(0)
constant ResponseCodeRejected (line 14) | ResponseCodeRejected = ResponseCode(1)
constant ResponseCodeMoreBlocks (line 15) | ResponseCodeMoreBlocks = ResponseCode(2)
constant ResponseCodeNoMoreBlocks (line 16) | ResponseCodeNoMoreBlocks = ResponseCode(3)
constant ResponseCodeSynced (line 17) | ResponseCodeSynced = ResponseCode(4)
type Type (line 41) | type Type
method String (line 56) | func (t Type) String() string {
constant TypeHello (line 44) | TypeHello = Type(1)
constant TypeHelloAck (line 45) | TypeHelloAck = Type(2)
constant TypeTransaction (line 46) | TypeTransaction = Type(3)
constant TypeQueryProposal (line 47) | TypeQueryProposal = Type(4)
constant TypeProposal (line 48) | TypeProposal = Type(5)
constant TypeQueryVote (line 49) | TypeQueryVote = Type(6)
constant TypeVote (line 50) | TypeVote = Type(7)
constant TypeBlockAnnounce (line 51) | TypeBlockAnnounce = Type(8)
constant TypeBlocksRequest (line 52) | TypeBlocksRequest = Type(9)
constant TypeBlocksResponse (line 53) | TypeBlocksResponse = Type(10)
function MakeMessage (line 93) | func MakeMessage(msgType Type) (Message, error) {
type Message (line 134) | type Message interface
FILE: sync/bundle/message/message_test.go
Copy disabled (too large)
Download .json
Condensed preview — 825 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (15,480K chars).
[
{
"path": ".dockerignore",
"chars": 14,
"preview": ".github\nbuild\n"
},
{
"path": ".editorconfig",
"chars": 168,
"preview": "root = true\n\n[*]\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.go]\nindent_size = 4\nin"
},
{
"path": ".entire/.gitignore",
"chars": 41,
"preview": "tmp/\nsettings.local.json\nmetadata/\nlogs/\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 946,
"preview": "---\nname: Bug report\nabout: If you find an issue, please let us know.\ntitle: '[BUG]: '\nlabels: '[\"bug\"]'\ntype: 'Bug'\nass"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 852,
"preview": "---\nname: Feature request\nabout: Any new functionality for Pactus.\ntitle: '[FEATURE]: '\nlabels: '[\"enhancement\"]'\ntype: "
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 104,
"preview": "## Description\n\n> A clear description of what the pull request does.\n\n## Related Issue\n\nFixes # (issue)\n"
},
{
"path": ".github/actions/windows-signing/action.yml",
"chars": 1280,
"preview": "name: \"Signing Windows Artifacts\"\ndescription: \"Signing Windows Artifacts\"\n\ninputs:\n signpath-api-token:\n descriptio"
},
{
"path": ".github/codecov.yml",
"chars": 266,
"preview": "comment:\n layout: header, changes, diff, sunburst\ncoverage:\n status:\n patch:\n default:\n threshold: \"10%"
},
{
"path": ".github/packager/js/grpc/README.md",
"chars": 679,
"preview": "# pactus-grpc\n\nJavaScript client for interacting with the [Pactus](https://pactus.org) blockchain via gRPC.\n\n## Installa"
},
{
"path": ".github/packager/js/grpc/package.json",
"chars": 604,
"preview": "{\n \"name\": \"pactus-grpc\",\n \"version\": \"{{ VERSION }}\",\n \"description\": \"JavaScript client for interacting with the Pa"
},
{
"path": ".github/packager/js/jsonrpc/README.md",
"chars": 503,
"preview": "# pactus-jsonrpc\n\nJavaScript client for interacting with the [Pactus](https://pactus.org) blockchain via JSON-RPC.\n\n## I"
},
{
"path": ".github/packager/js/jsonrpc/package.json",
"chars": 691,
"preview": "{\n \"name\": \"pactus-jsonrpc\",\n \"version\": \"{{ VERSION }}\",\n \"description\": \"JavaScript client for interacting with the"
},
{
"path": ".github/packager/packager.sh",
"chars": 4184,
"preview": "#!/bin/bash\n\n# The 'set -e' command causes the script to immediately exit\n# if any command returns a non-zero exit statu"
},
{
"path": ".github/packager/python/grpc/README.md",
"chars": 710,
"preview": "# pactus-grpc\n\nPython client for interacting with the [Pactus](https://pactus.org) blockchain via gRPC.\n\n## Installation"
},
{
"path": ".github/packager/python/grpc/pactus_grpc/__init__.py",
"chars": 84,
"preview": "import os\nimport sys\nsys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))\n"
},
{
"path": ".github/packager/python/grpc/pactus_grpc/__init__.pyi",
"chars": 84,
"preview": "import os\nimport sys\nsys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))\n"
},
{
"path": ".github/packager/python/grpc/pyproject.toml",
"chars": 91,
"preview": "[build-system]\nrequires = [\"setuptools >= 42.0.0\"]\nbuild-backend = \"setuptools.build_meta\"\n"
},
{
"path": ".github/packager/python/grpc/setup.py",
"chars": 859,
"preview": "from pathlib import Path\n\nfrom setuptools import find_packages, setup\n\nsetup(\n name=\"pactus-grpc\",\n version=\"{{ VE"
},
{
"path": ".github/packager/python/jsonrpc/README.md",
"chars": 541,
"preview": "# pactus-jsonrpc\n\nPython client for interacting with the [Pactus](https://pactus.org) blockchain via JSON-RPC.\n\n## Insta"
},
{
"path": ".github/packager/python/jsonrpc/pactus_jsonrpc/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": ".github/packager/python/jsonrpc/pyproject.toml",
"chars": 91,
"preview": "[build-system]\nrequires = [\"setuptools >= 42.0.0\"]\nbuild-backend = \"setuptools.build_meta\"\n"
},
{
"path": ".github/packager/python/jsonrpc/setup.py",
"chars": 925,
"preview": "from pathlib import Path\n\nfrom setuptools import find_packages, setup\n\nsetup(\n name=\"pactus-jsonrpc\",\n version=\"{{"
},
{
"path": ".github/packager/rust/grpc/Cargo.toml",
"chars": 875,
"preview": "[package]\nname = \"pactus-grpc\"\nversion = \"{{ VERSION }}\"\nedition = \"2021\"\ndescription = \"Rust client for "
},
{
"path": ".github/packager/rust/grpc/README.md",
"chars": 764,
"preview": "# pactus-grpc\n\nRust client for interacting with the [Pactus](https://pactus.org) blockchain via gRPC.\n\n## Installation\n\n"
},
{
"path": ".github/packager/rust/grpc/src/lib.rs",
"chars": 882,
"preview": "//! # Pactus gRPC Client\n//!\n//! A Rust client library for interacting with the Pactus blockchain via gRPC.\n//!\n//! ## E"
},
{
"path": ".github/packager/rust/jsonrpc/Cargo.toml",
"chars": 753,
"preview": "[package]\nname = \"pactus-jsonrpc\"\nversion = \"{{ VERSION }}\"\nedition = \"2021\"\ndescription = \"Rust client f"
},
{
"path": ".github/packager/rust/jsonrpc/README.md",
"chars": 589,
"preview": "# pactus-jsonrpc\n\nRust client for interacting with the [Pactus](https://pactus.org) blockchain via JSON-RPC.\n\n## Install"
},
{
"path": ".github/packager/rust/jsonrpc/src/lib.rs",
"chars": 620,
"preview": "//! # Pactus JSON-RPC Client\n//!\n//! A Rust client library for interacting with the Pactus blockchain via JSON-RPC.\n//!\n"
},
{
"path": ".github/releasers/linux/pactus-gui.desktop",
"chars": 128,
"preview": "[Desktop Entry]\nName=pactus-gui\nComment=Pactus blockchain node\nExec=pactus-gui\nIcon=pactus\nType=Application\nCategories=N"
},
{
"path": ".github/releasers/macos/Info.plist",
"chars": 885,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.c"
},
{
"path": ".github/releasers/macos/gtk3-launcher.sh",
"chars": 1235,
"preview": "#!/bin/sh\n\nif test \"x$GTK_DEBUG_LAUNCHER\" != x; then\n set -x\nfi\n\nif test \"x$GTK_DEBUG_GDB\" != x; then\n EXEC=\"gdb -"
},
{
"path": ".github/releasers/macos/gui.bundle",
"chars": 4179,
"preview": "<?xml version=\"1.0\" standalone=\"no\"?> <!--*- mode: xml -*-->\n<app-bundle>\n\n <meta>\n <!-- Where to pick up the GTK+ i"
},
{
"path": ".github/releasers/macos/run-install-name-tool-change.sh",
"chars": 1280,
"preview": "#!/bin/sh\n\nif [ $# -lt 3 ]; then\n echo \"Usage: $0 library old_prefix new_prefix action\"\n exit 1\nfi\n\nLIBRARY=$1\nWRO"
},
{
"path": ".github/releasers/pactus_downloader.sh",
"chars": 4210,
"preview": "#!/bin/sh\n\n# Function to check if a command is available\ncommand_exists() {\n command -v \"$1\" >/dev/null 2>&1\n}\n\n# Dow"
},
{
"path": ".github/releasers/releaser_cli.sh",
"chars": 1710,
"preview": "#!/bin/bash\n\n# The 'set -e' command causes the script to immediately exit\n# if any command returns a non-zero exit statu"
},
{
"path": ".github/releasers/releaser_gui_linux.sh",
"chars": 2101,
"preview": "#!/bin/bash\n\nset -e\n\nROOT_DIR=\"$(pwd)\"\nVERSION=\"$(echo `git -C ${ROOT_DIR} describe --abbrev=0 --tags` | sed 's/^.//')\" "
},
{
"path": ".github/releasers/releaser_gui_macos.sh",
"chars": 2937,
"preview": "#!/bin/bash\n\nset -e\n\nROOT_DIR=\"$(pwd)\"\nVERSION=\"$(echo `git -C ${ROOT_DIR} describe --abbrev=0 --tags` | sed 's/^.//')\" "
},
{
"path": ".github/releasers/releaser_gui_windows_build.sh",
"chars": 841,
"preview": "#!/bin/bash\n\nset -e\n\nROOT_DIR=\"$(pwd)\"\nBUILD_DIR=\"${ROOT_DIR}/build\"\n\n# Copy Windows resources file for application icon"
},
{
"path": ".github/releasers/releaser_gui_windows_installer.sh",
"chars": 1943,
"preview": "#!/bin/bash\n\nset -e\n\nROOT_DIR=\"$(pwd)\"\nVERSION=\"$(echo `git -C ${ROOT_DIR} describe --abbrev=0 --tags` | sed 's/^.//')\"\n"
},
{
"path": ".github/releasers/windows/README.md",
"chars": 215,
"preview": "# Generating the Windows resource (.syso)\n1) Install the tool (once):\n `go install github.com/akavel/rsrc@latest`\n\n2) "
},
{
"path": ".github/releasers/windows/gtk-win-bundler.py",
"chars": 7063,
"preview": "#!/usr/bin/env python3\n\"\"\"\nGTK Bundle Helper for Windows\nAutomatically detects and bundles all GTK dependencies for Wind"
},
{
"path": ".github/releasers/windows/pactus-gui.manifest",
"chars": 938,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersi"
},
{
"path": ".github/workflows/codeql.yml",
"chars": 1567,
"preview": "name: \"CodeQL Advanced\"\n\non:\n push:\n branches: [\"main\"]\n pull_request:\n branches: [\"main\"]\n schedule:\n - cro"
},
{
"path": ".github/workflows/coverage.yml",
"chars": 623,
"preview": "name: Reporting Test Coverage\npermissions:\n contents: read\n\non:\n push:\n branches: [\"main\"]\n pull_request:\n bran"
},
{
"path": ".github/workflows/deadlock.yml",
"chars": 768,
"preview": "name: Deadlock and Data Race Detection\npermissions:\n contents: read\n\non:\n pull_request:\n branches: [\"main\"]\n\njobs:\n"
},
{
"path": ".github/workflows/docker.yml",
"chars": 3025,
"preview": "name: Building Docker and Push to DockerHub\npermissions:\n contents: read\n\non:\n push:\n tags: [\"v[0-9]+.[0-9]+.[0-9]+"
},
{
"path": ".github/workflows/gui.yml",
"chars": 3055,
"preview": "name: Build and Test GUI\npermissions:\n contents: read\n\non:\n push:\n branches: [\"main\"]\n pull_request:\n branches:"
},
{
"path": ".github/workflows/linting.yml",
"chars": 625,
"preview": "name: Lint and Format Check\npermissions:\n contents: read\n\non:\n push:\n branches: [\"main\"]\n pull_request:\n branch"
},
{
"path": ".github/workflows/packager.yml",
"chars": 7384,
"preview": "## Important Notes:\n## 1. The Releaser workflow is triggered when a new tag is pushed to the repository.\n## 2. The Packa"
},
{
"path": ".github/workflows/releaser.yml",
"chars": 9102,
"preview": "name: Releaser\npermissions:\n # https://github.com/softprops/action-gh-release?tab=readme-ov-file#permissions\n contents"
},
{
"path": ".github/workflows/semantic-pr.yml",
"chars": 1737,
"preview": "name: Semantic PR\npermissions:\n pull-requests: read\n\non:\n pull_request_target:\n types:\n - opened\n - edite"
},
{
"path": ".github/workflows/testing.yml",
"chars": 488,
"preview": "name: Unit Testing\npermissions:\n contents: read\n\non:\n push:\n branches: [\"main\"]\n pull_request:\n branches: [\"mai"
},
{
"path": ".gitignore",
"chars": 127,
"preview": "build/\n.DS_Store\n\n# IDEs\n.idea\n.vscode\n\n# TODO tasks\ntodo\n\n# Releasers output\n/pactus-*\n\n# VIM artifacts\n.swp\n.*.sw*\npac"
},
{
"path": ".golangci.yml",
"chars": 4930,
"preview": "version: \"2\"\nlinters:\n enable:\n - asasalint\n - asciicheck\n - bidichk\n - bodyclose\n - contextcheck\n - "
},
{
"path": "CHANGELOG.md",
"chars": 65224,
"preview": "# Changelog\n\n## [1.13.0](https://github.com/pactus-project/pactus/compare/v1.12.0...v1.13.0) (2026-04-03)\n\n### Feat\n\n- *"
},
{
"path": "CONTRIBUTING.md",
"chars": 5819,
"preview": "# Contributing\n\nThank you for considering contributing to the Pactus blockchain!\nPlease read these guidelines before sub"
},
{
"path": "Dockerfile",
"chars": 762,
"preview": "FROM golang:1.26.2-alpine3.23 AS builder\n\nRUN apk add --no-cache git gmp-dev build-base g++ openssl-dev\nADD . /pactus\n\n#"
},
{
"path": "LICENSE",
"chars": 1074,
"preview": "MIT License\n\nCopyright (c) 2020 Pactus blockchain\n\nPermission is hereby granted, free of charge, to any person obtaining"
},
{
"path": "Makefile",
"chars": 2966,
"preview": "PACKAGES=$(shell go list ./... | grep -v 'tests' | grep -v 'grpc/gen')\n\nifneq (,$(filter $(OS),Windows_NT MINGW64))\nEXE "
},
{
"path": "README.md",
"chars": 959,
"preview": "[](https://codecov.i"
},
{
"path": "cmd/cmd.go",
"chars": 12179,
"preview": "package cmd\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/user\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"git"
},
{
"path": "cmd/cmd_test.go",
"chars": 10064,
"preview": "package cmd\n\nimport (\n\t\"runtime\"\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/config\"\n\t\"github.com/pactus-project/pact"
},
{
"path": "cmd/daemon/import.go",
"chars": 3357,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/ezex-io/gopkg/signal\"\n\t\"github.com/gofrs/flock\"\n\t\"git"
},
{
"path": "cmd/daemon/init.go",
"chars": 4679,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"path/filepath\"\n\n\t\"github.com/pactus-project/pactus/cmd\"\n\t\"github.com/pactus-project/"
},
{
"path": "cmd/daemon/main.go",
"chars": 937,
"preview": "package main\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd\"\n\t\"github.com/pactus-project/pactus/util/terminal\"\n\t\"githu"
},
{
"path": "cmd/daemon/prune.go",
"chars": 3791,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/ezex-io/gopkg/signal\"\n\t\"github.com/gofrs/f"
},
{
"path": "cmd/daemon/start.go",
"chars": 2588,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/ezex-io/gopkg/signal\"\n\t\"github.com/gof"
},
{
"path": "cmd/daemon/version.go",
"chars": 457,
"preview": "package main\n\nimport (\n\t\"github.com/pactus-project/pactus/version\"\n\t\"github.com/spf13/cobra\"\n)\n\n// Version prints the ve"
},
{
"path": "cmd/gtk/app/run.go",
"chars": 3913,
"preview": "//go:build gtk\n\npackage app\n\nimport (\n\t\"context\"\n\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd\"\n"
},
{
"path": "cmd/gtk/assets/assets.go",
"chars": 760,
"preview": "//go:build gtk\n\npackage assets\n\nimport (\n\t\"github.com/gotk3/gotk3/gdk\"\n\t\"github.com/gotk3/gotk3/gtk\"\n)\n\nfunc InitAssets("
},
{
"path": "cmd/gtk/assets/css/style.css",
"chars": 136,
"preview": ".inline_button {\n padding: 2px;\n margin-right: 3px;\n}\n\n.copyable_entry {\n padding-right: 36px;\n}\n\n.warning {\n "
},
{
"path": "cmd/gtk/assets/css.go",
"chars": 114,
"preview": "//go:build gtk\n\npackage assets\n\nimport _ \"embed\"\n\n// Main CSS.\n\n//go:embed css/style.css\nvar MainWindowCSS string\n"
},
{
"path": "cmd/gtk/assets/dialogs.go",
"chars": 1226,
"preview": "//go:build gtk\n\npackage assets\n\nimport (\n\t_ \"embed\"\n)\n\n// Dialogs/UI used by the GTK app.\n\n// About dialogs.\n\n//go:embed"
},
{
"path": "cmd/gtk/assets/icons.go",
"chars": 1772,
"preview": "//go:build gtk\n\npackage assets\n\nimport (\n\t_ \"embed\"\n\n\t\"github.com/gotk3/gotk3/gdk\"\n\t\"github.com/pactus-project/pactus/cm"
},
{
"path": "cmd/gtk/assets/images.go",
"chars": 744,
"preview": "//go:build gtk\n\npackage assets\n\nimport (\n\t_ \"embed\"\n\n\t\"github.com/gotk3/gotk3/gdk\"\n\t\"github.com/pactus-project/pactus/cm"
},
{
"path": "cmd/gtk/assets/main_ui.go",
"chars": 446,
"preview": "//go:build gtk\n\npackage assets\n\nimport (\n\t_ \"embed\"\n)\n\n// Main window / widgets UI and CSS.\n\n//go:embed ui/main_window.u"
},
{
"path": "cmd/gtk/assets/ui/dialog_about.ui",
"chars": 1687,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.40.0 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_about_gtk.ui",
"chars": 1757,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_address_details.ui",
"chars": 6372,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_address_label.ui",
"chars": 5038,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_address_private_key.ui",
"chars": 6113,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_transaction_bond.ui",
"chars": 16117,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_transaction_transfer.ui",
"chars": 14301,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_transaction_unbond.ui",
"chars": 7831,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_transaction_withdraw.ui",
"chars": 14134,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_wallet_change_password.ui",
"chars": 7646,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_wallet_create_address.ui",
"chars": 6065,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_wallet_password.ui",
"chars": 5240,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_wallet_set_default_fee.ui",
"chars": 6260,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/dialog_wallet_show_seed.ui",
"chars": 5197,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/main_window.ui",
"chars": 17306,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.40.0 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/widget_committee.ui",
"chars": 8137,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<interface>\n <requires lib=\"gtk+\" version=\"3.24\"/>\n <object class=\"GtkBox\" id=\""
},
{
"path": "cmd/gtk/assets/ui/widget_network.ui",
"chars": 5686,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<interface>\n <requires lib=\"gtk+\" version=\"3.24\"/>\n <object class=\"GtkBox\" id=\""
},
{
"path": "cmd/gtk/assets/ui/widget_node.ui",
"chars": 38292,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/widget_validator.ui",
"chars": 1197,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.40.0 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/assets/ui/widget_wallet.ui",
"chars": 28849,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated with glade 3.38.2 -->\n<interface>\n <requires lib=\"gtk+\" version=\""
},
{
"path": "cmd/gtk/controller/address_details_dialog_controller.go",
"chars": 1004,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/address_label_dialog_controller.go",
"chars": 1066,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/address_private_key_dialog_controller.go",
"chars": 1008,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/committee_widget_controller.go",
"chars": 2401,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/eze"
},
{
"path": "cmd/gtk/controller/controller.go",
"chars": 35,
"preview": "//go:build gtk\n\npackage controller\n"
},
{
"path": "cmd/gtk/controller/main_window_controller.go",
"chars": 1244,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/navigator.go",
"chars": 3533,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/gt"
},
{
"path": "cmd/gtk/controller/network_widget_controller.go",
"chars": 1832,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/ezex-io/gopkg/scheduler\"\n\t\"gith"
},
{
"path": "cmd/gtk/controller/node_widget_controller.go",
"chars": 5570,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/ezex-io/gopkg/sc"
},
{
"path": "cmd/gtk/controller/password_prompt.go",
"chars": 773,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/model\"\n\t\"github.com/pactus-proje"
},
{
"path": "cmd/gtk/controller/tx_bond_dialog_controller.go",
"chars": 4277,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cm"
},
{
"path": "cmd/gtk/controller/tx_transfer_dialog_controller.go",
"chars": 4077,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cm"
},
{
"path": "cmd/gtk/controller/tx_unbond_dialog_controller.go",
"chars": 2730,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pa"
},
{
"path": "cmd/gtk/controller/tx_withdraw_dialog_controller.go",
"chars": 4286,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pa"
},
{
"path": "cmd/gtk/controller/validator_widget_controller.go",
"chars": 1485,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/ezex-io/gopkg/scheduler\"\n\t\"gith"
},
{
"path": "cmd/gtk/controller/wallet_change_password_dialog_controller.go",
"chars": 1408,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/wallet_create_address_dialog_controller.go",
"chars": 1898,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/wallet_default_fee_dialog_controller.go",
"chars": 1574,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"gi"
},
{
"path": "cmd/gtk/controller/wallet_password_dialog_controller.go",
"chars": 838,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/wallet_seed_dialog_controller.go",
"chars": 911,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"github.com/pactus-project/pactus/cmd/gtk/gtkutil\"\n\t\"github.com/pactus-pro"
},
{
"path": "cmd/gtk/controller/wallet_widget_controller.go",
"chars": 6226,
"preview": "//go:build gtk\n\npackage controller\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/ezex-io/gopkg/scheduler\"\n\t\"gith"
},
{
"path": "cmd/gtk/gtkutil/format.go",
"chars": 1000,
"preview": "//go:build gtk\n\npackage gtkutil\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc escapeMarkup(text string) string {\n\t// Minimal escap"
},
{
"path": "cmd/gtk/gtkutil/format_test.go",
"chars": 468,
"preview": "//go:build gtk\n\npackage gtkutil\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestSmallGray_Escape"
},
{
"path": "cmd/gtk/gtkutil/gtkutil.go",
"chars": 8410,
"preview": "//go:build gtk\n\npackage gtkutil\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/url\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"time\"\n\n\t"
},
{
"path": "cmd/gtk/gtkutil/gtkutil_test.go",
"chars": 32,
"preview": "//go:build gtk\n\npackage gtkutil\n"
},
{
"path": "cmd/gtk/main.go",
"chars": 8154,
"preview": "//go:build gtk\n\npackage main\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"flag\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"sync\"\n\t\"time"
},
{
"path": "cmd/gtk/model/committee_model.go",
"chars": 911,
"preview": "//go:build gtk\n\npackage model\n\nimport (\n\t\"context\"\n\n\tpactus \"github.com/pactus-project/pactus/www/grpc/gen/go\"\n)\n\n// Com"
},
{
"path": "cmd/gtk/model/network_model.go",
"chars": 1118,
"preview": "//go:build gtk\n\npackage model\n\nimport (\n\t\"context\"\n\n\tpactus \"github.com/pactus-project/pactus/www/grpc/gen/go\"\n)\n\n// Net"
},
{
"path": "cmd/gtk/model/node_model.go",
"chars": 1715,
"preview": "//go:build gtk\n\npackage model\n\nimport (\n\t\"context\"\n\n\tpactus \"github.com/pactus-project/pactus/www/grpc/gen/go\"\n)\n\n// Nod"
},
{
"path": "cmd/gtk/model/validator_model.go",
"chars": 1347,
"preview": "//go:build gtk\n\npackage model\n\nimport (\n\t\"context\"\n\n\tpactus \"github.com/pactus-project/pactus/www/grpc/gen/go\"\n)\n\n// Val"
},
{
"path": "cmd/gtk/model/wallet_model.go",
"chars": 10889,
"preview": "//go:build gtk\n\npackage model\n\nimport (\n\t\"context\"\n\t\"encoding/hex\"\n\n\t\"github.com/pactus-project/pactus/crypto\"\n\t\"github."
},
{
"path": "cmd/gtk/startup_assistant.go",
"chars": 29109,
"preview": "//go:build gtk\n\npackage main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n"
},
{
"path": "cmd/gtk/view/about_dialog_view.go",
"chars": 325,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/about_gtk_dialog_view.go",
"chars": 331,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/address_details_dialog_view.go",
"chars": 946,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/address_label_dialog_view.go",
"chars": 905,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/address_private_key_dialog_view.go",
"chars": 869,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/committee_widget_view.go",
"chars": 2616,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/glib\"\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-"
},
{
"path": "cmd/gtk/view/main_window_view.go",
"chars": 1476,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gdk\"\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-p"
},
{
"path": "cmd/gtk/view/network_widget_view.go",
"chars": 2062,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/glib\"\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-"
},
{
"path": "cmd/gtk/view/node_widget_view.go",
"chars": 2470,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/splash_window_view.go",
"chars": 2151,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gdk\"\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-p"
},
{
"path": "cmd/gtk/view/tx_bond_dialog_view.go",
"chars": 1680,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/tx_transfer_dialog_view.go",
"chars": 1583,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/tx_unbond_dialog_view.go",
"chars": 1090,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/tx_withdraw_dialog_view.go",
"chars": 1619,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/validator_widget_view.go",
"chars": 2244,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/glib\"\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-"
},
{
"path": "cmd/gtk/view/view_builder.go",
"chars": 2550,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/glib\"\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-"
},
{
"path": "cmd/gtk/view/wallet_change_password_dialog_view.go",
"chars": 1259,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/wallet_create_address_dialog_view.go",
"chars": 1089,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/wallet_default_fee_dialog_view.go",
"chars": 1059,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/wallet_password_dialog_view.go",
"chars": 926,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/wallet_seed_dialog_view.go",
"chars": 878,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-project/pactus/cmd/gtk/assets\"\n"
},
{
"path": "cmd/gtk/view/wallet_widget_view.go",
"chars": 7747,
"preview": "//go:build gtk\n\npackage view\n\nimport (\n\t\"github.com/gotk3/gotk3/glib\"\n\t\"github.com/gotk3/gotk3/gtk\"\n\t\"github.com/pactus-"
},
{
"path": "cmd/helper.go",
"chars": 385,
"preview": "package cmd\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto\"\n\t\"github.com/pactus-project/pactus/crypto/hash\"\n)\n\nfunc"
},
{
"path": "cmd/importer.go",
"chars": 4692,
"preview": "package cmd\n\nimport (\n\t\"archive/zip\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"p"
},
{
"path": "cmd/shell/main.go",
"chars": 4170,
"preview": "package main\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\n\t\"github.com/NathanBaulch/protoc-gen-cobra/client\"\n\t\"github.com/Nathan"
},
{
"path": "cmd/shell/main_test.go",
"chars": 3619,
"preview": "package main\n\nimport (\n\t\"testing\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCreateRo"
},
{
"path": "cmd/wallet/address.go",
"chars": 7959,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/pactus-project/pactus/crypto\"\n\t\"github.com/pactus-proj"
},
{
"path": "cmd/wallet/create.go",
"chars": 1589,
"preview": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/pactus-project/pactus/genesis\"\n\t\"github.com/pactus-project/pactus/util/p"
},
{
"path": "cmd/wallet/fee.go",
"chars": 816,
"preview": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/pactus-project/pactus/types/amount\"\n\t\"github.com/pactus-project/pactus/u"
},
{
"path": "cmd/wallet/info.go",
"chars": 1021,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/pactus-project/pactus/util/terminal\"\n\t\"github.com/spf13/cobra\"\n)"
},
{
"path": "cmd/wallet/main.go",
"chars": 2442,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/pactus-project/pactus/cmd\"\n\t\"github.com/pactus-project/pactus/ut"
},
{
"path": "cmd/wallet/neuter.go",
"chars": 828,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/ipfs/boxo/util\"\n\t\"github.com/pactus-project/pactus/util/terminal\""
},
{
"path": "cmd/wallet/password.go",
"chars": 906,
"preview": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/pactus-project/pactus/util/prompt\"\n\t\"github.com/pactus-project/pactus/ut"
},
{
"path": "cmd/wallet/recover.go",
"chars": 2573,
"preview": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/pactus-project/pactus/cmd\"\n\t\"github.com/pactus-project/pactus/genesis\"\n\t"
},
{
"path": "cmd/wallet/send.go",
"chars": 8729,
"preview": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/pactus-project/pactus/types\"\n\t\"github.com/pactus-project/pactus/types/am"
},
{
"path": "cmd/wallet/transaction.go",
"chars": 4444,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/pactus-project/pactus/cmd\"\n\t\"github.com/pactus-project/pactus/cry"
},
{
"path": "committee/committee.go",
"chars": 6417,
"preview": "package committee\n\nimport (\n\t\"cmp\"\n\t\"errors\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/pactus-project/pactus/crypto\"\n\t\"g"
},
{
"path": "committee/committee_test.go",
"chars": 16646,
"preview": "package committee_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/committee\"\n\t\"github.com/pactus-pr"
},
{
"path": "committee/interface.go",
"chars": 701,
"preview": "package committee\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto\"\n\t\"github.com/pactus-project/pactus/types\"\n\t\"githu"
},
{
"path": "config/banned_addrs.json",
"chars": 2103,
"preview": "[\n \"pc1p8slveave2zm9tgj7q260fgrdfu2ph8n7ezxhtt\",\n \"pc1prqnrscsgtcp25sqvwk6d2zj9p9m37wexu0x8z5\",\n \"pc1pd5mytehyr"
},
{
"path": "config/bootstrap.json",
"chars": 14068,
"preview": "[\n {\n \"name\": \"Pactus\",\n \"email\": \"info@pactus.org\",\n \"website\": \"https://pactus.org\",\n \""
},
{
"path": "config/config.go",
"chars": 9461,
"preview": "package config\n\nimport (\n\t\"bytes\"\n\t_ \"embed\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/pactus-project/pactus/consensus"
},
{
"path": "config/config_test.go",
"chars": 7963,
"preview": "package config\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/crypto\"\n\t\"github.com/pactus-project/p"
},
{
"path": "config/errors.go",
"chars": 198,
"preview": "package config\n\n// NodeConfigError is returned when the config configuration is invalid.\ntype NodeConfigError struct {\n\t"
},
{
"path": "config/example_config.toml",
"chars": 10790,
"preview": "### This configuration file specifies configurations for running a Pactus node.\n\n# `node` contains configuration options"
},
{
"path": "consensus/commit.go",
"chars": 1120,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/types/proposal\"\n\t\"github.com/pactus-project/pactus/types/"
},
{
"path": "consensus/config.go",
"chars": 1328,
"preview": "package consensus\n\nimport (\n\t\"time\"\n\n\t\"github.com/pactus-project/pactus/types\"\n)\n\n// Config defines parameters for the l"
},
{
"path": "consensus/config_test.go",
"chars": 2116,
"preview": "package consensus\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/requ"
},
{
"path": "consensus/consensus.go",
"chars": 13856,
"preview": "package consensus\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/ezex-io/gopkg/pipeline\"\n\t\"github.com/ezex-io"
},
{
"path": "consensus/consensus_test.go",
"chars": 33999,
"preview": "package consensus\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/ezex-io/gopkg/pipeline\"\n\t\"github.com/pactus-project/"
},
{
"path": "consensus/cp.go",
"chars": 7648,
"preview": "package consensus\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n\n\t\"github.com/pactus-project/pactus/crypto/hash\"\n\t\"github.com/pactus-projec"
},
{
"path": "consensus/cp_decide.go",
"chars": 1761,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto/hash\"\n\t\"github.com/pactus-project/pactus/types/vot"
},
{
"path": "consensus/cp_mainvote.go",
"chars": 2664,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto/hash\"\n\t\"github.com/pactus-project/pactus/types/vot"
},
{
"path": "consensus/cp_prevote.go",
"chars": 2290,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto/hash\"\n\t\"github.com/pactus-project/pactus/types/vot"
},
{
"path": "consensus/cp_test.go",
"chars": 15590,
"preview": "package consensus\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/crypto\"\n\t\"github.com/pactus-project/pa"
},
{
"path": "consensus/errors.go",
"chars": 617,
"preview": "package consensus\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pactus-project/pactus/types/vote\"\n)\n\n// InvalidJustificationError is re"
},
{
"path": "consensus/height.go",
"chars": 1583,
"preview": "package consensus\n\nimport (\n\t\"time\"\n\n\t\"github.com/pactus-project/pactus/types/proposal\"\n\t\"github.com/pactus-project/pact"
},
{
"path": "consensus/height_test.go",
"chars": 1612,
"preview": "package consensus\n\nimport (\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/types\"\n\t\"github.com/pactus-project/pactus/typ"
},
{
"path": "consensus/interface.go",
"chars": 776,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto/bls\"\n\t\"github.com/pactus-project/pactus/crypto/has"
},
{
"path": "consensus/log/log.go",
"chars": 3210,
"preview": "package log\n\nimport (\n\t\"github.com/pactus-project/pactus/consensus/voteset\"\n\t\"github.com/pactus-project/pactus/crypto\"\n\t"
},
{
"path": "consensus/log/log_test.go",
"chars": 3259,
"preview": "package log\n\nimport (\n\t\"encoding/hex\"\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/types/vote\"\n\t\"github.com/pactus-pro"
},
{
"path": "consensus/log/messages.go",
"chars": 1793,
"preview": "package log\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pactus-project/pactus/consensus/voteset\"\n\t\"github.com/pactus-project/pactus/c"
},
{
"path": "consensus/manager/interface.go",
"chars": 1226,
"preview": "package manager\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto/bls\"\n\t\"github.com/pactus-project/pactus/crypto/hash\""
},
{
"path": "consensus/manager/manager.go",
"chars": 6687,
"preview": "package manager\n\nimport (\n\t\"context\"\n\n\t\"github.com/ezex-io/gopkg/pipeline\"\n\t\"github.com/pactus-project/pactus/consensus\""
},
{
"path": "consensus/manager/manager_test.go",
"chars": 5554,
"preview": "package manager\n\nimport (\n\t\"testing\"\n\n\t\"github.com/ezex-io/gopkg/pipeline\"\n\t\"github.com/pactus-project/pactus/consensusv"
},
{
"path": "consensus/manager/mock.go",
"chars": 843,
"preview": "package manager\n\nimport (\n\t\"github.com/pactus-project/pactus/consensus\"\n\t\"github.com/pactus-project/pactus/crypto/bls\"\n\t"
},
{
"path": "consensus/mediator.go",
"chars": 1251,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/types/proposal\"\n\t\"github.com/pactus-project/pactus/types/"
},
{
"path": "consensus/mock.go",
"chars": 2291,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/crypto/bls\"\n\t\"github.com/pactus-project/pactus/crypto/has"
},
{
"path": "consensus/precommit.go",
"chars": 1996,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/types/proposal\"\n\t\"github.com/pactus-project/pactus/types/"
},
{
"path": "consensus/precommit_test.go",
"chars": 2720,
"preview": "package consensus\n\nimport (\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/crypto/hash\"\n\t\"github.com/pactus-project/pact"
},
{
"path": "consensus/prepare.go",
"chars": 2412,
"preview": "package consensus\n\nimport (\n\t\"github.com/pactus-project/pactus/types/proposal\"\n\t\"github.com/pactus-project/pactus/types/"
},
{
"path": "consensus/prepare_test.go",
"chars": 1895,
"preview": "package consensus\n\nimport (\n\t\"testing\"\n\n\t\"github.com/pactus-project/pactus/crypto/hash\"\n\t\"github.com/pactus-project/pact"
}
]
// ... and 625 more files (download for full content)
About this extraction
This page contains the full source code of the pactus-project/pactus GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 825 files (14.1 MB), approximately 3.7M tokens, and a symbol index with 25946 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.