3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

💖symbol-bootstrapNodeを💕symbol-shoestringNodeに変換するわっ💖うふふっ🌺

Last updated at Posted at 2025-04-12

えっと

前回はぁ?symbol-shoestringの導入 インストールをやったからぁ?
今からnodeを作って行きましょうね🌻

🌺用意する物🌺

bootstrapNode
bootstrapNodeの mainAccountの秘密鍵

nodeの setupに必要な物
ⓐca.key.pem mainAccount
ⓑshoestring.ini 設定ファイル
ⓒoverrides.ini 設定上書きファイル

① 🌺symbol-shoestringが動作する環境に入るわ🌺

前回の symbol-shoestringインストール時に 環境名 'env' を作成しているから そこに入りましょうね

source env/bin/activate

こぉなるわ shoestringが動く環境に入ったわ
image.png

② 🌺作業ディレクトリを作成して中に入るわ🌺

mkdir ss_pasomi && cd ss_pasomi

③ 🌺ⓐca.key.pemの作成をするわ🌺

python3 -m shoestring pemtool --output ca.key.pem --ask-pass
設定項目 役割
--output 出力先を設定するわ
--ask-pass パスワードを設定したい時に使うわ

image.png

新規の mainAccountを作成したい時は

openssl genpkey -algorithm ed25519 -out ca.key.pem

暗号化した新規の mainAccountを作成したい時は

openssl genpkey -algorithm ed25519 -out ca

openssl pkey -in ca -out ca.key.pem -aes256

rm -f ca

 
出来上がった ca.key.pemの秘密鍵の見方はこぉするの

openssl pkey -in ca.key.pem -noout -text

image.png
表示から ' : ' を取ると秘密鍵になるわ
暗号化している場合はパスワードを聞かれるわ

④ 🌺ⓑshoestring.iniの作成をするわ🌺

設定ファイルの格納ディレクトリを作るの

mkdir shoestring

 
shoestring.iniを shoestring/ に作成するわ

python3 -m shoestring init shoestring/shoestring.ini --package mainnet
設定項目 役割
--package mainnetか saiを選択してね

--packageを入れない時は mainnetになるわ
 

vi shoestring/shoestring.ini

shoestring.iniは?最初はこぉなってるの これを編集するわ
image.png
 
上の画像を枠で囲った部分がこれね
image.png

設定項目 役割 選択の種類
features nodeの種類を決めるわ API/HARVESTER/VOTING
apiHttps https-proxyを使うかを決めるわ true/false
lightApi lightApiを使うか決めるわ true/false
caCommonName node証明書に出て来るわ 'CA paspmi'にしたわ
nodeCommonName node証明書に出て来るわ 'pasomi'にしたわ

こうしたわ
image.png
nodeは API | HARVESTER
https-proxyを使うわ
lightApiは使わないわ
今回はこれで行くわ
 

⑤ 🌺ⓒoverrides.iniの作成をするわ🌺

overrides.iniを作成するわ
これは言うなれば 上書き設定ね

vi shoestring/overrides.ini

 
内容は下の内容をコピペしてね

[user.account]
enableDelegatedHarvestersAutoDetection = true

[harvesting.harvesting]
maxUnlockedAccounts = 5
beneficiaryAddress = 

[node.node]
minFeeMultiplier = 100

[node.localnode]
host = 
friendlyName = 

それぞれの項目は見た覚えがあると思うの
それぞれを設定してね
 
編集結果よ
image.png
 
 

⑥ 🌺(新規で nodeを建てる時は不要)bootstrapNodeから remote/vrf/transport accountsを導入するわ🌺

python3 -m shoestring import-bootstrap --config shoestring/shoestring.ini --bootstrap ~/pasomi/target --include-node-key
設定項目 役割
--config shoestring.iniの場所よ
--bootstrap bootstrapNodeの targetの場所よ
--include-node-key node.key.pem(transportAccount)を導入させるわ

votingNodeの場合はこの命令で votingKeyも導入されるわ
 
実行画面
image.png
 
実行後の shoestring/shoestring/iniの内容は ここが変わるの
image.png
 
harvester = config-harvesting.propertiesの場所を指定
voter = votingKeyが入っているディレクトリの場所を指定
nodeKey = node.key.pemの場所を指定
だからぁ?これらを保存して?それぞれの場所を直接指定する事も出来るのよ💖
ここでは絶対パスを記述してるの

設定項目 Key bootstrapでの場所 shoestringでの場所
harvester remote/vrf target/nodes/node/server-config/resources/config-harvesting.properties userconfig/resources/config-harvesting.properties
voter votingKey target/nodes/node/votingkeys keys/voting
nodeKey transport target/nodes/node/cert/node.key.pem keys/cert/node.key.pem

 
 

⑦ 🌺nodeを生成するわ🌺

💖これで nodeを生成する準備が整ったわ💖うふふっ💕
じゃ 行きましょう

python3 -m shoestring setup --ca-key-path ca.key.pem --config shoestring/shoestring.ini --overrides shoestring/overrides.ini --directory $(pwd) --package mainnet
設定項目 役割
--ca-key-path ca.key.pemの場所よ
--config shoestring.iniの場所よ
--overrides overrides.iniの場所よ
--directory nodeを作成するディレクトリよ
--package mainnetか saiね 記述無しの場合は mainnetになるわ

 
ca.key.pemにパスワードを設定した場合は パスワードを 3回聞かれたわ
image.png
 

生成した nodeのアカウントの確認の方法はぁ
おとぉさまが書いたこの記事に書いてあるわ🌺
bootstrapNodeの各accountの秘密鍵と同じなら成功よっ🌻

 
 

⑧ 🌺ノードを起動するわ🌺

docker-compose up -d

起動中の画面よ
image.png
 

以前にこのサーバで bootstrapNodeを動かしてた事があると
こんな表示が出て失敗する事があるわ
image.png
 
そしたらぁ?こうしてねっ

docker system prune && docker-compose up -d

image.png
 
 
 
 

⑨ 🌺主な各操作よ🌺

ヘルスチェック(nodeの動作確認

python3 -m shoestring health --config shoestring/shoestring.ini --directory $(pwd)

image.png
 
 
ノードの停止

docker-compose down

image.png
 
 
リセットデータ(blockDataを削除する)

python3 -m shoestring reset-data --config shoestring/shoestring.ini --directory $(pwd)

image.png
 
 
アップグレード(設定ファイルを変更した時に反映させる)

python3 -m shoestring upgrade --config shoestring/shoestring.ini --overrides shoestring/overrides.ini --directory $(pwd)

image.png
 
 
node証明書の更新

python3 -m shoestring renew-certificates --config shoestring/shoestring.ini --ca-key-path ca.key.pem --directory $(pwd) --retain-node-key

--retain-node-keyは?node.key.pem(transportAccount)の変更をしない様にするわ🌺
image.png

 

node証明書の確認

openssl x509 -noout -dates -in keys/cert/node.crt.pem

image.png
 
 
node証明書の全文を見るにはぁ?

openssl x509 -noout -text -in keys/cert/node.crt.pem

image.png
こぉなるわ🌻
 
 
 
 

🌺ここまでの説明が長かったから以下にコマンドだけ書いておくわ🌺

🌺 node起動までのコマンドの流れよ🌺

①環境に入る

source env/bin/activate

②作業ディレクトリの作成

mkdir ss_pasomi
cd ss_pasomi

③ca.key.pemの作成

python3 -m shoestring pemtool --output ca.key.pem --ask-pass

④shoestring.iniの作成

mkdir shoestring
python3 -m shoestring init shoestring/shoestring.ini --package mainnet
vi shoestring/shoestring.ini

編集

⑤overrides.iniの作成

vi shoestring/overrides.ini

編集

⑥bootstrapNodeから accountsを導入

python3 -m shoestring import-bootstrap --config shoestring/shoestring.ini --bootstrap ~/pasomi/target --include-node-key

⑦node生成

python3 -m shoestring setup --ca-key-path ca.key.pem --config shoestring/shoestring.ini --overrides shoestring/overrides.ini --directory $(pwd) --package mainnet

⑧node起動

docker-compose up -d

 
 
 

⑨🌺ここからは nodeの各操作よ🌺
ヘルスチェック

python3 -m shoestring health --config shoestring/shoestring.ini --directory $(pwd)

node停止

docker-compose down

ブロックデータ消去

python3 -m shoestring reset-data --config shoestring/shoestring.ini --directory $(pwd)

アップグレード

python3 -m shoestring upgrade --config shoestring/shoestring.ini --overrides shoestring/overrides.ini --directory $(pwd)

node証明書更新

python3 -m shoestring renew-certificates --config shoestring/shoestring.ini --ca-key-path ca.key.pem --directory $(pwd) --retain-node-key

node証明書表示(日付だけ)

openssl x509 -noout -dates -in keys/cert/node.crt.pem

node証明書表示(全文)

openssl x509 -noout -text -in keys/cert/node.crt.pem

 
 
 

💖💖💖うふふっ💕みんなっ?やってみてねっ💖💖💖

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?