Skip to content

[#2] Rename internals #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 0 additions & 129 deletions .github/logo.svg

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ temp
test.sh
testfile
.blast.yml
.neofs-cli.yml
.frostfs-cli.yml

.cache

Expand Down
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<p align="center">
<img src="./.github/logo.svg" width="500px" alt="FrostFS">
</p>
<p align="center">
<a href="https://frostfs.info">FrostFS</a> is a decentralized distributed object storage integrated with the <a href="https://neo.org">NEO Blockchain</a>.
</p>
Expand Down Expand Up @@ -52,7 +49,7 @@ FrostFS nodes with weighted load balancing).

If you launch HTTP gateway in bundle with [frostfs-dev-env](https://github.com/TrueCloudLab/frostfs-dev-env),
you can get the IP address of the node in the output of `make hosts` command
(with s0*.neofs.devenv name).
(with s0*.frostfs.devenv name).

These two commands are functionally equivalent, they run the gate with one
backend node (and otherwise default settings):
Expand Down Expand Up @@ -96,7 +93,7 @@ You can provide a wallet via `--wallet` or `-w` flag. You can also specify the a
(if no address provided default one will be used). If wallet is used, you need to set `HTTP_GW_WALLET_PASSPHRASE` variable to decrypt the wallet.
If no wallet provided, the gateway autogenerates a key pair it will use for FrostFS requests.
```
$ frostfs-http-gw -p $NEOFS_NODE -w $WALLET_PATH --address $ACCOUNT_ADDRESS
$ frostfs-http-gw -p $FROSTFS_NODE -w $WALLET_PATH --address $ACCOUNT_ADDRESS
```
Example:
```
Expand Down Expand Up @@ -206,7 +203,7 @@ Steps to start using name resolving:
1. Enable NNS resolving in config (`rpc_endpoint` must be a valid neo rpc node, see [configs](./config) for other examples):

```yaml
rpc_endpoint: http://morph-chain.neofs.devenv:30333
rpc_endpoint: http://morph-chain.frostfs.devenv:30333
resolve_order:
- nns
```
Expand All @@ -216,13 +213,13 @@ you can check if your container (e.g. with `container-name` name) is registered

```shell
$ curl -s --data '{"id":1,"jsonrpc":"2.0","method":"getcontractstate","params":[1]}' \
http://morph-chain.neofs.devenv:30333 | jq -r '.result.hash'
http://morph-chain.frostfs.devenv:30333 | jq -r '.result.hash'

0x8e6c3cd4b976b28e84a3788f6ea9e2676c15d667

$ docker exec -it morph_chain neo-go \
contract testinvokefunction \
-r http://morph-chain.neofs.devenv:30333 0x8e6c3cd4b976b28e84a3788f6ea9e2676c15d667 \
-r http://morph-chain.frostfs.devenv:30333 0x8e6c3cd4b976b28e84a3788f6ea9e2676c15d667 \
resolve string:container-name.container int:16 \
| jq -r '.stack[0].value | if type=="array" then .[0].value else . end' \
| base64 -d && echo
Expand All @@ -240,7 +237,7 @@ $ curl http://localhost:8082/get_by_attribute/container-name/FileName/object-nam

You can create a container via [frostfs-cli](https://github.com/TrueCloudLab/frostfs-node/releases):
```
$ frostfs-cli -r $NEOFS_NODE -w $WALLET container create --policy $POLICY --basic-acl $ACL
$ frostfs-cli -r $FROSTFS_NODE -w $WALLET container create --policy $POLICY --basic-acl $ACL
```
where `$WALLET` is a path to user wallet,
`$ACL` -- hex encoded basic ACL value or keywords 'private, 'public-read', 'public-read-write' and
Expand All @@ -259,7 +256,7 @@ the file `wallets/wallet.key`.

To create a file via [frostfs-cli](https://github.com/TrueCloudLab/frostfs-node/releases), run a command below:
```
$ frostfs-cli -r $NEOFS_NODE -k $KEY object put --file $FILENAME --cid $CID
$ frostfs-cli -r $FROSTFS_NODE -k $KEY object put --file $FILENAME --cid $CID
```
where
`$KEY` -- the key, please read the information [above](#create-a-container),
Expand Down
8 changes: 4 additions & 4 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ func newApp(ctx context.Context, opt ...Option) App {
a.webServer.DisablePreParseMultipartForm = true
a.webServer.StreamRequestBody = a.cfg.GetBool(cfgWebStreamRequestBody)
// -- -- -- -- -- -- -- -- -- -- -- -- -- --
key, err = getNeoFSKey(a)
key, err = getFrostFSKey(a)
if err != nil {
a.log.Fatal("failed to get neofs credentials", zap.Error(err))
a.log.Fatal("failed to get frostfs credentials", zap.Error(err))
}

var owner user.ID
Expand Down Expand Up @@ -194,7 +194,7 @@ func (a *app) initResolver() {

func (a *app) getResolverConfig() ([]string, *resolver.Config) {
resolveCfg := &resolver.Config{
NeoFS: resolver.NewNeoFSResolver(a.pool),
FrostFS: resolver.NewFrostFSResolver(a.pool),
RPCAddress: a.cfg.GetString(cfgRPCEndpoint),
}

Expand Down Expand Up @@ -266,7 +266,7 @@ func remove(list []string, element string) []string {
return list
}

func getNeoFSKey(a *app) (*ecdsa.PrivateKey, error) {
func getFrostFSKey(a *app) (*ecdsa.PrivateKey, error) {
walletPath := a.cfg.GetString(cfgWalletPath)

if len(walletPath) == 0 {
Expand Down
12 changes: 6 additions & 6 deletions config/config.env
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ HTTP_GW_SERVER_1_TLS_CERT_FILE=/path/to/tls/cert
HTTP_GW_SERVER_1_TLS_KEY_FILE=/path/to/tls/key

# Nodes configuration.
# This configuration make the gateway use the first node (grpc://s01.neofs.devenv:8080)
# while it's healthy. Otherwise, the gateway use the second node (grpc://s01.neofs.devenv:8080)
# This configuration make the gateway use the first node (grpc://s01.frostfs.devenv:8080)
# while it's healthy. Otherwise, the gateway use the second node (grpc://s01.frostfs.devenv:8080)
# for 10% of requests and the third node for 90% of requests.

# Peer 1.
# Endpoint.
HTTP_GW_PEERS_0_ADDRESS=grpc://s01.neofs.devenv:8080
HTTP_GW_PEERS_0_ADDRESS=grpc://s01.frostfs.devenv:8080
# Until nodes with the same priority level are healthy
# nodes with other priority are not used.
# The lower the value, the higher the priority.
HTTP_GW_PEERS_0_PRIORITY=1
# Load distribution proportion for nodes with the same priority.
HTTP_GW_PEERS_0_WEIGHT=1
# Peer 2.
HTTP_GW_PEERS_1_ADDRESS=grpc://s02.neofs.devenv:8080
HTTP_GW_PEERS_1_ADDRESS=grpc://s02.frostfs.devenv:8080
HTTP_GW_PEERS_1_PRIORITY=2
HTTP_GW_PEERS_1_WEIGHT=1
# Peer 3.
HTTP_GW_PEERS_2_ADDRESS=grpc://s03.neofs.devenv:8080
HTTP_GW_PEERS_2_ADDRESS=grpc://s03.frostfs.devenv:8080
HTTP_GW_PEERS_2_PRIORITY=2
HTTP_GW_PEERS_2_WEIGHT=9

Expand All @@ -72,7 +72,7 @@ HTTP_GW_STREAM_REQUEST_BODY=true
HTTP_GW_MAX_REQUEST_BODY_SIZE=4194304

# RPC endpoint to be able to use nns container resolving.
HTTP_GW_RPC_ENDPOINT=http://morph-chain.neofs.devenv:30333
HTTP_GW_RPC_ENDPOINT=http://morph-chain.frostfs.devenv:30333
# The order in which resolvers are used to find an container id by name.
HTTP_GW_RESOLVE_ORDER="nns dns"

Expand Down
12 changes: 6 additions & 6 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ server:
key_file: /path/to/key

# Nodes configuration.
# This configuration make the gateway use the first node (grpc://s01.neofs.devenv:8080)
# while it's healthy. Otherwise, the gateway use the second node (grpc://s01.neofs.devenv:8080)
# This configuration make the gateway use the first node (grpc://s01.frostfs.devenv:8080)
# while it's healthy. Otherwise, the gateway use the second node (grpc://s01.frostfs.devenv:8080)
# for 10% of requests and the third node for 90% of requests.
peers:
0:
# Endpoint.
address: grpc://s01.neofs.devenv:8080
address: grpc://s01.frostfs.devenv:8080

# Until nodes with the same priority level are healthy
# nodes with other priority are not used.
Expand All @@ -42,11 +42,11 @@ peers:
# Load distribution proportion for nodes with the same priority.
weight: 1
1:
address: grpc://s02.neofs.devenv:8080
address: grpc://s02.frostfs.devenv:8080
priority: 2
weight: 1
2:
address: grpc://s03.neofs.devenv:8080
address: grpc://s03.frostfs.devenv:8080
priority: 2
weight: 9

Expand Down Expand Up @@ -80,7 +80,7 @@ web:
max_request_body_size: 4194304

# RPC endpoint to be able to use nns container resolving.
rpc_endpoint: http://morph-chain.neofs.devenv:30333
rpc_endpoint: http://morph-chain.frostfs.devenv:30333
# The order in which resolvers are used to find an container id by name.
resolve_order:
- nns
Expand Down
14 changes: 7 additions & 7 deletions docs/gate-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $ cat http.log
# General section

```yaml
rpc_endpoint: http://morph-chain.neofs.devenv:30333
rpc_endpoint: http://morph-chain.frostfs.devenv:30333
resolve_order:
- nns
- dns
Expand Down Expand Up @@ -98,23 +98,23 @@ wallet:

```yaml
# Nodes configuration
# This configuration makes the gateway use the first node (node1.neofs:8080)
# while it's healthy. Otherwise, gateway uses the second node (node2.neofs:8080)
# for 10% of requests and the third node (node3.neofs:8080) for 90% of requests.
# This configuration makes the gateway use the first node (node1.frostfs:8080)
# while it's healthy. Otherwise, gateway uses the second node (node2.frostfs:8080)
# for 10% of requests and the third node (node3.frostfs:8080) for 90% of requests.
# Until nodes with the same priority level are healthy
# nodes with other priority are not used.
# The lower the value, the higher the priority.
peers:
0:
address: node1.neofs:8080
address: node1.frostfs:8080
priority: 1
weight: 1
1:
address: node2.neofs:8080
address: node2.frostfs:8080
priority: 2
weight: 0.1
2:
address: node3.neofs:8080
address: node3.frostfs:8080
priority: 2
weight: 0.9
```
Expand Down
6 changes: 3 additions & 3 deletions downloader/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (r request) receiveFile(clnt *pool.Pool, objectAddress oid.Address) {

rObj, err := clnt.GetObject(r.appCtx, prm)
if err != nil {
r.handleNeoFSErr(err, start)
r.handleFrostFSErr(err, start)
return
}

Expand Down Expand Up @@ -224,7 +224,7 @@ func bearerToken(ctx context.Context) *bearer.Token {
return nil
}

func (r *request) handleNeoFSErr(err error, start time.Time) {
func (r *request) handleFrostFSErr(err error, start time.Time) {
r.log.Error(
"could not receive object",
zap.Stringer("elapsed", time.Since(start)),
Expand Down Expand Up @@ -500,7 +500,7 @@ func (d *Downloader) zipObject(zipWriter *zip.Writer, addr oid.Address, btoken *

resGet, err := d.pool.GetObject(d.appCtx, prm)
if err != nil {
return fmt.Errorf("get NeoFS object: %v", err)
return fmt.Errorf("get FrostFS object: %v", err)
}

objWriter, err := d.addObjectToZip(zipWriter, &resGet.Header)
Expand Down
Loading