Beispiel #1
0
        public ParseDemocracy()
        {
            var dbCon        = "Host=localhost;Port=5432;Database=postgres;Username=postgres;Password="******"wss://kusama-rpc.polkadot.io/";

            _app = PolkaApi.GetAppication();
            _sch = new MetadataSchema();

            string nodeUrl = substrateCon;

            _app.Connect(nodeUrl);

            // Connect to db and check metadata version
            _postgres = new Postgres(dbCon);
            _indexer  = new Indexer(_app, _postgres);

            // Create or update current schema
            var metadata = _app.GetMetadata(null);

            _sch.ParseMetadata(metadata);
            var si = _app.GetSystemInfo();

            _sch.DatabaseSchema.Title = "Test_ParseBalances";

            _sch.CommitToDb(_postgres, si);

            // Check current schema
            _indexer.CheckSystemInfo();
        }