Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
b682ec88
Commit
b682ec88
authored
1 year ago
by
Hugo Trentesaux
Committed by
Cédric Moreau
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
remove indexer-specific code
parent
f94d3847
No related branches found
No related tags found
1 merge request
!266
adapt ci to export new py-g1-migrator history files
Pipeline
#37371
passed
11 months ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+2
-3
2 additions, 3 deletions
.gitlab-ci.yml
node/src/chain_spec/gen_genesis_data.rs
+1
-65
1 addition, 65 deletions
node/src/chain_spec/gen_genesis_data.rs
with
3 additions
and
68 deletions
.gitlab-ci.yml
+
2
−
3
View file @
b682ec88
...
...
@@ -306,8 +306,7 @@ create_g1_data:
image
:
rust:1-bullseye
variables
:
WASM_FILE
:
$CI_PROJECT_DIR/release/${RUNTIME}_runtime.compact.compressed.wasm
DUNITER_GENESIS_DATA
:
$CI_PROJECT_DIR/release/g1-data.json
DUNITER_GENESIS_EXPORT
:
$CI_PROJECT_DIR/release/${RUNTIME}-indexer.json
DUNITER_GENESIS_DATA
:
$CI_PROJECT_DIR/release/genesis.json
# py-g1-migrator outputs this file with `./main.py`
DEBIAN_FRONTEND
:
noninteractive
script
:
-
apt-get update
...
...
@@ -358,7 +357,7 @@ create_release:
-
export MILESTONE=$(echo $CI_COMMIT_BRANCH | sed -e "s/release\///g")
-
cargo xtask release-runtime $MILESTONE $CI_COMMIT_BRANCH
# We always ship runtimes: this is both a proof and a convenience
-
cargo xtask create-asset-link $MILESTONE g
1-data
.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/g
1-data
.json
-
cargo xtask create-asset-link $MILESTONE g
enesis
.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/g
enesis
.json
-
cargo xtask create-asset-link $MILESTONE gdev_runtime.compact.compressed.wasm https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gdev_runtime.compact.compressed.wasm
-
cargo xtask create-asset-link $MILESTONE gtest_runtime.compact.compressed.wasm https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gtest_runtime.compact.compressed.wasm
-
cargo xtask create-asset-link $MILESTONE gdev_client-specs.yaml https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gdev_client-specs.yaml
...
...
This diff is collapsed.
Click to expand it.
node/src/chain_spec/gen_genesis_data.rs
+
1
−
65
View file @
b682ec88
...
...
@@ -34,7 +34,6 @@ use sp_runtime::{
use
std
::{
collections
::{
BTreeMap
,
HashMap
},
fmt
::{
Display
,
Formatter
},
fs
,
ops
::{
Add
,
Sub
},
};
...
...
@@ -129,7 +128,6 @@ pub struct GenesisIndexerExport {
technical_committee
:
Vec
<
String
>
,
ud
:
u64
,
wallets
:
BTreeMap
<
AccountId
,
u64
>
,
transactions_history
:
Option
<
BTreeMap
<
AccountId
,
Vec
<
TransactionV2
>>>
,
}
#[derive(Deserialize,
Serialize)]
...
...
@@ -155,7 +153,6 @@ struct GenesisMigrationData {
identities
:
BTreeMap
<
String
,
IdentityV1
>
,
#[serde(default)]
wallets
:
BTreeMap
<
PubkeyV1
,
u64
>
,
transactions_history
:
Option
<
BTreeMap
<
PubkeyV1
,
Vec
<
TransactionV1
>>>
,
}
// Base58 encoded Ed25519 public key
...
...
@@ -667,68 +664,7 @@ where
}
// Indexer output
if
let
Ok
(
path
)
=
std
::
env
::
var
(
"DUNITER_GENESIS_EXPORT"
)
{
// genesis_certs_min_received => min_cert
// genesis_memberships_expire_on => membership_period
// genesis_smith_certs_min_received => smith_min_cert
let
export
=
GenesisIndexerExport
{
first_ud
,
first_ud_reeval
,
genesis_parameters
:
common_parameters
.clone
(),
identities
:
identities_v2
,
sudo_key
:
sudo_key
.clone
(),
technical_committee
,
ud
,
wallets
:
accounts
.iter
()
.map
(|(
account_id
,
data
)|
(
account_id
.clone
(),
data
.balance
))
.collect
(),
smiths
:
(
smiths
)
.iter
()
.map
(|
smith
|
{
(
smith
.name
.clone
(),
SmithData
{
idty_index
:
smith
.idty_index
,
name
:
smith
.name
.clone
(),
account
:
smith
.account
.clone
(),
session_keys
:
smith
.session_keys
.clone
(),
certs_received
:
smith
.certs_received
.clone
(),
},
)
})
.collect
::
<
BTreeMap
<
String
,
SmithData
>>
(),
transactions_history
:
genesis_data
.transactions_history
.map
(|
history
|
{
history
.iter
()
// Avoid wrong pubkeys in tx history
.filter
(|(
pubkey
,
_
)|
v1_pubkey_to_account_id
((
*
pubkey
)
.clone
())
.is_ok
())
.map
(|(
pubkey
,
txs
)|
{
(
v1_pubkey_to_account_id
(
pubkey
.clone
())
.expect
(
"already checked account"
),
txs
.iter
()
// Avoid wrong pubkeys in tx history
.filter
(|
tx
|
v1_pubkey_to_account_id
(
tx
.issuer
.clone
())
.is_ok
())
.map
(|
tx
|
TransactionV2
{
issuer
:
v1_pubkey_to_account_id
(
tx
.issuer
.clone
())
.expect
(
"already checked tx.issuer"
),
amount
:
tx
.amount
.clone
(),
written_time
:
tx
.written_time
,
comment
:
tx
.comment
.clone
(),
})
.collect
::
<
Vec
<
TransactionV2
>>
(),
)
})
.collect
::
<
BTreeMap
<
AccountId
,
Vec
<
TransactionV2
>>>
()
}),
};
fs
::
write
(
&
path
,
serde_json
::
to_string_pretty
(
&
export
)
.expect
(
"should be serializable"
),
)
.unwrap_or_else
(|
_
|
panic!
(
"Could not export genesis data to {}"
,
&
path
));
}
// handled by indexer directly from py-g1-migrator output
let
genesis_data
=
GenesisData
{
accounts
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment