Skip to content

Commit

Permalink
include migrations for democracy pallet (#376)
Browse files Browse the repository at this point in the history
* include migrations for democracy pallet

* bump v
  • Loading branch information
brenzi authored Sep 10, 2024
1 parent 1184e62 commit aa2f373
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 24 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, versio
pallet-encointer-communities = { default-features = false, version = "~13.1.0" }
pallet-encointer-communities-rpc = { version = "~13.1.0" }
pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "~13.1.0" }
pallet-encointer-democracy = { default-features = false, version = "~13.3.0" }
pallet-encointer-democracy = { default-features = false, version = "~13.3.1" }
pallet-encointer-faucet = { default-features = false, version = "~13.2.0" }
pallet-encointer-reputation-commitments = { default-features = false, version = "~13.1.0" }
pallet-encointer-scheduler = { default-features = false, version = "~13.1.0" }
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# encointer-node

Encointer-node is the implementation of the [encointer.org](https://encointer.org) blockchain.
Use this together with the mobile phone app [encointer mobile app](https://github.com/encointer/encointer-wallet-flutter)
Use this together with the mobile phone
app [encointer mobile app](https://github.com/encointer/encointer-wallet-flutter)

The cli client is based on [substrate-api-client](https://github.com/scs/substrate-api-client)
The Trusted Execution version for Testnet Cantillon is on branch [sgx-master](https://github.com/encointer/encointer-node/tree/sgx-master) based on [substraTEE project](https://github.com/scs/substraTEE).
The Trusted Execution version for Testnet Cantillon is on
branch [sgx-master](https://github.com/encointer/encointer-node/tree/sgx-master) based
on [substraTEE project](https://github.com/scs/substraTEE).

## Building

Expand Down Expand Up @@ -52,10 +55,7 @@ cargo build --release --features try-runtime
Then test state migrations with against live data on the Gesell network with:

```bash
./target/release/encointer-node-notee try-runtime \
--runtime ./target/release/wbuild/encointer-node-notee-runtime/encointer_node_notee_runtime.wasm \
on-runtime-upgrade --checks=all \
live --uri wss://gesell.encointer.org:443
try-runtime --runtime target/release/wbuild/encointer-node-notee-runtime/encointer_node_notee_runtime.compact.compressed.wasm on-runtime-upgrade --checks=pre-and-post --disable-spec-version-check live --uri wss://gesell.encointer.org:443
```

### Run with docker
Expand All @@ -73,6 +73,7 @@ docker run -p 30333:30333 -p 9944:9944 -p 9933:9933 -p 9615:9615 \
```

## Run Testnet Gesell Node

Join our testnet as a full node with

```bash
Expand All @@ -81,7 +82,9 @@ RUST_LOG=INFO,parity_ws=WARN,sc_basic_authorship=warn,aura=warn,encointer=debug
```

## CLI client
We currently have limited support for the [polkadot-js apps](https://polkadot.js.org/apps) UI. Encointer comes with a cli application instead that supports all interactions with the chain

We currently have limited support for the [polkadot-js apps](https://polkadot.js.org/apps) UI. Encointer comes with a
cli application instead that supports all interactions with the chain

### Run Client

Expand All @@ -93,17 +96,21 @@ encointer-node/client> ../target/release/encointer-client-notee list_meetup_regi
encointer-node/client> ../target/release/encointer-client-notee list_witnesses_registry
encointer-node/client> ../target/release/encointer-client-notee --help
```

The master of ceremony can play fast-forward for demo purposes (ceremonies only happen ~monthly. not good for demos)

```bash
encointer-node/client> ./encointer-client-notee next_phase
```

To run a full demo (you may need to fix ports in the scripts if you change them):

```
encointer-node/client> ./bootstrap_demo_community.sh
```

### Run with docker

```bash
docker run -it encointer/encointer-client-notee:<version> [encointer-client-notee|bootstrap_demo_community.py|cli.py] <params>

Expand All @@ -117,6 +124,7 @@ docker run -it encointer-client-notee:dev bootstrap_demo_community.py -u ws://ho
### Grow Bot Community

Assuming a local node is running with default ports:

```bash
pip3 install pip install geojson pyproj RandomWords substrate-interface
# in first terminal, do this to accelerate phase progress
Expand All @@ -131,15 +139,18 @@ pip3 install pip install geojson pyproj RandomWords substrate-interface
## Web UI

There is no fully featured UI yet, but you can use [polkadot-js apps](https://github.com/polkadot-js/apps).
This allows you to explore chain state but it doesn't support all types of extrinsic parameters needed. Use our CLI client instead.
This allows you to explore chain state but it doesn't support all types of extrinsic parameters needed. Use our CLI
client instead.

## Mobile App

The PoC1 Android App doesn't work with this release anymore, but you can watch progress at [encointer-app](https://github.com/encointer/encointer-app)
The PoC1 Android App doesn't work with this release anymore, but you can watch progress
at [encointer-app](https://github.com/encointer/encointer-app)

## Dev-Remarks

### Benchmarking

For benchmarking a new pallet you need to do the following:

1. Add the new pallet to be benchmarked to the `define_benchmarks!` macro in the runtime.
Expand Down
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "encointer-client-notee"
authors = ["encointer.org <alain@encointer.org>"]
edition = "2021"
#keep with node version. major, minor and patch
version = "1.14.1"
version = "1.14.2"

[dependencies]
# todo migrate to clap >=3 https://github.com/encointer/encointer-node/issues/107
Expand Down
4 changes: 3 additions & 1 deletion client/src/commands/encointer_democracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use encointer_primitives::{
ReputationVec, Vote,
},
};
use log::error;
use log::{debug, error};
use parity_scale_codec::{Decode, Encode};
use sp_core::{sr25519 as sr25519_core, ConstU32};
use substrate_api_client::{
Expand Down Expand Up @@ -143,10 +143,12 @@ pub fn list_proposals(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:
println!("📜 Number of proposals: {}, global config: proposal lifetime: {:?}, confirmation period: {:?}, min turnout: {:.3}%", storage_keys.len(), proposal_lifetime, confirmation_period, min_turnout_permill as f64 / 10f64);
let mut proposals: Vec<(ProposalIdType, Proposal<Moment, AccountId, Balance>)> = Vec::new();
for storage_key in storage_keys.iter() {
debug!("storage_key: 0x{}", hex::encode(storage_key));
let key_postfix = storage_key.as_ref();
let proposal_id =
ProposalIdType::decode(&mut key_postfix[key_postfix.len() - 16..].as_ref())
.unwrap();
debug!("proposalid: {:?}", proposal_id);
let proposal: Proposal<Moment, AccountId, Balance> =
api.get_storage_by_key(storage_key.clone(), maybe_at).await.unwrap().unwrap();
if !matches.all_flag() && proposal.state.has_failed() {
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/encointer/encointer-node"
# * Align major and minor version with polkadot-sdk major.minor.
# * Bump patch version for new releases, and make it the release tag.
# * The client should follow this version.
version = "1.14.1"
version = "1.14.2"

[[bin]]
name = "encointer-node-notee"
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "encointer-node-notee-runtime"
repository = "https://github.com/encointer/encointer-node/"
# minor revision must match node/client
# patch revision must match runtime spec_version
version = "1.14.360"
version = "1.14.361"

[dependencies]
log = { workspace = true }
Expand Down
7 changes: 2 additions & 5 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("encointer-node-notee"),
impl_name: create_runtime_str!("encointer-node-notee"),
authoring_version: 0,
spec_version: 360,
spec_version: 361,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 5,
Expand Down Expand Up @@ -608,10 +608,7 @@ pub type UncheckedExtrinsic =
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;

/// storage migrations to be applied upon runtime upgrade
pub type Migrations = (
pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
pallet_encointer_ceremonies::migrations::v2::MigrateToV2<Runtime>,
);
pub type Migrations = (pallet_encointer_democracy::migrations::v1::MigrateV0toV1purging<Runtime>,);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down

0 comments on commit aa2f373

Please sign in to comment.