NeoFS T5 Testnet has been started

How to start with NeoFS T5 Testnet

Create Wallet and get neofs-cli

First, you need to create a wallet and request N3 Testnet GAS tokens.

$ wget https://github.com/nspcc-dev/neo-go/releases/download/v0.99.1/neo-go-linux-amd64 -O neo-go$ chmod +x neo-go$ cp neo-go /usr/local/bin/neo-go$ neo-go --version
neo-go version 0.99.1
$ wget https://github.com/nspcc-dev/neofs-node/releases/download/v0.30.1/neofs-cli-amd64 -O neofs-cli$ chmod +x neofs-cli$ cp neofs-cli /usr/local/bin/neofs-cli$ neofs-cli --version
NeoFS CLI
Version: v0.30.1
GoVersion: go1.17.11
$ neo-go wallet init -w wallet.json -a
$ neo-go wallet dump-keys -w wallet.json
NTRyEpPKFHaxj8uphYi54DJtbbCUtyYjyg (simple signature contract):
027810f6af30862884c7b0cd2d7705fffaa7e3254cecd8707fbd0223e8864c2be4
  1. Check your address here to see that everything is done correctly.

Make a Deposit

To make a deposit to the NeoFS account, execute the transfer method to the NeoFS Smart Contract address.

neo-go wallet nep17 transfer -w wallet.json -r https://rpc.t5.n3.nspcc.ru:20331 --from {address} --to  NZAUkYbJ1Cb2HrNmwZ1pg9xYHBhm2FgtKV--token GAS --amount {amount}
  • {amount} — number of gas tokens to add to the NeoFS balance
$ neo-go wallet nep17 transfer -w wallet.json -r https://rpc.t5.n3.nspcc.ru:20331 --from NTRyEpPKFHaxj8uphYi54DJtbbCUtyYjyg --to NZAUkYbJ1Cb2HrNmwZ1pg9xYHBhm2FgtKV --token GAS --amount 20Enter password > 
Network fee: 0.00123252
System fee: 0.01451339
Total fee: 0.01574591
Relay transaction (y|N)> y
00fe1882fef5ab5edaca153b4cfb8949328873b4e52577b36341705a15b64ebd

Check NeoFS balance

To get NeoFS balance, execute the command below:

$ neofs-cli -r {NEOFS_ENDPOINT} -w wallet.json accounting balance
$ neofs-cli -r st1.t5.fs.neo.org:8080 -w wallet.json accounting balance Enter password > 
106.00173390

Create your first container

In NeoFS, users put their data into Containers. Containers are like folders in a file system or buckets in Amazon’s S3 but with Storage Policy attached. Storage Policy is set up by the user and defines how objects in this container should be stored.

  • public-read,
  • public-read-write.
$ neofs-cli -r st1.t5.fs.neo.org:8080 -w wallet.json container create --policy 'REP 2 IN X CBF 2 SELECT 2 FROM F AS X FILTER "Deployed" EQ "NSPCC" AS F' --basic-acl public-read --awaitEnter password > 
container ID: 7gHG4HB3BrpFcH9BN3KMZg6hEETx4mFP71nEoNXHFqrv
awaiting...
container has been persisted on sidechain

Upload a file to NeoFS

To put an object in our container, we should execute the neofs-cli command.

$ neofs-cli -r st1.t5.fs.neo.org:8080 -w wallet.json object put --file cat.jpg --cid 7gHG4HB3BrpFcH9BN3KMZg6hEETx4mFP71nEoNXHFqrv --attributes content_tag=cat,my_attr=cuteEnter password > 
233776 / 233776 [===============================================================================================================================================================================] 100.00% 1s
[cat.jpg] Object successfully stored
ID: C4FWmxCGyv6vkXbnnAMXRFMSnkEfZCSG8FJ2WdEr2noS
CID: 7gHG4HB3BrpFcH9BN3KMZg6hEETx4mFP71nEoNXHFqrv

Get your file or share it with friends

To get the object, you can use the command below with either any key (in case of public container) or an owner key (in case of private container):

$ neofs-cli -r st1.t5.fs.neo.org:8080 -w wallet.json object get --cid {CONTAINER_ID} --oid {OBJECT_ID} --file {PATH_TO_FILE}

Search for objects with some specific attributes in the container

To run search operation, you can use different filters by meta information of the objects. For example, you can filter objects by attributes declared in the previous steps:

$ neofs-cli -r st1.t5.fs.neo.org:8080 -w wallet.json object search --cid 7gHG4HB3BrpFcH9BN3KMZg6hEETx4mFP71nEoNXHFqrv --filters 'content_tag EQ cat' --filters 'my_attr EQ cute'Enter password > 
Found 2 objects.
FVaR4RiwzeG79BURYHU4xVNE2BcHB7NaGpEDH5nsEGue
C4FWmxCGyv6vkXbnnAMXRFMSnkEfZCSG8FJ2WdEr2noS

Try our public HTTP Gateway

We provide a demo HTTP gateway, but recommend to deploy your own instance for your applications.

https://http.t5.fs.neo.org/7gHG4HB3BrpFcH9BN3KMZg6hEETx4mFP71nEoNXHFqrv/{Object ID or file name}

Disclaimer

Remember, though, that it is Testnet. If you have any problems, mail us via ops@nspcc.ru or file issues on Github. Also, be aware that depending on the capacity of the test network and production needs, we can periodically clear all data stored in N3 TestNet.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store