forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* op-node: use openrpc to get blobs * op-batcher: use openrpc to submit blobs * op-celestia-: use openrpc to fetch blobs * da: update rpc port * docker: update rpc port * readme: devnet - rm unused port * docker: devnet - restore platform
- Loading branch information
Showing
14 changed files
with
1,584 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
package rollup | ||
|
||
import ( | ||
"context" | ||
"encoding/hex" | ||
"time" | ||
|
||
"github.com/celestiaorg/go-cnc" | ||
openrpc "github.com/rollkit/celestia-openrpc" | ||
openrpcns "github.com/rollkit/celestia-openrpc/types/namespace" | ||
"github.com/rollkit/celestia-openrpc/types/share" | ||
) | ||
|
||
type DAConfig struct { | ||
Rpc string | ||
Namespace cnc.Namespace | ||
Client *cnc.Client | ||
Namespace openrpcns.Namespace | ||
Client *openrpc.Client | ||
AuthToken string | ||
} | ||
|
||
func NewDAConfig(rpc string, ns string) (*DAConfig, error) { | ||
func NewDAConfig(rpc, token, ns string) (*DAConfig, error) { | ||
nsBytes, err := hex.DecodeString(ns) | ||
if err != nil { | ||
return &DAConfig{}, err | ||
} | ||
|
||
namespace := cnc.MustNewV0(nsBytes) | ||
namespace, err := share.NewBlobNamespaceV0(nsBytes) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
daClient, err := cnc.NewClient(rpc, cnc.WithTimeout(30*time.Second)) | ||
client, err := openrpc.NewClient(context.Background(), rpc, token) | ||
if err != nil { | ||
return &DAConfig{}, err | ||
} | ||
|
||
return &DAConfig{ | ||
Namespace: namespace, | ||
Namespace: namespace.ToAppNamespace(), | ||
Rpc: rpc, | ||
Client: daClient, | ||
Client: client, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters