Skip to content

Instantly share code, notes, and snippets.

View Wondertan's full-sized avatar

Hlib Kanunnikov Wondertan

View GitHub Profile
@Wondertan
Wondertan / concord.go
Last active May 6, 2023 20:56
Interfaces for heterogenous consensus algorigthms over p2p network.
// ProposalData is arbitrary data that Proposers agree on.
//
// Alternative names: consensus.Data, Contract, or can remove alias altogether.
type ProposalData = []byte
// ValidatorFunc validates the ProposalData and reports back to the Concord
// Q: Verify vs Validate? Quick googling suggests that Validate suits better, but might be wrong.
type ValidatorFunc func(context.Context, ProposalData) (bool, error)
// ProposeFunc builds ProposalData.

0x0d1aa45cebe24fccf683bc160329db30f7544e30e79712edeb75b4e4c5472a65

@Wondertan
Wondertan / pledge.service
Created June 11, 2021 12:41
Lotus Miner Auto Pledging Service
# /etc/systemd/system/pledge.service
[Unit]
Description=Lotus Miner Auto Pledging Service
Wants=lotus-miner.service
[Service]
User=lotus # or any other user
Type=oneshot
ExecStart=lotus-miner sectors pledge
Environment=LOTUS_MINER_PATH=/lotus/miner-repo # set miner repository accordingly to your setup
@Wondertan
Wondertan / pledge.timer
Last active June 11, 2021 12:44
Lotus Miner Auto Pledge `systemd` Timer
# /etc/systemd/system/pledge.timer
[Unit]
Description=Lotus Miner Auto Pledging Timer
[Timer]
OnUnitActiveSec=21min # Set the time that suits you harwdare the best.
# NOTE: You should also have enought funds for that, as pledging takes FILs for every produced sectors
# It requires having `pledge.service` in the same folder
# To start timer, manually fire `systemctl start pledge`
@Wondertan
Wondertan / lotus-worker-c2.service
Created June 11, 2021 12:36
Lotus C2 Worker `systemd` service.
# /etc/systemd/system/lotus-worker-c2.service
[Unit]
Description=Lotus C2 Worker Service
After=network.target
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus-worker run --no-local-storage --addpiece=false --precommit1=false --unseal=false --precommit2=false --commit=true --parallel-fetch-limit 10 --listen 192.168.88.105:3458
Restart=always
RestartSec=10
@Wondertan
Wondertan / lotus-worker-pc2.service
Last active January 1, 2022 01:17
Lotus Worker PC2 `systemd` Service
# /etc/systemd/system/lotus-worker-pc2.service
[Unit]
Description=Lotus PC2 Worker Service
After=network.target
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus-worker run --no-local-storage --addpiece=false --precommit1=false --unseal=false --precommit2=true --commit=false --parallel-fetch-limit 10 --listen 192.168.88.102:3456
Restart=always
RestartSec=10
@Wondertan
Wondertan / lotus-worker-pc1.service
Last active January 1, 2022 01:17
Lotus PC1 Worker `systemd` service.
# /etc/systemd/system/lotus-worker-pc1.service
[Unit]
Description=Lotus PC1 Worker Service
After=network.target
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus-worker run --no-local-storage --addpiece=false --precommit1=true --unseal=true --precommit2=false --commit=false --parallel-fetch-limit 10 --listen 192.168.88.106:3456
Restart=always
RestartSec=10
@Wondertan
Wondertan / lotus-miner.service
Last active January 1, 2022 01:17
Lotus Miner `systemd` Service
# /etc/systemd/system/lotus-miner.service
[Unit]
Description=Lotus Miner Service
After=network.target
After=lotus-daemon.service
Wants=lotus-daemon.service
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus-miner run
@Wondertan
Wondertan / lotus-daemon.service
Last active January 1, 2022 01:18
Lotus Daemon `systemd` Service
# /etc/systemd/system/lotus-daemin.service
[Unit]
Description=Lotus Daemon Service
After=network-online.target
Requires=network-online.target
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus daemon
ExecStop=/usr/local/bin/lotus daemon stop

Keybase proof

I hereby claim:

  • I am wondertan on github.
  • I am wondertan (https://keybase.io/wondertan) on keybase.
  • I have a public key ASDHMMeXSi1Iflwi1HUMLFSAu89CPBXsTldO-9tfbdT3SQo

To claim this, I am signing this object: