Skip to content

Commit

Permalink
add readme and change version (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
badkk authored May 26, 2020
1 parent d2a5772 commit 9d9d614
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 6 deletions.
88 changes: 83 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Response:
}
```

### Get block hash by block number
### [MPoW] Get block hash by block number
Request:
```shell
curl GET 'http://localhost:56666/api/v1/block/hash?blockNumber=100'
Expand All @@ -42,7 +42,7 @@ Response:
"0xeeadb2bd71c125c98ce0892d830931fb27c771ab0025c60735fca9419abae990"
```

### Post TEE identity
### [MPoW] Post TEE identity
Request:
```shell
curl POST 'http://localhost:56666/api/v1/tee/identity' \
Expand All @@ -61,7 +61,7 @@ Response:
}
```

### Get TEE identity
### [MPoW] Get TEE identity
Request:
```shell
curl GET 'http://localhost:56666/api/v1/tee/identity?address=5HBPJZkoLeUBdPombuYe3tcUkXcTAKyRhRgXJvHpCs9mzxfL'
Expand All @@ -78,7 +78,7 @@ Response:
}
```

### Post TEE work report
### [MPoW] Post TEE work report
Request:
```shell
curl POST 'http://localhost:56666/api/v1/tee/workreport' \
Expand All @@ -97,7 +97,7 @@ Response:
}
```

### Get TEE work report
### [MPoW] Get TEE work report
Request:
```shell
curl GET 'http://localhost:56666/api/v1/tee/workreport?address=5HBPJZkoLeUBdPombuYe3tcUkXcTAKyRhRgXJvHpCs9mzxfL'
Expand All @@ -116,6 +116,84 @@ Response:
}
```

### [Market] Register as provider
Request:
```shell
curl POST 'http://localhost:56666/api/v1/market/register'
```

Response:
```json
{
"msg": "register success"
}
```

### [Market] Place storage order
Request:
```shell
curl POST 'http://localhost:56666/api/v1/market/sorder' \
--header 'Content-Type: application/json' \
--header 'password: 123456' \
--data-raw '{
"sorder":"{\"provider\":\"5HpyALyFUJTDMc6iRziEKwh1BkvMHFJGHss3mJjXefuzCap3\",\"amount\":0,\"fileIdentifier\":\"0xd9bf1512e28399ae0cccdebacf5fa337b1e1f4a6b08cd43405a11f74368d023f\",\"fileSize\":205452,\"duration\":320}",
"backup": "{\"address\":\"5FjAZtpXuqNGGw4yoDo3z8ko3Edft4Q25awTr5EakW3bYarE\",\"encoded\":\"0xfbcdb94f892959b1b253145f0893bd2b1d315ced24b497b98b4eb10513a5f3ef46bafec71a538c3f25703843856c9449c02e9bc6bf33bfa7e4ce2716f225d69067888655d60a30b9da618ce4725cb1737bc9980651950edfb5da86ee82ffa5b10dbe0d26d226b15e3bb990424c543210a93bd457be856799872a5f8ef52822980bd266e2b1aea53802f4248e4213498aaf1945033cb8217250b69d00d6\",\"encoding\":{\"content\":[\"pkcs8\",\"sr25519\"],\"type\":\"xsalsa20-poly1305\",\"version\":\"2\"},\"meta\":{\"name\":\"Yang\",\"tags\":[],\"whenCreated\":1580452568110}}"
}'
```

Response:
```json
{
"orderId": "0x3be23b7d519e8600ea37964501bdc64e00888a15498fd96cff3d2c0e763bb39c"
}
```

### [Market] Get provider info
Request:
```shell
curl GET 'http://127.0.0.1:56666/api/v1/market/provider?address=5HpyALyFUJTDMc6iRziEKwh1BkvMHFJGHss3mJjXefuzCap3'
```

Response:
```json
{
"address": "ws://127.0.0.1:17000",
"file_map": [
[
"0x",
"0xfd1f6dd1cb83a2a06744233157e5ee70acecdf07dd89b3ecacc81a8966e2723d"
],
[
"0x1c0eb16d3d89f5856fc78353a7afa04ed1d232777a264d7f33507efab8186d87",
"0x985849656f044d0b49fa960ed8d2b3e1e78a6d6596c8e290d81049bb51c55ec7"
],
[
"0x7a056e0f7a9fff404b36b0f0e69fb517890bc8daf544fdf053069634f3663da4",
"0xf12630b71dac4188dd465073784d769e8b50a1122466c7df487f43c77d16cb36"
]
]
}
```

### [Market] Get storage order
Request:
```shell
curl GET 'http://localhost:56666/api/v1/market/sorder?orderId=0x1f1e8eeac7b871ac3c603087120eb0b8a7286ee69ff01c785e52af083edaf2f5'
```

Response:
```json
{
"file_identifier": "0x7a056e0f7a9fff404b36b0f0e69fb517890bc8daf544fdf053069634f3663da4",
"file_size": 25848,
"created_on": 1643,
"expired_on": 1963,
"provider": "5HpyALyFUJTDMc6iRziEKwh1BkvMHFJGHss3mJjXefuzCap3",
"client": "5HpyALyFUJTDMc6iRziEKwh1BkvMHFJGHss3mJjXefuzCap3",
"order_status": "Pending"
}
```

## License

[GPL v3](LICENSE)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.4.0

0 comments on commit 9d9d614

Please sign in to comment.