22 2017
Blockchain & Bitcoin Conference - , , -.
20- . habrahabr .
, -. , .
gelbplaneten.
, , , .
: ( ) - . -.
: -, () : API . , , .
, , .
. . . , . , .
2016 R&D. , , .
: - . , .
. , .
: - , . , .
: , .

:
- , .
- .
(, ). .
- . .
- , (-, , ..) .
- .
.
, - . , . , .
, , Ethereum. .
, , , API . , , . , - (), -, (, , , ).
, -. , , : , , .
, . , .
:
:
- -,
- (DFS) ,
- , . , , DFS .
- ( )
- .
, -, - , . ( ) ( ) ( ) , .
- :
:
: blockchainhub.net/blockchain-oracles
DFS , Swarm: swarm-guide.readthedocs.io/en/latest/introduction.html
Storj: storj.io
( , , ):

:
- (, - ). , - - -. , - , , - , , - . - , , .
- - () . -, . - DFS, - , (, ) , DFS. - DFS, ( ) .
- - -, , , ..
- - . - . - .
- , - - .
-
- .
,

, . , . , , , .., (, ). .
- - ( ), New.
.
- , , - , .
InBank.
- ( ) ( ) . , , , (, , ..)
- , Rejected.
Confirmed.
- , , ( , ..)
- ( ), New.
.
, , .
- ( ) , Released.
Released.
Released :
- : Invalid, , .
Invalid.
- Overdue .
Overdue.
, ( , ..)
- ( , ) InBank. InBank .
, , ( ).
- Closed.
Closed.
- .
(Ethereum, Swarm, Storj). :

, :
- - Ethereum Solidity;
- Swarm Storj.io;
- ;
- - ;
- ;
- , - , .
:
- Ethereum, Swarm Storj.io,
- ,
- ,
- UI-,
-
2 .
Ethereum -. Ropsten, Rinkeby.
DDOS Ropsten, .
, :
- DFS Storj.io
- DFS Swarm Ropston Ethereum
-
, .
, , .
UI- , - .
Ethereum
Ethereum RPC API
JSON-RPC,
Management-APIs.
.
ropsten.etherscan.io rinkeby.etherscan.io, .
Swarm
Swarm HTTP API:
Swarm-guide,
gist.github.com.
SWARM HTTP-
PUT /bzz: $PATH$ ($PATH$ )
16- , SWARM.
SWARM HTTP-
GET /bzzi:/$MANIFEST$/ ($MANIFEST$ 16- ).
- / .
, Swarm ( Etherscan Ethereum), .
Storj.io
Storj API . Storj.
storj upload-file $BUCKET$ $PATH$ ( $BUCKET$ , $PATH$ ).
.
storj download-file $BUCKET$ $FILE$ $PATH$ ( $BUCKET$ , $FILE$ , $PATH$ ).
Storj , , .
https://api.storj.io, API.
COM-. vbs.
- .
:
- 32- (64- hex), 20 (40 hex) , , .
- 32- (64- hex), .
- , :
GetExternalRequest,
SetExternalResponse CheckExternalResponse.
, , :
- AddRequest - RequestsQueue, .
- () - RequestsQueue GetRequests .
- GetExternalRequest :
- (, DAILY 10:00 PERIOD 20)
- (, CALENDAR DADATA_NAME_EXISTS)
- , (, DADATA_NAME_EXISTS)
- .
- , , , SetExternalResponse .
.
- CheckExternalResponse, .
:
- FAIL ,
- REPEAT ,
- DELETE ,
- DELETE_ALL , ,
- , DELETE (DELETE_ALL) DeleteRequest () - RequestsQueue.
, DeleteRequest - RequestsQueue.
, . , , . . , .
- , (txn.origin) , .
Requests Queue
AddRequest |
|
:
|
DeleteRequest |
|
:
|
CheckRequest |
|
:
|
GetRequest |
|
.
:
|
AddBank |
|
:
|
CheckBank |
|
:
|
GetExternalRequest |
|
:
- (bytes32)
( bytes32[]):
- ( )
-
- ( )
|
SetExternalResponse |
|
:
- (bytes32)
- (bytes32)
- ( bytes32)
|
CheckExternalResponse |
|
:
:
-
- :
- FAIL
- DELETE ,
- DELETE_ALL ,
- REPEAT ,
|
.
( OVERDUE) (DADATA_EXISTS_WAIT).
, , .
bytes32 Status ;
bytes32 ExpireDate ;
bytes32 OrgName ;
address Queue ;
bytes32[] Request_1 ;
bytes32[] Request_2 ;
bytes32 Request_id_1 ;
bytes32 Request_id_2 ;
bytes32 Response_id_1 ;
bytes32 Response_id_2 ;
function SomeContract(..., bytes32[] logics)
{
Owner =msg.sender ;
ExpireDate=logics[0] ;
OrgName =logics[1] ;
Status ="New" ;
Queue =0xd9b076d0b559f70782f379582bd3d54b85fc42cb ;
Request_1.length= 3 ;
Request_1[0] ="DAILY 00:10" ;
Request_1[1] ="OVERDUE" ;
Request_1[2] = ExpireDate ;
Request_2.length= 3 ;
Request_2[0] ="PERIOD 10" ;
Request_2[1] ="DADATA_EXISTS_WAIT" ;
Request_2[2] = OrgName ;
}
( )
function SetStatus(bytes32 status_, ...)
{
address self_addr ;
Status=status_ ;
if(status_=="Released_") {
self_addr=this ;
Request_id_1=bytes32(bytes20(self_addr)) | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x001" ;
Request_id_2=bytes32(bytes20(self_addr)) | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002" ;
Queue.call.gas(0x30000).value(0)(bytes4(sha3("AddRequest(bytes32)")), Request_id_1) ;
Queue.call.gas(0x30000).value(0)(bytes4(sha3("AddRequest(bytes32)")), Request_id_2) ;
}
}
function GetExternalRequest(bytes32 request_id_) constant returns (bytes32[] retVal)
{
if(request_id_==Request_id_1) return(Request_1) ;
if(request_id_==Request_id_2) return(Request_2) ;
}
function SetExternalResponse(bytes32 response_id_, bytes32 request_id_, bytes32[] response_)
{
if(tx.origin!=Owner) return ;
if(Status!="Released_") return ;
if(request_id_==Request_id_1) {
Response_id_1=response_id_ ;
Status ="Overdue__" ;
}
if(request_id_==Request_id_2) {
Response_id_2=response_id_ ;
Status ="ToBank___" ;
}
}
Ethereum Rinkeby :
Rinkeby
79548a65e3ce179ec8d208c22ee84435dc34058f YYYY/MM/DD.
:
contract Check_request
{
Calendar Oracle ; // -
bytes32 Date ;
function Check_request()
{
// -
Oracle=Calendar(0x79548a65e3ce179ec8d208c22ee84435dc34058f) ;
//
Date=Oracle.GetDate() ;
}
}
//
//
//
contract Calendar
{
function GetDate() constant returns (bytes32 retVal) ;
}
- Rinkeby
d9b076d0b559f70782f379582bd3d54b85fc42cb.
.
:
( ) Ethereum, .
0.1 Ether ( , ) . Rinkeby
faucet, - PoA.
Ethereum
- -, (, - - , - ). , -, () .
Ethereum Solidity
, , , .
Ethereum Swarm
, Ethereum, Swarm ( ) . , - .
Swarm Windows . linux OSX, .
Storj.io
, API. API, Ethereum Swarm , .
. , , . , , , , .
- , .
, , , ( ) .
-, , , .
-, : (transaction fee). , - .
-, .
, : , .. - - .
, . , , .
, . , , .
Stay tuned!
https://habrahabr.ru/post/332756/