registry

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2023 License: LGPL-3.0 Imports: 19 Imported by: 0

README

Build chain

# it will create binary in build folder with `laconicd`
$ make build

Setup Chain

./build/laconicd keys add root
./build/laconicd init test-moniker --chain-id laconic_9000-1
./build/laconicd add-genesis-account $(./build/laconicd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake
./build/laconicd gentx root 1000000000000000000stake --chain-id laconic_9000-1
./build/laconicd collect-gentxs
./build/laconicd start

Get Params

$ ./build/laconicd q registry params -o json | jq .
{
  "params": {
    "record_rent": {
      "denom": "stake",
      "amount": "1000000"
    },

    "record_rent_duration": "31536000s",
    "authority_rent": {
      "denom": "stake",
      "amount": "1000000"
    },
    "authority_rent_duration": "31536000s",
    "authority_grace_period": "172800s",
    "authority_auction_enabled": false,
    "authority_auction_commits_duration": "86400s",
    "authority_auction_reveals_duration": "86400s",
    "authority_auction_commit_fee": {
      "denom": "stake",
      "amount": "1000000"
    },
    "authority_auction_reveal_fee": {
      "denom": "stake",
      "amount": "1000000"
    },
    "authority_auction_minimum_bid": {
      "denom": "stake",
      "amount": "5000000"
    }
  }

Create (Set) Record

First you have to Create bond

$ ./build/laconicd tx registry set ~/Desktop/examples/records/service_provider_example.yml 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id laconic_9000-1 --yes -o json
{
  "height": "0",
  "txhash": "BA44ABE1194724694E7CB290F9F3121DB4E63E1A030D95CB84813EEA132CF95F",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Get records list

$ ./build/laconicd q registry list -o json  | jq
[
  {
    "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae",
    "bondId": "c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440",
    "createTime": "2021-10-04T06:50:06.369025861Z",
    "expiryTime": "2022-10-04T06:50:06.369025861Z",
    "attributes": {
      "attr1": "value1",
      "attr2": "value2",
      "link1": {
        "/": "QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D"
      },
      "link2": {
        "/": "QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9"
      }
    }
  }
]


Get record by id

$ ./build/laconicd q registry get bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae -o json | jq .
{
  "record": {
    "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae",
    "bond_id": "95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d",
    "create_time": "2021-09-27T07:23:25.558111606Z",
    "expiry_time": "2022-09-27T07:23:25.558111606Z",
    "deleted": false,
    "owners": [],
    "attributes": "eyJhdHRyMSI6InZhbHVlMSIsImF0dHIyIjoidmFsdWUyIiwibGluazEiOnsiLyI6IlFtU251V214cHRKWmRMSnBLUmFyeEJNUzJKdTJvQU5WcmdicjJ4V2JpZTliMkQifSwibGluazIiOnsiLyI6IlFtUDhqVEcxbTlHU0RKTENiZVdoVlNWZ0V6Q1BQd1hSZENSdUp0UTVUejlLYzkifX0="
  }
}

Reserve name

 ./build/laconicd tx registry reserve-name hello --from root --chain-id laconic_9000-1 --owner $(./build/laconicd key
s show root -a) -y -o json | jq .
{
  "height": "0",
  "txhash": "7EC19157AC89279DEBE840EA3384FC95D1E2A0931C27746CA42AC23AE285B7ED",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Query Whois for name authority

 ./build/laconicd q registry whois hello -o json | jq .
{
  "name_authority": {
    "owner_public_key": "Au3hH1tzL1KgZfXfA71jGYSe5RV9Wg95kwhBWs8V+N+h",
    "owner_address": "ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk",
    "height": "174",
    "status": "active",
    "auction_id": "",
    "bond_id": "",
    "expiry_time": "2021-09-29T07:34:36.304545965Z"
  }
}

Query the registry module balance

$ ./build/laconicd q registry  balance -o json | jq .
{
  "balances": [
    {
      "account_name": "record_rent",
      "balance": [
        {
          "denom": "stake",
          "amount": "1000000"
        }
      ]
    }
  ]
}

add bond to the authority

$ ./build/laconicd tx registry authority-bond [Authority Name] [Bond ID ]  --from root --chain-id laconic_9000-1  -y -o json | jq .
$ ./build/laconicd tx registry authority-bond hello 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d  --from root --chain-id laconic_9000-1  -y -o json | jq .

Query the records by associate bond id

$ ./build/laconicd q registry query-by-bond 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d -o json | jq .
{
  "records": [
    {
      "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae",
      "bond_id": "95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d",
      "create_time": "2021-09-27T08:25:32.893155609Z",
      "expiry_time": "2022-09-27T08:25:32.893155609Z",
      "deleted": false,
      "owners": [],
      "attributes": "eyJhdHRyMSI6InZhbHVlMSIsImF0dHIyIjoidmFsdWUyIiwibGluazEiOnsiLyI6IlFtU251V214cHRKWmRMSnBLUmFyeEJNUzJKdTJvQU5WcmdicjJ4V2JpZTliMkQifSwibGluazIiOnsiLyI6IlFtUDhqVEcxbTlHU0RKTENiZVdoVlNWZ0V6Q1BQd1hSZENSdUp0UTVUejlLYzkifX0="
    }
  ],
  "pagination": null
}

dissociate bond from record

$ ./build/laconicd tx registry dissociate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae  --from root --chain-id laconic_9000-1
{"body":{"messages":[{"@type":"/vulcanize.registry.v1beta1.MsgDissociateBond","record_id":"bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae","signer":"ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: y
code: 0
codespace: ""
data: ""
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: 7AFEF524CB0D92D6576FC08601A787786E802449888FD8DDAA7635698CC85060

Associate bond with record

./build/laconicd tx registry associate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id laconic_9000-1  -y -o json | jq .
{
  "height": "0",
  "txhash": "F75C2BF2FE73668AE1332E1237F924AC549E31E822A56394DE5AC17200B199F9",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

dissociate-records => remove all record from bond

$./build/laconicd tx registry dissociate-records c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id laconic_9000-1  -y -o json | jq .
{
  "height": "0",
  "txhash": "0316F503E5DEA47CB108AE6C7C7FFAF3F71CC56BC22F63CB97322E1BE48B33B9",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Renew a record

When a record is expires , needs to renew record

$ ./build/laconicd tx registry renew-record bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id laconic_9000-1

Set the authority name

$ ./build/laconicd tx registry set-name crn://hello/test test_hello_cid  --from root --chain-id laconic_9000-1 -y -o json | jq .
{
  "height": "0",
  "txhash": "66A63C73B076EEE9A2F7605354448EDEB161F0115D4D03AF68C01BA28DB97486",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Delete the name

$./build/laconicd tx registry delete-name crn://hello/test --from root --chain-id laconic_9000-1 -y
code: 0
codespace: ""
data: ""
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: A3FF4C46BAC7BD6E54BBB743A49830AE8C6F6FE59282384789CBA323C1FE540C

List of Authorities Expire Queue

$ ./build/laconicd q registry authority-expiry  -o json | jq .
{
  "authorities": [],
  "pagination": null
}

List of Records Expire Queue

$  ./build/laconicd q registry record-expiry -o json | jq .
{
  "records": [],
  "pagination": null
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Context, k keeper.Keeper)

BeginBlocker will persist the current header and validator set as a historical entry and prune the oldest entry based on the HistoricalEntries parameter

func EndBlocker

func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate

EndBlocker Called every block, update validator set

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) types.GenesisState

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState) []abci.ValidatorUpdate

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(k keeper.Keeper) AppModule

NewAppModule creates a new AppModule Object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)

func (AppModule) ConsensusVersion

func (am AppModule) ConsensusVersion() uint64

func (AppModule) EndBlock

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

func (AppModule) GenerateGenesisState

func (AppModule) GenerateGenesisState(simState *module.SimulationState)

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier

func (AppModule) ProposalContents

func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent

ProposalContents doesn't return any content functions for governance proposals.

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RandomizedParams

func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange

RandomizedParams creates randomized fee market param changes for the simulator.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(registry sdk.InvariantRegistry)

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

func (AppModule) RegisterStoreDecoder

func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for fee market module's types

func (AppModule) Route

func (am AppModule) Route() sdk.Route

func (AppModule) WeightedOperations

func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation

WeightedOperations returns the all the fee market module operations with their respective weights.

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic _ app module Basics object

func (AppModuleBasic) DefaultGenesis

func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

func (AppModuleBasic) GetQueryCmd

func (a AppModuleBasic) GetQueryCmd() *cobra.Command

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd() *cobra.Command

func (AppModuleBasic) Name

func (a AppModuleBasic) Name() string

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)

func (AppModuleBasic) RegisterLegacyAminoCodec

func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino)

func (AppModuleBasic) RegisterRESTRoutes

func (a AppModuleBasic) RegisterRESTRoutes(context client.Context, router *mux.Router)

func (AppModuleBasic) ValidateGenesis

func (a AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error

Directories

Path Synopsis
client
cli
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL