We have developed a underlay infrastructure for distributed storage protocol. Including state channel, file system, blockchain services. We provide following tools for developers:
- dsp-go-sdk
- Edge Client
- Edge REST API Docs
graph BT
Edge-->RESTFUL_API,RPC
dsp((dsp-go-sdk))-->Edge
fs-->dsp
channel-->dsp
dns-->dsp
chain-go-sdk-->dsp
network-->channel
network-->dns
$ vim config.jsonConfig Example:
{
"Base": {
"BaseDir": ".",
"LogPath": "./SeekLog_Config_1",
"LogMaxSize": 5242880,
"ChainId": "1",
"BlockTime": 5,
"NetworkId": 1567651915,
"PublicIP": "",
"IntranetIP": "",
"PortBase": 10000,
"LogLevel": 0,
"LocalRpcPortOffset": 338,
"EnableLocalRpc": false,
"JsonRpcPortOffset": 336,
"EnableJsonRpc": true,
"HttpRestPortOffset": 335,
"HttpCertPath": "",
"HttpKeyPath": "",
"RestEnable": true,
"P2PHttpEnable": true,
"WsPortOffset": 339,
"WsCertPath": "",
"WsKeyPath": "",
"ChannelPortOffset": 3005,
"ChannelProtocol": "tcp",
"DBPath": "./DB",
"ChainRestAddrs": [
"http://106.75.10.25:10334",
"http://106.75.10.25:20334",
"http://139.219.141.206:20334"
],
"ChainRpcAddrs": [
"http://106.75.10.25:10336",
"http://106.75.10.25:20336",
"http://139.219.141.206:20336"
],
"NATProxyServerAddrs": "tcp://106.75.9.56:6007",
"DspProtocol": "tcp",
"DspPortOffset": 4001,
"TrackerNetworkId": 1567651915,
"TrackerProtocol": "tcp",
"TrackerPortOffset": 337,
"WalletDir": "./keystore.dat"
},
"Fs": {
"FsRepoRoot": "./FS",
"FsFileRoot": "./Downloads",
"FsType": 0,
"FsGCPeriod": "1h",
"FsMaxStorage": "",
"EnableBackup": false
},
"Dsp": {
"BlockConfirm": 1,
"ChannelClientType": "rpc",
"ChannelRevealTimeout": "20",
"ChannelSettleTimeout": "50",
"BlockDelay": "3",
"MaxUnpaidPayment": 5,
"AutoSetupDNSEnable": false,
"DnsNodeMaxNum": 100,
"DnsChannelDeposit": 0,
"DNSWalletAddrs": null,
"HealthCheckDNS": false,
"SeedInterval": 600,
"Trackers": null,
"MaxUploadTask": 10000,
"MaxDownloadTask": 10000,
"MaxShareTask": 10000
},
"Bootstraps": []
}$ ./edge --config=config.json First run will initialize state channel data, please wait a moment. You can use cmd to show the initialization progress.
$ ./edge channel initprogressThe result will be:
{
"Progress": 0.030025735, // when progress equal to 1, it's finished
"Start": 108631, // start syncing block height
"End": 112128, // end syncing block height
"Now": 108736 // current block height
}Open another terminal for input commands. Use account command for manage account. Create account command is:
$ ./edge account create --label="123"The shell will prompt you to ether the account password. Then apply the TestNet assets for testing.
Address AcJdio7iRMzPxCWgBjSLSqKZcXMjNRtLpd is a example address for docs. Please use a right dns address.
$ ./edge channel open --partnerAddr=AcJdio7iRMzPxCWgBjSLSqKZcXMjNRtLpdAfter create channel, you can deposit assets to it.
$ ./edge channel deposit --partnerAddr=AcJdio7iRMzPxCWgBjSLSqKZcXMjNRtLpd --amount=100Show all channels commands
$ ./edge channel listSee more detail in Restful API Doc
$./edge userspace set --walletAddr=AZgCJrwXBwSrZVGumnfdUogTUBRUbUq8YW --blockCount=864000 --blockCountOp=1 --size=1024000 --sizeOp=1Result:
{
"Tx": "75cdd4b9e30e16e91970fb2243a79807c65d401646732591ffd7c000b83cf3be"
}Use $ ./edge userspace show --walletAddr=AZgCJrwXBwSrZVGumnfdUogTUBRUbUq8YW to show space details.
$./edge file upload --filePath=./wallet.dat --desc=wallet.dat --copyNum=0- filePath: the file location.
- fileDesc: description of file, recommend use file name.
- copyNum: number of redundancy storage node
$ ./edge file transferlist --transferType=1- transferType: type of transfer list. 0 all files. 1 uploading file. 2 downloading file.
$ ./edge file uploadlist$./edge file download --url=save://share/0f53c771- url: the shorten url for file
$./edge file transferlist --transferType=2$./edge file transferlist --transferType=0