Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'supra-authorization'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=supra-authorization"
],
"filter": {
"name": "supra-authorization",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'client'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=client"
],
"filter": {
"name": "client",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'supra'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=supra"
],
"filter": {
"name": "supra",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'supra'",
"cargo": {
"args": [
"build",
"--bin=supra",
"--package=supra"
],
"filter": {
"name": "supra",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'supra'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=supra",
"--package=supra"
],
"filter": {
"name": "supra",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'supra-runtime'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=supra-runtime"
],
"filter": {
"name": "supra-runtime",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'pallet-template'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=pallet-template"
],
"filter": {
"name": "pallet-template",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
8 changes: 4 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ FROM debian:buster-slim as runtime
COPY --from=builder /usr/local/bin/supra /usr/local/bin/
COPY --from=builder /usr/local/bin/sub* /usr/local/bin/
WORKDIR /app
COPY --from=planner /app/scripts/create-bootnode.sh scripts/
COPY --from=builder /app/docker.script.sh start
COPY --from=planner /app/scripts/docker.create-bootnode.sh scripts/
COPY --from=builder /app/scripts/docker.start.sh start
RUN apt-get update && apt-get install -y curl procps
EXPOSE 30333 9933 9944
ENTRYPOINT ["./start"]
1 change: 1 addition & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ version = '2.1.1'

[dev-dependencies]
sp-core = { default-features = false, version = '3.0.0' }

[features]
default = ['std']
std = [
Expand Down
104 changes: 104 additions & 0 deletions customSpec.json

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions customSpecRaw.json

Large diffs are not rendered by default.

44 changes: 42 additions & 2 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,46 @@ pub fn development_config() -> Result<ChainSpec, String> {
))
}

pub fn supra_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;

Ok(ChainSpec::from_genesis(
// Name
"Supra",
// ID
"supra",
ChainType::Custom(String::from("Supra")),
move || {
testnet_genesis(
wasm_binary,
// Initial PoA authorities
vec![
authority_keys_from_seed("0xc8c157749a3f500000e6e5b92de459b4a609e50ece5c036abbf43006ced4d111"),
],
// Sudo account
get_account_id_from_seed::<sr25519::Public>("0xc8c157749a3f500000e6e5b92de459b4a609e50ece5c036abbf43006ced4d111"),
// Pre-funded accounts
vec![
get_account_id_from_seed::<sr25519::Public>("0xc8c157749a3f500000e6e5b92de459b4a609e50ece5c036abbf43006ced4d111"),
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
],
true,
)
},
// Bootnodes
vec![],
// Telemetry
None,
// Protocol ID
None,
// Properties
None,
// Extensions
None,
))
}

pub fn local_testnet_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;

Expand Down Expand Up @@ -164,15 +204,15 @@ fn testnet_genesis(
nodes: vec![
(
OpaquePeerId(
bs58::decode("12D3KooWBmAwcd4PJNJvfV89HwE48nwkRmAgo8Vy3uQEyNNHBox2")
bs58::decode("12D3KooWCPow32NJx3Jo87jpXSPmPUwDct6sNZSVBHzGeTJY1uB9")
.into_vec()
.unwrap(),
),
endowed_accounts[0].clone(),
),
(
OpaquePeerId(
bs58::decode("12D3KooWQYV9dGMFoRzNStwpXztXaBUjtPqi6aU76ZgUriHhKust")
bs58::decode("12D3KooWRqAe5uRWY9zFRb83StW6s11iPtgTWvHX5Bf9zP379FYf")
.into_vec()
.unwrap(),
),
Expand Down
3 changes: 3 additions & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl SubstrateCli for Cli {
Ok(match id {
"dev" => Box::new(chain_spec::development_config()?),
"" | "local" => Box::new(chain_spec::local_testnet_config()?),
"supra" => Box::new(chain_spec::supra_config()?),
path => Box::new(chain_spec::ChainSpec::from_json_file(
std::path::PathBuf::from(path),
)?),
Expand Down Expand Up @@ -157,3 +158,5 @@ pub fn run() -> sc_cli::Result<()> {
}
}
}


Loading