Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Reduce initial funds to test address (#161)
Browse files Browse the repository at this point in the history
* reduce initial funds to test address

* remove funds for test address except in rootnet

* recover genesis.car in mir scripts

* add some initial funds to gateway in root to fund initial validators

* add new bundle not funding initial membership in /root
  • Loading branch information
adlrocha authored Apr 19, 2023
1 parent f5c0d77 commit 4bf581b
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ mir-event-logs
devgen.car
*.log
fx.dot
genesis.car


# The following files are checked into git and result
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ COPY --from=lotus-builder /opt/filecoin/eudico /usr/local/bin/

# Copy subnets genesis template
COPY --from=lotus-builder /opt/filecoin/eudico-core/genesis/genesis.json /
COPY --from=lotus-builder /opt/filecoin/eudico-core/genesis/genesis-test.json /
# Copy ipc scripts
COPY --from=lotus-builder /opt/filecoin/scripts/ipc /scripts/ipc

Expand Down
Binary file modified build/actors/ipc-actors.car
Binary file not shown.
Binary file modified build/genesis/spacenet.car
Binary file not shown.
2 changes: 1 addition & 1 deletion chain/consensus/compute_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
if membership.IsConfigMsg(DefaultGatewayAddr, m) {
r, err := vmi.ApplyImplicitMessage(ctx, m) // nolint
if err != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("running cron: %w", err)
return cid.Undef, cid.Undef, xerrors.Errorf("applying Mir config message: %w", err)
}

if em != nil {
Expand Down
127 changes: 127 additions & 0 deletions eudico-core/genesis/genesis-test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"NetworkVersion": 18,
"Timestamp": 42,
"Accounts": [
{
"Type": "account",
"Balance": "50000000000000000000000000",
"Meta": {
"Owner": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a"
}
},
{
"Type": "account",
"Balance": "50000000000000000000000000",
"Meta": {
"Owner": "t1jlm55oqkdalh2l3akqfsaqmpjxgjd36pob34dqy"
}
},
{
"Type": "account",
"Balance": "5000000000000000000000",
"Meta": {
"Owner": "t1cp4q4lqsdhob23ysywffg2tvbmar5cshia4rweq"
}
}
],
"Miners": [
{
"ID": "t01000",
"Owner": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a",
"Worker": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a",
"PeerId": "12D3KooWGnEaQeRxwJtvBQ7bNNYSP5XyFL2TZVyuswkbAJ3MakFB",
"MarketBalance": "0",
"PowerBalance": "0",
"SectorSize": 2048,
"Sectors": [
{
"CommR": {
"/": "bagboea4b5abcbf33kvktdrl4vipsv5n2uwo3cuhagx4ldcfra4a3d3c26hxzy4b4"
},
"CommD": {
"/": "baga6ea4seaqlikortzuo455iu3ggem62veye2kpeenftkvn4isxmgrkmxlotcma"
},
"SectorID": 0,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqlikortzuo455iu3ggem62veye2kpeenftkvn4isxmgrkmxlotcma"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a",
"Provider": "t01000",
"Label": "0",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"DealClientKey": {
"Type": "bls",
"PrivateKey": "oAQEUxvkaogDLfgCR69XseQjDra0KdDHjzrW8UDl5Vs=",
"PublicKey": "mCev6PA2j+LRylUby9/80Vb/6RarZAd3PAg+LsLHSujMUUsTaDN/jzlrcEB900Qe",
"Address": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcbckyfnyxbq2vdk4bifzsiyygi3qd6cir6fxt76gyfjmroqrdhztd"
},
"CommD": {
"/": "baga6ea4seaqebwwnv3ltxshq6mvub2jtpb7ujwdae37y3i5tybnzs6plvtwo2bq"
},
"SectorID": 1,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqebwwnv3ltxshq6mvub2jtpb7ujwdae37y3i5tybnzs6plvtwo2bq"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a",
"Provider": "t01000",
"Label": "1",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"DealClientKey": {
"Type": "bls",
"PrivateKey": "oAQEUxvkaogDLfgCR69XseQjDra0KdDHjzrW8UDl5Vs=",
"PublicKey": "mCev6PA2j+LRylUby9/80Vb/6RarZAd3PAg+LsLHSujMUUsTaDN/jzlrcEB900Qe",
"Address": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a"
},
"ProofType": 5
}
]
}
],
"NetworkName": "localnet-059bb756-cde4-41ca-a3f8-3576866c469f",
"VerifregRootKey": {
"Type": "multisig",
"Balance": "0",
"Meta": {
"Signers": [
"t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy"
],
"Threshold": 1,
"VestingDuration": 0,
"VestingStart": 0
}
},
"RemainderAccount": {
"Type": "multisig",
"Balance": "0",
"Meta": {
"Signers": [
"t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy"
],
"Threshold": 1,
"VestingDuration": 0,
"VestingStart": 0
}
}
}
7 changes: 0 additions & 7 deletions eudico-core/genesis/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
"Meta": {
"Owner": "t1jlm55oqkdalh2l3akqfsaqmpjxgjd36pob34dqy"
}
},
{
"Type": "account",
"Balance": "5000000000000000000000",
"Meta": {
"Owner": "t1cp4q4lqsdhob23ysywffg2tvbmar5cshia4rweq"
}
}
],
"Miners": [
Expand Down
7 changes: 6 additions & 1 deletion scripts/ipc/src/subnet-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ echo '
' > $LOTUS_PATH/config.toml

echo "[*] Generate genesis for subnet deterministically"
eudico genesis new --subnet-id=$SUBNETID --template=/genesis.json --out=subnet.car
if [[ "$SUBNETID" == "/root" ]]; then
eudico genesis new --subnet-id=$SUBNETID --template=/genesis-test.json --out=subnet.car
else
eudico genesis new --subnet-id=$SUBNETID --template=/genesis.json --out=subnet.car
fi

echo "[*] Starting daemon"
eudico mir daemon --genesis=subnet.car --bootstrap=false
2 changes: 1 addition & 1 deletion scripts/mir/daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ rm -rf $LOTUS_PATH
# rm ./scripts/mir/devgen.car
# ./eudico mir daemon --eudico-make-genesis=./scripts/mir/devgen.car --genesis-template=./scripts/mir/localnet.json --bootstrap=false --api=123$INDEX
# else
./eudico mir daemon --genesis=./build/genesis/spacenet.car --bootstrap=false --api=123$INDEX
./eudico mir daemon --genesis=./scripts/mir/genesis.car --bootstrap=false --api=123$INDEX
# fi
Binary file added scripts/mir/genesis.car
Binary file not shown.
7 changes: 7 additions & 0 deletions scripts/spacenet-genesis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
echo "[*] Re-compiling"
make spacenet
echo "[*] Generating spacenet genesis"
./eudico genesis new --template=./eudico-core/genesis/genesis.json --out=./build/genesis/spacenet.car
echo "[*] Generating test genesis"
./eudico genesis new --template=./eudico-core/genesis/genesis-test.json --out=./scripts/mir/genesis.car

0 comments on commit 4bf581b

Please sign in to comment.