Skip to content

Commit

Permalink
feat: add ledger sync protocol (#529)
Browse files Browse the repository at this point in the history
* feat: add ledger sync protocol

Signed-off-by: Brandon H. Gomes <[email protected]>
Co-authored-by: Shumo Chu <[email protected]>
  • Loading branch information
bhgomes and stechu authored Jun 8, 2022
1 parent 7b421ba commit 682f3fc
Show file tree
Hide file tree
Showing 38 changed files with 1,642 additions and 424 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Breaking changes

### Features
- [\#529](https://github.com/Manta-Network/Manta/pull/529) Add RPC for MantaPay to synchronize with latest ledger state

### Improvements
[\#481](https://github.com/Manta-Network/Manta/pull/481) Update upstream dependencies to v0.9.18.
Expand Down
101 changes: 87 additions & 14 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

[workspace]
resolver = "2"
members = [
Expand Down
4 changes: 3 additions & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license = 'GPL-3.0'
name = 'manta'
repository = 'https://github.com/Manta-Network/Manta/'
version = '3.1.5'
default-run = "manta"

[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
Expand Down Expand Up @@ -89,9 +90,10 @@ xcm = { git = "https://github.com/paritytech/polkadot.git", branch = "release-v0

# Self dependencies
calamari-runtime = { path = '../runtime/calamari' }
manta-runtime = { path = '../runtime/manta' }
dolphin-runtime = { path = '../runtime/dolphin' }
manta-primitives = { path = '../primitives' }
manta-runtime = { path = '../runtime/manta' }
pallet-manta-pay = { path = '../pallets/manta-pay', features = ["rpc", "runtime"] }

[build-dependencies]
substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate.git', branch = "polkadot-v0.9.18" }
Expand Down
3 changes: 1 addition & 2 deletions node/src/chain_specs/calamari.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

use super::*;
use crate::command::CALAMARI_PARACHAIN_ID;

use calamari_runtime::{CouncilConfig, DemocracyConfig, GenesisConfig, TechnicalCommitteeConfig};
use calamari_runtime::{CouncilConfig, DemocracyConfig, TechnicalCommitteeConfig};
use manta_primitives::helpers::{get_account_id_from_seed, get_collator_keys_from_seed};

/// Specialized `ChainSpec` for the normal parachain runtime.
Expand Down
7 changes: 2 additions & 5 deletions node/src/chain_specs/dolphin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@

use super::*;
use crate::command::DOLPHIN_PARACHAIN_ID;

use dolphin_runtime::{
AssetManagerConfig, CouncilConfig, DemocracyConfig, GenesisConfig, TechnicalCommitteeConfig,
};
use dolphin_runtime::{CouncilConfig, DemocracyConfig, GenesisConfig, TechnicalCommitteeConfig};
use manta_primitives::helpers::{get_account_id_from_seed, get_collator_keys_from_seed};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type DolphinChainSpec =
sc_service::GenericChainSpec<dolphin_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<GenesisConfig, Extensions>;

const DOLPHIN_PROTOCOL_ID: &str = "dolphin"; // for p2p network configuration
const KUSAMA_RELAYCHAIN_LOCAL_NET: &str = "kusama-local";
Expand Down
6 changes: 2 additions & 4 deletions node/src/chain_specs/manta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

use super::*;
use crate::command::MANTA_PARACHAIN_ID;

pub type MantaChainSpec = sc_service::GenericChainSpec<manta_runtime::GenesisConfig, Extensions>;
use manta_primitives::helpers::{get_account_id_from_seed, get_collator_keys_from_seed};

const MANTA_PROTOCOL_ID: &str = "manta"; // for p2p network configuration
Expand All @@ -29,6 +27,8 @@ const POLKADOT_RELAYCHAIN_MAIN_NET: &str = "polkadot";
/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = 2;

pub type MantaChainSpec = sc_service::GenericChainSpec<manta_runtime::GenesisConfig, Extensions>;

/// Generate the manta session keys from individual elements.
///
/// The input must be a tuple of individual keys (a single arg for now since we have just one key).
Expand All @@ -48,7 +48,6 @@ pub fn manta_properties() -> Properties {
// manta chain spec
pub fn manta_development_config() -> MantaChainSpec {
let properties = manta_properties();

MantaChainSpec::from_genesis(
// Name
"Manta Parachain Development",
Expand Down Expand Up @@ -85,7 +84,6 @@ pub fn manta_development_config() -> MantaChainSpec {

pub fn manta_local_config() -> MantaChainSpec {
let properties = manta_properties();

MantaChainSpec::from_genesis(
// Name
"Manta Parachain Local",
Expand Down
20 changes: 8 additions & 12 deletions node/src/chain_specs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,25 @@
// You should have received a copy of the GNU General Public License
// along with Manta. If not, see <http://www.gnu.org/licenses/>.

#![allow(unused_imports)]
#![allow(dead_code)]
use cumulus_primitives_core::ParaId;
use hex_literal::hex;

use manta_primitives::{
constants,
types::{AccountId, AuraId, Balance, Signature},
types::{AccountId, AuraId, Balance},
};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::{ChainType, Properties};
use serde::{Deserialize, Serialize};
use sp_core::{crypto::UncheckedInto, sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};
use sp_core::sr25519;

pub mod calamari;
pub use self::calamari::*;
pub use calamari_runtime::currency::KMA;
pub mod manta;
pub use self::manta::*;
pub use manta_runtime::currency::MANTA;
pub mod dolphin;
pub use self::dolphin::*;
pub mod manta;

pub use self::{calamari::*, dolphin::*, manta::*};
pub use calamari_runtime::currency::KMA;
pub use dolphin_runtime::currency::DOL;
pub use manta_runtime::currency::MANTA;

const CALAMARI_ENDOWMENT: Balance = 1_000_000_000 * KMA; // 10 endowment so that total supply is 10B

Expand Down
Loading

0 comments on commit 682f3fc

Please sign in to comment.