Documentation ¶
Index ¶
- func CreatePostRequest(url string, command []byte) string
- func Reverse(s string) string
- type EtherConfig
- type Trusternity
- func (trusternityObject *Trusternity) AuditSTR(epoch uint64) string
- func (trusternityObject *Trusternity) GetIPName(id, address string) string
- func (trusternityObject *Trusternity) GetSTR(id string, epoch uint64, address string) string
- func (trusternityObject *Trusternity) PublishSTR(str *protocol.DirSTR)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePostRequest ¶
CreatePostRequest create a http POST request to a host with a command body.
Types ¶
type EtherConfig ¶
type EtherConfig struct { //Geth RPC endpoint url that we can use to connect to EndpointURL string `toml:"geth_rpc_endpoint_url"` //Ethereum Account address that is used to send transaction //This account should have enough gas to spent on transaction //format: hex string AccountAddress string `toml:"eth_account_address"` //Ethereum contract address that we will send transaction to //format: hex string TrusternityContractAddress string `toml:"trusternity_contract_address"` // contains filtered or unexported fields }
A EtherConfig contains configuration values which are read at initialization time from a TOML format configuration file.
type Trusternity ¶
type Trusternity struct {
// contains filtered or unexported fields
}
A Trusternity object contains all auditing logics using Ethereum. When running CONIKS server with eth parameter, we create a new Trusternity object with configurations regarding the local Ethereum wallet and the RPC server.
func NewTrusternityObject ¶
func NewTrusternityObject(configFile string) *Trusternity
NewTrusternityObject Initialize an Trusternity object
func (*Trusternity) AuditSTR ¶
func (trusternityObject *Trusternity) AuditSTR(epoch uint64) string
AuditSTR query STR from the corresponding account address of the Trusternity object
func (*Trusternity) GetIPName ¶
func (trusternityObject *Trusternity) GetIPName(id, address string) string
GetIPName comment
func (*Trusternity) GetSTR ¶
func (trusternityObject *Trusternity) GetSTR(id string, epoch uint64, address string) string
GetSTR comment
func (*Trusternity) PublishSTR ¶
func (trusternityObject *Trusternity) PublishSTR(str *protocol.DirSTR)
PublishSTR get the latest STR and publish to Ethereum This function should be called periodically after directory update at every Epoch