Compare commits

...
Author SHA1 Message Date
Łukasz Magiera c459a13dca Merge pull request #2593 from mgoelzer/paych_get_parse_as_fil
Parse amount as FIL in paych get
2020-07-25 09:54:54 +02:00
Mike Goelzer b409c8f2be Parse amount as FIL in paych get 2020-07-25 01:54:21 +00:00
Whyrusleeping f69cce4089 Merge pull request #2576 from filecoin-project/fix/testnet-compat
pull in specs actors fix for testnet
2020-07-24 13:17:41 -07:00
whyrusleeping cda0326cc3 go mod tidy 2020-07-24 13:09:19 -07:00
whyrusleeping 3bdcae9a59 dont update go-fil-commcid 2020-07-24 12:41:23 -07:00
whyrusleeping 1163d36b02 hardcode legacy multihash types for backward compat 2020-07-24 12:33:04 -07:00
whyrusleeping d764d86e89 pull in specs actors fix for testnet 2020-07-24 11:36:19 -07:00
Łukasz Magiera 3921623861 Merge pull request #2506 from filecoin-project/asr/null-tipset
API documentation must not tell lies
2020-07-23 22:07:36 +02:00
Łukasz Magiera 22c684deb6 Merge pull request #2534 from filecoin-project/asr/getsize
Implement buffered blocktore GetSize()
2020-07-23 10:59:28 +02:00
Łukasz Magiera df801470ca Return size in bufbs.GetSize 2020-07-23 10:23:44 +02:00
Łukasz Magiera 01685c44e4 Merge pull request #2543 from filecoin-project/asr/readme
update devnet in readme
2020-07-23 10:10:17 +02:00
Aayush Rajasekaran 2c895e8df2 update devnet in readme 2020-07-22 23:34:26 -04:00
Aayush Rajasekaran 54c0ae17f4 Implement buffered blocktore GetSize() 2020-07-22 19:58:35 -04:00
Aayush Rajasekaran d254fb228b API documentation must not tell lies 2020-07-21 13:44:05 -04:00
Łukasz Magiera 9b1d2f4c13 Merge pull request #2462 from jsign/jsign/ipfsbstore
ipfsbstore: offlinemode, and Has() fix
2020-07-18 01:52:37 +02:00
Ignacio Hagopian fd2262f51f ipbsbstore: offlinemode, and Has() fix
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2020-07-17 18:02:12 -03:00
7 changed files with 36 additions and 14 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ All work is tracked via issues. An attempt at keeping an up-to-date view on rema
The main branches under development at the moment are:
* [`master`](https://github.com/filecoin-project/lotus): current testnet.
* [`next`](https://github.com/filecoin-project/lotus/tree/next): working branch with chain-breaking changes.
* [`interopnet`](https://github.com/filecoin-project/lotus/tree/interopnet): devnet running one of `next` commits.
* [`ntwk-calibration`](https://github.com/filecoin-project/lotus/tree/ntwk-calibration): devnet running one of `next` commits.
## License
+1 -1
View File
@@ -57,7 +57,7 @@ type FullNode interface {
ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]Message, error)
// ChainGetTipSetByHeight looks back for a tipset at the specified epoch.
// If there are no blocks at the specified epoch, a tipset at higher epoch
// If there are no blocks at the specified epoch, a tipset at an earlier epoch
// will be returned.
ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)
+4 -4
View File
@@ -29,7 +29,7 @@ var paychGetCmd = &cli.Command{
ArgsUsage: "[fromAddress toAddress amount]",
Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 3 {
return fmt.Errorf("must pass three arguments: <from> <to> <available funds>")
return fmt.Errorf("must pass three arguments: <from> <to> <available funds in FIL>")
}
from, err := address.NewFromString(cctx.Args().Get(0))
@@ -42,9 +42,9 @@ var paychGetCmd = &cli.Command{
return fmt.Errorf("failed to parse to address: %s", err)
}
amt, err := types.BigFromString(cctx.Args().Get(2))
amt, err := types.ParseFIL(cctx.Args().Get(2))
if err != nil {
return fmt.Errorf("parsing amount failed: %s", err)
return fmt.Errorf("parsing amount as whole FIL failed: %s", err)
}
api, closer, err := GetFullNodeAPI(cctx)
@@ -55,7 +55,7 @@ var paychGetCmd = &cli.Command{
ctx := ReqContext(cctx)
info, err := api.PaychGet(ctx, from, to, amt)
info, err := api.PaychGet(ctx, from, to, types.BigInt(amt))
if err != nil {
return err
}
+2 -2
View File
@@ -31,7 +31,7 @@ require (
github.com/filecoin-project/go-statestore v0.1.0
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b
github.com/filecoin-project/sector-storage v0.0.0-20200630180318-4c1968f62a8f
github.com/filecoin-project/specs-actors v0.6.2-0.20200702170846-2cd72643a5cf
github.com/filecoin-project/specs-actors v0.6.2-0.20200724193152-534b25bdca30
github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea
github.com/filecoin-project/storage-fsm v0.0.0-20200625160832-379a4655b044
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1
@@ -102,7 +102,7 @@ require (
github.com/multiformats/go-multiaddr-dns v0.2.0
github.com/multiformats/go-multiaddr-net v0.1.5
github.com/multiformats/go-multibase v0.0.3
github.com/multiformats/go-multihash v0.0.13
github.com/multiformats/go-multihash v0.0.14
github.com/opentracing/opentracing-go v1.1.0
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.6.1
+4 -2
View File
@@ -262,8 +262,8 @@ github.com/filecoin-project/specs-actors v0.0.0-20200210130641-2d1fbd8672cf/go.m
github.com/filecoin-project/specs-actors v0.3.0/go.mod h1:nQYnFbQ7Y0bHZyq6HDEuVlCPR+U3z5Q3wMOQ+2aiV+Y=
github.com/filecoin-project/specs-actors v0.6.0/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY=
github.com/filecoin-project/specs-actors v0.6.1/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY=
github.com/filecoin-project/specs-actors v0.6.2-0.20200702170846-2cd72643a5cf h1:2ERozAZteHYef3tVLVJRepzYieLtJdxvfXNUel19CeU=
github.com/filecoin-project/specs-actors v0.6.2-0.20200702170846-2cd72643a5cf/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY=
github.com/filecoin-project/specs-actors v0.6.2-0.20200724193152-534b25bdca30 h1:7wH0V1OhS5gkjlJF/PvwS6MuS1oeVqCJlNECgf9eabw=
github.com/filecoin-project/specs-actors v0.6.2-0.20200724193152-534b25bdca30/go.mod h1:ppIYDlWQvcfzDW0zxar53Z1Ag69er4BmFvJAtV1uDMI=
github.com/filecoin-project/specs-storage v0.1.0 h1:PkDgTOT5W5Ao7752onjDl4QSv+sgOVdJbvFjOnD5w94=
github.com/filecoin-project/specs-storage v0.1.0/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k=
github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea h1:iixjULRQFPn7Q9KlIqfwLJnlAXO10bbkI+xy5GKGdLY=
@@ -1100,6 +1100,8 @@ github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa
github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew=
github.com/multiformats/go-multihash v0.0.13 h1:06x+mk/zj1FoMsgNejLpy6QTvJqlSt/BhLEy87zidlc=
github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc=
github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I=
github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc=
github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg=
github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg=
github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg=
+6 -1
View File
@@ -104,7 +104,12 @@ func (bs *BufferedBS) Get(c cid.Cid) (block.Block, error) {
}
func (bs *BufferedBS) GetSize(c cid.Cid) (int, error) {
panic("nyi")
s, err := bs.read.GetSize(c)
if err == bstore.ErrNotFound || s == 0 {
return bs.write.GetSize(c)
}
return s, err
}
func (bs *BufferedBS) Put(blk block.Block) error {
+18 -3
View File
@@ -25,10 +25,14 @@ type IpfsBstore struct {
}
func NewIpfsBstore(ctx context.Context) (*IpfsBstore, error) {
api, err := httpapi.NewLocalApi()
localApi, err := httpapi.NewLocalApi()
if err != nil {
return nil, xerrors.Errorf("getting local ipfs api: %w", err)
}
api, err := localApi.WithOptions(options.Api.Offline(true))
if err != nil {
return nil, xerrors.Errorf("setting offline mode: %s", err)
}
return &IpfsBstore{
ctx: ctx,
@@ -37,9 +41,13 @@ func NewIpfsBstore(ctx context.Context) (*IpfsBstore, error) {
}
func NewRemoteIpfsBstore(ctx context.Context, maddr multiaddr.Multiaddr) (*IpfsBstore, error) {
api, err := httpapi.NewApi(maddr)
httpApi, err := httpapi.NewApi(maddr)
if err != nil {
return nil, xerrors.Errorf("getting remote ipfs api: %w", err)
return nil, xerrors.Errorf("setting remote ipfs api: %w", err)
}
api, err := httpApi.WithOptions(options.Api.Offline(true))
if err != nil {
return nil, xerrors.Errorf("applying offline mode: %s", err)
}
return &IpfsBstore{
@@ -55,6 +63,13 @@ func (i *IpfsBstore) DeleteBlock(cid cid.Cid) error {
func (i *IpfsBstore) Has(cid cid.Cid) (bool, error) {
_, err := i.api.Block().Stat(i.ctx, path.IpldPath(cid))
if err != nil {
// The underlying client is running in Offline mode.
// Stat() will fail with an err if the block isn't in the
// blockstore. If that's the case, return false without
// an error since that's the original intention of this method.
if err.Error() == "blockservice: key not found" {
return false, nil
}
return false, xerrors.Errorf("getting ipfs block: %w", err)
}