diff --git a/app/data/compose/docker-compose-fixturenet-lotus.yml b/app/data/compose/docker-compose-fixturenet-lotus.yml index 3727c8e2..79fa9ed6 100644 --- a/app/data/compose/docker-compose-fixturenet-lotus.yml +++ b/app/data/compose/docker-compose-fixturenet-lotus.yml @@ -8,8 +8,6 @@ services: image: cerc/lotus:local volumes: - ../config/fixturenet-lotus/setup-miner.sh:/docker-entrypoint-scripts.d/setup-miner.sh - - ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car - - $HOME/stack-orchestrator/app/data/config/fixturenet-lotus/genesis/.genesis-sectors:/root/.genesis-sectors - lotus-shared:/root/.lotus-shared entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-miner.sh"] ports: @@ -25,7 +23,6 @@ services: image: cerc/lotus:local volumes: - ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh - - ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car - lotus-shared:/root/.lotus-shared depends_on: - lotus-miner @@ -43,7 +40,6 @@ services: image: cerc/lotus:local volumes: - ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh - - ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car - lotus-shared:/root/.lotus-shared depends_on: - lotus-miner diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/p_aux b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/p_aux deleted file mode 100644 index 81030cb4..00000000 --- a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/p_aux +++ /dev/null @@ -1 +0,0 @@ -}+V{iй\kq  ?Af~쩙Ltbyqč?aӚJ \ No newline at end of file diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/sc-02-data-tree-r-last.dat b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/sc-02-data-tree-r-last.dat deleted file mode 100644 index 5af05cae..00000000 --- a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/sc-02-data-tree-r-last.dat +++ /dev/null @@ -1 +0,0 @@ -f~쩙Ltbyqč?aӚJ \ No newline at end of file diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/t_aux b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/t_aux deleted file mode 100644 index 09302363..00000000 Binary files a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-0/t_aux and /dev/null differ diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/p_aux b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/p_aux deleted file mode 100644 index 5ed0bcb8..00000000 Binary files a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/p_aux and /dev/null differ diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/sc-02-data-tree-r-last.dat b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/sc-02-data-tree-r-last.dat deleted file mode 100644 index 6165cf10..00000000 Binary files a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/sc-02-data-tree-r-last.dat and /dev/null differ diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/t_aux b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/t_aux deleted file mode 100644 index 1a9f9afc..00000000 Binary files a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/cache/s-t01000-1/t_aux and /dev/null differ diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/pre-seal-t01000.json b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/pre-seal-t01000.json deleted file mode 100644 index 3a05d4b1..00000000 --- a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/pre-seal-t01000.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "t01000": { - "ID": "t01000", - "Owner": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "Worker": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "PeerId": "12D3KooWG5q6pWJVdPBhDBv9AjWVbUh4xxTAZ7xvgZSjczWuD2Z9", - "MarketBalance": "0", - "PowerBalance": "0", - "SectorSize": 2048, - "Sectors": [ - { - "CommR": { - "/": "bagboea4b5abcboxypcewlkmrat2myu4vthk3ii2pcomak7nhqmdbb6sxlolp2wdf" - }, - "CommD": { - "/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq" - }, - "SectorID": 0, - "Deal": { - "PieceCID": { - "/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq" - }, - "PieceSize": 2048, - "VerifiedDeal": false, - "Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "Provider": "t01000", - "Label": "0", - "StartEpoch": 0, - "EndEpoch": 9001, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "DealClientKey": { - "Type": "bls", - "PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4=" - }, - "ProofType": 5 - }, - { - "CommR": { - "/": "bagboea4b5abcb6krzypqcczhcnbeyjcqkeo6omfergm336o3kitugh3jgjog2yqq" - }, - "CommD": { - "/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii" - }, - "SectorID": 1, - "Deal": { - "PieceCID": { - "/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii" - }, - "PieceSize": 2048, - "VerifiedDeal": false, - "Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "Provider": "t01000", - "Label": "1", - "StartEpoch": 0, - "EndEpoch": 9001, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "DealClientKey": { - "Type": "bls", - "PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4=" - }, - "ProofType": 5 - } - ] - } -} \ No newline at end of file diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/pre-seal-t01000.key b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/pre-seal-t01000.key deleted file mode 100644 index 53e58628..00000000 --- a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/pre-seal-t01000.key +++ /dev/null @@ -1 +0,0 @@ -7b2254797065223a22626c73222c22507269766174654b6579223a227446765352695367324733537367673050535979323358796a61494d5870736d64794732423755464c54343d227d \ No newline at end of file diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sealed/s-t01000-0 b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sealed/s-t01000-0 deleted file mode 100644 index 56a0f872..00000000 Binary files a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sealed/s-t01000-0 and /dev/null differ diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sealed/s-t01000-1 b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sealed/s-t01000-1 deleted file mode 100644 index dc3afe0f..00000000 Binary files a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sealed/s-t01000-1 and /dev/null differ diff --git a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sectorstore.json b/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sectorstore.json deleted file mode 100644 index a49be73f..00000000 --- a/app/data/config/fixturenet-lotus/genesis/.genesis-sectors/sectorstore.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "ID": "f355523e-69d0-4984-bd0e-9588487c6231", - "Weight": 0, - "CanSeal": false, - "CanStore": false, - "MaxStorage": 0, - "Groups": null, - "AllowTo": null, - "AllowTypes": null, - "DenyTypes": null -} \ No newline at end of file diff --git a/app/data/config/fixturenet-lotus/genesis/devgen.car b/app/data/config/fixturenet-lotus/genesis/devgen.car deleted file mode 100644 index a22eaed4..00000000 Binary files a/app/data/config/fixturenet-lotus/genesis/devgen.car and /dev/null differ diff --git a/app/data/config/fixturenet-lotus/genesis/localnet.json b/app/data/config/fixturenet-lotus/genesis/localnet.json deleted file mode 100644 index 06d3123e..00000000 --- a/app/data/config/fixturenet-lotus/genesis/localnet.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "NetworkVersion": 18, - "Accounts": [ - { - "Type": "account", - "Balance": "50000000000000000000000000", - "Meta": { - "Owner": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q" - } - } - ], - "Miners": [ - { - "ID": "t01000", - "Owner": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "Worker": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "PeerId": "12D3KooWG5q6pWJVdPBhDBv9AjWVbUh4xxTAZ7xvgZSjczWuD2Z9", - "MarketBalance": "0", - "PowerBalance": "0", - "SectorSize": 2048, - "Sectors": [ - { - "CommR": { - "/": "bagboea4b5abcboxypcewlkmrat2myu4vthk3ii2pcomak7nhqmdbb6sxlolp2wdf" - }, - "CommD": { - "/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq" - }, - "SectorID": 0, - "Deal": { - "PieceCID": { - "/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq" - }, - "PieceSize": 2048, - "VerifiedDeal": false, - "Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "Provider": "t01000", - "Label": "0", - "StartEpoch": 0, - "EndEpoch": 9001, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "DealClientKey": { - "Type": "bls", - "PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4=" - }, - "ProofType": 5 - }, - { - "CommR": { - "/": "bagboea4b5abcb6krzypqcczhcnbeyjcqkeo6omfergm336o3kitugh3jgjog2yqq" - }, - "CommD": { - "/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii" - }, - "SectorID": 1, - "Deal": { - "PieceCID": { - "/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii" - }, - "PieceSize": 2048, - "VerifiedDeal": false, - "Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q", - "Provider": "t01000", - "Label": "1", - "StartEpoch": 0, - "EndEpoch": 9001, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "DealClientKey": { - "Type": "bls", - "PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4=" - }, - "ProofType": 5 - } - ] - } - ], - "NetworkName": "localnet-6d52dae5-ff29-4bac-a45d-f84e6c07564c", - "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 - } - } -} \ No newline at end of file diff --git a/app/data/config/fixturenet-lotus/lotus-env.env b/app/data/config/fixturenet-lotus/lotus-env.env index 582b8944..a0b20888 100644 --- a/app/data/config/fixturenet-lotus/lotus-env.env +++ b/app/data/config/fixturenet-lotus/lotus-env.env @@ -1,5 +1,5 @@ -LOTUS_PATH=~/.lotus-local-net -LOTUS_MINER_PATH=~/.lotus-miner-local-net +LOTUS_PATH=$HOME/.lotus-local-net +LOTUS_MINER_PATH=$HOME/.lotus-miner-local-net LOTUS_SKIP_GENESIS_CHECK=_yes_ CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" CGO_CFLAGS="-D__BLST_PORTABLE__" diff --git a/app/data/config/fixturenet-lotus/setup-miner.sh b/app/data/config/fixturenet-lotus/setup-miner.sh index e0e362f3..236b37c9 100644 --- a/app/data/config/fixturenet-lotus/setup-miner.sh +++ b/app/data/config/fixturenet-lotus/setup-miner.sh @@ -7,17 +7,13 @@ if [ -f /root/.lotus-shared/miner.addr ]; then rm /root/.lotus-shared/miner.addr fi - -##TODO: generate genesis files inside container instead of bundling in config dir -##something like commands below should work, other scripts/compose will have to be updated to corresponding directories -# lotus fetch-params 2048 -# lotus-seed pre-seal --sector-size 2KiB --num-sectors 2 -# lotus-seed genesis new localnet.json -# lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json - +lotus fetch-params 2048 +lotus-seed pre-seal --sector-size 2KiB --num-sectors 2 +lotus-seed genesis new localnet.json +lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json # start daemon -nohup lotus daemon --genesis=/devgen.car --profile=bootstrapper --bootstrap=false > /var/log/lotus.log 2>&1 & +nohup lotus daemon --lotus-make-genesis=devgen.car --profile=bootstrapper --genesis-template=localnet.json --bootstrap=false > /var/log/lotus.log 2>&1 & # Loop until the daemon is started echo "Waiting for daemon to start..." @@ -26,11 +22,14 @@ while ! grep -q "started ChainNotify channel" /var/log/lotus.log ; do done echo "Daemon started." +# copy genesis file to shared volume +cp /devgen.car /root/.lotus-shared + # publish bootnode peer info to shared volume lotus net listen | awk 'NR==1{print}' > /root/.lotus-shared/miner.addr # if miner not already initialized -if [ ! -d /root/.lotus-miner-local-net ]; then +if [ ! -d $LOTUS_MINER_PATH ]; then # initialize miner lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync diff --git a/app/data/config/fixturenet-lotus/setup-node.sh b/app/data/config/fixturenet-lotus/setup-node.sh index 2abf8f1b..98862081 100644 --- a/app/data/config/fixturenet-lotus/setup-node.sh +++ b/app/data/config/fixturenet-lotus/setup-node.sh @@ -2,8 +2,6 @@ lotus --version -##TODO: paths can use values from lotus-env.env file - # Loop until the daemon is started echo "Waiting for miner to share peering info..." while [ ! -f /root/.lotus-shared/miner.addr ]; do @@ -12,20 +10,20 @@ done echo "Resuming..." # if not already initialized -if [ ! -f /root/.lotus-local-net/config.toml ]; then +if [ ! -f $LOTUS_PATH/config.toml ]; then # init node config - mkdir $HOME/.lotus-local-net - lotus config default > $HOME/.lotus-local-net/config.toml + mkdir $LOTUS_PATH + lotus config default > $LOTUS_PATH/config.toml # add bootstrap peer info if available if [ -f /root/.lotus-shared/miner.addr ]; then MINER_ADDR=\"$(cat /root/.lotus-shared/miner.addr)\" # add bootstrap peer id to config file - sed -i "/^\[Libp2p\]/a \ \ BootstrapPeers = [$MINER_ADDR]" $HOME/.lotus-local-net/config.toml + sed -i "/^\[Libp2p\]/a \ \ BootstrapPeers = [$MINER_ADDR]" $LOTUS_PATH/config.toml else echo "Bootstrap peer info not found, unable to configure. Manual peering will be required." fi fi # start node -lotus daemon --genesis=/devgen.car +lotus daemon --genesis=/root/.lotus-shared/devgen.car