# Transactions and Queries
See use case sequence diagrams for the examples of how transaction can be used.
1. [General](#general)
2. [How to write to the Ledger](#how-to-write-to-the-ledger)
3. [How to read from the Ledger](#how-to-read-from-the-ledger)
4. [Modules](#modules)
* [Vendor Info](#vendor-info)
* [Model and Model Version](#model-and-model-version)
* [Compliance](#compliance)
* [X509 PKI](#x509-pki)
* [Auth](#auth)
* [Validator Node](#validator-node)
* [Upgrade](#upgrade)
5. [Extensions](#extensions)
6. [Mapping DCL Entities to Matter Specification](mapping_against_matter_spec.md)
## General
- Every writer to the Ledger must
- Have a private/public key pair.
- Have an Account created on the ledger via `ACCOUNT` transaction (see [Use Case Txn Auth](./use_cases/use_cases_txn_auth.puml)).
- The Account stores the public part of the key
- The Account has an associated role. The role is used for authorization policies.
- Sign every transaction by the private key.
- Ledger is public for read which means that anyone can read from the Ledger without a need to have
an Account or sign the request.
- The following roles are supported:
- `Trustee` - can create and approve accounts, approve root certificates.
- `Vendor` - can add models that belong to the vendor ID associated with the vendor account.
- `VendorAdmin` - can add vendor info records and update any vendor info; can also add, edit and delete any Model and Model Version.
- `CertificationCenter` - can certify and revoke models.
- `NodeAdmin` - can add validator nodes to the network.
## How to write to the Ledger
- Local CLI
- Configure the CLI before using.
See `CLI Configuration` section in [how-to.md](./how-to.md#cli-configuration).
- Generate and store a private key for the Account to be used for sending.
See `Getting Account` section in [how-to.md](./how-to.md#getting-account).
- Send transactions to the ledger from the Account (`--from`).
- it will automatically build a request, sign it by the account's key, and broadcast to the ledger.
- See `CLI` sub-sections for every write request (transaction).
- It's possible to build, sign and broadcast a transaction separately (possibly by diferent CLIs):
- Let's assume we have two CLIs:
- CLI 1: Is connected to the network of nodes. Doesn't have access to private keys.
- CLI 2: Stores private key. Does not have a connection to the network of nodes.
- Build transaction by CLI 1: `dcld tx ... --generate-only`
- Fetch `account-number` and `sequence` by CLI 1: `dcld query auth account --address
`
- Sign transaction by CLI 2: `dcld tx sign txn.json --from --account-number --sequence --gas "auto" --offline --output-document txn.json`
- Broadcast transaction by CLI 1: `dcld tx broadcast txn.json`
- To get the actual result of transaction, `dcld query tx=txHash` call must be executed, where `txHash` is the hash of previously executed transaction.
- gRPC:
- Generate a client code from the proto files [proto](../proto) for the client language (see )
- Build, sign, and broadcast the message (transaction).
See [grpc/rest integration tests](../integration_tests/grpc_rest) as an example.
- REST API
- Build and sign a transaction by one of the following ways
- In code via gRPC (see above)
- Via CLI commands specifying `--generate-only` flag and using `dcld tx sign` (see above)
- The user does a `POST` of the signed request to `http://:1317/cosmos/tx/v1beta1/txs` endpoint.
- Example
### Possible list of transactional errors
If the request is transactional it will error with DCL's error codes.
DCL error codes are separated by modules:
1. [Auth](../x/dclauth/types/errors.go)
2. [Compliance](../x/compliance/types/errors.go)
3. [PKI](../types/pki/errors.go)
4. [Model](../x/model/types/errors.go)
5. [Validator](../x/validator/types/errors.go)
6. [VendorInfo](../x/vendorinfo/types/errors.go)
7. [DCL Upgrade](../x/dclupgrade/types/errors.go)
```bash
dcld tx ... --generate-only
dcld query auth account --address
dcld tx sign txn.json --from --account-number --sequence --gas "auto" --offline --output-document txn.json
POST http://:1317/cosmos/tx/v1beta1/txs
```
## How to read from the Ledger
No keys/account is needed as the ledger is public for reads.
Please note, that multi-value queries don't have state proofs support and should be sent to trusted nodes only.
Please make sure that TLS is enabled in gRPC, REST or Light Client Proxy for secure communication with a Node.
- Local CLI
- See `CLI` section for every read request.
- If there are no trusted Observer or Validator nodes to connect a CLI, then a [Light Client Proxy](./running-light-client-proxy.md) can be used.
- REST API
- OpenAPI specification: .
- Any running node exposes a REST API at port `1317`. See .
- See `REST API` section for every read request.
- See [grpc/rest integration tests](../integration_tests/grpc_rest) as an example.
- There are no state proofs in REST, so REST queries should be sent to trusted Validator or Observer nodes only.
- gRPC
- Any running node exposes a REST API at port `9090`. See .
- Generate a client code from the proto files [proto](../proto) for the client language (see ).
- See [grpc/rest integration tests](../integration_tests/grpc_rest) as an example.
- There are no state proofs in gRPC, so gRPC queries should be sent to trusted Validator or Observer nodes only.
- Tendermint RPC
- Tendermint RPC OpenAPI specification can be found in .
- Tendermint RPC is exposed by every running node at port `26657`. See .
- Tendermint RPC supports state proofs. Tendermint's Light Client library can be used to verify the state proofs.
So, if Light Client API is used, then it's possible to communicate with non-trusted nodes.
- Please note, that multi-value queries don't have state proofs support and should be sent to trusted nodes only.
- Refer to [this doc](./cometbft-rpc.md) to see how to [subscribe](./cometbft-rpc.md#subscribe) to a Tendermint WebSocket based events and/or [query](./cometbft-rpc.md#querying-application-components) an application components.
`NotFound` (404 code) is returned if an entry is not found on the ledger.
### Possible list of query errors
If the request is plain query (GET request) it will return error with GRPC error code.
GRPC error codes are defined in grpc [doc](https://pkg.go.dev/google.golang.org/grpc/codes).
### Query types
- Query single value
- Query list of values with pagination support (should be sent to trusted nodes only)
### Common pagination parameters
- count-total `optional(bool)`: count total number of records
- limit `optional(uint)`: pagination limit (default 100)
- offset `optional(uint)`: pagination offset
- page `optional(uint)`: pagination page. This sets offset to a multiple of limit (default 1).
- page-key `optional(string)`: pagination page-key
- reverse `optional(bool)`: results are sorted in descending order
## Modules
### [Vendor Info](transactions/vendor-info.md)
| Method | CLI command / REST API |
|---------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ADD_VENDOR_INFO](transactions/vendor-info.md#add_vendor_info)
Adds a record about a Vendor | CLI `dcld tx vendorinfo add-vendor --vid= --vendorName= --companyLegalName= ...`
POST `/cosmos/tx/v1beta1/txs`([NewMsgCreateVendorInfo](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/vendorinfo/tx.proto#L18)) |
| [UPDATE_VENDOR_INFO](transactions/vendor-info.md#update_vendor_info)
Updates a record about a Vendor | CLI `dcld tx vendorinfo update-vendor --vid= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgUpdateVendorInfo](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/vendorinfo/tx.proto#L30)) |
| [GET_VENDOR_INFO](transactions/vendor-info.md#get_vendor_info)
Gets a Vendor Info for the given `vid` (vendor ID) | CLI `dcld query vendorinfo vendor --vid=`
GET `/dcl/vendorinfo/vendors/{vid}` |
| [GET_ALL_VENDOR_INFO](transactions/vendor-info.md#get_all_vendor_info)
Gets information about all vendors for all VIDs | CLI `dcld query vendorinfo all-vendors`
GET `/dcl/vendorinfo/vendors` |
### [Model and Model Version](transactions/model.md)
| Method | CLI command / REST API |
|-----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ADD_MODEL](transactions/model.md#ADD_MODEL)
Adds a new Model | CLI `dcld tx model add-model --vid= --pid= --deviceTypeID= --productName= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgCreateModel](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/model/tx.proto#L24)) |
| [EDIT_MODEL](transactions/model.md#EDIT_MODEL)
Edits an existing Model | CLI `dcld tx model update-model --vid= --pid= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgUpdateModel](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/model/tx.proto#L55)) |
| [DELETE_MODEL](transactions/model.md#DELETE_MODEL)
Deletes an existing Model | CLI `dcld tx model delete-model --vid= --pid= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgDeleteModel](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/model/tx.proto#L83)) |
| [ADD_MODEL_VERSION](transactions/model.md#ADD_MODEL_VERSION)
Adds a new Model Software Version | CLI `dcld tx model add-model-version --vid= --pid= --softwareVersion= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgCreateModelVersion](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/model/tx.proto#L90)) |
| [EDIT_MODEL_VERSION](transactions/model.md#EDIT_MODEL_VERSION)
Edits an existing Model Software Version | CLI `dcld tx model update-model-version --vid= --pid= --softwareVersion= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgUpdateModelVersion](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/model/tx.proto#L110)) |
| [DELETE_MODEL_VERSION](transactions/model.md#DELETE_MODEL_VERSION)
Deletes an existing Model Version | CLI `dcld tx model delete-model-version --vid=< uint16 > --pid=< uint16 > --softwareVersion= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgDeleteModelVersion](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/model/tx.proto#L126)) |
| [GET_MODEL](transactions/model.md#GET_MODEL)
Gets a Model Info | CLI `dcld query model get-model --vid= --pid=`
GET `/dcl/model/models/{vid}/{pid}` |
| [GET_MODEL_VERSION](transactions/model.md#GET_MODEL_VERSION)
Gets a Model Software Versions | CLI `dcld query model model-version --vid= --pid= --softwareVersion=`
GET `/dcl/model/versions/{vid}/{pid}/{softwareVersion}` |
| [GET_ALL_MODELS](transactions/model.md#GET_ALL_MODELS)
Gets all Model Infos for all vendors | CLI `dcld query model all-models`
GET `/dcl/model/models` |
| [GET_ALL_VENDOR_MODELS](transactions/model.md#GET_ALL_VENDOR_MODELS)
Gets all Model Infos by the given Vendor | CLI `dcld query model vendor-models --vid=`
GET `/dcl/model/models/{vid}` |
| [GET_ALL_MODEL_VERSIONS](transactions/model.md#GET_ALL_MODEL_VERSIONS)
Gets all Model Software Versions for vid and pid | CLI `dcld query model all-model-versions --vid= --pid=`
GET `/dcl/model/versions/{vid}/{pid}` |
### [Compliance](transactions/compliance.md)
| Method | CLI command / REST API |
|---------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CERTIFY_MODEL](transactions/compliance.md#CERTIFY_MODEL)
Attests compliance of the Model Version | CLI `dcld tx compliance certify-model --vid= --pid= --softwareVersion= --softwareVersionString= --certificationType= --specificationVersion= --certificationDate= --cdCertificateId= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgCertifyModel](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/compliance/tx.proto#L21)) |
| [UPDATE_COMPLIANCE_INFO](transactions/compliance.md#UPDATE_COMPLIANCE_INFO)
Updates a compliance info | CLI `dcld tx compliance update-compliance-info --vid= --pid= --softwareVersion= --certificationType= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgUpdateComplianceInfo](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/compliance/tx.proto#L95)) |
| [DELETE_COMPLIANCE_INFO](transactions/compliance.md#DELETE_COMPLIANCE_INFO)
Delete compliance of the Model Version | CLI `dcld tx compliance delete-compliance-info --vid= --pid= --softwareVersion= --certificationType=`
POST `/cosmos/tx/v1beta1/txs`([MsgDeleteComplianceInfo](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/compliance/tx.proto#L124)) |
| [REVOKE_MODEL_CERTIFICATION](transactions/compliance.md#REVOKE_MODEL_CERTIFICATION)
Revoke compliance of the Model Version | CLI `dcld tx compliance revoke-model --vid= --pid= --softwareVersion= --softwareVersionString= --certificationType= --revocationDate= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRevokeModel](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/compliance/tx.proto#L50)) |
| [PROVISION_MODEL](transactions/compliance.md#PROVISION_MODEL)
Sets provisional state for the Model Version | CLI `dcld tx compliance provision-model --vid= --pid= --softwareVersion= --softwareVersionString= --certificationType= --specificationVersion= --provisionalDate= --cdCertificateId= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgProvisionModel](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/compliance/tx.proto#L66)) |
| [GET_CERTIFIED_MODEL](transactions/compliance.md#GET_CERTIFIED_MODEL)
Gets Model compliance information | CLI `dcld query compliance certified-model --vid= --pid= --softwareVersion= --certificationType=`
GET `/dcl/compliance/certified-models/{vid}/{pid}/{software_version}/{certification_type}` |
| [GET_REVOKED_MODEL](transactions/compliance.md#GET_REVOKED_MODEL)
Gets Model revocation information | CLI `dcld query compliance revoked-model --vid= --pid= --softwareVersion= --certificationType=`
GET `/dcl/compliance/revoked-models/{vid}/{pid}/{software_version}/{certification_type}` |
| [GET_PROVISIONAL_MODEL](transactions/compliance.md#GET_PROVISIONAL_MODEL)
Gets Model Version provisional information | CLI `dcld query compliance provisional-model --vid= --pid= --softwareVersion= --certificationType=`
GET `/dcl/compliance/provisional-models/{vid}/{pid}/{software_version}/{certification_type}` |
| [GET_COMPLIANCE_INFO](transactions/compliance.md#GET_COMPLIANCE_INFO)
Gets Model Version compliance information | CLI `dcld query compliance compliance-info --vid= --pid= --softwareVersion= --certificationType=`
GET `/dcl/compliance/compliance-info/{vid}/{pid}/{software_version}/{certification_type}` |
| [GET_DEVICE_SOFT_COMPLIANCE](transactions/compliance.md#GET_DEVICE_SOFTWARE_COMPLIANCE)
Gets device software compliance | CLI `dcld query compliance device-software-compliance --cDCertificateId=`
GET `/dcl/compliance/device-software-compliance/{cDCertificateId}` |
| [GET_ALL_CERTIFIED_MODELS](transactions/compliance.md#GET_ALL_CERTIFIED_MODELS)
Gets all compliant Model Versions | CLI `dcld query compliance all-certified-models`
GET `/dcl/compliance/certified-models` |
| [GET_ALL_REVOKED_MODELS](transactions/compliance.md#GET_ALL_REVOKED_MODELS)
Gets all revoked Model Versions | CLI `dcld query compliance all-revoked-models`
GET `/dcl/compliance/revoked-models` |
| [GET_ALL_PROVISIONAL_MODELS](transactions/compliance.md#GET_ALL_PROVISIONAL_MODELS)
Gets all Model Versions in provisional state | CLI `dcld query compliance all-provisional-models`
GET `/dcl/compliance/provisional-models` |
| [GET_ALL_COMPLIANCE_RECORDS](transactions/compliance.md#GET_ALL_COMPLIANCE_INFO_RECORDS)
Gets all stored compliance information records | CLI `dcld query compliance all-compliance-info`
GET `/dcl/compliance/compliance-info` |
| [GET_ALL_DEVICE_SOFT_CMPLIANCES](transactions/compliance.md#GET_ALL_DEVICE_SOFTWARE_COMPLIANCES)
Gets all stored device software compliance's | CLI `dcld query compliance all-device-software-compliance`
GET `/dcl/compliance/device-software-compliance` |
### [X509 PKI](transactions/pki.md)
| Method | CLI command / REST API |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **GLOBAL - Work for all certificate types (DA, NOC)** | |
| [GET_CERT](transactions/pki.md#get_cert)
Gets a certificate (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki cert --subject= --subject-key-id=`
GET `/dcl/pki/all-certificates/{subject}/{subject_key_id}` |
| [GET_ALL_CERTS](transactions/pki.md#get_all_certs)
Gets all certificates (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki all-certs`
GET `/dcl/pki/all-certificates` |
| [GET_ALL_CERTS_BY_SUBJECT](transactions/pki.md#get_all_certs_by_subject)
Gets all certificates associated with a subject (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki all-subject-certs --subject=`
GET `/dcl/pki/all-certificates/{subject}` |
| [GET_ALL_CERTS_BY_SKID](transactions/pki.md#get_all_certs_by_skid)
Gets all certificates by the given subject key ID (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki cert --subject-key-id=`
GET `/dcl/pki/all-certificates?subjectKeyId={subjectKeyId}` |
| [GET_CHILD_CERTS](transactions/pki.md#get_child_certs)
Gets all child certificates for the given certificate (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki all-child-x509-certs --subject= --subject-key-id=`
GET `/dcl/pki/child-certificates/{subject}/{subject_key_id}` |
| **DA - Work for DA certificate types (PAA, PAI)** | |
| [PROPOSE_ADD_PAA](transactions/pki.md#propose_add_paa)
Proposes a new PAA (self-signed root certificate) | CLI `dcld tx pki propose-add-x509-root-cert --certificate=`
POST `/cosmos/tx/v1beta1/txs`([MsgProposeAddX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L34)) |
| [APPROVE_ADD_PAA](transactions/pki.md#approve_add_paa)
Approves the proposed PAA / Re-vote | CLI `dcld tx pki approve-add-x509-root-cert --subject= --subject-key-id=`
POST `/cosmos/tx/v1beta1/txs`([MsgApproveAddX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L46)) |
| [REJECT_ADD_PAA](transactions/pki.md#reject_add_paa)
Rejects the proposed PAA / Re-vote | CLI `dcld tx pki reject-add-x509-root-cert --subject= --subject-key-id=`
POST `/cosmos/tx/v1beta1/txs`([MsgRejectAddX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L106)) |
| [PROPOSE_REVOKE_PAA](transactions/pki.md#propose_revoke_paa)
Proposes revocation of the given PAA | CLI `dcld tx pki propose-revoke-x509-root-cert --subject= --subject-key-id=`
POST `/cosmos/tx/v1beta1/txs`([MsgProposeRevokeX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L68)) |
| [APPROVE_REVOKE_PAA](transactions/pki.md#approve_revoke_paa)
Approves the revocation of the given PAA | CLI `dcld tx pki approve-revoke-x509-root-cert --subject= --subject-key-id=`
POST `/cosmos/tx/v1beta1/txs`([MsgApproveRevokeX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L81)) |
| [ASSIGN_VID_TO_PAA](transactions/pki.md#assign_vid_to_paa)
Assigns a Vendor ID to non-VID scoped PAAs | CLI `dcld tx pki assign-vid --subject= --subject-key-id= --vid=`
POST `/cosmos/tx/v1beta1/txs`([MsgAssignVid](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L164)) |
| [ADD_REVOCATION_DIST_POINT](transactions/pki.md#add_revocation_distribution_point)
Publishes a PKI Revocation distribution endpoint | CLI `dcld tx pki add-revocation-point -vid= --pid= --issuer-subject-key-id= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgAddPkiRevocationDistributionPoint](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L117)) |
| [UPDATE_REVOCATION_DIST_POINT](transactions/pki.md#update_revocation_distribution_point)
Updates an existing PKI Revocation distribution endpoint | CLI `dcld tx pki update-revocation-point --vid= --issuer-subject-key-id= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgUpdatePkiRevocationDistributionPoint](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L137)) |
| [DELETE_REVOCATION_DIST_POINT](transactions/pki.md#delete_revocation_distribution_point)
Deletes a PKI Revocation distribution endpoint | CLI `dcld tx pki delete-revocation-point --vid= --issuer-subject-key-id= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgDeletePkiRevocationDistributionPoint](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L154)) |
| [ADD_PAI](transactions/pki.md#add_pai)
Adds a PAI (intermediate certificate) | CLI `dcld tx pki add-x509-cert --certificate=`
POST `/cosmos/tx/v1beta1/txs`([MsgAddX509Cert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L57)) |
| [REVOKE_PAI](transactions/pki.md#revoke_pai)
Revokes the given PAI (intermediate certificate) | CLI `dcld tx pki revoke-x509-cert --subject= --subject-key-id=`
POST `/cosmos/tx/v1beta1/txs`([MsgRevokeX509Cert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L93)) |
| [REMOVE_PAI](transactions/pki.md#remove_pai)
Removes the given PAI from approved and revoked lists | CLI `dcld tx pki remove-x509-cert --subject= --subject-key-id=`
POST `/cosmos/tx/v1beta1/txs`([MsgRemoveX509Cert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L183)) |
| [GET_ALL_DA_CERTS](transactions/pki.md#get_all_da_certs)
Gets all DA certificates | CLI `dcld query pki all-x509-certs`
GET `/dcl/pki/certificates` |
| [GET_ALL_PAA](transactions/pki.md#get_all_paa)
Gets all approved PAA certificates | CLI `dcld query pki all-x509-root-certs`
GET `/dcl/pki/root-certificates` |
| [GET_DA_CERT](transactions/pki.md#get_da_cert)
Gets a DA certificate (PAA, PAI) | CLI `dcld query pki x509-cert --subject= --subject-key-id=`
GET `/dcl/pki/certificates/{subject}/{subject_key_id}` |
| [GET_DA_CERTS_BY_SKID](transactions/pki.md#get_da_certs_by_skid)
Gets all DA certificates by the given subject key ID | CLI `dcld query pki x509-cert --subject-key-id=`
GET `/dcl/pki/certificates?subjectKeyId={subjectKeyId}` |
| [GET_DA_CERTS_BY_SUBJECT](transactions/pki.md#get_da_certs_by_subject)
Gets all DA certificates associated with a subject | CLI `dcld query pki all-subject-x509-certs --subject=`
GET `/dcl/pki/certificates/{subject}` |
| [GET_REV_DIST_POINT](transactions/pki.md#get_pki_revocation_distribution_point)
Gets a revocation distribution point | CLI `dcld query pki revocation-point --vid= --label= --issuer-subject-key-id=`
GET `/dcl/pki/revocation-points/{issuerSubjectKeyID}/{vid}/{label}` |
| [GET_REV_DIST_POINTS_BY_SKID](transactions/pki.md#get_pki_revocation_distribution_points_by_subject_key_id)
Gets a list of revocation distribution point by subject key id | CLI `dcld query pki revocation-points --issuer-subject-key-id=`
GET `/dcl/pki/revocation-points/{issuerSubjectKeyID}` |
| [GET_ALL_PKI_REVOCATION_DIST_POINT](transactions/pki.md#get_all_pki_revocation_distribution_point)
Gets a list of all revocation distribution points | CLI `dcld query pki all-revocation-points`
GET `/dcl/pki/revocation-points` |
| [GET_ALL_PROPOSED_PAA](transactions/pki.md#get_all_proposed_paa)
Gets all proposed but not approved root certificates | CLI `dcld query pki all-proposed-x509-root-certs`
GET `/dcl/pki/revocation-points` |
| [GET_PROPOSED_PAA](transactions/pki.md#get_proposed_paa)
Gets a proposed but not approved PAA certificate | CLI `dcld query pki proposed-x509-root-cert --subject= --subject-key-id=`
GET `/dcl/pki/proposed-certificates/{subject}/{subject_key_id}` |
| [GET_ALL_PROPOSED_PAA_TO_REVOKE](transactions/pki.md#get_all_proposed_paa_to_revoke)
Gets all proposed but not approved root certificates to be revoked | CLI `dcld query pki all-proposed-x509-root-certs-to-revoke`
GET `/dcl/pki/proposed-revocation-certificates` |
| [GET_PROPOSED_PAA_TO_REVOKE](transactions/pki.md#get_proposed_paa_to_revoke)
Gets a proposed but not approved PAA certificate to be revoked | CLI `dcld query pki proposed-x509-root-cert-to-revoke --subject= --subject-key-id=`
GET `/dcl/pki/proposed-revocation-certificates/{subject}/{subject_key_id}?serialnumber={serialnumber}` |
| [GET_ALL_REVOKED_DA_CERTS](transactions/pki.md#get_all_revoked_da_certs)
Gets all revoked DA certificates | CLI `dcld query pki all-revoked-x509-certs`
GET `/dcl/pki/revoked-certificates` |
| [GET_REVOKED_DA_CERT](transactions/pki.md#get_revoked_da_cert)
Gets a revoked DA certificate (PAA, PAI) | CLI `dcld query pki revoked-x509-cert --subject= --subject-key-id=`
GET `/dcl/pki/revoked-certificates/{subject}/{subject_key_id}` |
| [GET_ALL_REVOKED_PAA](transactions/pki.md#get_all_revoked_paa)
Gets all revoked PAA certificates | CLI `dcld query pki all-revoked-x509-root-certs`
GET `/dcl/pki/revoked-root-certificates` |
| [GET_ALL_REJECTED_PAA](transactions/pki.md#get_all_rejected_paa)
Gets all rejected root certificates | CLI `dcld query pki all-rejected-x509-root-certs`
GET `dcl/pki/rejected-certificates` |
| [GET_REJECTED_PAA](transactions/pki.md#get_rejected_paa)
Get a rejected PAA certificate | CLI `dcld query pki rejected-x509-root-cert --subject= --subject-key-id=`
GET `/dcl/pki/rejected-certificates/{subject}/{subject_key_id}` |
| **NOC - Work for NOC certificate types (RCAC, ICAC)** | |
| [ADD_NOC_ROOT](transactions/pki.md#add_noc_root-rcac)
Adds a NOC root certificate (RCAC) | CLI `dcld tx pki add-noc-x509-root-cert --certificate= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgAddNocX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L174)) |
| [REVOKE_NOC_ROOT](transactions/pki.md#revoke_noc_root-rcac)
Revokes a NOC root certificate (RCAC) | CLI `dcld tx pki revoke-noc-x509-root-cert --subject= --subject-key-id= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRevokeNocX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L202)) |
| [REMOVE_NOC_ROOT](transactions/pki.md#remove_noc_root-rcac)
Removes a NOC root certificate (RCAC) | CLI `dcld tx pki remove-noc-x509-root-cert --subject= --subject-key-id= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRemoveNocX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L235)) |
| [ADD_NOC_ICA](transactions/pki.md#add_noc_ica-icac)
Adds a NOC ica certificate (ICAC) | CLI `dcld tx pki add-noc-x509-ica-cert --certificate= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgAddNocX509IcaCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L193)) |
| [REVOKE_NOC_ICA](transactions/pki.md#revoke_noc_ica-icac)
Revokes a NOC ica certificate (ICAC) | CLI `dcld tx pki revoke-noc-x509-ica-cert --subject= --subject-key-id= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRevokeNocX509IcaCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L215)) |
| [REMOVE_NOC_ICA](transactions/pki.md#remove_noc_ica-icac)
Remove a NOC ica certificate (ICAC) | CLI `dcld tx pki remove-noc-x509-ica-cert --subject= --subject-key-id= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRemoveNocX509IcaCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L228)) |
| [GET_NOC_CERT](transactions/pki.md#get_noc_cert)
Gets a NOC certificate (RCAC, ICAC) | CLI `dcld query pki noc-x509-cert --subject= --subject-key-id=`
GET `/dcl/pki/all-noc-certificates/{subject}/{subject_key_id}` |
| [GET_NOC_ROOT_BY_VID](transactions/pki.md#get_noc_root_by_vid-rcacs)
Retrieve NOC root certificates (RCACs) associated with a specific VID | CLI `dcld query pki noc-x509-root-certs --vid=`
GET `/dcl/pki/noc-vid-root-certificates/{vid}` |
| [GET_NOC_BY_VID_AND_SKID](transactions/pki.md#get_noc_by_vid_and_skid-rcacsicacs)
Retrieve NOC certificates (RCACs/ICACs) associated with a specific VID and SKID | CLI `dcld query pki noc-x509-cert --vid= --subject-key-id=`
GET `/dcl/pki/noc-vid-certificates/{vid}/{subject_key_id}` |
| [GET_NOC_ICA_BY_VID](transactions/pki.md#get_noc_ica_by_vid-icacs)
Retrieve NOC ICA certificates (ICACs) associated with a specific VID | CLI `dcld query pki noc-x509-ica-certs --vid=`
GET `/dcl/pki/noc-vid-ica-certificates/{vid}` |
| [GET_NOC_CERTS_BY_SUBJECT](transactions/pki.md#get_noc_certs_by_subject)
Gets all NOC certificates associated with a subject | CLI `dcld query pki all-noc-subject-x509-certs --subject=`
GET `/dcl/pki/all-noc-certificates/{subject}` |
| [GET_REVOKED_NOC_ROOT](transactions/pki.md#get_revoked_noc_root-rcac)
Gets a revoked NOC root certificate (RCAC) by the given subject and SKID | CLI `dcld query pki revoked-noc-x509-root-cert --subject= --subject-key-id=`
GET `/dcl/pki/revoked-noc-root-certificates/{subject}/{subject_key_id}` |
| [GET_REVOKED_NOC_ICA](transactions/pki.md#get_revoked_noc_ica-icac)
Gets a revoked NOC ica certificate (ICAC) by the given subject and SKID | CLI `dcld query pki revoked-noc-x509-ica-cert --subject= --subject-key-id=`
GET `/dcl/pki/revoked-noc-ica-certificates/{subject}/{subject_key_id}` |
| [GET_ALL_NOC](transactions/pki.md#get_all_noc-rcacsicacs)
Retrieve a list of all of NOC certificates (RCACs of ICACs) | CLI `dcld query pki all-noc-x509-certs`
GET `/dcl/pki/all-noc-certificates` |
| [GET_ALL_NOC_ROOT](transactions/pki.md#get_all_noc_root-rcacs)
Retrieve a list of all of NOC root certificates (RCACs) | CLI `dcld query pki all-noc-x509-root-certs`
GET `/dcl/pki/noc-root-certificates` |
| [GET_ALL_NOC_ICA](transactions/pki.md#get_all_noc_ica-icacs)
Retrieve a list of all of NOC ICA certificates (ICACs) | CLI `dcld query pki all-noc-x509-ica-certs`
GET `/dcl/pki/noc-ica-certificates` |
| [GET_ALL_REVOKED_NOC_ROOT](transactions/pki.md#get_all_revoked_noc_root-rcacs)
Gets all revoked NOC root certificates (RCACs) | CLI `dcld query pki all-revoked-noc-x509-root-certs`
GET `/dcl/pki/revoked-noc-root-certificates` |
| [GET_ALL_REVOKED_NOC_ICA](transactions/pki.md#get_all_revoked_noc_ica-icacs)
Gets all revoked NOC ica certificates (ICACs) | CLI `dcld query pki all-revoked-noc-x509-ica-certs`
GET `/dcl/pki/revoked-noc-ica-certificates` |
### [Auth](transactions/auth.md)
| Method | CLI command / REST API |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PROPOSE_ADD_ACCOUNT](transactions/auth.md#propose_add_account)
Proposes a new Account | CLI `dcld tx auth propose-add-account --address= --pubkey='' ...`
POST `/cosmos/tx/v1beta1/txs`([MsgProposeAddAccount](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclauth/tx.proto#L23)) |
| [APPROVE_ADD_ACCOUNT](transactions/auth.md#approve_add_account)
Approves the proposed account / Re-vote | CLI `dcld tx auth approve-add-account --address= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgApproveAddAccount](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclauth/tx.proto#L37)) |
| [REJECT_ADD_ACCOUNT](transactions/auth.md#reject_add_account)
Rejects the proposed account / Re-vote | CLI `dcld tx auth reject-add-account --address= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRejectAddAccount](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclauth/tx.proto#L67)) |
| [PROPOSE_REVOKE_ACCOUNT](transactions/auth.md#propose_revoke_account)
Proposes revocation of the Account | CLI `dcld tx auth propose-revoke-account --address= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgProposeRevokeAccount](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclauth/tx.proto#L47)) |
| [APPROVE_REVOKE_ACCOUNT](transactions/auth.md#approve_revoke_account)
Approves the proposed revocation of the account | CLI `dcld tx auth approve-revoke-account --address= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgApproveRevokeAccount](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclauth/tx.proto#L57)) |
| [GET_ACCOUNT](transactions/auth.md#get_account)
Gets an accounts | CLI `dcld query auth account --addres `
GET `/dcl/auth/accounts/{address}` |
| [GET_PROPOSED_ACCOUNT](transactions/auth.md#get_proposed_account)
Gets a proposed but not approved accounts | CLI `dcld query auth proposed-account --address `
GET `/dcl/auth/proposed-accounts/{address}` |
| [GET_REJECTED_ACCOUNT](transactions/auth.md#get_rejected_account)
Get a rejected accounts | CLI `dcld query auth rejected-account --address `
GET `/dcl/auth/rejected-accounts/{address}` |
| [GET_PROPOSED_ACCOUNT_TO_REVOKE](transactions/auth.md#get_proposed_account_to_revoke)
Gets a proposed but not approved accounts to be revoked | CLI `dcld query auth proposed-account-to-revoke --address `
GET `/dcl/auth/proposed-revocation-accounts/{address}` |
| [GET_REVOKED_ACCOUNT](transactions/auth.md#get_revoked_account)
Gets a revoked account by its address | CLI `dcld query auth revoked-account --address `
GET `/dcl/auth/revoked-accounts/{address}` |
| [GET_ALL_ACCOUNTS](transactions/auth.md#get_all_accounts)
Gets all accounts | CLI `dcld query auth all-accounts`
GET `/dcl/auth/accounts` |
| [GET_ALL_PROPOSED_ACCOUNTS](transactions/auth.md#get_all_proposed_accounts)
Gets all proposed but not approved accounts | CLI `dcld query auth all-proposed-accounts`
GET `/dcl/auth/proposed-accounts` |
| [GET_ALL_REJECTED_ACCOUNTS](transactions/auth.md#get_all_rejected_accounts)
Get all rejected accounts | CLI `dcld query auth all-rejected-accounts`
GET `/dcl/auth/rejected-accounts` |
| [GET_ALL_PROPOSED_ACCS_TO_REVOKE](transactions/auth.md#get_all_proposed_accounts_to_revoke)
Gets all proposed but not approved accounts to be revoked | CLI `dcld query auth all-proposed-accounts-to-revoke`
GET `/dcl/auth/proposed-revocation-accounts` |
| [GET_ALL_REVOKED_ACCOUNTS](transactions/auth.md#get_all_revoked_accounts)
Gets all revoked accounts | CLI `dcld query auth all-revoked-accounts`
GET `/dcl/auth/revoked-accounts` |
### [Validator Node](transactions/validator-node.md)
| Method | CLI command / REST API |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ADD_VALIDATOR_NODE](transactions/validator-node.md#add_validator_node)
Adds a new Validator node | CLI `dcld tx validator add-node --pubkey='' --moniker= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgCreateValidator](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/validator/tx.proto#L24)) |
| [DISABLE_VALIDATOR_NODE](transactions/validator-node.md#disable_validator_node)
Disables the Validator node by owner | CLI `dcld tx validator disable-node ...`
POST `/cosmos/tx/v1beta1/txs`([MsgDisableValidator](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/validator/tx.proto#L56)) |
| [PROPOSE_DISABLE_VALIDATOR_NODE](transactions/validator-node.md#propose_disable_validator_node)
Proposes disabling of the Validator node by a Trustee | CLI `dcld tx validator propose-disable-node --address= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgProposeDisableValidator](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/validator/tx.proto#L36)) |
| [APPROVE_DISABLE_VALIDATOR_NODE](transactions/validator-node.md#approve_disable_validator_node)
Approves disabling of the Validator node by a Trustee / Re-vote | CLI `dcld tx validator approve-disable-node --address= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgApproveDisableValidator](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/validator/tx.proto#L46)) |
| [REJECT_DISABLE_VALIDATOR_NODE](transactions/validator-node.md#reject_disable_validator_node)
Rejects disabling of the Validator node by a Trustee / Re-vote | CLI `dcld tx validator reject-disable-node --address= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRejectDisableValidator](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/validator/tx.proto#L76)) |
| [ENABLE_VALIDATOR_NODE](transactions/validator-node.md#enable_validator_node)
Enables the Validator node by the owner | CLI `dcld tx validator enable-node ...`
POST `/cosmos/tx/v1beta1/txs`([MsgEnableValidator](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/validator/tx.proto#L63)) |
| [GET_VALIDATOR](transactions/validator-node.md#get_validator)
Gets a validator node | CLI `dcld query validator node --address=
GET `/dcl/validator/nodes/{owner}` |
| [GET_ALL_VALIDATORS](transactions/validator-node.md#get_all_validators)
Gets the list of all validator nodes | CLI `dcld query validator all-nodes`
GET `/dcl/validator/nodes` |
| [GET_PROPOSED_DISABLE_VALIDATOR](transactions/validator-node.md#get_proposed_disable_validator)
Gets a proposed validator node | CLI `dcld query validator proposed-disable-node --address=`
GET `/dcl/validator/proposed-disable-nodes/{address}` |
| [GET_ALL_PROPOSED_DISABLE_VALIDATORS](transactions/validator-node.md#get_all_proposed_disable_validators)
Gets the list of all proposed disable validator nodes | CLI `dcld query validator all-proposed-disable-nodes`
GET `/dcl/validator/proposed-disable-nodes` |
| [GET_REJECTED_DISABLE_VALIDATOR](transactions/validator-node.md#get_rejected_disable_validator)
Gets a rejected validator node | CLI `dcld query validator rejected-disable-node --address=`
GET `/dcl/validator/rejected-disable-nodes/{address}` |
| [GET_ALL_REJECTED_DISABLE_VALIDATORS](transactions/validator-node.md#get_all_rejected_disable_validators)
Gets the list of all rejected disable validator nodes | CLI `dcld query validator all-rejected-disable-nodes`
GET `/dcl/validator/rejected-disable-nodes` |
| [GET_DISABLED_VALIDATOR](transactions/validator-node.md#get_disabled_validator)
Gets a disabled validator node | CLI `dcld query validator disabled-node --address=`
GET `/dcl/validator/disabled-nodes/{address}` |
| [GET_ALL_DISABLED_VALIDATORS](transactions/validator-node.md#get_all_disabled_validators)
Gets the list of all disabled validator nodes | CLI `dcld query validator all-disabled-nodes`
GET `/dcl/validator/disabled-nodes` |
| [GET_LAST_VALIDATOR_POWER](transactions/validator-node.md#get_last_validator_power)
Gets a last validator node power | CLI `dcld query validator last-power --address=`
GET `/dcl/validator/last-powers/{owner}` |
| [GET_ALL_LAST_VALIDATORS_POWER](transactions/validator-node.md#get_all_last_validators_power)
Gets the list of all last validator nodes power | CLI `dcld query validator all-last-powers`
GET `/dcl/validator/last-powers` |
| [UPDATE_VALIDATOR_NODE](transactions/validator-node.md#update_validator_node)
Updates the Validator node by the owner | |
### [Upgrade](transactions/upgrade.md)
| Method | CLI command / REST API |
|--------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PROPOSE_UPGRADE](transactions/upgrade.md#propose_upgrade)
Proposes an upgrade plan with the given name at the given height | CLI `dcld tx dclupgrade propose-upgrade --name= --upgrade-height= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgProposeUpgrade](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclupgrade/tx.proto#L19)) |
| [APPROVE_UPGRADE](transactions/upgrade.md#approve_upgrade)
Approves the proposed upgrade plan with the given name / Re-vote | CLI `dcld tx dclupgrade approve-upgrade --name= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgApproveUpgrade](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclupgrade/tx.proto#L29)) |
| [REJECT_UPGRADE](transactions/upgrade.md#reject_upgrade)
Rejects the proposed upgrade plan with the given name / Re-vote | CLI `dcld tx dclupgrade reject-upgrade --name= ...`
POST `/cosmos/tx/v1beta1/txs`([MsgRejectUpgrade](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/dclupgrade/tx.proto#L39)) |
| [GET_PROPOSED_UPGRADE](transactions/upgrade.md#get_proposed_upgrade)
Gets the proposed upgrade plan with the given name | CLI `dcld query dclupgrade proposed-upgrade --name=`
GET `/dcl/dclupgrade/proposed-upgrades/{name}` |
| [GET_APPROVED_UPGRADE](transactions/upgrade.md#get_approved_upgrade)
Gets the approved upgrade plan with the given name | CLI `dcld query dclupgrade approved-upgrade --name=`
GET `/dcl/dclupgrade/approved-upgrades/{name}` |
| [GET_REJECTED_UPGRADE](transactions/upgrade.md#get_rejected_upgrade)
Gets the rejected upgrade plan with the given name | CLI `dcld query dclupgrade rejected-upgrade --name=`
GET `/dcl/dclupgrade/rejected-upgrades/{name}` |
| [GET_ALL_PROPOSED_UPGRADES](transactions/upgrade.md#get_all_proposed_upgrades)
Gets all the proposed upgrade plans | CLI `dcld query dclupgrade all-proposed-upgrades`
GET `/dcl/dclupgrade/proposed-upgrades` |
| [GET_ALL_APPROVED_UPGRADES](transactions/upgrade.md#get_all_approved_upgrades)
Gets all the approved upgrade plans | CLI `dcld query dclupgrade all-approved-upgrades`
GET `/dcl/dclupgrade/approved-upgrades` |
| [GET_ALL_REJECTED_UPGRADES](transactions/upgrade.md#get_all_rejected_upgrades)
Gets all the rejected upgrade plans | CLI `dcld query dclupgrade all-rejected-upgrades`
GET `/dcl/dclupgrade/rejected-upgrades` |
| [GET_UPGRADE_PLAN](transactions/upgrade.md#get_upgrade_plan)
Gets the currently scheduled upgrade plan, if it exists | CLI `dcld query upgrade plan`
GET `/cosmos/upgrade/v1beta1/current_plan` |
| [GET_APPLIED_UPGRADE](transactions/upgrade.md#get_applied_upgrade)
Gets header block at which the upgrade was applied | CLI `dcld query upgrade applied `
GET `/cosmos/upgrade/v1beta1/applied_plan/{name}` |
| [GET_MODULE_VERSIONS](transactions/upgrade.md#get_module_versions)
Gets a list of module names and their respective consensus versions | CLI `dcld query upgrade module_versions`
GET `/cosmos/upgrade/v1beta1/module_versions` |
## Extensions
### Sign
Sign transaction by the given key.
- Parameters:
- `txn` - transaction to sign.
- `from` - name or address of private key to use to sign.
- `account-number` - (optional) the account number of the signing account.
- `sequence` - (optional) the sequence number of the signing account.
- `chain-id` - (optional) chain ID.
- CLI command:
- `dcld tx sign [path-to-txn-file] --from [address]`
> **_Note:_** if `account_number` and `sequence` are not specified they will be fetched from the ledger automatically.
### Broadcast
Broadcast transaction to the ledger.
- Parameters:
- `txn` - transaction to broadcast
- CLI command:
- `dcld tx broadcast [path-to-txn-file]`
- REST API:
- POST `/cosmos/tx/v1beta1/txs`
### Status
Query status of a node.
- Parameters:
- `node`: optional(string) - node physical address to query (by default queries the node specified in CLI config file or else "tcp://localhost:26657")
- CLI command:
- `dcld status [--node=]`
- REST API:
- GET `/cosmos/base/tendermint/v1beta1/node_info`
### Validator set
Get the list of tendermint validators participating in the consensus at given height.
- Parameters:
- `height`: optional(uint) - height to query (the latest by default)
- CLI command:
- `dcld query tendermint-validator-set [height]`
- REST API:
- GET `/cosmos/base/tendermint/v1beta1/validatorsets/latest`
- GET `/cosmos/base/tendermint/v1beta1/validatorsets/{height}`
### Keys
The set of CLI commands that allows you to manage your local keystore.
Commands:
- Derive a new private key and encrypt to disk.
You will be prompted to create an encryption passphrase.
This passphrase will be requested each time you send write transactions on the ledger using this key.
You can remember and securely save the mnemonic phrase shown after the key is created
to be able to recover the key later.
Command: `dcld keys add `
Example: `dcld keys add jack`
- Recover existing key instead of creating a new one.
The key can be recovered from a seed obtained from the mnemonic passphrase (see the previous command).
You will be prompted to create an encryption passphrase and enter the seed's mnemonic.
This passphrase will be requested each time you send write transactions on the ledger using this key.
Command: `dcld keys add --recover`
Example: `dcld keys add jack --recover`
- Get a list of all stored public keys.
Command: `dcld keys list`
Example: `dcld keys list`
- Get details for a key.
Command: `dcld keys show `
Example: `dcld keys show jack`
- Export a key.
A private key from the local keystore can be exported in ASCII-armored encrypted format.
You will be prompted to enter the decryption passphrase for the key and
to create an encryption passphrase for the exported key.
The exported key can be stored to a file for import.
Command: `dcld keys export `
Example: `dcld keys export jack`
- Import a key.
A key can be imported from the ASCII-armored encrypted format
obtained by the export key command.
You will be prompted to enter the decryption passphrase for the exported key
which was used during the export process.
Command: `dcld keys import `
Example: `dcld keys import jack jack_exported_priv_key_file`