体验Hyperledger-Burrow-3

./burrow natives , Dump Solidity interface contracts for Burrow native contracts.

抽出Burrow内置的solidity接口合约。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
➜  script ./burrow natives       
pragma solidity >=0.4.24;

/**
* acmstate.ReaderWriter for managing Secure Native authorizations.
* @dev This interface describes the functions exposed by the native permissions layer in burrow.
* @dev These functions can be accessed as if this contract were deployed at a special address (0x0A758FEB535243577C1A79AE55BED8CA03E226EC).
* @dev This special address is defined as the last 20 bytes of the sha3 hash of the the contract name.
* @dev To instantiate the contract use:
* @dev Permissions permissions = Permissions(address(uint256(keccak256("Permissions"))));
*/
interface Permissions {
/**
* @notice Adds a role to an account
* @param Account account address
* @param Role role name
* @return result whether role was added
*/
function addRole(address _account, string memory _role) public view returns (bool _result);

/**
* @notice Removes a role from an account
* @param Account account address
* @param Role role name
* @return result whether role was removed
*/
function removeRole(address _account, string memory _role) public view returns (bool _result);

/**
* @notice Indicates whether an account has a role
* @param Account account address
* @param Role role name
* @return result whether account has role
*/
function hasRole(address _account, string memory _role) public view returns (bool _result);

/**
* @notice Sets the permission flags for an account. Makes them explicitly set (on or off).
* @param Account account address
* @param Permission the base permissions flags to set for the account
* @param Set whether to set or unset the permissions flags at the account level
* @return The permission flag that was set as uint64
*/
function setBase(address _account, uint64 _permission, bool _set) public view returns (uint64 _result);

/**
* @notice Unsets the permissions flags for an account. Causes permissions being unset to fall through to global permissions.
* @param Account account address
* @param Permission the permissions flags to unset for the account
* @return The permission flag that was unset as uint64
*/
function unsetBase(address _account, uint64 _permission) public view returns (uint64 _result);

/**
* @notice Indicates whether an account has a subset of permissions set
* @param Account account address
* @param Permission the permissions flags (mask) to check whether enabled against base permissions for the account
* @return result whether account has the passed permissions flags set
*/
function hasBase(address _account, uint64 _permission) public view returns (bool _result);

/**
* @notice Sets the global (default) permissions flags for the entire chain
* @param Permission the permissions flags to set
* @param Set whether to set (or unset) the permissions flags
* @return The permission flag that was set as uint64
*/
function setGlobal(uint64 _permission, bool _set) public view returns (uint64 _result);
}

./burrow dump , Dump chain state to backup

1
2
3
4
5
6
7
8
➜  script ./burrow dump local backup_dump
Sourcing config from first of: defaults
Sourcing config from defaults
Sourcing config from first of: genesis file at genesis.json
Sourcing config from genesis file at genesis.json
{"log_channel":"Info","message":"Dumping accounts"}
{"log_channel":"Info","message":"Dumping names"}
{"log_channel":"Info","message":"Dumping events"}

./burrow restore, Restore new chain from backup

从backup文件恢复区块链