edf03c9ba8
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
29 lines
581 B
Go
29 lines
581 B
Go
package genesis
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/filecoin-project/lotus/chain/types"
|
|
"github.com/filecoin-project/specs-actors/actors/builtin"
|
|
"github.com/filecoin-project/specs-actors/actors/util/adt"
|
|
bstore "github.com/ipfs/go-ipfs-blockstore"
|
|
cbor "github.com/ipfs/go-ipld-cbor"
|
|
)
|
|
|
|
func SetupSystemActor(bs bstore.Blockstore) (*types.Actor, error) {
|
|
|
|
cst := cbor.NewCborStore(bs)
|
|
|
|
statecid, err := cst.Put(context.TODO(), adt.Empty)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
act := &types.Actor{
|
|
Code: builtin.SystemActorCodeID,
|
|
Head: statecid,
|
|
}
|
|
|
|
return act, nil
|
|
}
|