Skip to content

Commit

Permalink
Del file (#206)
Browse files Browse the repository at this point in the history
* update delete file and tee extrinsic

* update Audit

* update balance

* update treasury

* update filebank

* update cfg

* update oss

* update storage handler

* update sminer

* update staking

* update TeeWorker

* update chain, rpc_call

* update tee,treasury

* update sign

* update file

* update sdk

* update extrinsic_name

* update sdk
  • Loading branch information
AstaFrode authored May 12, 2024
1 parent d49e89a commit 47f9e5d
Show file tree
Hide file tree
Showing 46 changed files with 6,871 additions and 6,021 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ If you find any system errors or you have better suggestions, please submit an i
wss://testnet-rpc0.cess.cloud/ws/
wss://testnet-rpc1.cess.cloud/ws/
wss://testnet-rpc2.cess.cloud/ws/
wss://testnet-rpc3.cess.cloud/ws/
```
**CESS test network bootstrap node**
```
_dnsaddr.boot-bucket-testnet.cess.cloud
_dnsaddr.boot-miner-testnet.cess.cloud
```

## 🚰 CESS test network faucet
Expand All @@ -38,19 +39,16 @@ https://testnet-faucet.cess.cloud/
To get the package use the standard:

```sh
go get -u "github.com/CESSProject/cess-go-sdk"
go get "github.com/CESSProject/cess-go-sdk"
```

## ✅ Testing

To run test:

1. Run a [CESS node](https://github.com/CESSProject/cess) locally.
2. Run the command

```sh
go test -v
```
```sh
make check
```

## 📖 Document

Expand Down
54 changes: 54 additions & 0 deletions cfg.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
Copyright (C) CESS. All rights reserved.
Copyright (C) Cumulus Encrypted Storage System. All rights reserved.
SPDX-License-Identifier: Apache-2.0
*/

package sdkgo

import (
"context"
"time"

"github.com/CESSProject/cess-go-sdk/chain"
"github.com/CESSProject/cess-go-sdk/config"
)

// Config describes a set of settings for a client
type Config struct {
Rpc []string
Mnemonic string
Name string
Timeout time.Duration
}

// Option is a client config option that can be given to the client constructor
type Option func(cfg *Config) error

// // Option is a client config option that can be given to the client constructor
// type Option func(cfg *Config) error

// NewSDK constructs a new client from the Config.
//
// This function consumes the config. Do not reuse it (really!).
func (cfg *Config) NewSDK(ctx context.Context) (*chain.ChainClient, error) {
if cfg.Name == "" {
cfg.Name = config.CharacterName_Default
}
return chain.NewChainClient(ctx, cfg.Name, cfg.Rpc, cfg.Mnemonic, cfg.Timeout)
}

// Apply applies the given options to the config, returning the first error
// encountered (if any).
func (cfg *Config) Apply(opts ...Option) error {
for _, opt := range opts {
if opt == nil {
continue
}
if err := opt(cfg); err != nil {
return err
}
}
return nil
}
Loading

0 comments on commit 47f9e5d

Please sign in to comment.