Merge branch 'master' into libp2p-pubsub-tracer
This commit is contained in:
@@ -20,7 +20,8 @@ ListenAddresses = ["/ip4/0.0.0.0/tcp/5678", "/ip6/::/tcp/5678"]
|
||||
# IpfsOnlineMode = false
|
||||
# IpfsMAddr = ""
|
||||
# IpfsUseForRetrieval = false
|
||||
# SimultaneousTransfers = 20
|
||||
# SimultaneousTransfersForStorage = 20
|
||||
# SimultaneousTransfersForRetrieval = 20
|
||||
#
|
||||
[Metrics]
|
||||
# Nickname = ""
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script sets up an initial configuraiton for the lotus daemon and miner
|
||||
# It will only run once.
|
||||
|
||||
GATE="$LOTUS_PATH"/date_initialized
|
||||
|
||||
# Don't init if already initialized.
|
||||
if [ -f "$GATE" ]; then
|
||||
echo lotus already initialized.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Not importing snapshot on nerpanet
|
||||
#
|
||||
# echo importing minimal snapshot
|
||||
# lotus daemon --import-snapshot https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car --halt-after-import
|
||||
|
||||
# Block future inits
|
||||
date > "$GATE"
|
||||
@@ -267,7 +267,11 @@ func RecordTipsetStatePoints(ctx context.Context, api v0api.FullNode, pl *PointL
|
||||
return err
|
||||
}
|
||||
|
||||
p = NewPoint("chain.power", totalPower.TotalPower.QualityAdjPower.Int64())
|
||||
// We divide the power into gibibytes because 2^63 bytes is 8 exbibytes which is smaller than the Filecoin Mainnet.
|
||||
// Dividing by a gibibyte gives us more room to work with. This will allow the dashboard to report network and miner
|
||||
// sizes up to 8192 yobibytes.
|
||||
gibi := types.NewInt(1024 * 1024 * 1024)
|
||||
p = NewPoint("chain.power", types.BigDiv(totalPower.TotalPower.QualityAdjPower, gibi).Int64())
|
||||
pl.AddPoint(p)
|
||||
|
||||
powerActor, err := api.StateGetActor(ctx, power.Address, tipset.Key())
|
||||
@@ -281,11 +285,12 @@ func RecordTipsetStatePoints(ctx context.Context, api v0api.FullNode, pl *PointL
|
||||
}
|
||||
|
||||
return powerActorState.ForEachClaim(func(addr address.Address, claim power.Claim) error {
|
||||
if claim.QualityAdjPower.Int64() == 0 {
|
||||
// BigCmp returns 0 if values are equal
|
||||
if types.BigCmp(claim.QualityAdjPower, types.NewInt(0)) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
p = NewPoint("chain.miner_power", claim.QualityAdjPower.Int64())
|
||||
p = NewPoint("chain.miner_power", types.BigDiv(claim.QualityAdjPower, gibi).Int64())
|
||||
p.AddTag("miner", addr.String())
|
||||
pl.AddPoint(p)
|
||||
|
||||
|
||||
+4
-1
@@ -139,7 +139,10 @@ func GetTips(ctx context.Context, api v0api.FullNode, lastHeight abi.ChainEpoch,
|
||||
|
||||
for {
|
||||
select {
|
||||
case changes := <-notif:
|
||||
case changes, ok := <-notif:
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
for _, change := range changes {
|
||||
log.Infow("Head event", "height", change.Val.Height(), "type", change.Type)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user